diff --git a/assets/cssMode-24dc600b.js b/assets/cssMode-33ee3626.js similarity index 99% rename from assets/cssMode-24dc600b.js rename to assets/cssMode-33ee3626.js index abcfa6d..e099f28 100644 --- a/assets/cssMode-24dc600b.js +++ b/assets/cssMode-33ee3626.js @@ -1,4 +1,4 @@ -var Le=Object.defineProperty;var je=(e,n,i)=>n in e?Le(e,n,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[n]=i;var k=(e,n,i)=>(je(e,typeof n!="symbol"?n+"":n,i),i);import{m as Ne}from"./index-96cdf3d3.js";/*!----------------------------------------------------------------------------- +var Le=Object.defineProperty;var je=(e,n,i)=>n in e?Le(e,n,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[n]=i;var k=(e,n,i)=>(je(e,typeof n!="symbol"?n+"":n,i),i);import{m as Ne}from"./index-dcd446f7.js";/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.44.0(3e047efd345ff102c8c61b5398fb30845aaac166) * Released under the MIT license diff --git a/assets/freemarker2-e12e2a68.js b/assets/freemarker2-ad19929c.js similarity index 99% rename from assets/freemarker2-e12e2a68.js rename to assets/freemarker2-ad19929c.js index a02245d..a67d557 100644 --- a/assets/freemarker2-e12e2a68.js +++ b/assets/freemarker2-ad19929c.js @@ -1,4 +1,4 @@ -import{m as F}from"./index-96cdf3d3.js";/*!----------------------------------------------------------------------------- +import{m as F}from"./index-dcd446f7.js";/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.44.0(3e047efd345ff102c8c61b5398fb30845aaac166) * Released under the MIT license diff --git a/assets/handlebars-0dcb5c5e.js b/assets/handlebars-805d6e9f.js similarity index 99% rename from assets/handlebars-0dcb5c5e.js rename to assets/handlebars-805d6e9f.js index 5e812bb..797f024 100644 --- a/assets/handlebars-0dcb5c5e.js +++ b/assets/handlebars-805d6e9f.js @@ -1,4 +1,4 @@ -import{m as i}from"./index-96cdf3d3.js";/*!----------------------------------------------------------------------------- +import{m as i}from"./index-dcd446f7.js";/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.44.0(3e047efd345ff102c8c61b5398fb30845aaac166) * Released under the MIT license diff --git a/assets/html-dc7249e5.js b/assets/html-ab9c0d64.js similarity index 98% rename from assets/html-dc7249e5.js rename to assets/html-ab9c0d64.js index f524ae2..62a6d2a 100644 --- a/assets/html-dc7249e5.js +++ b/assets/html-ab9c0d64.js @@ -1,4 +1,4 @@ -import{m as d}from"./index-96cdf3d3.js";/*!----------------------------------------------------------------------------- +import{m as d}from"./index-dcd446f7.js";/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.44.0(3e047efd345ff102c8c61b5398fb30845aaac166) * Released under the MIT license diff --git a/assets/htmlMode-6a4ef462.js b/assets/htmlMode-cc928c6e.js similarity index 99% rename from assets/htmlMode-6a4ef462.js rename to assets/htmlMode-cc928c6e.js index eeb1013..2b93be4 100644 --- a/assets/htmlMode-6a4ef462.js +++ b/assets/htmlMode-cc928c6e.js @@ -1,4 +1,4 @@ -var $e=Object.defineProperty;var qe=(e,n,i)=>n in e?$e(e,n,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[n]=i;var k=(e,n,i)=>(qe(e,typeof n!="symbol"?n+"":n,i),i);import{m as Qe}from"./index-96cdf3d3.js";/*!----------------------------------------------------------------------------- +var $e=Object.defineProperty;var qe=(e,n,i)=>n in e?$e(e,n,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[n]=i;var k=(e,n,i)=>(qe(e,typeof n!="symbol"?n+"":n,i),i);import{m as Qe}from"./index-dcd446f7.js";/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.44.0(3e047efd345ff102c8c61b5398fb30845aaac166) * Released under the MIT license diff --git a/assets/index-96cdf3d3.js b/assets/index-dcd446f7.js similarity index 94% rename from assets/index-96cdf3d3.js rename to assets/index-dcd446f7.js index 96327f9..a8f6f7e 100644 --- a/assets/index-96cdf3d3.js +++ b/assets/index-dcd446f7.js @@ -1,32 +1,32 @@ -var Pce=Object.defineProperty;var Oce=(n,e,t)=>e in n?Pce(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var an=(n,e,t)=>(Oce(n,typeof e!="symbol"?e+"":e,t),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)}})();function wB(n,e){const t=Object.create(null),i=n.split(",");for(let s=0;s!!t[s.toLowerCase()]:s=>!!t[s]}const Hn={},Nv=[],ic=()=>{},Fce=()=>!1,Bce=/^on[^a-z]/,LT=n=>Bce.test(n),yB=n=>n.startsWith("onUpdate:"),Is=Object.assign,SB=(n,e)=>{const t=n.indexOf(e);t>-1&&n.splice(t,1)},Wce=Object.prototype.hasOwnProperty,ji=(n,e)=>Wce.call(n,e),Xt=Array.isArray,Av=n=>kT(n)==="[object Map]",XG=n=>kT(n)==="[object Set]",mi=n=>typeof n=="function",ns=n=>typeof n=="string",LB=n=>typeof n=="symbol",Kn=n=>n!==null&&typeof n=="object",QG=n=>Kn(n)&&mi(n.then)&&mi(n.catch),JG=Object.prototype.toString,kT=n=>JG.call(n),Vce=n=>kT(n).slice(8,-1),eY=n=>kT(n)==="[object Object]",kB=n=>ns(n)&&n!=="NaN"&&n[0]!=="-"&&""+parseInt(n,10)===n,Uk=wB(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),DT=n=>{const e=Object.create(null);return t=>e[t]||(e[t]=n(t))},Hce=/-(\w)/g,vd=DT(n=>n.replace(Hce,(e,t)=>t?t.toUpperCase():"")),$ce=/\B([A-Z])/g,Hm=DT(n=>n.replace($ce,"-$1").toLowerCase()),ET=DT(n=>n.charAt(0).toUpperCase()+n.slice(1)),LA=DT(n=>n?"on".concat(ET(n)):""),QC=(n,e)=>!Object.is(n,e),jk=(n,e)=>{for(let t=0;t{Object.defineProperty(n,e,{configurable:!0,enumerable:!1,value:t})},u2=n=>{const e=parseFloat(n);return isNaN(e)?n:e},zce=n=>{const e=ns(n)?Number(n):NaN;return isNaN(e)?n:e};let iW;const h2=()=>iW||(iW=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Fe(n){if(Xt(n)){const e={};for(let t=0;t{if(t){const i=t.split(jce);i.length>1&&(e[i[0].trim()]=i[1].trim())}}),e}function B(n){let e="";if(ns(n))e=n;else if(Xt(n))for(let t=0;tns(n)?n:n==null?"":Xt(n)||Kn(n)&&(n.toString===JG||!mi(n.toString))?JSON.stringify(n,iY,2):String(n),iY=(n,e)=>e&&e.__v_isRef?iY(n,e.value):Av(e)?{["Map(".concat(e.size,")")]:[...e.entries()].reduce((t,[i,s])=>(t["".concat(i," =>")]=s,t),{})}:XG(e)?{["Set(".concat(e.size,")")]:[...e.values()]}:Kn(e)&&!Xt(e)&&!eY(e)?String(e):e;let Rl;class Zce{constructor(e=!1){this.detached=e,this._active=!0,this.effects=[],this.cleanups=[],this.parent=Rl,!e&&Rl&&(this.index=(Rl.scopes||(Rl.scopes=[])).push(this)-1)}get active(){return this._active}run(e){if(this._active){const t=Rl;try{return Rl=this,e()}finally{Rl=t}}}on(){Rl=this}off(){Rl=this.parent}stop(e){if(this._active){let t,i;for(t=0,i=this.effects.length;t{const e=new Set(n);return e.w=0,e.n=0,e},nY=n=>(n.w&Ff)>0,sY=n=>(n.n&Ff)>0,Jce=({deps:n})=>{if(n.length)for(let e=0;e{const{deps:e}=n;if(e.length){let t=0;for(let i=0;i{(d==="length"||d>=l)&&a.push(c)})}else switch(t!==void 0&&a.push(r.get(t)),e){case"add":Xt(n)?kB(t)&&a.push(r.get("length")):(a.push(r.get(Op)),Av(n)&&a.push(r.get(g2)));break;case"delete":Xt(n)||(a.push(r.get(Op)),Av(n)&&a.push(r.get(g2)));break;case"set":Av(n)&&a.push(r.get(Op));break}if(a.length===1)a[0]&&p2(a[0]);else{const l=[];for(const c of a)c&&l.push(...c);p2(DB(l))}}function p2(n,e){const t=Xt(n)?n:[...n];for(const i of t)i.computed&&sW(i);for(const i of t)i.computed||sW(i)}function sW(n,e){(n!==ql||n.allowRecurse)&&(n.scheduler?n.scheduler():n.run())}function tde(n,e){var t;return(t=jD.get(n))==null?void 0:t.get(e)}const ide=wB("__proto__,__v_isRef,__isVue"),aY=new Set(Object.getOwnPropertyNames(Symbol).filter(n=>n!=="arguments"&&n!=="caller").map(n=>Symbol[n]).filter(LB)),nde=IB(),sde=IB(!1,!0),ode=IB(!0),oW=rde();function rde(){const n={};return["includes","indexOf","lastIndexOf"].forEach(e=>{n[e]=function(...t){const i=Hi(this);for(let o=0,r=this.length;o{n[e]=function(...t){g0();const i=Hi(this)[e].apply(this,t);return p0(),i}}),n}function ade(n){const e=Hi(this);return Zr(e,"has",n),e.hasOwnProperty(n)}function IB(n=!1,e=!1){return function(i,s,o){if(s==="__v_isReactive")return!n;if(s==="__v_isReadonly")return n;if(s==="__v_isShallow")return e;if(s==="__v_raw"&&o===(n?e?Sde:hY:e?uY:dY).get(i))return i;const r=Xt(i);if(!n){if(r&&ji(oW,s))return Reflect.get(oW,s,o);if(s==="hasOwnProperty")return ade}const a=Reflect.get(i,s,o);return(LB(s)?aY.has(s):ide(s))||(n||Zr(i,"get",s),e)?a:eo(a)?r&&kB(s)?a:a.value:Kn(a)?n?NB(a):Cn(a):a}}const lde=lY(),cde=lY(!0);function lY(n=!1){return function(t,i,s,o){let r=t[i];if(im(r)&&eo(r)&&!eo(s))return!1;if(!n&&(!KD(s)&&!im(s)&&(r=Hi(r),s=Hi(s)),!Xt(t)&&eo(r)&&!eo(s)))return r.value=s,!0;const a=Xt(t)&&kB(i)?Number(i)n,IT=n=>Reflect.getPrototypeOf(n);function nL(n,e,t=!1,i=!1){n=n.__v_raw;const s=Hi(n),o=Hi(e);t||(e!==o&&Zr(s,"get",e),Zr(s,"get",o));const{has:r}=IT(s),a=i?TB:t?RB:JC;if(r.call(s,e))return a(n.get(e));if(r.call(s,o))return a(n.get(o));n!==s&&n.get(e)}function sL(n,e=!1){const t=this.__v_raw,i=Hi(t),s=Hi(n);return e||(n!==s&&Zr(i,"has",n),Zr(i,"has",s)),n===s?t.has(n):t.has(n)||t.has(s)}function oL(n,e=!1){return n=n.__v_raw,!e&&Zr(Hi(n),"iterate",Op),Reflect.get(n,"size",n)}function rW(n){n=Hi(n);const e=Hi(this);return IT(e).has.call(e,n)||(e.add(n),Uu(e,"add",n,n)),this}function aW(n,e){e=Hi(e);const t=Hi(this),{has:i,get:s}=IT(t);let o=i.call(t,n);o||(n=Hi(n),o=i.call(t,n));const r=s.call(t,n);return t.set(n,e),o?QC(e,r)&&Uu(t,"set",n,e):Uu(t,"add",n,e),this}function lW(n){const e=Hi(this),{has:t,get:i}=IT(e);let s=t.call(e,n);s||(n=Hi(n),s=t.call(e,n)),i&&i.call(e,n);const o=e.delete(n);return s&&Uu(e,"delete",n,void 0),o}function cW(){const n=Hi(this),e=n.size!==0,t=n.clear();return e&&Uu(n,"clear",void 0,void 0),t}function rL(n,e){return function(i,s){const o=this,r=o.__v_raw,a=Hi(r),l=e?TB:n?RB:JC;return!n&&Zr(a,"iterate",Op),r.forEach((c,d)=>i.call(s,l(c),l(d),o))}}function aL(n,e,t){return function(...i){const s=this.__v_raw,o=Hi(s),r=Av(o),a=n==="entries"||n===Symbol.iterator&&r,l=n==="keys"&&r,c=s[n](...i),d=t?TB:e?RB:JC;return!e&&Zr(o,"iterate",l?g2:Op),{next(){const{value:u,done:h}=c.next();return h?{value:u,done:h}:{value:a?[d(u[0]),d(u[1])]:d(u),done:h}},[Symbol.iterator](){return this}}}}function hh(n){return function(...e){return n==="delete"?!1:this}}function pde(){const n={get(o){return nL(this,o)},get size(){return oL(this)},has:sL,add:rW,set:aW,delete:lW,clear:cW,forEach:rL(!1,!1)},e={get(o){return nL(this,o,!1,!0)},get size(){return oL(this)},has:sL,add:rW,set:aW,delete:lW,clear:cW,forEach:rL(!1,!0)},t={get(o){return nL(this,o,!0)},get size(){return oL(this,!0)},has(o){return sL.call(this,o,!0)},add:hh("add"),set:hh("set"),delete:hh("delete"),clear:hh("clear"),forEach:rL(!0,!1)},i={get(o){return nL(this,o,!0,!0)},get size(){return oL(this,!0)},has(o){return sL.call(this,o,!0)},add:hh("add"),set:hh("set"),delete:hh("delete"),clear:hh("clear"),forEach:rL(!0,!0)};return["keys","values","entries",Symbol.iterator].forEach(o=>{n[o]=aL(o,!1,!1),t[o]=aL(o,!0,!1),e[o]=aL(o,!1,!0),i[o]=aL(o,!0,!0)}),[n,t,e,i]}const[mde,_de,vde,bde]=pde();function xB(n,e){const t=e?n?bde:vde:n?_de:mde;return(i,s,o)=>s==="__v_isReactive"?!n:s==="__v_isReadonly"?n:s==="__v_raw"?i:Reflect.get(ji(t,s)&&s in i?t:i,s,o)}const Cde={get:xB(!1,!1)},wde={get:xB(!1,!0)},yde={get:xB(!0,!1)},dY=new WeakMap,uY=new WeakMap,hY=new WeakMap,Sde=new WeakMap;function Lde(n){switch(n){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function kde(n){return n.__v_skip||!Object.isExtensible(n)?0:Lde(Vce(n))}function Cn(n){return im(n)?n:AB(n,!1,cY,Cde,dY)}function Dde(n){return AB(n,!1,gde,wde,uY)}function NB(n){return AB(n,!0,fde,yde,hY)}function AB(n,e,t,i,s){if(!Kn(n)||n.__v_raw&&!(e&&n.__v_isReactive))return n;const o=s.get(n);if(o)return o;const r=kde(n);if(r===0)return n;const a=new Proxy(n,r===2?i:t);return s.set(n,a),a}function Fp(n){return im(n)?Fp(n.__v_raw):!!(n&&n.__v_isReactive)}function im(n){return!!(n&&n.__v_isReadonly)}function KD(n){return!!(n&&n.__v_isShallow)}function MB(n){return Fp(n)||im(n)}function Hi(n){const e=n&&n.__v_raw;return e?Hi(e):n}function fY(n){return UD(n,"__v_skip",!0),n}const JC=n=>Kn(n)?Cn(n):n,RB=n=>Kn(n)?NB(n):n;function gY(n){mf&&ql&&(n=Hi(n),rY(n.dep||(n.dep=DB())))}function pY(n,e){n=Hi(n);const t=n.dep;t&&p2(t)}function eo(n){return!!(n&&n.__v_isRef===!0)}function se(n){return mY(n,!1)}function qD(n){return mY(n,!0)}function mY(n,e){return eo(n)?n:new Ede(n,e)}class Ede{constructor(e,t){this.__v_isShallow=t,this.dep=void 0,this.__v_isRef=!0,this._rawValue=t?e:Hi(e),this._value=t?e:JC(e)}get value(){return gY(this),this._value}set value(e){const t=this.__v_isShallow||KD(e)||im(e);e=t?e:Hi(e),QC(e,this._rawValue)&&(this._rawValue=e,this._value=t?e:JC(e),pY(this))}}function ud(n){return eo(n)?n.value:n}const Ide={get:(n,e,t)=>ud(Reflect.get(n,e,t)),set:(n,e,t,i)=>{const s=n[e];return eo(s)&&!eo(t)?(s.value=t,!0):Reflect.set(n,e,t,i)}};function _Y(n){return Fp(n)?n:new Proxy(n,Ide)}function Tde(n){const e=Xt(n)?new Array(n.length):{};for(const t in n)e[t]=Nde(n,t);return e}class xde{constructor(e,t,i){this._object=e,this._key=t,this._defaultValue=i,this.__v_isRef=!0}get value(){const e=this._object[this._key];return e===void 0?this._defaultValue:e}set value(e){this._object[this._key]=e}get dep(){return tde(Hi(this._object),this._key)}}function Nde(n,e,t){const i=n[e];return eo(i)?i:new xde(n,e,t)}class Ade{constructor(e,t,i,s){this._setter=t,this.dep=void 0,this.__v_isRef=!0,this.__v_isReadonly=!1,this._dirty=!0,this.effect=new EB(e,()=>{this._dirty||(this._dirty=!0,pY(this))}),this.effect.computed=this,this.effect.active=this._cacheable=!s,this.__v_isReadonly=i}get value(){const e=Hi(this);return gY(e),(e._dirty||!e._cacheable)&&(e._dirty=!1,e._value=e.effect.run()),e._value}set value(e){this._setter(e)}}function Mde(n,e,t=!1){let i,s;const o=mi(n);return o?(i=n,s=ic):(i=n.get,s=n.set),new Ade(i,s,o||!s,t)}function _f(n,e,t,i){let s;try{s=i?n(...i):n()}catch(o){TT(o,e,t)}return s}function nl(n,e,t,i){if(mi(n)){const o=_f(n,e,t,i);return o&&QG(o)&&o.catch(r=>{TT(r,e,t)}),o}const s=[];for(let o=0;o>>1;tw(Zo[i])Uc&&Zo.splice(e,1)}function Fde(n){Xt(n)?Mv.push(...n):(!su||!su.includes(n,n.allowRecurse?cp+1:cp))&&Mv.push(n),bY()}function dW(n,e=ew?Uc+1:0){for(;etw(t)-tw(i)),cp=0;cpn.id==null?1/0:n.id,Bde=(n,e)=>{const t=tw(n)-tw(e);if(t===0){if(n.pre&&!e.pre)return-1;if(e.pre&&!n.pre)return 1}return t};function wY(n){m2=!1,ew=!0,Zo.sort(Bde);const e=ic;try{for(Uc=0;Ucns(f)?f.trim():f)),u&&(s=t.map(u2))}let a,l=i[a=LA(e)]||i[a=LA(vd(e))];!l&&o&&(l=i[a=LA(Hm(e))]),l&&nl(l,n,6,s);const c=i[a+"Once"];if(c){if(!n.emitted)n.emitted={};else if(n.emitted[a])return;n.emitted[a]=!0,nl(c,n,6,s)}}function yY(n,e,t=!1){const i=e.emitsCache,s=i.get(n);if(s!==void 0)return s;const o=n.emits;let r={},a=!1;if(!mi(n)){const l=c=>{const d=yY(c,e,!0);d&&(a=!0,Is(r,d))};!t&&e.mixins.length&&e.mixins.forEach(l),n.extends&&l(n.extends),n.mixins&&n.mixins.forEach(l)}return!o&&!a?(Kn(n)&&i.set(n,null),null):(Xt(o)?o.forEach(l=>r[l]=null):Is(r,o),Kn(n)&&i.set(n,r),r)}function xT(n,e){return!n||!LT(e)?!1:(e=e.slice(2).replace(/Once$/,""),ji(n,e[0].toLowerCase()+e.slice(1))||ji(n,Hm(e))||ji(n,e))}let Eo=null,NT=null;function GD(n){const e=Eo;return Eo=n,NT=n&&n.type.__scopeId||null,e}function vg(n){NT=n}function bg(){NT=null}function Lt(n,e=Eo,t){if(!e||n._n)return n;const i=(...s)=>{i._d&&SW(-1);const o=GD(e);let r;try{r=n(...s)}finally{GD(o),i._d&&SW(1)}return r};return i._n=!0,i._c=!0,i._d=!0,i}function kA(n){const{type:e,vnode:t,proxy:i,withProxy:s,props:o,propsOptions:[r],slots:a,attrs:l,emit:c,render:d,renderCache:u,data:h,setupState:f,ctx:g,inheritAttrs:p}=n;let _,v;const b=GD(n);try{if(t.shapeFlag&4){const w=s||i;_=Fc(d.call(w,w,u,o,f,h,g)),v=l}else{const w=e;_=Fc(w.length>1?w(o,{attrs:l,slots:a,emit:c}):w(o,null)),v=e.props?l:Vde(l)}}catch(w){dC.length=0,TT(w,n,1),_=Oe(ya)}let C=_;if(v&&p!==!1){const w=Object.keys(v),{shapeFlag:y}=C;w.length&&y&7&&(r&&w.some(yB)&&(v=Hde(v,r)),C=Bf(C,v))}return t.dirs&&(C=Bf(C),C.dirs=C.dirs?C.dirs.concat(t.dirs):t.dirs),t.transition&&(C.transition=t.transition),_=C,GD(b),_}const Vde=n=>{let e;for(const t in n)(t==="class"||t==="style"||LT(t))&&((e||(e={}))[t]=n[t]);return e},Hde=(n,e)=>{const t={};for(const i in n)(!yB(i)||!(i.slice(9)in e))&&(t[i]=n[i]);return t};function $de(n,e,t){const{props:i,children:s,component:o}=n,{props:r,children:a,patchFlag:l}=e,c=o.emitsOptions;if(e.dirs||e.transition)return!0;if(t&&l>=0){if(l&1024)return!0;if(l&16)return i?uW(i,r,c):!!r;if(l&8){const d=e.dynamicProps;for(let u=0;un.__isSuspense;function jde(n,e){e&&e.pendingBranch?Xt(n)?e.effects.push(...n):e.effects.push(n):Fde(n)}function Kde(n,e){return tS(n,null,e)}function qde(n,e){return tS(n,null,{flush:"post"})}function Gde(n,e){return tS(n,null,{flush:"sync"})}const lL={};function ht(n,e,t){return tS(n,e,t)}function tS(n,e,{immediate:t,deep:i,flush:s,onTrack:o,onTrigger:r}=Hn){var a;const l=Qce()===((a=_o)==null?void 0:a.scope)?_o:null;let c,d=!1,u=!1;if(eo(n)?(c=()=>n.value,d=KD(n)):Fp(n)?(c=()=>n,i=!0):Xt(n)?(u=!0,d=n.some(w=>Fp(w)||KD(w)),c=()=>n.map(w=>{if(eo(w))return w.value;if(Fp(w))return Lp(w);if(mi(w))return _f(w,l,2)})):mi(n)?e?c=()=>_f(n,l,2):c=()=>{if(!(l&&l.isUnmounted))return h&&h(),nl(n,l,3,[f])}:c=ic,e&&i){const w=c;c=()=>Lp(w())}let h,f=w=>{h=b.onStop=()=>{_f(w,l,4)}},g;if(rw)if(f=ic,e?t&&nl(e,l,3,[c(),u?[]:void 0,f]):c(),s==="sync"){const w=Pue();g=w.__watcherHandles||(w.__watcherHandles=[])}else return ic;let p=u?new Array(n.length).fill(lL):lL;const _=()=>{if(b.active)if(e){const w=b.run();(i||d||(u?w.some((y,L)=>QC(y,p[L])):QC(w,p)))&&(h&&h(),nl(e,l,3,[w,p===lL?void 0:u&&p[0]===lL?[]:p,f]),p=w)}else b.run()};_.allowRecurse=!!e;let v;s==="sync"?v=_:s==="post"?v=()=>Ar(_,l&&l.suspense):(_.pre=!0,l&&(_.id=l.uid),v=()=>OB(_));const b=new EB(c,v);e?t?_():p=b.run():s==="post"?Ar(b.run.bind(b),l&&l.suspense):b.run();const C=()=>{b.stop(),l&&l.scope&&SB(l.scope.effects,b)};return g&&g.push(C),C}function Yde(n,e,t){const i=this.proxy,s=ns(n)?n.includes(".")?SY(i,n):()=>i[n]:n.bind(i,i);let o;mi(e)?o=e:(o=e.handler,t=e);const r=_o;ub(this);const a=tS(s,o.bind(i),t);return r?ub(r):Bp(),a}function SY(n,e){const t=e.split(".");return()=>{let i=n;for(let s=0;s{Lp(t,e)});else if(eY(n))for(const t in n)Lp(n[t],e);return n}function wi(n,e){const t=Eo;if(t===null)return n;const i=OT(t)||t.proxy,s=n.dirs||(n.dirs=[]);for(let o=0;o{n.isMounted=!0}),zm(()=>{n.isUnmounting=!0}),n}const ja=[Function,Array],kY={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:ja,onEnter:ja,onAfterEnter:ja,onEnterCancelled:ja,onBeforeLeave:ja,onLeave:ja,onAfterLeave:ja,onLeaveCancelled:ja,onBeforeAppear:ja,onAppear:ja,onAfterAppear:ja,onAppearCancelled:ja},Zde={name:"BaseTransition",props:kY,setup(n,{slots:e}){const t=ih(),i=LY();let s;return()=>{const o=e.default&&FB(e.default(),!0);if(!o||!o.length)return;let r=o[0];if(o.length>1){for(const p of o)if(p.type!==ya){r=p;break}}const a=Hi(n),{mode:l}=a;if(i.isLeaving)return DA(r);const c=hW(r);if(!c)return DA(r);const d=iw(c,a,i,t);nw(c,d);const u=t.subTree,h=u&&hW(u);let f=!1;const{getTransitionKey:g}=c.type;if(g){const p=g();s===void 0?s=p:p!==s&&(s=p,f=!0)}if(h&&h.type!==ya&&(!dp(c,h)||f)){const p=iw(h,a,i,t);if(nw(h,p),l==="out-in")return i.isLeaving=!0,p.afterLeave=()=>{i.isLeaving=!1,t.update.active!==!1&&t.update()},DA(r);l==="in-out"&&c.type!==ya&&(p.delayLeave=(_,v,b)=>{const C=DY(i,h);C[String(h.key)]=h,_._leaveCb=()=>{v(),_._leaveCb=void 0,delete d.delayedLeave},d.delayedLeave=b})}return r}}},Xde=Zde;function DY(n,e){const{leavingVNodes:t}=n;let i=t.get(e.type);return i||(i=Object.create(null),t.set(e.type,i)),i}function iw(n,e,t,i){const{appear:s,mode:o,persisted:r=!1,onBeforeEnter:a,onEnter:l,onAfterEnter:c,onEnterCancelled:d,onBeforeLeave:u,onLeave:h,onAfterLeave:f,onLeaveCancelled:g,onBeforeAppear:p,onAppear:_,onAfterAppear:v,onAppearCancelled:b}=e,C=String(n.key),w=DY(t,n),y=(k,D)=>{k&&nl(k,i,9,D)},L=(k,D)=>{const x=D[1];y(k,D),Xt(k)?k.every(A=>A.length<=1)&&x():k.length<=1&&x()},S={mode:o,persisted:r,beforeEnter(k){let D=a;if(!t.isMounted)if(s)D=p||a;else return;k._leaveCb&&k._leaveCb(!0);const x=w[C];x&&dp(n,x)&&x.el._leaveCb&&x.el._leaveCb(),y(D,[k])},enter(k){let D=l,x=c,A=d;if(!t.isMounted)if(s)D=_||l,x=v||c,A=b||d;else return;let T=!1;const P=k._enterCb=W=>{T||(T=!0,W?y(A,[k]):y(x,[k]),S.delayedLeave&&S.delayedLeave(),k._enterCb=void 0)};D?L(D,[k,P]):P()},leave(k,D){const x=String(n.key);if(k._enterCb&&k._enterCb(!0),t.isUnmounting)return D();y(u,[k]);let A=!1;const T=k._leaveCb=P=>{A||(A=!0,D(),P?y(g,[k]):y(f,[k]),k._leaveCb=void 0,w[x]===n&&delete w[x])};w[x]=n,h?L(h,[k,T]):T()},clone(k){return iw(k,e,t,i)}};return S}function DA(n){if(AT(n))return n=Bf(n),n.children=null,n}function hW(n){return AT(n)?n.children?n.children[0]:void 0:n}function nw(n,e){n.shapeFlag&6&&n.component?nw(n.component.subTree,e):n.shapeFlag&128?(n.ssContent.transition=e.clone(n.ssContent),n.ssFallback.transition=e.clone(n.ssFallback)):n.transition=e}function FB(n,e=!1,t){let i=[],s=0;for(let o=0;o1)for(let o=0;oIs({name:n.name},e,{setup:n}))():n}const rC=n=>!!n.type.__asyncLoader,AT=n=>n.type.__isKeepAlive;function eh(n,e){EY(n,"a",e)}function $m(n,e){EY(n,"da",e)}function EY(n,e,t=_o){const i=n.__wdc||(n.__wdc=()=>{let s=t;for(;s;){if(s.isDeactivated)return;s=s.parent}return n()});if(MT(e,i,t),t){let s=t.parent;for(;s&&s.parent;)AT(s.parent.vnode)&&Qde(i,e,t,s),s=s.parent}}function Qde(n,e,t,i){const s=MT(e,n,i,!0);Cd(()=>{SB(i[e],s)},t)}function MT(n,e,t=_o,i=!1){if(t){const s=t[n]||(t[n]=[]),o=e.__weh||(e.__weh=(...r)=>{if(t.isUnmounted)return;g0(),ub(t);const a=nl(e,t,n,r);return Bp(),p0(),a});return i?s.unshift(o):s.push(o),o}}const th=n=>(e,t=_o)=>(!rw||n==="sp")&&MT(n,(...i)=>e(...i),t),BB=th("bm"),bd=th("m"),IY=th("bu"),Cg=th("u"),zm=th("bum"),Cd=th("um"),Jde=th("sp"),eue=th("rtg"),tue=th("rtc");function iue(n,e=_o){MT("ec",n,e)}const WB="components",nue="directives";function gt(n,e){return VB(WB,n,!0,e)||n}const TY=Symbol.for("v-ndc");function m0(n){return ns(n)?VB(WB,n,!1)||n:n||TY}function hn(n){return VB(nue,n)}function VB(n,e,t=!0,i=!1){const s=Eo||_o;if(s){const o=s.type;if(n===WB){const a=Aue(o,!1);if(a&&(a===e||a===vd(e)||a===ET(vd(e))))return o}const r=fW(s[n]||o[n],e)||fW(s.appContext[n],e);return!r&&i?o:r}}function fW(n,e){return n&&(n[e]||n[vd(e)]||n[ET(vd(e))])}function ss(n,e,t,i){let s;const o=t&&t[i];if(Xt(n)||ns(n)){s=new Array(n.length);for(let r=0,a=n.length;re(r,a,void 0,o&&o[a]));else{const r=Object.keys(n);s=new Array(r.length);for(let a=0,l=r.length;a{const o=i.fn(...s);return o&&(o.key=i.key),o}:i.fn)}return n}function xe(n,e,t={},i,s){if(Eo.isCE||Eo.parent&&rC(Eo.parent)&&Eo.parent.isCE)return e!=="default"&&(t.name=e),Oe("slot",t,i&&i());let o=n[e];o&&o._c&&(o._d=!1),q();const r=o&&xY(o(t)),a=ei(li,{key:t.key||r&&r.key||"_".concat(e)},r||(i?i():[]),r&&n._===1?64:-2);return!s&&a.scopeId&&(a.slotScopeIds=[a.scopeId+"-s"]),o&&o._c&&(o._d=!0),a}function xY(n){return n.some(e=>ow(e)?!(e.type===ya||e.type===li&&!xY(e.children)):!0)?n:null}const _2=n=>n?$Y(n)?OT(n)||n.proxy:_2(n.parent):null,aC=Is(Object.create(null),{$:n=>n,$el:n=>n.vnode.el,$data:n=>n.data,$props:n=>n.props,$attrs:n=>n.attrs,$slots:n=>n.slots,$refs:n=>n.refs,$parent:n=>_2(n.parent),$root:n=>_2(n.root),$emit:n=>n.emit,$options:n=>HB(n),$forceUpdate:n=>n.f||(n.f=()=>OB(n.update)),$nextTick:n=>n.n||(n.n=Fn.bind(n.proxy)),$watch:n=>Yde.bind(n)}),EA=(n,e)=>n!==Hn&&!n.__isScriptSetup&&ji(n,e),sue={get({_:n},e){const{ctx:t,setupState:i,data:s,props:o,accessCache:r,type:a,appContext:l}=n;let c;if(e[0]!=="$"){const f=r[e];if(f!==void 0)switch(f){case 1:return i[e];case 2:return s[e];case 4:return t[e];case 3:return o[e]}else{if(EA(i,e))return r[e]=1,i[e];if(s!==Hn&&ji(s,e))return r[e]=2,s[e];if((c=n.propsOptions[0])&&ji(c,e))return r[e]=3,o[e];if(t!==Hn&&ji(t,e))return r[e]=4,t[e];v2&&(r[e]=0)}}const d=aC[e];let u,h;if(d)return e==="$attrs"&&Zr(n,"get",e),d(n);if((u=a.__cssModules)&&(u=u[e]))return u;if(t!==Hn&&ji(t,e))return r[e]=4,t[e];if(h=l.config.globalProperties,ji(h,e))return h[e]},set({_:n},e,t){const{data:i,setupState:s,ctx:o}=n;return EA(s,e)?(s[e]=t,!0):i!==Hn&&ji(i,e)?(i[e]=t,!0):ji(n.props,e)||e[0]==="$"&&e.slice(1)in n?!1:(o[e]=t,!0)},has({_:{data:n,setupState:e,accessCache:t,ctx:i,appContext:s,propsOptions:o}},r){let a;return!!t[r]||n!==Hn&&ji(n,r)||EA(e,r)||(a=o[0])&&ji(a,r)||ji(i,r)||ji(aC,r)||ji(s.config.globalProperties,r)},defineProperty(n,e,t){return t.get!=null?n._.accessCache[e]=0:ji(t,"value")&&this.set(n,e,t.value,null),Reflect.defineProperty(n,e,t)}};function gW(n){return Xt(n)?n.reduce((e,t)=>(e[t]=null,e),{}):n}let v2=!0;function oue(n){const e=HB(n),t=n.proxy,i=n.ctx;v2=!1,e.beforeCreate&&pW(e.beforeCreate,n,"bc");const{data:s,computed:o,methods:r,watch:a,provide:l,inject:c,created:d,beforeMount:u,mounted:h,beforeUpdate:f,updated:g,activated:p,deactivated:_,beforeDestroy:v,beforeUnmount:b,destroyed:C,unmounted:w,render:y,renderTracked:L,renderTriggered:S,errorCaptured:k,serverPrefetch:D,expose:x,inheritAttrs:A,components:T,directives:P,filters:W}=e;if(c&&rue(c,i,null),r)for(const J in r){const Q=r[J];mi(Q)&&(i[J]=Q.bind(t))}if(s){const J=s.call(t,t);Kn(J)&&(n.data=Cn(J))}if(v2=!0,o)for(const J in o){const Q=o[J],le=mi(Q)?Q.bind(t,t):mi(Q.get)?Q.get.bind(t,t):ic,de=!mi(Q)&&mi(Q.set)?Q.set.bind(t):ic,_e=ve({get:le,set:de});Object.defineProperty(i,J,{enumerable:!0,configurable:!0,get:()=>_e.value,set:ie=>_e.value=ie})}if(a)for(const J in a)NY(a[J],i,t,J);if(l){const J=mi(l)?l.call(t):l;Reflect.ownKeys(J).forEach(Q=>{MY(Q,J[Q])})}d&&pW(d,n,"c");function X(J,Q){Xt(Q)?Q.forEach(le=>J(le.bind(t))):Q&&J(Q.bind(t))}if(X(BB,u),X(bd,h),X(IY,f),X(Cg,g),X(eh,p),X($m,_),X(iue,k),X(tue,L),X(eue,S),X(zm,b),X(Cd,w),X(Jde,D),Xt(x))if(x.length){const J=n.exposed||(n.exposed={});x.forEach(Q=>{Object.defineProperty(J,Q,{get:()=>t[Q],set:le=>t[Q]=le})})}else n.exposed||(n.exposed={});y&&n.render===ic&&(n.render=y),A!=null&&(n.inheritAttrs=A),T&&(n.components=T),P&&(n.directives=P)}function rue(n,e,t=ic){Xt(n)&&(n=b2(n));for(const i in n){const s=n[i];let o;Kn(s)?"default"in s?o=lC(s.from||i,s.default,!0):o=lC(s.from||i):o=lC(s),eo(o)?Object.defineProperty(e,i,{enumerable:!0,configurable:!0,get:()=>o.value,set:r=>o.value=r}):e[i]=o}}function pW(n,e,t){nl(Xt(n)?n.map(i=>i.bind(e.proxy)):n.bind(e.proxy),e,t)}function NY(n,e,t,i){const s=i.includes(".")?SY(t,i):()=>t[i];if(ns(n)){const o=e[n];mi(o)&&ht(s,o)}else if(mi(n))ht(s,n.bind(t));else if(Kn(n))if(Xt(n))n.forEach(o=>NY(o,e,t,i));else{const o=mi(n.handler)?n.handler.bind(t):e[n.handler];mi(o)&&ht(s,o,n)}}function HB(n){const e=n.type,{mixins:t,extends:i}=e,{mixins:s,optionsCache:o,config:{optionMergeStrategies:r}}=n.appContext,a=o.get(e);let l;return a?l=a:!s.length&&!t&&!i?l=e:(l={},s.length&&s.forEach(c=>ZD(l,c,r,!0)),ZD(l,e,r)),Kn(e)&&o.set(e,l),l}function ZD(n,e,t,i=!1){const{mixins:s,extends:o}=e;o&&ZD(n,o,t,!0),s&&s.forEach(r=>ZD(n,r,t,!0));for(const r in e)if(!(i&&r==="expose")){const a=aue[r]||t&&t[r];n[r]=a?a(n[r],e[r]):e[r]}return n}const aue={data:mW,props:_W,emits:_W,methods:P1,computed:P1,beforeCreate:lr,created:lr,beforeMount:lr,mounted:lr,beforeUpdate:lr,updated:lr,beforeDestroy:lr,beforeUnmount:lr,destroyed:lr,unmounted:lr,activated:lr,deactivated:lr,errorCaptured:lr,serverPrefetch:lr,components:P1,directives:P1,watch:cue,provide:mW,inject:lue};function mW(n,e){return e?n?function(){return Is(mi(n)?n.call(this,this):n,mi(e)?e.call(this,this):e)}:e:n}function lue(n,e){return P1(b2(n),b2(e))}function b2(n){if(Xt(n)){const e={};for(let t=0;t1)return t&&mi(e)?e.call(i&&i.proxy):e}}function hue(n,e,t,i=!1){const s={},o={};UD(o,PT,1),n.propsDefaults=Object.create(null),RY(n,e,s,o);for(const r in n.propsOptions[0])r in s||(s[r]=void 0);t?n.props=i?s:Dde(s):n.type.props?n.props=s:n.props=o,n.attrs=o}function fue(n,e,t,i){const{props:s,attrs:o,vnode:{patchFlag:r}}=n,a=Hi(s),[l]=n.propsOptions;let c=!1;if((i||r>0)&&!(r&16)){if(r&8){const d=n.vnode.dynamicProps;for(let u=0;u{l=!0;const[h,f]=PY(u,e,!0);Is(r,h),f&&a.push(...f)};!t&&e.mixins.length&&e.mixins.forEach(d),n.extends&&d(n.extends),n.mixins&&n.mixins.forEach(d)}if(!o&&!l)return Kn(n)&&i.set(n,Nv),Nv;if(Xt(o))for(let d=0;d-1,f[1]=p<0||g-1||ji(f,"default"))&&a.push(u)}}}const c=[r,a];return Kn(n)&&i.set(n,c),c}function vW(n){return n[0]!=="$"}function bW(n){const e=n&&n.toString().match(/^\s*(function|class) (\w+)/);return e?e[2]:n===null?"null":""}function CW(n,e){return bW(n)===bW(e)}function wW(n,e){return Xt(e)?e.findIndex(t=>CW(t,n)):mi(e)&&CW(e,n)?0:-1}const OY=n=>n[0]==="_"||n==="$stable",$B=n=>Xt(n)?n.map(Fc):[Fc(n)],gue=(n,e,t)=>{if(e._n)return e;const i=Lt((...s)=>$B(e(...s)),t);return i._c=!1,i},FY=(n,e,t)=>{const i=n._ctx;for(const s in n){if(OY(s))continue;const o=n[s];if(mi(o))e[s]=gue(s,o,i);else if(o!=null){const r=$B(o);e[s]=()=>r}}},BY=(n,e)=>{const t=$B(e);n.slots.default=()=>t},pue=(n,e)=>{if(n.vnode.shapeFlag&32){const t=e._;t?(n.slots=Hi(e),UD(e,"_",t)):FY(e,n.slots={})}else n.slots={},e&&BY(n,e);UD(n.slots,PT,1)},mue=(n,e,t)=>{const{vnode:i,slots:s}=n;let o=!0,r=Hn;if(i.shapeFlag&32){const a=e._;a?t&&a===1?o=!1:(Is(s,e),!t&&a===1&&delete s._):(o=!e.$stable,FY(e,s)),r=e}else e&&(BY(n,e),r={default:1});if(o)for(const a in s)!OY(a)&&!(a in r)&&delete s[a]};function w2(n,e,t,i,s=!1){if(Xt(n)){n.forEach((h,f)=>w2(h,e&&(Xt(e)?e[f]:e),t,i,s));return}if(rC(i)&&!s)return;const o=i.shapeFlag&4?OT(i.component)||i.component.proxy:i.el,r=s?null:o,{i:a,r:l}=n,c=e&&e.r,d=a.refs===Hn?a.refs={}:a.refs,u=a.setupState;if(c!=null&&c!==l&&(ns(c)?(d[c]=null,ji(u,c)&&(u[c]=null)):eo(c)&&(c.value=null)),mi(l))_f(l,a,12,[r,d]);else{const h=ns(l),f=eo(l);if(h||f){const g=()=>{if(n.f){const p=h?ji(u,l)?u[l]:d[l]:l.value;s?Xt(p)&&SB(p,o):Xt(p)?p.includes(o)||p.push(o):h?(d[l]=[o],ji(u,l)&&(u[l]=d[l])):(l.value=[o],n.k&&(d[n.k]=l.value))}else h?(d[l]=r,ji(u,l)&&(u[l]=r)):f&&(l.value=r,n.k&&(d[n.k]=r))};r?(g.id=-1,Ar(g,t)):g()}}}const Ar=jde;function _ue(n){return vue(n)}function vue(n,e){const t=h2();t.__VUE__=!0;const{insert:i,remove:s,patchProp:o,createElement:r,createText:a,createComment:l,setText:c,setElementText:d,parentNode:u,nextSibling:h,setScopeId:f=ic,insertStaticContent:g}=n,p=(Z,z,ae,we=null,Ne=null,Ce=null,Be=!1,Ae=null,K=!!z.dynamicChildren)=>{if(Z===z)return;Z&&!dp(Z,z)&&(we=ze(Z),ie(Z,Ne,Ce,!0),Z=null),z.patchFlag===-2&&(K=!1,z.dynamicChildren=null);const{type:V,ref:G,shapeFlag:N}=z;switch(V){case RT:_(Z,z,ae,we);break;case ya:v(Z,z,ae,we);break;case IA:Z==null&&b(z,ae,we,Be);break;case li:T(Z,z,ae,we,Ne,Ce,Be,Ae,K);break;default:N&1?y(Z,z,ae,we,Ne,Ce,Be,Ae,K):N&6?P(Z,z,ae,we,Ne,Ce,Be,Ae,K):(N&64||N&128)&&V.process(Z,z,ae,we,Ne,Ce,Be,Ae,K,Ke)}G!=null&&Ne&&w2(G,Z&&Z.ref,Ce,z||Z,!z)},_=(Z,z,ae,we)=>{if(Z==null)i(z.el=a(z.children),ae,we);else{const Ne=z.el=Z.el;z.children!==Z.children&&c(Ne,z.children)}},v=(Z,z,ae,we)=>{Z==null?i(z.el=l(z.children||""),ae,we):z.el=Z.el},b=(Z,z,ae,we)=>{[Z.el,Z.anchor]=g(Z.children,z,ae,we,Z.el,Z.anchor)},C=({el:Z,anchor:z},ae,we)=>{let Ne;for(;Z&&Z!==z;)Ne=h(Z),i(Z,ae,we),Z=Ne;i(z,ae,we)},w=({el:Z,anchor:z})=>{let ae;for(;Z&&Z!==z;)ae=h(Z),s(Z),Z=ae;s(z)},y=(Z,z,ae,we,Ne,Ce,Be,Ae,K)=>{Be=Be||z.type==="svg",Z==null?L(z,ae,we,Ne,Ce,Be,Ae,K):D(Z,z,Ne,Ce,Be,Ae,K)},L=(Z,z,ae,we,Ne,Ce,Be,Ae)=>{let K,V;const{type:G,props:N,shapeFlag:R,transition:U,dirs:H}=Z;if(K=Z.el=r(Z.type,Ce,N&&N.is,N),R&8?d(K,Z.children):R&16&&k(Z.children,K,null,we,Ne,Ce&&G!=="foreignObject",Be,Ae),H&&zg(Z,null,we,"created"),S(K,Z,Z.scopeId,Be,we),N){for(const Le in N)Le!=="value"&&!Uk(Le)&&o(K,Le,null,N[Le],Ce,Z.children,we,Ne,Ee);"value"in N&&o(K,"value",null,N.value),(V=N.onVnodeBeforeMount)&&Dc(V,we,Z)}H&&zg(Z,null,we,"beforeMount");const he=(!Ne||Ne&&!Ne.pendingBranch)&&U&&!U.persisted;he&&U.beforeEnter(K),i(K,z,ae),((V=N&&N.onVnodeMounted)||he||H)&&Ar(()=>{V&&Dc(V,we,Z),he&&U.enter(K),H&&zg(Z,null,we,"mounted")},Ne)},S=(Z,z,ae,we,Ne)=>{if(ae&&f(Z,ae),we)for(let Ce=0;Ce{for(let V=K;V{const Ae=z.el=Z.el;let{patchFlag:K,dynamicChildren:V,dirs:G}=z;K|=Z.patchFlag&16;const N=Z.props||Hn,R=z.props||Hn;let U;ae&&Ug(ae,!1),(U=R.onVnodeBeforeUpdate)&&Dc(U,ae,z,Z),G&&zg(z,Z,ae,"beforeUpdate"),ae&&Ug(ae,!0);const H=Ne&&z.type!=="foreignObject";if(V?x(Z.dynamicChildren,V,Ae,ae,we,H,Ce):Be||Q(Z,z,Ae,null,ae,we,H,Ce,!1),K>0){if(K&16)A(Ae,z,N,R,ae,we,Ne);else if(K&2&&N.class!==R.class&&o(Ae,"class",null,R.class,Ne),K&4&&o(Ae,"style",N.style,R.style,Ne),K&8){const he=z.dynamicProps;for(let Le=0;Le{U&&Dc(U,ae,z,Z),G&&zg(z,Z,ae,"updated")},we)},x=(Z,z,ae,we,Ne,Ce,Be)=>{for(let Ae=0;Ae{if(ae!==we){if(ae!==Hn)for(const Ae in ae)!Uk(Ae)&&!(Ae in we)&&o(Z,Ae,ae[Ae],null,Be,z.children,Ne,Ce,Ee);for(const Ae in we){if(Uk(Ae))continue;const K=we[Ae],V=ae[Ae];K!==V&&Ae!=="value"&&o(Z,Ae,V,K,Be,z.children,Ne,Ce,Ee)}"value"in we&&o(Z,"value",ae.value,we.value)}},T=(Z,z,ae,we,Ne,Ce,Be,Ae,K)=>{const V=z.el=Z?Z.el:a(""),G=z.anchor=Z?Z.anchor:a("");let{patchFlag:N,dynamicChildren:R,slotScopeIds:U}=z;U&&(Ae=Ae?Ae.concat(U):U),Z==null?(i(V,ae,we),i(G,ae,we),k(z.children,ae,G,Ne,Ce,Be,Ae,K)):N>0&&N&64&&R&&Z.dynamicChildren?(x(Z.dynamicChildren,R,ae,Ne,Ce,Be,Ae),(z.key!=null||Ne&&z===Ne.subTree)&&zB(Z,z,!0)):Q(Z,z,ae,G,Ne,Ce,Be,Ae,K)},P=(Z,z,ae,we,Ne,Ce,Be,Ae,K)=>{z.slotScopeIds=Ae,Z==null?z.shapeFlag&512?Ne.ctx.activate(z,ae,we,Be,K):W(z,ae,we,Ne,Ce,Be,K):$(Z,z,K)},W=(Z,z,ae,we,Ne,Ce,Be)=>{const Ae=Z.component=Eue(Z,we,Ne);if(AT(Z)&&(Ae.ctx.renderer=Ke),Iue(Ae),Ae.asyncDep){if(Ne&&Ne.registerDep(Ae,X),!Z.el){const K=Ae.subTree=Oe(ya);v(null,K,z,ae)}return}X(Ae,Z,z,ae,Ne,Ce,Be)},$=(Z,z,ae)=>{const we=z.component=Z.component;if($de(Z,z,ae))if(we.asyncDep&&!we.asyncResolved){J(we,z,ae);return}else we.next=z,Ode(we.update),we.update();else z.el=Z.el,we.vnode=z},X=(Z,z,ae,we,Ne,Ce,Be)=>{const Ae=()=>{if(Z.isMounted){let{next:G,bu:N,u:R,parent:U,vnode:H}=Z,he=G,Le;Ug(Z,!1),G?(G.el=H.el,J(Z,G,Be)):G=H,N&&jk(N),(Le=G.props&&G.props.onVnodeBeforeUpdate)&&Dc(Le,U,G,H),Ug(Z,!0);const qe=kA(Z),ot=Z.subTree;Z.subTree=qe,p(ot,qe,u(ot.el),ze(ot),Z,Ne,Ce),G.el=qe.el,he===null&&zde(Z,qe.el),R&&Ar(R,Ne),(Le=G.props&&G.props.onVnodeUpdated)&&Ar(()=>Dc(Le,U,G,H),Ne)}else{let G;const{el:N,props:R}=z,{bm:U,m:H,parent:he}=Z,Le=rC(z);if(Ug(Z,!1),U&&jk(U),!Le&&(G=R&&R.onVnodeBeforeMount)&&Dc(G,he,z),Ug(Z,!0),N&&je){const qe=()=>{Z.subTree=kA(Z),je(N,Z.subTree,Z,Ne,null)};Le?z.type.__asyncLoader().then(()=>!Z.isUnmounted&&qe()):qe()}else{const qe=Z.subTree=kA(Z);p(null,qe,ae,we,Z,Ne,Ce),z.el=qe.el}if(H&&Ar(H,Ne),!Le&&(G=R&&R.onVnodeMounted)){const qe=z;Ar(()=>Dc(G,he,qe),Ne)}(z.shapeFlag&256||he&&rC(he.vnode)&&he.vnode.shapeFlag&256)&&Z.a&&Ar(Z.a,Ne),Z.isMounted=!0,z=ae=we=null}},K=Z.effect=new EB(Ae,()=>OB(V),Z.scope),V=Z.update=()=>K.run();V.id=Z.uid,Ug(Z,!0),V()},J=(Z,z,ae)=>{z.component=Z;const we=Z.vnode.props;Z.vnode=z,Z.next=null,fue(Z,z.props,we,ae),mue(Z,z.children,ae),g0(),dW(),p0()},Q=(Z,z,ae,we,Ne,Ce,Be,Ae,K=!1)=>{const V=Z&&Z.children,G=Z?Z.shapeFlag:0,N=z.children,{patchFlag:R,shapeFlag:U}=z;if(R>0){if(R&128){de(V,N,ae,we,Ne,Ce,Be,Ae,K);return}else if(R&256){le(V,N,ae,we,Ne,Ce,Be,Ae,K);return}}U&8?(G&16&&Ee(V,Ne,Ce),N!==V&&d(ae,N)):G&16?U&16?de(V,N,ae,we,Ne,Ce,Be,Ae,K):Ee(V,Ne,Ce,!0):(G&8&&d(ae,""),U&16&&k(N,ae,we,Ne,Ce,Be,Ae,K))},le=(Z,z,ae,we,Ne,Ce,Be,Ae,K)=>{Z=Z||Nv,z=z||Nv;const V=Z.length,G=z.length,N=Math.min(V,G);let R;for(R=0;RG?Ee(Z,Ne,Ce,!0,!1,N):k(z,ae,we,Ne,Ce,Be,Ae,K,N)},de=(Z,z,ae,we,Ne,Ce,Be,Ae,K)=>{let V=0;const G=z.length;let N=Z.length-1,R=G-1;for(;V<=N&&V<=R;){const U=Z[V],H=z[V]=K?Rh(z[V]):Fc(z[V]);if(dp(U,H))p(U,H,ae,null,Ne,Ce,Be,Ae,K);else break;V++}for(;V<=N&&V<=R;){const U=Z[N],H=z[R]=K?Rh(z[R]):Fc(z[R]);if(dp(U,H))p(U,H,ae,null,Ne,Ce,Be,Ae,K);else break;N--,R--}if(V>N){if(V<=R){const U=R+1,H=UR)for(;V<=N;)ie(Z[V],Ne,Ce,!0),V++;else{const U=V,H=V,he=new Map;for(V=H;V<=R;V++){const ft=z[V]=K?Rh(z[V]):Fc(z[V]);ft.key!=null&&he.set(ft.key,V)}let Le,qe=0;const ot=R-H+1;let yt=!1,Et=0;const gi=new Array(ot);for(V=0;V=ot){ie(ft,Ne,Ce,!0);continue}let Ci;if(ft.key!=null)Ci=he.get(ft.key);else for(Le=H;Le<=R;Le++)if(gi[Le-H]===0&&dp(ft,z[Le])){Ci=Le;break}Ci===void 0?ie(ft,Ne,Ce,!0):(gi[Ci-H]=V+1,Ci>=Et?Et=Ci:yt=!0,p(ft,z[Ci],ae,null,Ne,Ce,Be,Ae,K),qe++)}const _i=yt?bue(gi):Nv;for(Le=_i.length-1,V=ot-1;V>=0;V--){const ft=H+V,Ci=z[ft],Xi=ft+1{const{el:Ce,type:Be,transition:Ae,children:K,shapeFlag:V}=Z;if(V&6){_e(Z.component.subTree,z,ae,we);return}if(V&128){Z.suspense.move(z,ae,we);return}if(V&64){Be.move(Z,z,ae,Ke);return}if(Be===li){i(Ce,z,ae);for(let N=0;NAe.enter(Ce),Ne);else{const{leave:N,delayLeave:R,afterLeave:U}=Ae,H=()=>i(Ce,z,ae),he=()=>{N(Ce,()=>{H(),U&&U()})};R?R(Ce,H,he):he()}else i(Ce,z,ae)},ie=(Z,z,ae,we=!1,Ne=!1)=>{const{type:Ce,props:Be,ref:Ae,children:K,dynamicChildren:V,shapeFlag:G,patchFlag:N,dirs:R}=Z;if(Ae!=null&&w2(Ae,null,ae,Z,!0),G&256){z.ctx.deactivate(Z);return}const U=G&1&&R,H=!rC(Z);let he;if(H&&(he=Be&&Be.onVnodeBeforeUnmount)&&Dc(he,z,Z),G&6)pe(Z.component,ae,we);else{if(G&128){Z.suspense.unmount(ae,we);return}U&&zg(Z,null,z,"beforeUnmount"),G&64?Z.type.remove(Z,z,ae,Ne,Ke,we):V&&(Ce!==li||N>0&&N&64)?Ee(V,z,ae,!1,!0):(Ce===li&&N&384||!Ne&&G&16)&&Ee(K,z,ae),we&&ne(Z)}(H&&(he=Be&&Be.onVnodeUnmounted)||U)&&Ar(()=>{he&&Dc(he,z,Z),U&&zg(Z,null,z,"unmounted")},ae)},ne=Z=>{const{type:z,el:ae,anchor:we,transition:Ne}=Z;if(z===li){Ye(ae,we);return}if(z===IA){w(Z);return}const Ce=()=>{s(ae),Ne&&!Ne.persisted&&Ne.afterLeave&&Ne.afterLeave()};if(Z.shapeFlag&1&&Ne&&!Ne.persisted){const{leave:Be,delayLeave:Ae}=Ne,K=()=>Be(ae,Ce);Ae?Ae(Z.el,Ce,K):K()}else Ce()},Ye=(Z,z)=>{let ae;for(;Z!==z;)ae=h(Z),s(Z),Z=ae;s(z)},pe=(Z,z,ae)=>{const{bum:we,scope:Ne,update:Ce,subTree:Be,um:Ae}=Z;we&&jk(we),Ne.stop(),Ce&&(Ce.active=!1,ie(Be,Z,z,ae)),Ae&&Ar(Ae,z),Ar(()=>{Z.isUnmounted=!0},z),z&&z.pendingBranch&&!z.isUnmounted&&Z.asyncDep&&!Z.asyncResolved&&Z.suspenseId===z.pendingId&&(z.deps--,z.deps===0&&z.resolve())},Ee=(Z,z,ae,we=!1,Ne=!1,Ce=0)=>{for(let Be=Ce;BeZ.shapeFlag&6?ze(Z.component.subTree):Z.shapeFlag&128?Z.suspense.next():h(Z.anchor||Z.el),It=(Z,z,ae)=>{Z==null?z._vnode&&ie(z._vnode,null,null,!0):p(z._vnode||null,Z,z,null,null,null,ae),dW(),CY(),z._vnode=Z},Ke={p,um:ie,m:_e,r:ne,mt:W,mc:k,pc:Q,pbc:x,n:ze,o:n};let Xe,je;return e&&([Xe,je]=e(Ke)),{render:It,hydrate:Xe,createApp:uue(It,Xe)}}function Ug({effect:n,update:e},t){n.allowRecurse=e.allowRecurse=t}function zB(n,e,t=!1){const i=n.children,s=e.children;if(Xt(i)&&Xt(s))for(let o=0;o>1,n[t[a]]0&&(e[i]=t[o-1]),t[o]=i)}}for(o=t.length,r=t[o-1];o-- >0;)t[o]=r,r=e[r];return t}const Cue=n=>n.__isTeleport,cC=n=>n&&(n.disabled||n.disabled===""),yW=n=>typeof SVGElement<"u"&&n instanceof SVGElement,y2=(n,e)=>{const t=n&&n.to;return ns(t)?e?e(t):null:t},wue={__isTeleport:!0,process(n,e,t,i,s,o,r,a,l,c){const{mc:d,pc:u,pbc:h,o:{insert:f,querySelector:g,createText:p,createComment:_}}=c,v=cC(e.props);let{shapeFlag:b,children:C,dynamicChildren:w}=e;if(n==null){const y=e.el=p(""),L=e.anchor=p("");f(y,t,i),f(L,t,i);const S=e.target=y2(e.props,g),k=e.targetAnchor=p("");S&&(f(k,S),r=r||yW(S));const D=(x,A)=>{b&16&&d(C,x,A,s,o,r,a,l)};v?D(t,L):S&&D(S,k)}else{e.el=n.el;const y=e.anchor=n.anchor,L=e.target=n.target,S=e.targetAnchor=n.targetAnchor,k=cC(n.props),D=k?t:L,x=k?y:S;if(r=r||yW(L),w?(h(n.dynamicChildren,w,D,s,o,r,a),zB(n,e,!0)):l||u(n,e,D,x,s,o,r,a,!1),v)k||cL(e,t,y,c,1);else if((e.props&&e.props.to)!==(n.props&&n.props.to)){const A=e.target=y2(e.props,g);A&&cL(e,A,null,c,0)}else k&&cL(e,L,S,c,1)}WY(e)},remove(n,e,t,i,{um:s,o:{remove:o}},r){const{shapeFlag:a,children:l,anchor:c,targetAnchor:d,target:u,props:h}=n;if(u&&o(d),(r||!cC(h))&&(o(c),a&16))for(let f=0;f0?Xl||Nv:null,Sue(),sw>0&&Xl&&Xl.push(n),n}function re(n,e,t,i,s,o){return VY(me(n,e,t,i,s,o,!0))}function ei(n,e,t,i,s){return VY(Oe(n,e,t,i,s,!0))}function ow(n){return n?n.__v_isVNode===!0:!1}function dp(n,e){return n.type===e.type&&n.key===e.key}const PT="__vInternal",HY=({key:n})=>n!=null?n:null,Kk=({ref:n,ref_key:e,ref_for:t})=>(typeof n=="number"&&(n=""+n),n!=null?ns(n)||eo(n)||mi(n)?{i:Eo,r:n,k:e,f:!!t}:n:null);function me(n,e=null,t=null,i=0,s=null,o=n===li?0:1,r=!1,a=!1){const l={__v_isVNode:!0,__v_skip:!0,type:n,props:e,key:e&&HY(e),ref:e&&Kk(e),scopeId:NT,slotScopeIds:null,children:t,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetAnchor:null,staticCount:0,shapeFlag:o,patchFlag:i,dynamicProps:s,dynamicChildren:null,appContext:null,ctx:Eo};return a?(UB(l,t),o&128&&n.normalize(l)):t&&(l.shapeFlag|=ns(t)?8:16),sw>0&&!r&&Xl&&(l.patchFlag>0||o&6)&&l.patchFlag!==32&&Xl.push(l),l}const Oe=Lue;function Lue(n,e=null,t=null,i=0,s=null,o=!1){if((!n||n===TY)&&(n=ya),ow(n)){const a=Bf(n,e,!0);return t&&UB(a,t),sw>0&&!o&&Xl&&(a.shapeFlag&6?Xl[Xl.indexOf(n)]=a:Xl.push(a)),a.patchFlag|=-2,a}if(Mue(n)&&(n=n.__vccOpts),e){e=_0(e);let{class:a,style:l}=e;a&&!ns(a)&&(e.class=B(a)),Kn(l)&&(MB(l)&&!Xt(l)&&(l=Is({},l)),e.style=Fe(l))}const r=ns(n)?1:Ude(n)?128:Cue(n)?64:Kn(n)?4:mi(n)?2:0;return me(n,e,t,i,s,r,o,!0)}function _0(n){return n?MB(n)||PT in n?Is({},n):n:null}function Bf(n,e,t=!1){const{props:i,ref:s,patchFlag:o,children:r}=n,a=e?fn(i||{},e):i;return{__v_isVNode:!0,__v_skip:!0,type:n.type,props:a,key:a&&HY(a),ref:e&&e.ref?t&&s?Xt(s)?s.concat(Kk(e)):[s,Kk(e)]:Kk(e):s,scopeId:n.scopeId,slotScopeIds:n.slotScopeIds,children:r,target:n.target,targetAnchor:n.targetAnchor,staticCount:n.staticCount,shapeFlag:n.shapeFlag,patchFlag:e&&n.type!==li?o===-1?16:o|16:o,dynamicProps:n.dynamicProps,dynamicChildren:n.dynamicChildren,appContext:n.appContext,dirs:n.dirs,transition:n.transition,component:n.component,suspense:n.suspense,ssContent:n.ssContent&&Bf(n.ssContent),ssFallback:n.ssFallback&&Bf(n.ssFallback),el:n.el,anchor:n.anchor,ctx:n.ctx,ce:n.ce}}function Mi(n=" ",e=0){return Oe(RT,null,n,e)}function Qe(n="",e=!1){return e?(q(),ei(ya,null,n)):Oe(ya,null,n)}function Fc(n){return n==null||typeof n=="boolean"?Oe(ya):Xt(n)?Oe(li,null,n.slice()):typeof n=="object"?Rh(n):Oe(RT,null,String(n))}function Rh(n){return n.el===null&&n.patchFlag!==-1||n.memo?n:Bf(n)}function UB(n,e){let t=0;const{shapeFlag:i}=n;if(e==null)e=null;else if(Xt(e))t=16;else if(typeof e=="object")if(i&65){const s=e.default;s&&(s._c&&(s._d=!1),UB(n,s()),s._c&&(s._d=!0));return}else{t=32;const s=e._;!s&&!(PT in e)?e._ctx=Eo:s===3&&Eo&&(Eo.slots._===1?e._=1:(e._=2,n.patchFlag|=1024))}else mi(e)?(e={default:e,_ctx:Eo},t=32):(e=String(e),i&64?(t=16,e=[Mi(e)]):t=8);n.children=e,n.shapeFlag|=t}function fn(...n){const e={};for(let t=0;t_o||Eo;let jB,m_,LW="__VUE_INSTANCE_SETTERS__";(m_=h2()[LW])||(m_=h2()[LW]=[]),m_.push(n=>_o=n),jB=n=>{m_.length>1?m_.forEach(e=>e(n)):m_[0](n)};const ub=n=>{jB(n),n.scope.on()},Bp=()=>{_o&&_o.scope.off(),jB(null)};function $Y(n){return n.vnode.shapeFlag&4}let rw=!1;function Iue(n,e=!1){rw=e;const{props:t,children:i}=n.vnode,s=$Y(n);hue(n,t,s,e),pue(n,i);const o=s?Tue(n,e):void 0;return rw=!1,o}function Tue(n,e){const t=n.type;n.accessCache=Object.create(null),n.proxy=fY(new Proxy(n.ctx,sue));const{setup:i}=t;if(i){const s=n.setupContext=i.length>1?Nue(n):null;ub(n),g0();const o=_f(i,n,0,[n.props,s]);if(p0(),Bp(),QG(o)){if(o.then(Bp,Bp),e)return o.then(r=>{kW(n,r,e)}).catch(r=>{TT(r,n,0)});n.asyncDep=o}else kW(n,o,e)}else zY(n,e)}function kW(n,e,t){mi(e)?n.type.__ssrInlineRender?n.ssrRender=e:n.render=e:Kn(e)&&(n.setupState=_Y(e)),zY(n,t)}let DW;function zY(n,e,t){const i=n.type;if(!n.render){if(!e&&DW&&!i.render){const s=i.template||HB(n).template;if(s){const{isCustomElement:o,compilerOptions:r}=n.appContext.config,{delimiters:a,compilerOptions:l}=i,c=Is(Is({isCustomElement:o,delimiters:a},r),l);i.render=DW(s,c)}}n.render=i.render||ic}ub(n),g0(),oue(n),p0(),Bp()}function xue(n){return n.attrsProxy||(n.attrsProxy=new Proxy(n.attrs,{get(e,t){return Zr(n,"get","$attrs"),e[t]}}))}function Nue(n){const e=t=>{n.exposed=t||{}};return{get attrs(){return xue(n)},slots:n.slots,emit:n.emit,expose:e}}function OT(n){if(n.exposed)return n.exposeProxy||(n.exposeProxy=new Proxy(_Y(fY(n.exposed)),{get(e,t){if(t in e)return e[t];if(t in aC)return aC[t](n)},has(e,t){return t in e||t in aC}}))}function Aue(n,e=!0){return mi(n)?n.displayName||n.name:n.name||e&&n.__name}function Mue(n){return mi(n)&&"__vccOpts"in n}const ve=(n,e)=>Mde(n,e,rw);function Bc(n,e,t){const i=arguments.length;return i===2?Kn(e)&&!Xt(e)?ow(e)?Oe(n,null,[e]):Oe(n,e):Oe(n,null,e):(i>3?t=Array.prototype.slice.call(arguments,2):i===3&&ow(t)&&(t=[t]),Oe(n,e,t))}const Rue=Symbol.for("v-scx"),Pue=()=>lC(Rue),Oue="3.3.4",Fue="http://www.w3.org/2000/svg",up=typeof document<"u"?document:null,EW=up&&up.createElement("template"),Bue={insert:(n,e,t)=>{e.insertBefore(n,t||null)},remove:n=>{const e=n.parentNode;e&&e.removeChild(n)},createElement:(n,e,t,i)=>{const s=e?up.createElementNS(Fue,n):up.createElement(n,t?{is:t}:void 0);return n==="select"&&i&&i.multiple!=null&&s.setAttribute("multiple",i.multiple),s},createText:n=>up.createTextNode(n),createComment:n=>up.createComment(n),setText:(n,e)=>{n.nodeValue=e},setElementText:(n,e)=>{n.textContent=e},parentNode:n=>n.parentNode,nextSibling:n=>n.nextSibling,querySelector:n=>up.querySelector(n),setScopeId(n,e){n.setAttribute(e,"")},insertStaticContent(n,e,t,i,s,o){const r=t?t.previousSibling:e.lastChild;if(s&&(s===o||s.nextSibling))for(;e.insertBefore(s.cloneNode(!0),t),!(s===o||!(s=s.nextSibling)););else{EW.innerHTML=i?"".concat(n,""):n;const a=EW.content;if(i){const l=a.firstChild;for(;l.firstChild;)a.appendChild(l.firstChild);a.removeChild(l)}e.insertBefore(a,t)}return[r?r.nextSibling:e.firstChild,t?t.previousSibling:e.lastChild]}};function Wue(n,e,t){const i=n._vtc;i&&(e=(e?[e,...i]:[...i]).join(" ")),e==null?n.removeAttribute("class"):t?n.setAttribute("class",e):n.className=e}function Vue(n,e,t){const i=n.style,s=ns(t);if(t&&!s){if(e&&!ns(e))for(const o in e)t[o]==null&&S2(i,o,"");for(const o in t)S2(i,o,t[o])}else{const o=i.display;s?e!==t&&(i.cssText=t):e&&n.removeAttribute("style"),"_vod"in n&&(i.display=o)}}const IW=/\s*!important$/;function S2(n,e,t){if(Xt(t))t.forEach(i=>S2(n,e,i));else if(t==null&&(t=""),e.startsWith("--"))n.setProperty(e,t);else{const i=Hue(n,e);IW.test(t)?n.setProperty(Hm(i),t.replace(IW,""),"important"):n[i]=t}}const TW=["Webkit","Moz","ms"],TA={};function Hue(n,e){const t=TA[e];if(t)return t;let i=vd(e);if(i!=="filter"&&i in n)return TA[e]=i;i=ET(i);for(let s=0;sxA||(que.then(()=>xA=0),xA=Date.now());function Yue(n,e){const t=i=>{if(!i._vts)i._vts=Date.now();else if(i._vts<=t.attached)return;nl(Zue(i,t.value),e,5,[i])};return t.value=n,t.attached=Gue(),t}function Zue(n,e){if(Xt(e)){const t=n.stopImmediatePropagation;return n.stopImmediatePropagation=()=>{t.call(n),n._stopped=!0},e.map(i=>s=>!s._stopped&&i&&i(s))}else return e}const AW=/^on[a-z]/,Xue=(n,e,t,i,s=!1,o,r,a,l)=>{e==="class"?Wue(n,i,s):e==="style"?Vue(n,t,i):LT(e)?yB(e)||jue(n,e,t,i,r):(e[0]==="."?(e=e.slice(1),!0):e[0]==="^"?(e=e.slice(1),!1):Que(n,e,i,s))?zue(n,e,i,o,r,a,l):(e==="true-value"?n._trueValue=i:e==="false-value"&&(n._falseValue=i),$ue(n,e,i,s))};function Que(n,e,t,i){return i?!!(e==="innerHTML"||e==="textContent"||e in n&&AW.test(e)&&mi(t)):e==="spellcheck"||e==="draggable"||e==="translate"||e==="form"||e==="list"&&n.tagName==="INPUT"||e==="type"&&n.tagName==="TEXTAREA"||AW.test(e)&&ns(t)?!1:e in n}const fh="transition",Y0="animation",On=(n,{slots:e})=>Bc(Xde,jY(n),e);On.displayName="Transition";const UY={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},Jue=On.props=Is({},kY,UY),jg=(n,e=[])=>{Xt(n)?n.forEach(t=>t(...e)):n&&n(...e)},MW=n=>n?Xt(n)?n.some(e=>e.length>1):n.length>1:!1;function jY(n){const e={};for(const T in n)T in UY||(e[T]=n[T]);if(n.css===!1)return e;const{name:t="v",type:i,duration:s,enterFromClass:o="".concat(t,"-enter-from"),enterActiveClass:r="".concat(t,"-enter-active"),enterToClass:a="".concat(t,"-enter-to"),appearFromClass:l=o,appearActiveClass:c=r,appearToClass:d=a,leaveFromClass:u="".concat(t,"-leave-from"),leaveActiveClass:h="".concat(t,"-leave-active"),leaveToClass:f="".concat(t,"-leave-to")}=n,g=ehe(s),p=g&&g[0],_=g&&g[1],{onBeforeEnter:v,onEnter:b,onEnterCancelled:C,onLeave:w,onLeaveCancelled:y,onBeforeAppear:L=v,onAppear:S=b,onAppearCancelled:k=C}=e,D=(T,P,W)=>{kh(T,P?d:a),kh(T,P?c:r),W&&W()},x=(T,P)=>{T._isLeaving=!1,kh(T,u),kh(T,f),kh(T,h),P&&P()},A=T=>(P,W)=>{const $=T?S:b,X=()=>D(P,T,W);jg($,[P,X]),RW(()=>{kh(P,T?l:o),tu(P,T?d:a),MW($)||PW(P,i,p,X)})};return Is(e,{onBeforeEnter(T){jg(v,[T]),tu(T,o),tu(T,r)},onBeforeAppear(T){jg(L,[T]),tu(T,l),tu(T,c)},onEnter:A(!1),onAppear:A(!0),onLeave(T,P){T._isLeaving=!0;const W=()=>x(T,P);tu(T,u),qY(),tu(T,h),RW(()=>{T._isLeaving&&(kh(T,u),tu(T,f),MW(w)||PW(T,i,_,W))}),jg(w,[T,W])},onEnterCancelled(T){D(T,!1),jg(C,[T])},onAppearCancelled(T){D(T,!0),jg(k,[T])},onLeaveCancelled(T){x(T),jg(y,[T])}})}function ehe(n){if(n==null)return null;if(Kn(n))return[NA(n.enter),NA(n.leave)];{const e=NA(n);return[e,e]}}function NA(n){return zce(n)}function tu(n,e){e.split(/\s+/).forEach(t=>t&&n.classList.add(t)),(n._vtc||(n._vtc=new Set)).add(e)}function kh(n,e){e.split(/\s+/).forEach(i=>i&&n.classList.remove(i));const{_vtc:t}=n;t&&(t.delete(e),t.size||(n._vtc=void 0))}function RW(n){requestAnimationFrame(()=>{requestAnimationFrame(n)})}let the=0;function PW(n,e,t,i){const s=n._endId=++the,o=()=>{s===n._endId&&i()};if(t)return setTimeout(o,t);const{type:r,timeout:a,propCount:l}=KY(n,e);if(!r)return i();const c=r+"end";let d=0;const u=()=>{n.removeEventListener(c,h),o()},h=f=>{f.target===n&&++d>=l&&u()};setTimeout(()=>{d(t[g]||"").split(", "),s=i("".concat(fh,"Delay")),o=i("".concat(fh,"Duration")),r=OW(s,o),a=i("".concat(Y0,"Delay")),l=i("".concat(Y0,"Duration")),c=OW(a,l);let d=null,u=0,h=0;e===fh?r>0&&(d=fh,u=r,h=o.length):e===Y0?c>0&&(d=Y0,u=c,h=l.length):(u=Math.max(r,c),d=u>0?r>c?fh:Y0:null,h=d?d===fh?o.length:l.length:0);const f=d===fh&&/\b(transform|all)(,|$)/.test(i("".concat(fh,"Property")).toString());return{type:d,timeout:u,propCount:h,hasTransform:f}}function OW(n,e){for(;n.lengthFW(t)+FW(n[i])))}function FW(n){return Number(n.slice(0,-1).replace(",","."))*1e3}function qY(){return document.body.offsetHeight}const GY=new WeakMap,YY=new WeakMap,ZY={name:"TransitionGroup",props:Is({},Jue,{tag:String,moveClass:String}),setup(n,{slots:e}){const t=ih(),i=LY();let s,o;return Cg(()=>{if(!s.length)return;const r=n.moveClass||"".concat(n.name||"v","-move");if(!ahe(s[0].el,t.vnode.el,r))return;s.forEach(she),s.forEach(ohe);const a=s.filter(rhe);qY(),a.forEach(l=>{const c=l.el,d=c.style;tu(c,r),d.transform=d.webkitTransform=d.transitionDuration="";const u=c._moveCb=h=>{h&&h.target!==c||(!h||/transform$/.test(h.propertyName))&&(c.removeEventListener("transitionend",u),c._moveCb=null,kh(c,r))};c.addEventListener("transitionend",u)})}),()=>{const r=Hi(n),a=jY(r);let l=r.tag||li;s=o,o=e.default?FB(e.default()):[];for(let c=0;cdelete n.mode;ZY.props;const nhe=ZY;function she(n){const e=n.el;e._moveCb&&e._moveCb(),e._enterCb&&e._enterCb()}function ohe(n){YY.set(n,n.el.getBoundingClientRect())}function rhe(n){const e=GY.get(n),t=YY.get(n),i=e.left-t.left,s=e.top-t.top;if(i||s){const o=n.el.style;return o.transform=o.webkitTransform="translate(".concat(i,"px,").concat(s,"px)"),o.transitionDuration="0s",n}}function ahe(n,e,t){const i=n.cloneNode();n._vtc&&n._vtc.forEach(r=>{r.split(/\s+/).forEach(a=>a&&i.classList.remove(a))}),t.split(/\s+/).forEach(r=>r&&i.classList.add(r)),i.style.display="none";const s=e.nodeType===1?e:e.parentNode;s.appendChild(i);const{hasTransform:o}=KY(i);return s.removeChild(i),o}const BW=n=>{const e=n.props["onUpdate:modelValue"]||!1;return Xt(e)?t=>jk(e,t):e};function lhe(n){n.target.composing=!0}function WW(n){const e=n.target;e.composing&&(e.composing=!1,e.dispatchEvent(new Event("input")))}const che={created(n,{modifiers:{lazy:e,trim:t,number:i}},s){n._assign=BW(s);const o=i||s.props&&s.props.type==="number";z_(n,e?"change":"input",r=>{if(r.target.composing)return;let a=n.value;t&&(a=a.trim()),o&&(a=u2(a)),n._assign(a)}),t&&z_(n,"change",()=>{n.value=n.value.trim()}),e||(z_(n,"compositionstart",lhe),z_(n,"compositionend",WW),z_(n,"change",WW))},mounted(n,{value:e}){n.value=e==null?"":e},beforeUpdate(n,{value:e,modifiers:{lazy:t,trim:i,number:s}},o){if(n._assign=BW(o),n.composing||document.activeElement===n&&n.type!=="range"&&(t||i&&n.value.trim()===e||(s||n.type==="number")&&u2(n.value)===e))return;const r=e==null?"":e;n.value!==r&&(n.value=r)}},dhe=["ctrl","shift","alt","meta"],uhe={stop:n=>n.stopPropagation(),prevent:n=>n.preventDefault(),self:n=>n.target!==n.currentTarget,ctrl:n=>!n.ctrlKey,shift:n=>!n.shiftKey,alt:n=>!n.altKey,meta:n=>!n.metaKey,left:n=>"button"in n&&n.button!==0,middle:n=>"button"in n&&n.button!==1,right:n=>"button"in n&&n.button!==2,exact:(n,e)=>dhe.some(t=>n["".concat(t,"Key")]&&!e.includes(t))},Ia=(n,e)=>(t,...i)=>{for(let s=0;st=>{if(!("key"in t))return;const i=Hm(t.key);if(e.some(s=>s===i||hhe[s]===i))return n(t)},hl={beforeMount(n,{value:e},{transition:t}){n._vod=n.style.display==="none"?"":n.style.display,t&&e?t.beforeEnter(n):Z0(n,e)},mounted(n,{value:e},{transition:t}){t&&e&&t.enter(n)},updated(n,{value:e,oldValue:t},{transition:i}){!e!=!t&&(i?e?(i.beforeEnter(n),Z0(n,!0),i.enter(n)):i.leave(n,()=>{Z0(n,!1)}):Z0(n,e))},beforeUnmount(n,{value:e}){Z0(n,e)}};function Z0(n,e){n.style.display=e?n._vod:"none"}const fhe=Is({patchProp:Xue},Bue);let HW;function ghe(){return HW||(HW=_ue(fhe))}const XY=(...n)=>{const e=ghe().createApp(...n),{mount:t}=e;return e.mount=i=>{const s=phe(i);if(!s)return;const o=e._component;!mi(o)&&!o.render&&!o.template&&(o.template=s.innerHTML),s.innerHTML="";const r=t(s,!1,s instanceof SVGElement);return s instanceof Element&&(s.removeAttribute("v-cloak"),s.setAttribute("data-v-app","")),r},e};function phe(n){return ns(n)?document.querySelector(n):n}var mhe=Object.defineProperty,_he=Object.defineProperties,vhe=Object.getOwnPropertyDescriptors,$W=Object.getOwnPropertySymbols,bhe=Object.prototype.hasOwnProperty,Che=Object.prototype.propertyIsEnumerable,zW=(n,e,t)=>e in n?mhe(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,whe=(n,e)=>{for(var t in e||(e={}))bhe.call(e,t)&&zW(n,t,e[t]);if($W)for(var t of $W(e))Che.call(e,t)&&zW(n,t,e[t]);return n},yhe=(n,e)=>_he(n,vhe(e)),Us=n=>typeof n=="string",KB=n=>typeof n=="boolean",qr=n=>typeof n=="number",ju=n=>Object.prototype.toString.call(n)==="[object Object]",She=n=>typeof n=="object"&&n!==null,v0=n=>typeof n=="function",tn=n=>Array.isArray(n),Lhe=n=>n?/^(http)|(\.*\/)/.test(n):!1,hd=n=>n==null||n===""||Array.isArray(n)&&!n.length,qB=n=>n===window,khe=()=>nh()&&"ontouchstart"in window,nh=()=>typeof window<"u",UW=n=>[...new Set(n)],qk=n=>tn(n)?n:[n],QD=(n,e)=>{if(n.length){const t=n.indexOf(e);if(t>-1)return n.splice(t,1)}},Dhe=(n,e,t="start")=>{let i=t==="start"?0:n.length-1;for(;n.length>0&&i>=0&&i<=n.length-1;){if(e(n[i],i,n))return[n[i],i];t==="start"?i++:i--}return[null,-1]},L2=(...n)=>n.map(e=>{if(tn(e)){const[t,i,s=null]=e;return t?i:s}return e}),QY=()=>typeof globalThis<"u"?globalThis:nh()?window:typeof global<"u"?global:self,aw=n=>{const e=QY();return e.requestAnimationFrame?e.requestAnimationFrame(n):e.setTimeout(n)},jW=n=>{const e=QY();e.cancelAnimationFrame?e.cancelAnimationFrame(n):e.clearTimeout(n)},Gk=()=>new Promise(n=>{aw(n)}),Cr=()=>new Promise(n=>{aw(()=>{aw(n)})}),Um=n=>window.getComputedStyle(n),no=n=>{if(qB(n)){const e=n.innerWidth,t=n.innerHeight,i={x:0,y:0,top:0,left:0,right:e,bottom:t,width:e,height:t};return yhe(whe({},i),{toJSON:()=>i})}return n.getBoundingClientRect()},Ehe=n=>{const{top:e,bottom:t,left:i,right:s}=no(n),{width:o,height:r}=no(window),a=i<=o&&s>=0,l=e<=r&&t>=0;return a&&l},Ihe=n=>new Promise(e=>{const t=new FileReader;t.onload=()=>{e(t.result)},t.readAsDataURL(n)}),dc=n=>{n.cancelable!==!1&&n.preventDefault()},hb=n=>{const e="scrollTop"in n?n.scrollTop:n.scrollY;return Math.max(e,0)},GB=n=>{const e="scrollLeft"in n?n.scrollLeft:n.scrollX;return Math.max(e,0)},YB=(n,e=200)=>{let t,i=0;return function s(...o){const r=Date.now(),a=r-i;i||(i=r),t&&window.clearTimeout(t),a>=e?(n.apply(this,o),i=r):t=window.setTimeout(()=>{s.apply(this,o)},e-a)}};function JD(n,...e){if(tn(n))return n.map(t=>t(...e));if(n)return n(...e)}var Ie=n=>n==null?0:Us(n)?(n=parseFloat(n),n=Number.isNaN(n)?0:n,n):KB(n)?Number(n):n,Wf=(n,e,t)=>Math.min(t,Math.max(e,n)),The=(n,e)=>Wf(n,0,e.length-1),xhe=n=>ZB(n).replace(n.charAt(0),n.charAt(0).toUpperCase()),ZB=n=>n.replace(/-(\w)/g,(e,t)=>t.toUpperCase()),JY=n=>n.replace(/([A-Z])/g," $1").trim().split(" ").join("-").toLowerCase();function Nhe(n){return e=>{const t="".concat(n,"-").concat(e),i=s=>s?s[0]==="$"?s.replace("$",n):s.startsWith("--")?"".concat(t).concat(s):"".concat(t,"__").concat(s):t;return{name:xhe(t),n:i,classes:L2}}}function eZ(n,e){return function(){return n.apply(e,arguments)}}const{toString:Ahe}=Object.prototype,{getPrototypeOf:XB}=Object,FT=(n=>e=>{const t=Ahe.call(e);return n[t]||(n[t]=t.slice(8,-1).toLowerCase())})(Object.create(null)),Wd=n=>(n=n.toLowerCase(),e=>FT(e)===n),BT=n=>e=>typeof e===n,{isArray:b0}=Array,lw=BT("undefined");function Mhe(n){return n!==null&&!lw(n)&&n.constructor!==null&&!lw(n.constructor)&&sl(n.constructor.isBuffer)&&n.constructor.isBuffer(n)}const tZ=Wd("ArrayBuffer");function Rhe(n){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(n):e=n&&n.buffer&&tZ(n.buffer),e}const Phe=BT("string"),sl=BT("function"),iZ=BT("number"),WT=n=>n!==null&&typeof n=="object",Ohe=n=>n===!0||n===!1,Yk=n=>{if(FT(n)!=="object")return!1;const e=XB(n);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in n)&&!(Symbol.iterator in n)},Fhe=Wd("Date"),Bhe=Wd("File"),Whe=Wd("Blob"),Vhe=Wd("FileList"),Hhe=n=>WT(n)&&sl(n.pipe),$he=n=>{let e;return n&&(typeof FormData=="function"&&n instanceof FormData||sl(n.append)&&((e=FT(n))==="formdata"||e==="object"&&sl(n.toString)&&n.toString()==="[object FormData]"))},zhe=Wd("URLSearchParams"),Uhe=n=>n.trim?n.trim():n.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function iS(n,e,{allOwnKeys:t=!1}={}){if(n===null||typeof n>"u")return;let i,s;if(typeof n!="object"&&(n=[n]),b0(n))for(i=0,s=n.length;i0;)if(s=t[i],e===s.toLowerCase())return s;return null}const sZ=(()=>typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global)(),oZ=n=>!lw(n)&&n!==sZ;function k2(){const{caseless:n}=oZ(this)&&this||{},e={},t=(i,s)=>{const o=n&&nZ(e,s)||s;Yk(e[o])&&Yk(i)?e[o]=k2(e[o],i):Yk(i)?e[o]=k2({},i):b0(i)?e[o]=i.slice():e[o]=i};for(let i=0,s=arguments.length;i(iS(e,(s,o)=>{t&&sl(s)?n[o]=eZ(s,t):n[o]=s},{allOwnKeys:i}),n),Khe=n=>(n.charCodeAt(0)===65279&&(n=n.slice(1)),n),qhe=(n,e,t,i)=>{n.prototype=Object.create(e.prototype,i),n.prototype.constructor=n,Object.defineProperty(n,"super",{value:e.prototype}),t&&Object.assign(n.prototype,t)},Ghe=(n,e,t,i)=>{let s,o,r;const a={};if(e=e||{},n==null)return e;do{for(s=Object.getOwnPropertyNames(n),o=s.length;o-- >0;)r=s[o],(!i||i(r,n,e))&&!a[r]&&(e[r]=n[r],a[r]=!0);n=t!==!1&&XB(n)}while(n&&(!t||t(n,e))&&n!==Object.prototype);return e},Yhe=(n,e,t)=>{n=String(n),(t===void 0||t>n.length)&&(t=n.length),t-=e.length;const i=n.indexOf(e,t);return i!==-1&&i===t},Zhe=n=>{if(!n)return null;if(b0(n))return n;let e=n.length;if(!iZ(e))return null;const t=new Array(e);for(;e-- >0;)t[e]=n[e];return t},Xhe=(n=>e=>n&&e instanceof n)(typeof Uint8Array<"u"&&XB(Uint8Array)),Qhe=(n,e)=>{const i=(n&&n[Symbol.iterator]).call(n);let s;for(;(s=i.next())&&!s.done;){const o=s.value;e.call(n,o[0],o[1])}},Jhe=(n,e)=>{let t;const i=[];for(;(t=n.exec(e))!==null;)i.push(t);return i},efe=Wd("HTMLFormElement"),tfe=n=>n.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(t,i,s){return i.toUpperCase()+s}),KW=(({hasOwnProperty:n})=>(e,t)=>n.call(e,t))(Object.prototype),ife=Wd("RegExp"),rZ=(n,e)=>{const t=Object.getOwnPropertyDescriptors(n),i={};iS(t,(s,o)=>{let r;(r=e(s,o,n))!==!1&&(i[o]=r||s)}),Object.defineProperties(n,i)},nfe=n=>{rZ(n,(e,t)=>{if(sl(n)&&["arguments","caller","callee"].indexOf(t)!==-1)return!1;const i=n[t];if(sl(i)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+t+"'")})}})},sfe=(n,e)=>{const t={},i=s=>{s.forEach(o=>{t[o]=!0})};return b0(n)?i(n):i(String(n).split(e)),t},ofe=()=>{},rfe=(n,e)=>(n=+n,Number.isFinite(n)?n:e),AA="abcdefghijklmnopqrstuvwxyz",qW="0123456789",aZ={DIGIT:qW,ALPHA:AA,ALPHA_DIGIT:AA+AA.toUpperCase()+qW},afe=(n=16,e=aZ.ALPHA_DIGIT)=>{let t="";const{length:i}=e;for(;n--;)t+=e[Math.random()*i|0];return t};function lfe(n){return!!(n&&sl(n.append)&&n[Symbol.toStringTag]==="FormData"&&n[Symbol.iterator])}const cfe=n=>{const e=new Array(10),t=(i,s)=>{if(WT(i)){if(e.indexOf(i)>=0)return;if(!("toJSON"in i)){e[s]=i;const o=b0(i)?[]:{};return iS(i,(r,a)=>{const l=t(r,s+1);!lw(l)&&(o[a]=l)}),e[s]=void 0,o}}return i};return t(n,0)},dfe=Wd("AsyncFunction"),ufe=n=>n&&(WT(n)||sl(n))&&sl(n.then)&&sl(n.catch),$e={isArray:b0,isArrayBuffer:tZ,isBuffer:Mhe,isFormData:$he,isArrayBufferView:Rhe,isString:Phe,isNumber:iZ,isBoolean:Ohe,isObject:WT,isPlainObject:Yk,isUndefined:lw,isDate:Fhe,isFile:Bhe,isBlob:Whe,isRegExp:ife,isFunction:sl,isStream:Hhe,isURLSearchParams:zhe,isTypedArray:Xhe,isFileList:Vhe,forEach:iS,merge:k2,extend:jhe,trim:Uhe,stripBOM:Khe,inherits:qhe,toFlatObject:Ghe,kindOf:FT,kindOfTest:Wd,endsWith:Yhe,toArray:Zhe,forEachEntry:Qhe,matchAll:Jhe,isHTMLForm:efe,hasOwnProperty:KW,hasOwnProp:KW,reduceDescriptors:rZ,freezeMethods:nfe,toObjectSet:sfe,toCamelCase:tfe,noop:ofe,toFiniteNumber:rfe,findKey:nZ,global:sZ,isContextDefined:oZ,ALPHABET:aZ,generateString:afe,isSpecCompliantForm:lfe,toJSONObject:cfe,isAsyncFn:dfe,isThenable:ufe};function Vi(n,e,t,i,s){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=n,this.name="AxiosError",e&&(this.code=e),t&&(this.config=t),i&&(this.request=i),s&&(this.response=s)}$e.inherits(Vi,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:$e.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const lZ=Vi.prototype,cZ={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(n=>{cZ[n]={value:n}});Object.defineProperties(Vi,cZ);Object.defineProperty(lZ,"isAxiosError",{value:!0});Vi.from=(n,e,t,i,s,o)=>{const r=Object.create(lZ);return $e.toFlatObject(n,r,function(l){return l!==Error.prototype},a=>a!=="isAxiosError"),Vi.call(r,n.message,e,t,i,s),r.cause=n,r.name=n.name,o&&Object.assign(r,o),r};const hfe=null;function D2(n){return $e.isPlainObject(n)||$e.isArray(n)}function dZ(n){return $e.endsWith(n,"[]")?n.slice(0,-2):n}function GW(n,e,t){return n?n.concat(e).map(function(s,o){return s=dZ(s),!t&&o?"["+s+"]":s}).join(t?".":""):e}function ffe(n){return $e.isArray(n)&&!n.some(D2)}const gfe=$e.toFlatObject($e,{},null,function(e){return/^is[A-Z]/.test(e)});function VT(n,e,t){if(!$e.isObject(n))throw new TypeError("target must be an object");e=e||new FormData,t=$e.toFlatObject(t,{metaTokens:!0,dots:!1,indexes:!1},!1,function(p,_){return!$e.isUndefined(_[p])});const i=t.metaTokens,s=t.visitor||d,o=t.dots,r=t.indexes,l=(t.Blob||typeof Blob<"u"&&Blob)&&$e.isSpecCompliantForm(e);if(!$e.isFunction(s))throw new TypeError("visitor must be a function");function c(g){if(g===null)return"";if($e.isDate(g))return g.toISOString();if(!l&&$e.isBlob(g))throw new Vi("Blob is not supported. Use a Buffer instead.");return $e.isArrayBuffer(g)||$e.isTypedArray(g)?l&&typeof Blob=="function"?new Blob([g]):Buffer.from(g):g}function d(g,p,_){let v=g;if(g&&!_&&typeof g=="object"){if($e.endsWith(p,"{}"))p=i?p:p.slice(0,-2),g=JSON.stringify(g);else if($e.isArray(g)&&ffe(g)||($e.isFileList(g)||$e.endsWith(p,"[]"))&&(v=$e.toArray(g)))return p=dZ(p),v.forEach(function(C,w){!($e.isUndefined(C)||C===null)&&e.append(r===!0?GW([p],w,o):r===null?p:p+"[]",c(C))}),!1}return D2(g)?!0:(e.append(GW(_,p,o),c(g)),!1)}const u=[],h=Object.assign(gfe,{defaultVisitor:d,convertValue:c,isVisitable:D2});function f(g,p){if(!$e.isUndefined(g)){if(u.indexOf(g)!==-1)throw Error("Circular reference detected in "+p.join("."));u.push(g),$e.forEach(g,function(v,b){(!($e.isUndefined(v)||v===null)&&s.call(e,v,$e.isString(b)?b.trim():b,p,h))===!0&&f(v,p?p.concat(b):[b])}),u.pop()}}if(!$e.isObject(n))throw new TypeError("data must be an object");return f(n),e}function YW(n){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(n).replace(/[!'()~]|%20|%00/g,function(i){return e[i]})}function QB(n,e){this._pairs=[],n&&VT(n,this,e)}const uZ=QB.prototype;uZ.append=function(e,t){this._pairs.push([e,t])};uZ.toString=function(e){const t=e?function(i){return e.call(this,i,YW)}:YW;return this._pairs.map(function(s){return t(s[0])+"="+t(s[1])},"").join("&")};function pfe(n){return encodeURIComponent(n).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function hZ(n,e,t){if(!e)return n;const i=t&&t.encode||pfe,s=t&&t.serialize;let o;if(s?o=s(e,t):o=$e.isURLSearchParams(e)?e.toString():new QB(e,t).toString(i),o){const r=n.indexOf("#");r!==-1&&(n=n.slice(0,r)),n+=(n.indexOf("?")===-1?"?":"&")+o}return n}class mfe{constructor(){this.handlers=[]}use(e,t,i){return this.handlers.push({fulfilled:e,rejected:t,synchronous:i?i.synchronous:!1,runWhen:i?i.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){$e.forEach(this.handlers,function(i){i!==null&&e(i)})}}const ZW=mfe,fZ={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},_fe=typeof URLSearchParams<"u"?URLSearchParams:QB,vfe=typeof FormData<"u"?FormData:null,bfe=typeof Blob<"u"?Blob:null,Cfe=(()=>{let n;return typeof navigator<"u"&&((n=navigator.product)==="ReactNative"||n==="NativeScript"||n==="NS")?!1:typeof window<"u"&&typeof document<"u"})(),wfe=(()=>typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function")(),ed={isBrowser:!0,classes:{URLSearchParams:_fe,FormData:vfe,Blob:bfe},isStandardBrowserEnv:Cfe,isStandardBrowserWebWorkerEnv:wfe,protocols:["http","https","file","blob","url","data"]};function yfe(n,e){return VT(n,new ed.classes.URLSearchParams,Object.assign({visitor:function(t,i,s,o){return ed.isNode&&$e.isBuffer(t)?(this.append(i,t.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)}},e))}function Sfe(n){return $e.matchAll(/\w+|\[(\w*)]/g,n).map(e=>e[0]==="[]"?"":e[1]||e[0])}function Lfe(n){const e={},t=Object.keys(n);let i;const s=t.length;let o;for(i=0;i=t.length;return r=!r&&$e.isArray(s)?s.length:r,l?($e.hasOwnProp(s,r)?s[r]=[s[r],i]:s[r]=i,!a):((!s[r]||!$e.isObject(s[r]))&&(s[r]=[]),e(t,i,s[r],o)&&$e.isArray(s[r])&&(s[r]=Lfe(s[r])),!a)}if($e.isFormData(n)&&$e.isFunction(n.entries)){const t={};return $e.forEachEntry(n,(i,s)=>{e(Sfe(i),s,t,0)}),t}return null}function kfe(n,e,t){if($e.isString(n))try{return(e||JSON.parse)(n),$e.trim(n)}catch(i){if(i.name!=="SyntaxError")throw i}return(t||JSON.stringify)(n)}const JB={transitional:fZ,adapter:["xhr","http"],transformRequest:[function(e,t){const i=t.getContentType()||"",s=i.indexOf("application/json")>-1,o=$e.isObject(e);if(o&&$e.isHTMLForm(e)&&(e=new FormData(e)),$e.isFormData(e))return s&&s?JSON.stringify(gZ(e)):e;if($e.isArrayBuffer(e)||$e.isBuffer(e)||$e.isStream(e)||$e.isFile(e)||$e.isBlob(e))return e;if($e.isArrayBufferView(e))return e.buffer;if($e.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let a;if(o){if(i.indexOf("application/x-www-form-urlencoded")>-1)return yfe(e,this.formSerializer).toString();if((a=$e.isFileList(e))||i.indexOf("multipart/form-data")>-1){const l=this.env&&this.env.FormData;return VT(a?{"files[]":e}:e,l&&new l,this.formSerializer)}}return o||s?(t.setContentType("application/json",!1),kfe(e)):e}],transformResponse:[function(e){const t=this.transitional||JB.transitional,i=t&&t.forcedJSONParsing,s=this.responseType==="json";if(e&&$e.isString(e)&&(i&&!this.responseType||s)){const r=!(t&&t.silentJSONParsing)&&s;try{return JSON.parse(e)}catch(a){if(r)throw a.name==="SyntaxError"?Vi.from(a,Vi.ERR_BAD_RESPONSE,this,null,this.response):a}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:ed.classes.FormData,Blob:ed.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};$e.forEach(["delete","get","head","post","put","patch"],n=>{JB.headers[n]={}});const e8=JB,Dfe=$e.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Efe=n=>{const e={};let t,i,s;return n&&n.split("\n").forEach(function(r){s=r.indexOf(":"),t=r.substring(0,s).trim().toLowerCase(),i=r.substring(s+1).trim(),!(!t||e[t]&&Dfe[t])&&(t==="set-cookie"?e[t]?e[t].push(i):e[t]=[i]:e[t]=e[t]?e[t]+", "+i:i)}),e},XW=Symbol("internals");function X0(n){return n&&String(n).trim().toLowerCase()}function Zk(n){return n===!1||n==null?n:$e.isArray(n)?n.map(Zk):String(n)}function Ife(n){const e=Object.create(null),t=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let i;for(;i=t.exec(n);)e[i[1]]=i[2];return e}const Tfe=n=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(n.trim());function MA(n,e,t,i,s){if($e.isFunction(i))return i.call(this,e,t);if(s&&(e=t),!!$e.isString(e)){if($e.isString(i))return e.indexOf(i)!==-1;if($e.isRegExp(i))return i.test(e)}}function xfe(n){return n.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,i)=>t.toUpperCase()+i)}function Nfe(n,e){const t=$e.toCamelCase(" "+e);["get","set","has"].forEach(i=>{Object.defineProperty(n,i+t,{value:function(s,o,r){return this[i].call(this,e,s,o,r)},configurable:!0})})}class HT{constructor(e){e&&this.set(e)}set(e,t,i){const s=this;function o(a,l,c){const d=X0(l);if(!d)throw new Error("header name must be a non-empty string");const u=$e.findKey(s,d);(!u||s[u]===void 0||c===!0||c===void 0&&s[u]!==!1)&&(s[u||l]=Zk(a))}const r=(a,l)=>$e.forEach(a,(c,d)=>o(c,d,l));return $e.isPlainObject(e)||e instanceof this.constructor?r(e,t):$e.isString(e)&&(e=e.trim())&&!Tfe(e)?r(Efe(e),t):e!=null&&o(t,e,i),this}get(e,t){if(e=X0(e),e){const i=$e.findKey(this,e);if(i){const s=this[i];if(!t)return s;if(t===!0)return Ife(s);if($e.isFunction(t))return t.call(this,s,i);if($e.isRegExp(t))return t.exec(s);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=X0(e),e){const i=$e.findKey(this,e);return!!(i&&this[i]!==void 0&&(!t||MA(this,this[i],i,t)))}return!1}delete(e,t){const i=this;let s=!1;function o(r){if(r=X0(r),r){const a=$e.findKey(i,r);a&&(!t||MA(i,i[a],a,t))&&(delete i[a],s=!0)}}return $e.isArray(e)?e.forEach(o):o(e),s}clear(e){const t=Object.keys(this);let i=t.length,s=!1;for(;i--;){const o=t[i];(!e||MA(this,this[o],o,e,!0))&&(delete this[o],s=!0)}return s}normalize(e){const t=this,i={};return $e.forEach(this,(s,o)=>{const r=$e.findKey(i,o);if(r){t[r]=Zk(s),delete t[o];return}const a=e?xfe(o):String(o).trim();a!==o&&delete t[o],t[a]=Zk(s),i[a]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return $e.forEach(this,(i,s)=>{i!=null&&i!==!1&&(t[s]=e&&$e.isArray(i)?i.join(", "):i)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+": "+t).join("\n")}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const i=new this(e);return t.forEach(s=>i.set(s)),i}static accessor(e){const i=(this[XW]=this[XW]={accessors:{}}).accessors,s=this.prototype;function o(r){const a=X0(r);i[a]||(Nfe(s,r),i[a]=!0)}return $e.isArray(e)?e.forEach(o):o(e),this}}HT.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);$e.reduceDescriptors(HT.prototype,({value:n},e)=>{let t=e[0].toUpperCase()+e.slice(1);return{get:()=>n,set(i){this[t]=i}}});$e.freezeMethods(HT);const Au=HT;function RA(n,e){const t=this||e8,i=e||t,s=Au.from(i.headers);let o=i.data;return $e.forEach(n,function(a){o=a.call(t,o,s.normalize(),e?e.status:void 0)}),s.normalize(),o}function pZ(n){return!!(n&&n.__CANCEL__)}function nS(n,e,t){Vi.call(this,n==null?"canceled":n,Vi.ERR_CANCELED,e,t),this.name="CanceledError"}$e.inherits(nS,Vi,{__CANCEL__:!0});function Afe(n,e,t){const i=t.config.validateStatus;!t.status||!i||i(t.status)?n(t):e(new Vi("Request failed with status code "+t.status,[Vi.ERR_BAD_REQUEST,Vi.ERR_BAD_RESPONSE][Math.floor(t.status/100)-4],t.config,t.request,t))}const Mfe=ed.isStandardBrowserEnv?function(){return{write:function(t,i,s,o,r,a){const l=[];l.push(t+"="+encodeURIComponent(i)),$e.isNumber(s)&&l.push("expires="+new Date(s).toGMTString()),$e.isString(o)&&l.push("path="+o),$e.isString(r)&&l.push("domain="+r),a===!0&&l.push("secure"),document.cookie=l.join("; ")},read:function(t){const i=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return i?decodeURIComponent(i[3]):null},remove:function(t){this.write(t,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}();function Rfe(n){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(n)}function Pfe(n,e){return e?n.replace(/\/+$/,"")+"/"+e.replace(/^\/+/,""):n}function mZ(n,e){return n&&!Rfe(e)?Pfe(n,e):e}const Ofe=ed.isStandardBrowserEnv?function(){const e=/(msie|trident)/i.test(navigator.userAgent),t=document.createElement("a");let i;function s(o){let r=o;return e&&(t.setAttribute("href",r),r=t.href),t.setAttribute("href",r),{href:t.href,protocol:t.protocol?t.protocol.replace(/:$/,""):"",host:t.host,search:t.search?t.search.replace(/^\?/,""):"",hash:t.hash?t.hash.replace(/^#/,""):"",hostname:t.hostname,port:t.port,pathname:t.pathname.charAt(0)==="/"?t.pathname:"/"+t.pathname}}return i=s(window.location.href),function(r){const a=$e.isString(r)?s(r):r;return a.protocol===i.protocol&&a.host===i.host}}():function(){return function(){return!0}}();function Ffe(n){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(n);return e&&e[1]||""}function Bfe(n,e){n=n||10;const t=new Array(n),i=new Array(n);let s=0,o=0,r;return e=e!==void 0?e:1e3,function(l){const c=Date.now(),d=i[o];r||(r=c),t[s]=l,i[s]=c;let u=o,h=0;for(;u!==s;)h+=t[u++],u=u%n;if(s=(s+1)%n,s===o&&(o=(o+1)%n),c-r{const o=s.loaded,r=s.lengthComputable?s.total:void 0,a=o-t,l=i(a),c=o<=r;t=o;const d={loaded:o,total:r,progress:r?o/r:void 0,bytes:a,rate:l||void 0,estimated:l&&r&&c?(r-o)/l:void 0,event:s};d[e?"download":"upload"]=!0,n(d)}}const Wfe=typeof XMLHttpRequest<"u",Vfe=Wfe&&function(n){return new Promise(function(t,i){let s=n.data;const o=Au.from(n.headers).normalize(),r=n.responseType;let a;function l(){n.cancelToken&&n.cancelToken.unsubscribe(a),n.signal&&n.signal.removeEventListener("abort",a)}let c;$e.isFormData(s)&&(ed.isStandardBrowserEnv||ed.isStandardBrowserWebWorkerEnv?o.setContentType(!1):o.getContentType(/^\s*multipart\/form-data/)?$e.isString(c=o.getContentType())&&o.setContentType(c.replace(/^\s*(multipart\/form-data);+/,"$1")):o.setContentType("multipart/form-data"));let d=new XMLHttpRequest;if(n.auth){const g=n.auth.username||"",p=n.auth.password?unescape(encodeURIComponent(n.auth.password)):"";o.set("Authorization","Basic "+btoa(g+":"+p))}const u=mZ(n.baseURL,n.url);d.open(n.method.toUpperCase(),hZ(u,n.params,n.paramsSerializer),!0),d.timeout=n.timeout;function h(){if(!d)return;const g=Au.from("getAllResponseHeaders"in d&&d.getAllResponseHeaders()),_={data:!r||r==="text"||r==="json"?d.responseText:d.response,status:d.status,statusText:d.statusText,headers:g,config:n,request:d};Afe(function(b){t(b),l()},function(b){i(b),l()},_),d=null}if("onloadend"in d?d.onloadend=h:d.onreadystatechange=function(){!d||d.readyState!==4||d.status===0&&!(d.responseURL&&d.responseURL.indexOf("file:")===0)||setTimeout(h)},d.onabort=function(){d&&(i(new Vi("Request aborted",Vi.ECONNABORTED,n,d)),d=null)},d.onerror=function(){i(new Vi("Network Error",Vi.ERR_NETWORK,n,d)),d=null},d.ontimeout=function(){let p=n.timeout?"timeout of "+n.timeout+"ms exceeded":"timeout exceeded";const _=n.transitional||fZ;n.timeoutErrorMessage&&(p=n.timeoutErrorMessage),i(new Vi(p,_.clarifyTimeoutError?Vi.ETIMEDOUT:Vi.ECONNABORTED,n,d)),d=null},ed.isStandardBrowserEnv){const g=Ofe(u)&&n.xsrfCookieName&&Mfe.read(n.xsrfCookieName);g&&o.set(n.xsrfHeaderName,g)}s===void 0&&o.setContentType(null),"setRequestHeader"in d&&$e.forEach(o.toJSON(),function(p,_){d.setRequestHeader(_,p)}),$e.isUndefined(n.withCredentials)||(d.withCredentials=!!n.withCredentials),r&&r!=="json"&&(d.responseType=n.responseType),typeof n.onDownloadProgress=="function"&&d.addEventListener("progress",QW(n.onDownloadProgress,!0)),typeof n.onUploadProgress=="function"&&d.upload&&d.upload.addEventListener("progress",QW(n.onUploadProgress)),(n.cancelToken||n.signal)&&(a=g=>{d&&(i(!g||g.type?new nS(null,n,d):g),d.abort(),d=null)},n.cancelToken&&n.cancelToken.subscribe(a),n.signal&&(n.signal.aborted?a():n.signal.addEventListener("abort",a)));const f=Ffe(u);if(f&&ed.protocols.indexOf(f)===-1){i(new Vi("Unsupported protocol "+f+":",Vi.ERR_BAD_REQUEST,n));return}d.send(s||null)})},E2={http:hfe,xhr:Vfe};$e.forEach(E2,(n,e)=>{if(n){try{Object.defineProperty(n,"name",{value:e})}catch{}Object.defineProperty(n,"adapterName",{value:e})}});const JW=n=>"- ".concat(n),Hfe=n=>$e.isFunction(n)||n===null||n===!1,_Z={getAdapter:n=>{n=$e.isArray(n)?n:[n];const{length:e}=n;let t,i;const s={};for(let o=0;o"adapter ".concat(a," ")+(l===!1?"is not supported by the environment":"is not available in the build"));let r=e?o.length>1?"since :\n"+o.map(JW).join("\n"):" "+JW(o[0]):"as no adapter specified";throw new Vi("There is no suitable adapter to dispatch the request "+r,"ERR_NOT_SUPPORT")}return i},adapters:E2};function PA(n){if(n.cancelToken&&n.cancelToken.throwIfRequested(),n.signal&&n.signal.aborted)throw new nS(null,n)}function eV(n){return PA(n),n.headers=Au.from(n.headers),n.data=RA.call(n,n.transformRequest),["post","put","patch"].indexOf(n.method)!==-1&&n.headers.setContentType("application/x-www-form-urlencoded",!1),_Z.getAdapter(n.adapter||e8.adapter)(n).then(function(i){return PA(n),i.data=RA.call(n,n.transformResponse,i),i.headers=Au.from(i.headers),i},function(i){return pZ(i)||(PA(n),i&&i.response&&(i.response.data=RA.call(n,n.transformResponse,i.response),i.response.headers=Au.from(i.response.headers))),Promise.reject(i)})}const tV=n=>n instanceof Au?n.toJSON():n;function fb(n,e){e=e||{};const t={};function i(c,d,u){return $e.isPlainObject(c)&&$e.isPlainObject(d)?$e.merge.call({caseless:u},c,d):$e.isPlainObject(d)?$e.merge({},d):$e.isArray(d)?d.slice():d}function s(c,d,u){if($e.isUndefined(d)){if(!$e.isUndefined(c))return i(void 0,c,u)}else return i(c,d,u)}function o(c,d){if(!$e.isUndefined(d))return i(void 0,d)}function r(c,d){if($e.isUndefined(d)){if(!$e.isUndefined(c))return i(void 0,c)}else return i(void 0,d)}function a(c,d,u){if(u in e)return i(c,d);if(u in n)return i(void 0,c)}const l={url:o,method:o,data:o,baseURL:r,transformRequest:r,transformResponse:r,paramsSerializer:r,timeout:r,timeoutMessage:r,withCredentials:r,adapter:r,responseType:r,xsrfCookieName:r,xsrfHeaderName:r,onUploadProgress:r,onDownloadProgress:r,decompress:r,maxContentLength:r,maxBodyLength:r,beforeRedirect:r,transport:r,httpAgent:r,httpsAgent:r,cancelToken:r,socketPath:r,responseEncoding:r,validateStatus:a,headers:(c,d)=>s(tV(c),tV(d),!0)};return $e.forEach(Object.keys(Object.assign({},n,e)),function(d){const u=l[d]||s,h=u(n[d],e[d],d);$e.isUndefined(h)&&u!==a||(t[d]=h)}),t}const vZ="1.6.0",t8={};["object","boolean","number","function","string","symbol"].forEach((n,e)=>{t8[n]=function(i){return typeof i===n||"a"+(e<1?"n ":" ")+n}});const iV={};t8.transitional=function(e,t,i){function s(o,r){return"[Axios v"+vZ+"] Transitional option '"+o+"'"+r+(i?". "+i:"")}return(o,r,a)=>{if(e===!1)throw new Vi(s(r," has been removed"+(t?" in "+t:"")),Vi.ERR_DEPRECATED);return t&&!iV[r]&&(iV[r]=!0,console.warn(s(r," has been deprecated since v"+t+" and will be removed in the near future"))),e?e(o,r,a):!0}};function $fe(n,e,t){if(typeof n!="object")throw new Vi("options must be an object",Vi.ERR_BAD_OPTION_VALUE);const i=Object.keys(n);let s=i.length;for(;s-- >0;){const o=i[s],r=e[o];if(r){const a=n[o],l=a===void 0||r(a,o,n);if(l!==!0)throw new Vi("option "+o+" must be "+l,Vi.ERR_BAD_OPTION_VALUE);continue}if(t!==!0)throw new Vi("Unknown option "+o,Vi.ERR_BAD_OPTION)}}const I2={assertOptions:$fe,validators:t8},gh=I2.validators;class eE{constructor(e){this.defaults=e,this.interceptors={request:new ZW,response:new ZW}}request(e,t){typeof e=="string"?(t=t||{},t.url=e):t=e||{},t=fb(this.defaults,t);const{transitional:i,paramsSerializer:s,headers:o}=t;i!==void 0&&I2.assertOptions(i,{silentJSONParsing:gh.transitional(gh.boolean),forcedJSONParsing:gh.transitional(gh.boolean),clarifyTimeoutError:gh.transitional(gh.boolean)},!1),s!=null&&($e.isFunction(s)?t.paramsSerializer={serialize:s}:I2.assertOptions(s,{encode:gh.function,serialize:gh.function},!0)),t.method=(t.method||this.defaults.method||"get").toLowerCase();let r=o&&$e.merge(o.common,o[t.method]);o&&$e.forEach(["delete","get","head","post","put","patch","common"],g=>{delete o[g]}),t.headers=Au.concat(r,o);const a=[];let l=!0;this.interceptors.request.forEach(function(p){typeof p.runWhen=="function"&&p.runWhen(t)===!1||(l=l&&p.synchronous,a.unshift(p.fulfilled,p.rejected))});const c=[];this.interceptors.response.forEach(function(p){c.push(p.fulfilled,p.rejected)});let d,u=0,h;if(!l){const g=[eV.bind(this),void 0];for(g.unshift.apply(g,a),g.push.apply(g,c),h=g.length,d=Promise.resolve(t);u{if(!i._listeners)return;let o=i._listeners.length;for(;o-- >0;)i._listeners[o](s);i._listeners=null}),this.promise.then=s=>{let o;const r=new Promise(a=>{i.subscribe(a),o=a}).then(s);return r.cancel=function(){i.unsubscribe(o)},r},e(function(o,r,a){i.reason||(i.reason=new nS(o,r,a),t(i.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);t!==-1&&this._listeners.splice(t,1)}static source(){let e;return{token:new i8(function(s){e=s}),cancel:e}}}const zfe=i8;function Ufe(n){return function(t){return n.apply(null,t)}}function jfe(n){return $e.isObject(n)&&n.isAxiosError===!0}const T2={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(T2).forEach(([n,e])=>{T2[e]=n});const Kfe=T2;function bZ(n){const e=new Xk(n),t=eZ(Xk.prototype.request,e);return $e.extend(t,Xk.prototype,e,{allOwnKeys:!0}),$e.extend(t,e,null,{allOwnKeys:!0}),t.create=function(s){return bZ(fb(n,s))},t}const $s=bZ(e8);$s.Axios=Xk;$s.CanceledError=nS;$s.CancelToken=zfe;$s.isCancel=pZ;$s.VERSION=vZ;$s.toFormData=VT;$s.AxiosError=Vi;$s.Cancel=$s.CanceledError;$s.all=function(e){return Promise.all(e)};$s.spread=Ufe;$s.isAxiosError=jfe;$s.mergeConfig=fb;$s.AxiosHeaders=Au;$s.formToJSON=n=>gZ($e.isHTMLForm(n)?new FormData(n):n);$s.getAdapter=_Z.getAdapter;$s.HttpStatusCode=Kfe;$s.default=$s;const qfe=$s;var Gfe=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Yfe(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}function Zfe(n){if(n.__esModule)return n;var e=n.default;if(typeof e=="function"){var t=function i(){return this instanceof i?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(n).forEach(function(i){var s=Object.getOwnPropertyDescriptor(n,i);Object.defineProperty(t,i,s.get?s:{enumerable:!0,get:function(){return n[i]}})}),t}var Xfe=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var e={},t=Symbol("test"),i=Object(t);if(typeof t=="string"||Object.prototype.toString.call(t)!=="[object Symbol]"||Object.prototype.toString.call(i)!=="[object Symbol]")return!1;var s=42;e[t]=s;for(t in e)return!1;if(typeof Object.keys=="function"&&Object.keys(e).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(e).length!==0)return!1;var o=Object.getOwnPropertySymbols(e);if(o.length!==1||o[0]!==t||!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var r=Object.getOwnPropertyDescriptor(e,t);if(r.value!==s||r.enumerable!==!0)return!1}return!0},nV=typeof Symbol<"u"&&Symbol,Qfe=Xfe,Jfe=function(){return typeof nV!="function"||typeof Symbol!="function"||typeof nV("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:Qfe()},sV={foo:{}},ege=Object,tge=function(){return{__proto__:sV}.foo===sV.foo&&!({__proto__:null}instanceof ege)},ige="Function.prototype.bind called on incompatible ",nge=Object.prototype.toString,sge=Math.max,oge="[object Function]",oV=function(e,t){for(var i=[],s=0;s"u"||!fo?Ei:fo(Uint8Array),Vp={"%AggregateError%":typeof AggregateError>"u"?Ei:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?Ei:ArrayBuffer,"%ArrayIteratorPrototype%":__&&fo?fo([][Symbol.iterator]()):Ei,"%AsyncFromSyncIteratorPrototype%":Ei,"%AsyncFunction%":U_,"%AsyncGenerator%":U_,"%AsyncGeneratorFunction%":U_,"%AsyncIteratorPrototype%":U_,"%Atomics%":typeof Atomics>"u"?Ei:Atomics,"%BigInt%":typeof BigInt>"u"?Ei:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?Ei:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?Ei:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?Ei:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":typeof Float32Array>"u"?Ei:Float32Array,"%Float64Array%":typeof Float64Array>"u"?Ei:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?Ei:FinalizationRegistry,"%Function%":CZ,"%GeneratorFunction%":U_,"%Int8Array%":typeof Int8Array>"u"?Ei:Int8Array,"%Int16Array%":typeof Int16Array>"u"?Ei:Int16Array,"%Int32Array%":typeof Int32Array>"u"?Ei:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":__&&fo?fo(fo([][Symbol.iterator]())):Ei,"%JSON%":typeof JSON=="object"?JSON:Ei,"%Map%":typeof Map>"u"?Ei:Map,"%MapIteratorPrototype%":typeof Map>"u"||!__||!fo?Ei:fo(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?Ei:Promise,"%Proxy%":typeof Proxy>"u"?Ei:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":typeof Reflect>"u"?Ei:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?Ei:Set,"%SetIteratorPrototype%":typeof Set>"u"||!__||!fo?Ei:fo(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?Ei:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":__&&fo?fo(""[Symbol.iterator]()):Ei,"%Symbol%":__?Symbol:Ei,"%SyntaxError%":gb,"%ThrowTypeError%":gge,"%TypedArray%":mge,"%TypeError%":Rv,"%Uint8Array%":typeof Uint8Array>"u"?Ei:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?Ei:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?Ei:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?Ei:Uint32Array,"%URIError%":URIError,"%WeakMap%":typeof WeakMap>"u"?Ei:WeakMap,"%WeakRef%":typeof WeakRef>"u"?Ei:WeakRef,"%WeakSet%":typeof WeakSet>"u"?Ei:WeakSet};if(fo)try{null.error}catch(n){var _ge=fo(fo(n));Vp["%Error.prototype%"]=_ge}var vge=function n(e){var t;if(e==="%AsyncFunction%")t=OA("async function () {}");else if(e==="%GeneratorFunction%")t=OA("function* () {}");else if(e==="%AsyncGeneratorFunction%")t=OA("async function* () {}");else if(e==="%AsyncGenerator%"){var i=n("%AsyncGeneratorFunction%");i&&(t=i.prototype)}else if(e==="%AsyncIteratorPrototype%"){var s=n("%AsyncGenerator%");s&&fo&&(t=fo(s.prototype))}return Vp[e]=t,t},rV={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},sS=n8,tE=fge,bge=sS.call(Function.call,Array.prototype.concat),Cge=sS.call(Function.apply,Array.prototype.splice),aV=sS.call(Function.call,String.prototype.replace),iE=sS.call(Function.call,String.prototype.slice),wge=sS.call(Function.call,RegExp.prototype.exec),yge=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,Sge=/\\(\\)?/g,Lge=function(e){var t=iE(e,0,1),i=iE(e,-1);if(t==="%"&&i!=="%")throw new gb("invalid intrinsic syntax, expected closing `%`");if(i==="%"&&t!=="%")throw new gb("invalid intrinsic syntax, expected opening `%`");var s=[];return aV(e,yge,function(o,r,a,l){s[s.length]=a?aV(l,Sge,"$1"):r||o}),s},kge=function(e,t){var i=e,s;if(tE(rV,i)&&(s=rV[i],i="%"+s[0]+"%"),tE(Vp,i)){var o=Vp[i];if(o===U_&&(o=vge(i)),typeof o>"u"&&!t)throw new Rv("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:s,name:i,value:o}}throw new gb("intrinsic "+e+" does not exist!")},jm=function(e,t){if(typeof e!="string"||e.length===0)throw new Rv("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof t!="boolean")throw new Rv('"allowMissing" argument must be a boolean');if(wge(/^%?[^%]*%?$/,e)===null)throw new gb("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var i=Lge(e),s=i.length>0?i[0]:"",o=kge("%"+s+"%",t),r=o.name,a=o.value,l=!1,c=o.alias;c&&(s=c[0],Cge(i,bge([0,1],c)));for(var d=1,u=!0;d=i.length){var p=Wp(a,h);u=!!p,u&&"get"in p&&!("originalValue"in p.get)?a=p.get:a=a[h]}else u=tE(a,h),a=a[h];u&&!l&&(Vp[r]=a)}}return a},wZ={exports:{}},Dge=jm,x2=Dge("%Object.defineProperty%",!0),N2=function(){if(x2)try{return x2({},"a",{value:1}),!0}catch{return!1}return!1};N2.hasArrayLengthDefineBug=function(){if(!N2())return null;try{return x2([],"length",{value:1}).length!==1}catch{return!0}};var yZ=N2,Ege=jm,Qk=Ege("%Object.getOwnPropertyDescriptor%",!0);if(Qk)try{Qk([],"length")}catch{Qk=null}var SZ=Qk,Ige=yZ(),s8=jm,uC=Ige&&s8("%Object.defineProperty%",!0);if(uC)try{uC({},"a",{value:1})}catch{uC=!1}var Tge=s8("%SyntaxError%"),v_=s8("%TypeError%"),lV=SZ,xge=function(e,t,i){if(!e||typeof e!="object"&&typeof e!="function")throw new v_("`obj` must be an object or a function`");if(typeof t!="string"&&typeof t!="symbol")throw new v_("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new v_("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new v_("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new v_("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new v_("`loose`, if provided, must be a boolean");var s=arguments.length>3?arguments[3]:null,o=arguments.length>4?arguments[4]:null,r=arguments.length>5?arguments[5]:null,a=arguments.length>6?arguments[6]:!1,l=!!lV&&lV(e,t);if(uC)uC(e,t,{configurable:r===null&&l?l.configurable:!r,enumerable:s===null&&l?l.enumerable:!s,value:i,writable:o===null&&l?l.writable:!o});else if(a||!s&&!o&&!r)e[t]=i;else throw new Tge("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},LZ=jm,cV=xge,Nge=yZ(),dV=SZ,uV=LZ("%TypeError%"),Age=LZ("%Math.floor%"),Mge=function(e,t){if(typeof e!="function")throw new uV("`fn` is not a function");if(typeof t!="number"||t<0||t>4294967295||Age(t)!==t)throw new uV("`length` must be a positive 32-bit integer");var i=arguments.length>2&&!!arguments[2],s=!0,o=!0;if("length"in e&&dV){var r=dV(e,"length");r&&!r.configurable&&(s=!1),r&&!r.writable&&(o=!1)}return(s||o||!i)&&(Nge?cV(e,"length",t,!0,!0):cV(e,"length",t)),e};(function(n){var e=n8,t=jm,i=Mge,s=t("%TypeError%"),o=t("%Function.prototype.apply%"),r=t("%Function.prototype.call%"),a=t("%Reflect.apply%",!0)||e.call(r,o),l=t("%Object.defineProperty%",!0),c=t("%Math.max%");if(l)try{l({},"a",{value:1})}catch{l=null}n.exports=function(h){if(typeof h!="function")throw new s("a function is required");var f=a(e,r,arguments);return i(f,1+c(0,h.length-(arguments.length-1)),!0)};var d=function(){return a(e,o,arguments)};l?l(n.exports,"apply",{value:d}):n.exports.apply=d})(wZ);var Rge=wZ.exports,kZ=jm,DZ=Rge,Pge=DZ(kZ("String.prototype.indexOf")),Oge=function(e,t){var i=kZ(e,!!t);return typeof i=="function"&&Pge(e,".prototype.")>-1?DZ(i):i};const Fge={},Bge=Object.freeze(Object.defineProperty({__proto__:null,default:Fge},Symbol.toStringTag,{value:"Module"})),Wge=Zfe(Bge);var o8=typeof Map=="function"&&Map.prototype,BA=Object.getOwnPropertyDescriptor&&o8?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,nE=o8&&BA&&typeof BA.get=="function"?BA.get:null,hV=o8&&Map.prototype.forEach,r8=typeof Set=="function"&&Set.prototype,WA=Object.getOwnPropertyDescriptor&&r8?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,sE=r8&&WA&&typeof WA.get=="function"?WA.get:null,fV=r8&&Set.prototype.forEach,Vge=typeof WeakMap=="function"&&WeakMap.prototype,hC=Vge?WeakMap.prototype.has:null,Hge=typeof WeakSet=="function"&&WeakSet.prototype,fC=Hge?WeakSet.prototype.has:null,$ge=typeof WeakRef=="function"&&WeakRef.prototype,gV=$ge?WeakRef.prototype.deref:null,zge=Boolean.prototype.valueOf,Uge=Object.prototype.toString,jge=Function.prototype.toString,Kge=String.prototype.match,a8=String.prototype.slice,Zh=String.prototype.replace,qge=String.prototype.toUpperCase,pV=String.prototype.toLowerCase,EZ=RegExp.prototype.test,mV=Array.prototype.concat,Wc=Array.prototype.join,Gge=Array.prototype.slice,_V=Math.floor,A2=typeof BigInt=="function"?BigInt.prototype.valueOf:null,VA=Object.getOwnPropertySymbols,M2=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,pb=typeof Symbol=="function"&&typeof Symbol.iterator=="object",Qo=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===pb||"symbol")?Symbol.toStringTag:null,IZ=Object.prototype.propertyIsEnumerable,vV=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(n){return n.__proto__}:null);function bV(n,e){if(n===1/0||n===-1/0||n!==n||n&&n>-1e3&&n<1e3||EZ.call(/e/,e))return e;var t=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof n=="number"){var i=n<0?-_V(-n):_V(n);if(i!==n){var s=String(i),o=a8.call(e,s.length+1);return Zh.call(s,t,"$&_")+"."+Zh.call(Zh.call(o,/([0-9]{3})/g,"$&_"),/_$/,"")}}return Zh.call(e,t,"$&_")}var R2=Wge,CV=R2.custom,wV=xZ(CV)?CV:null,Yge=function n(e,t,i,s){var o=t||{};if(Ph(o,"quoteStyle")&&o.quoteStyle!=="single"&&o.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(Ph(o,"maxStringLength")&&(typeof o.maxStringLength=="number"?o.maxStringLength<0&&o.maxStringLength!==1/0:o.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var r=Ph(o,"customInspect")?o.customInspect:!0;if(typeof r!="boolean"&&r!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(Ph(o,"indent")&&o.indent!==null&&o.indent!==" "&&!(parseInt(o.indent,10)===o.indent&&o.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(Ph(o,"numericSeparator")&&typeof o.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var a=o.numericSeparator;if(typeof e>"u")return"undefined";if(e===null)return"null";if(typeof e=="boolean")return e?"true":"false";if(typeof e=="string")return AZ(e,o);if(typeof e=="number"){if(e===0)return 1/0/e>0?"0":"-0";var l=String(e);return a?bV(e,l):l}if(typeof e=="bigint"){var c=String(e)+"n";return a?bV(e,c):c}var d=typeof o.depth>"u"?5:o.depth;if(typeof i>"u"&&(i=0),i>=d&&d>0&&typeof e=="object")return P2(e)?"[Array]":"[Object]";var u=fpe(o,i);if(typeof s>"u")s=[];else if(NZ(s,e)>=0)return"[Circular]";function h(P,W,$){if(W&&(s=Gge.call(s),s.push(W)),$){var X={depth:o.depth};return Ph(o,"quoteStyle")&&(X.quoteStyle=o.quoteStyle),n(P,X,i+1,s)}return n(P,o,i+1,s)}if(typeof e=="function"&&!yV(e)){var f=spe(e),g=dL(e,h);return"[Function"+(f?": "+f:" (anonymous)")+"]"+(g.length>0?" { "+Wc.call(g,", ")+" }":"")}if(xZ(e)){var p=pb?Zh.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):M2.call(e);return typeof e=="object"&&!pb?Q0(p):p}if(dpe(e)){for(var _="<"+pV.call(String(e.nodeName)),v=e.attributes||[],b=0;b",_}if(P2(e)){if(e.length===0)return"[]";var C=dL(e,h);return u&&!hpe(C)?"["+O2(C,u)+"]":"[ "+Wc.call(C,", ")+" ]"}if(Qge(e)){var w=dL(e,h);return!("cause"in Error.prototype)&&"cause"in e&&!IZ.call(e,"cause")?"{ ["+String(e)+"] "+Wc.call(mV.call("[cause]: "+h(e.cause),w),", ")+" }":w.length===0?"["+String(e)+"]":"{ ["+String(e)+"] "+Wc.call(w,", ")+" }"}if(typeof e=="object"&&r){if(wV&&typeof e[wV]=="function"&&R2)return R2(e,{depth:d-i});if(r!=="symbol"&&typeof e.inspect=="function")return e.inspect()}if(ope(e)){var y=[];return hV&&hV.call(e,function(P,W){y.push(h(W,e,!0)+" => "+h(P,e))}),SV("Map",nE.call(e),y,u)}if(lpe(e)){var L=[];return fV&&fV.call(e,function(P){L.push(h(P,e))}),SV("Set",sE.call(e),L,u)}if(rpe(e))return HA("WeakMap");if(cpe(e))return HA("WeakSet");if(ape(e))return HA("WeakRef");if(epe(e))return Q0(h(Number(e)));if(ipe(e))return Q0(h(A2.call(e)));if(tpe(e))return Q0(zge.call(e));if(Jge(e))return Q0(h(String(e)));if(typeof window<"u"&&e===window)return"{ [object Window] }";if(e===Gfe)return"{ [object globalThis] }";if(!Xge(e)&&!yV(e)){var S=dL(e,h),k=vV?vV(e)===Object.prototype:e instanceof Object||e.constructor===Object,D=e instanceof Object?"":"null prototype",x=!k&&Qo&&Object(e)===e&&Qo in e?a8.call(wg(e),8,-1):D?"Object":"",A=k||typeof e.constructor!="function"?"":e.constructor.name?e.constructor.name+" ":"",T=A+(x||D?"["+Wc.call(mV.call([],x||[],D||[]),": ")+"] ":"");return S.length===0?T+"{}":u?T+"{"+O2(S,u)+"}":T+"{ "+Wc.call(S,", ")+" }"}return String(e)};function TZ(n,e,t){var i=(t.quoteStyle||e)==="double"?'"':"'";return i+n+i}function Zge(n){return Zh.call(String(n),/"/g,""")}function P2(n){return wg(n)==="[object Array]"&&(!Qo||!(typeof n=="object"&&Qo in n))}function Xge(n){return wg(n)==="[object Date]"&&(!Qo||!(typeof n=="object"&&Qo in n))}function yV(n){return wg(n)==="[object RegExp]"&&(!Qo||!(typeof n=="object"&&Qo in n))}function Qge(n){return wg(n)==="[object Error]"&&(!Qo||!(typeof n=="object"&&Qo in n))}function Jge(n){return wg(n)==="[object String]"&&(!Qo||!(typeof n=="object"&&Qo in n))}function epe(n){return wg(n)==="[object Number]"&&(!Qo||!(typeof n=="object"&&Qo in n))}function tpe(n){return wg(n)==="[object Boolean]"&&(!Qo||!(typeof n=="object"&&Qo in n))}function xZ(n){if(pb)return n&&typeof n=="object"&&n instanceof Symbol;if(typeof n=="symbol")return!0;if(!n||typeof n!="object"||!M2)return!1;try{return M2.call(n),!0}catch{}return!1}function ipe(n){if(!n||typeof n!="object"||!A2)return!1;try{return A2.call(n),!0}catch{}return!1}var npe=Object.prototype.hasOwnProperty||function(n){return n in this};function Ph(n,e){return npe.call(n,e)}function wg(n){return Uge.call(n)}function spe(n){if(n.name)return n.name;var e=Kge.call(jge.call(n),/^function\s*([\w$]+)/);return e?e[1]:null}function NZ(n,e){if(n.indexOf)return n.indexOf(e);for(var t=0,i=n.length;te.maxStringLength){var t=n.length-e.maxStringLength,i="... "+t+" more character"+(t>1?"s":"");return AZ(a8.call(n,0,e.maxStringLength),e)+i}var s=Zh.call(Zh.call(n,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,upe);return TZ(s,"single",e)}function upe(n){var e=n.charCodeAt(0),t={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return t?"\\"+t:"\\x"+(e<16?"0":"")+qge.call(e.toString(16))}function Q0(n){return"Object("+n+")"}function HA(n){return n+" { ? }"}function SV(n,e,t,i){var s=i?O2(t,i):Wc.call(t,", ");return n+" ("+e+") {"+s+"}"}function hpe(n){for(var e=0;e=0)return!1;return!0}function fpe(n,e){var t;if(n.indent===" ")t=" ";else if(typeof n.indent=="number"&&n.indent>0)t=Wc.call(Array(n.indent+1)," ");else return null;return{base:t,prev:Wc.call(Array(e+1),t)}}function O2(n,e){if(n.length===0)return"";var t="\n"+e.prev+e.base;return t+Wc.call(n,","+t)+"\n"+e.prev}function dL(n,e){var t=P2(n),i=[];if(t){i.length=n.length;for(var s=0;s1;){var t=e.pop(),i=t.obj[t.prop];if(hp(i)){for(var s=[],o=0;o=48&&c<=57||c>=65&&c<=90||c>=97&&c<=122||o===Ipe.RFC1738&&(c===40||c===41)){a+=r.charAt(l);continue}if(c<128){a=a+Ec[c];continue}if(c<2048){a=a+(Ec[192|c>>6]+Ec[128|c&63]);continue}if(c<55296||c>=57344){a=a+(Ec[224|c>>12]+Ec[128|c>>6&63]+Ec[128|c&63]);continue}l+=1,c=65536+((c&1023)<<10|r.charCodeAt(l)&1023),a+=Ec[240|c>>18]+Ec[128|c>>12&63]+Ec[128|c>>6&63]+Ec[128|c&63]}return a},Rpe=function(e){for(var t=[{obj:{o:e},prop:"o"}],i=[],s=0;s"u"&&(C=0)}if(typeof l=="function"?v=l(t,v):v instanceof Date?v=u(v):i==="comma"&&cu(v)&&(v=Jk.maybeMap(v,function(X){return X instanceof Date?u(X):X})),v===null){if(o)return a&&!g?a(t,zo.encoder,p,"key",h):t;v=""}if($pe(v)||Jk.isBuffer(v)){if(a){var L=g?t:a(t,zo.encoder,p,"key",h);return[f(L)+"="+f(a(v,zo.encoder,p,"value",h))]}return[f(t)+"="+f(String(v))]}var S=[];if(typeof v>"u")return S;var k;if(i==="comma"&&cu(v))g&&a&&(v=Jk.maybeMap(v,a)),k=[{value:v.length>0?v.join(",")||null:void 0}];else if(cu(l))k=l;else{var D=Object.keys(v);k=c?D.sort(c):D}for(var x=s&&cu(v)&&v.length===1?t+"[]":t,A=0;A"u"?zo.allowDots:!!e.allowDots,charset:t,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:zo.charsetSentinel,delimiter:typeof e.delimiter>"u"?zo.delimiter:e.delimiter,encode:typeof e.encode=="boolean"?e.encode:zo.encode,encoder:typeof e.encoder=="function"?e.encoder:zo.encoder,encodeValuesOnly:typeof e.encodeValuesOnly=="boolean"?e.encodeValuesOnly:zo.encodeValuesOnly,filter:o,format:i,formatter:s,serializeDate:typeof e.serializeDate=="function"?e.serializeDate:zo.serializeDate,skipNulls:typeof e.skipNulls=="boolean"?e.skipNulls:zo.skipNulls,sort:typeof e.sort=="function"?e.sort:null,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:zo.strictNullHandling}},jpe=function(n,e){var t=n,i=Upe(e),s,o;typeof i.filter=="function"?(o=i.filter,t=o("",t)):cu(i.filter)&&(o=i.filter,s=o);var r=[];if(typeof t!="object"||t===null)return"";var a;e&&e.arrayFormat in LV?a=e.arrayFormat:e&&"indices"in e?a=e.indices?"indices":"repeat":a="indices";var l=LV[a];if(e&&"commaRoundTrip"in e&&typeof e.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var c=l==="comma"&&e&&e.commaRoundTrip;s||(s=Object.keys(t)),i.sort&&s.sort(i.sort);for(var d=PZ(),u=0;u0?g+f:""},mb=RZ,F2=Object.prototype.hasOwnProperty,Kpe=Array.isArray,uo={allowDots:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:mb.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},qpe=function(n){return n.replace(/&#(\d+);/g,function(e,t){return String.fromCharCode(parseInt(t,10))})},FZ=function(n,e){return n&&typeof n=="string"&&e.comma&&n.indexOf(",")>-1?n.split(","):n},Gpe="utf8=%26%2310003%3B",Ype="utf8=%E2%9C%93",Zpe=function(e,t){var i={__proto__:null},s=t.ignoreQueryPrefix?e.replace(/^\?/,""):e,o=t.parameterLimit===1/0?void 0:t.parameterLimit,r=s.split(t.delimiter,o),a=-1,l,c=t.charset;if(t.charsetSentinel)for(l=0;l-1&&(g=Kpe(g)?[g]:g),F2.call(i,f)?i[f]=mb.combine(i[f],g):i[f]=g}return i},Xpe=function(n,e,t,i){for(var s=i?e:FZ(e,t),o=n.length-1;o>=0;--o){var r,a=n[o];if(a==="[]"&&t.parseArrays)r=[].concat(s);else{r=t.plainObjects?Object.create(null):{};var l=a.charAt(0)==="["&&a.charAt(a.length-1)==="]"?a.slice(1,-1):a,c=parseInt(l,10);!t.parseArrays&&l===""?r={0:s}:!isNaN(c)&&a!==l&&String(c)===l&&c>=0&&t.parseArrays&&c<=t.arrayLimit?(r=[],r[c]=s):l!=="__proto__"&&(r[l]=s)}s=r}return s},Qpe=function(e,t,i,s){if(e){var o=i.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,r=/(\[[^[\]]*])/,a=/(\[[^[\]]*])/g,l=i.depth>0&&r.exec(o),c=l?o.slice(0,l.index):o,d=[];if(c){if(!i.plainObjects&&F2.call(Object.prototype,c)&&!i.allowPrototypes)return;d.push(c)}for(var u=0;i.depth>0&&(l=a.exec(o))!==null&&u"u"?uo.charset:e.charset;return{allowDots:typeof e.allowDots>"u"?uo.allowDots:!!e.allowDots,allowPrototypes:typeof e.allowPrototypes=="boolean"?e.allowPrototypes:uo.allowPrototypes,allowSparse:typeof e.allowSparse=="boolean"?e.allowSparse:uo.allowSparse,arrayLimit:typeof e.arrayLimit=="number"?e.arrayLimit:uo.arrayLimit,charset:t,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:uo.charsetSentinel,comma:typeof e.comma=="boolean"?e.comma:uo.comma,decoder:typeof e.decoder=="function"?e.decoder:uo.decoder,delimiter:typeof e.delimiter=="string"||mb.isRegExp(e.delimiter)?e.delimiter:uo.delimiter,depth:typeof e.depth=="number"||e.depth===!1?+e.depth:uo.depth,ignoreQueryPrefix:e.ignoreQueryPrefix===!0,interpretNumericEntities:typeof e.interpretNumericEntities=="boolean"?e.interpretNumericEntities:uo.interpretNumericEntities,parameterLimit:typeof e.parameterLimit=="number"?e.parameterLimit:uo.parameterLimit,parseArrays:e.parseArrays!==!1,plainObjects:typeof e.plainObjects=="boolean"?e.plainObjects:uo.plainObjects,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:uo.strictNullHandling}},eme=function(n,e){var t=Jpe(e);if(n===""||n===null||typeof n>"u")return t.plainObjects?Object.create(null):{};for(var i=typeof n=="string"?Zpe(n,t):n,s=t.plainObjects?Object.create(null):{},o=Object.keys(i),r=0;rr.append(a,s[a])),s=r}return n[e](i,s,Object.assign({headers:{"Content-Type":t}},o))}}function rme(n={}){const e=qfe.create(n);function t(){return e.defaults.headers.common}function i(o,r){e.defaults.headers.common[o]=r}function s(o){if(typeof o=="string"){Reflect.deleteProperty(e.defaults.headers.common,o);return}o.forEach(r=>Reflect.deleteProperty(e.defaults.headers.common,r))}return{get:Yn(e,"get","json"),getBlob:Yn(e,"get","blob"),getDocument:Yn(e,"get","document"),getArrayBuffer:Yn(e,"get","arraybuffer"),getText:Yn(e,"get","text"),getStream:Yn(e,"get","stream"),head:Yn(e,"head","json"),headBlob:Yn(e,"head","blob"),headDocument:Yn(e,"head","document"),headArrayBuffer:Yn(e,"head","arraybuffer"),headText:Yn(e,"head","text"),headStream:Yn(e,"head","stream"),options:Yn(e,"options","json"),optionsBlob:Yn(e,"options","blob"),optionsDocument:Yn(e,"options","document"),optionsArrayBuffer:Yn(e,"options","arraybuffer"),optionsText:Yn(e,"options","text"),optionsStream:Yn(e,"options","stream"),delete:Yn(e,"delete","json"),deleteBlob:Yn(e,"delete","blob"),deleteDocument:Yn(e,"delete","document"),deleteArrayBuffer:Yn(e,"delete","arraybuffer"),deleteText:Yn(e,"delete","text"),deleteStream:Yn(e,"delete","stream"),post:jd(e,"post","application/json"),postUrlEncode:jd(e,"post","application/x-www-form-urlencoded"),postMultipart:jd(e,"post","multipart/form-data"),put:jd(e,"put","application/json"),putUrlEncode:jd(e,"put","application/x-www-form-urlencoded"),putMultipart:jd(e,"put","multipart/form-data"),patch:jd(e,"patch","application/json"),patchUrlEncode:jd(e,"patch","application/x-www-form-urlencoded"),patchMultipart:jd(e,"patch","multipart/form-data"),getHeaders:t,setHeader:i,removeHeader:s,axios:e}}var ame=Object.defineProperty,lme=Object.defineProperties,cme=Object.getOwnPropertyDescriptors,DV=Object.getOwnPropertySymbols,dme=Object.prototype.hasOwnProperty,ume=Object.prototype.propertyIsEnumerable,EV=(n,e,t)=>e in n?ame(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,cr=(n,e)=>{for(var t in e||(e={}))dme.call(e,t)&&EV(n,t,e[t]);if(DV)for(var t of DV(e))ume.call(e,t)&&EV(n,t,e[t]);return n},j_=(n,e)=>lme(n,cme(e));function hme(n){return n.name==="Text"}function BZ(n){return ju(n)&&n.type==="Expression"}function fme(n){return ju(n)&&!BZ(n)&&!WZ(n)&&!VZ(n)}function WZ(n){return ju(n)&&n.type==="Render"&&n.id}function VZ(n){return ju(n)&&n.type==="VNode"}function gme(n){return JSON.parse(JSON.stringify(n))}function pme(n){return tn(n)?n:Us(n)?n.split(" "):[]}var IV="schema-renderer-style",mme=["$item","$index","$slotProps","$renderArgs"],_me=rme({}),HZ={schema:{type:Object,required:!0,default:()=>({})},components:{type:Object,default:()=>({})},injects:{type:Object,default:()=>({})}},vme=et({props:HZ,setup(n){const e={h:Bc,ref:se,reactive:Cn,computed:ve,readonly:NB,watch:ht,watchEffect:Kde,watchSyncEffect:Gde,watchPostEffect:qde,isRef:eo,unref:ud,toRefs:Tde,isProxy:MB,isReactive:Fp,isReadonly:im,onBeforeMount:BB,onMounted:bd,onBeforeUpdate:IY,onUpdated:Cg,onBeforeUnmount:zm,onUnmounted:Cd,axle:_me};let t=cr(cr({},e),n.injects);const{uid:i}=ih();s(),bd(r),Cd(a),ht(()=>n.schema.css,l),ht(()=>n.injects,()=>{t=cr(cr({},e),n.injects)});function s(){var L,S;const k=(S=(L=n.schema.compatibleCode)!=null?L:n.schema.code)!=null?S:"function setup() { return {} }",x=o(k)();Object.assign(t,x)}function o(L,S){return window.evalWith(L,S!=null?S:t)}function r(){if(!n.schema.css)return;const L=document.createElement("style");L.innerHTML=n.schema.css,L.id="".concat(IV,"-").concat(i),document.head.appendChild(L)}function a(){const L=document.querySelector("#".concat(IV,"-").concat(i));L&&document.head.removeChild(L)}function l(){a(),r()}function c(L,S){return cr(cr({},L),S)}function d(L){return mme.some(S=>L.includes(S))}function u(L,S){return o(L,cr(cr({},t),S))}function h(L,S){return d(L)?u(L,S):o(L)}function f(L,S){return Object.keys(L).reduce((k,D)=>(k[D]=g(L[D],S),k),{})}function g(L,S){var k,D;return WZ(L)?(...x)=>{const A=c(S,{$renderArgs:j_(cr({},S.$renderArgs),{[L.id]:x})}),T=C(L.value,A);return Bc(li,T.map(P=>w(P,A)))}:VZ(L)?((k=g(L.value.if,S))!=null?k:!0)?w(L.value,S):void 0:BZ(L)?h((D=L.compatibleValue)!=null?D:L.value,S):fme(L)?f(L,S):tn(L)?L.map(x=>g(x,S)):L}function p(L,S){const k=b(L,S),D=pme(k.class),x=j_(cr({},k),{class:D});if(hme(L)){const{value:A}=L;return Bc("span",x,g(A,S))}return Bc(_(L.name),x,y(L,S))}function _(L){return n.components[L]}function v(L={}){return Object.entries(L).reduce((k,[D,x])=>{if(!D.startsWith("v-model"))return k[D]=x,k;const A=D.startsWith("v-model:")?D.replace("v-model:",""):"modelValue",T="onUpdate:".concat(A);return k[A]=x,k[T]={type:"Expression",value:"(value) => { ".concat(x.value," = value }")},k},{})}function b(L,S){var k;return Object.entries(v((k=L.props)!=null?k:{})).reduce((x,[A,T])=>(x[A]=g(T,S),x),{})}function C(L,S){return L.filter(k=>{var D;return!!g((D=k.if)!=null?D:!0,S)})}function w(L,S){if(!L.hasOwnProperty("for"))return p(L,S);const k=g(L.for,S);return Bc(li,null,ss(k,(D,x)=>{const A=gme(L);return p(A,c(S,{$item:j_(cr({},S.$item),{[L.id]:D}),$index:j_(cr({},S.$index),{[L.id]:x})}))}))}function y(L,S){var k;try{const D=cr({},(k=L.slots)!=null?k:{});return!D.default&&L.children&&(D.default={children:[...L.children]}),Object.entries(D).reduce((x,[A,T])=>(x[A]=P=>{var W;const $=c(S,{$slotProps:j_(cr({},S.$slotProps),{[L.id]:P})});return C((W=T.children)!=null?W:[],$).map(X=>w(X,$))},x),{})}catch(D){throw console.error("Renderer error, please check console"),D}}return()=>Bc("div",{class:"var-schema-renderer"},y(n.schema,{}))}}),bme=et({props:HZ,setup(n){let e="",t=se(0);return ht(()=>n.schema,i=>{var s;i.code!==e&&t.value++,e=(s=i.code)!=null?s:""},{immediate:!0}),()=>Bc(vme,j_(cr({},n),{key:t.value}))}});function ca(n,e=0){return n[n.length-(1+e)]}function Cme(n){if(n.length===0)throw new Error("Invalid tail call");return[n.slice(0,n.length-1),n[n.length-1]]}function yn(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 yme(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 B2(n,e,t){if(n=n|0,n>=e.length)throw new TypeError("invalid index");const i=e[Math.floor(e.length*Math.random())],s=[],o=[],r=[];for(const a of e){const l=t(a,i);l<0?s.push(a):l>0?o.push(a):r.push(a)}return n!!e)}function xV(n){let e=0;for(let t=0;t0}function Vf(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 jZ(n,e){return n.length>0?n[0]:e}function yo(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 $T(n,e,t){const i=n.slice(0,e),s=n.slice(e);return i.concat(t,s)}function jA(n,e){const t=n.indexOf(e);t>-1&&(n.splice(t,1),n.unshift(e))}function fL(n,e){const t=n.indexOf(e);t>-1&&(n.splice(t,1),n.push(e))}function W2(n,e){for(const t of e)n.push(t)}function u8(n){return Array.isArray(n)?n:[n]}function Lme(n,e,t){const i=KZ(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})(dw||(dw={}));function Sa(n,e){return(t,i)=>e(n(t),n(i))}function kme(...n){return(e,t)=>{for(const i of n){const s=i(e,t);if(!dw.isNeitherLessOrGreaterThan(s))return s}return dw.neitherLessOrGreaterThan}}const Mu=(n,e)=>n-e,Dme=(n,e)=>Mu(n?1:0,e?1:0);function qZ(n){return(e,t)=>-n(e,t)}class Ku{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 fd{constructor(e){this.iterate=e}toArray(){const e=[];return this.iterate(t=>(e.push(t),!0)),e}filter(e){return new fd(t=>this.iterate(i=>e(i)?t(i):!0))}map(e){return new fd(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||dw.isGreaterThan(e(s,t)))&&(i=!1,t=s),!0)),t}}fd.empty=new fd(n=>{});function Mo(n){return typeof n=="string"}function Io(n){return typeof n=="object"&&n!==null&&!Array.isArray(n)&&!(n instanceof RegExp)&&!(n instanceof Date)}function Eme(n){const e=Object.getPrototypeOf(Uint8Array);return typeof n=="object"&&n instanceof e}function Hf(n){return typeof n=="number"&&!isNaN(n)}function AV(n){return!!n&&typeof n[Symbol.iterator]=="function"}function GZ(n){return n===!0||n===!1}function _r(n){return typeof n>"u"}function uw(n){return!Fr(n)}function Fr(n){return _r(n)||n===null}function bi(n,e){if(!n)throw new Error(e?"Unexpected type, expected '".concat(e,"'"):"Unexpected type")}function kp(n){if(Fr(n))throw new Error("Assertion Failed: argument is undefined or null");return n}function hw(n){return typeof n=="function"}function Ime(n,e){const t=Math.min(n.length,e.length);for(let i=0;i{e[t]=i&&typeof i=="object"?du(i):i}),e}function xme(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(YZ.call(t,i)){const s=t[i];typeof s=="object"&&!Object.isFrozen(s)&&!Eme(s)&&e.push(s)}}return n}const YZ=Object.prototype.hasOwnProperty;function ZZ(n,e){return V2(n,e,new Set)}function V2(n,e,t){if(Fr(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(V2(o,e,t));return s}if(Io(n)){if(t.has(n))throw new Error("Cannot clone recursive data-structure");t.add(n);const s={};for(const o in n)YZ.call(n,o)&&(s[o]=V2(n[o],e,t));return t.delete(n),s}return n}function zT(n,e,t=!0){return Io(n)?(Io(e)&&Object.keys(e).forEach(i=>{i in n?t&&(Io(n[i])&&Io(e[i])?zT(n[i],e[i],t):n[i]=e[i]):n[i]=e[i]}),n):e}function Gr(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}globalThis&&globalThis.__awaiter;let Mme=typeof document<"u"&&document.location&&document.location.hash.indexOf("pseudo=true")>=0;function Rme(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}),Mme&&(t="["+t.replace(/[aouei]/g,"$&$&")+"]"),t}function m(n,e,...t){return Rme(e,t)}var KA;const J_="en";let oE=!1,rE=!1,eD=!1,XZ=!1,f8=!1,g8=!1,QZ=!1,gL,tD=J_,MV=J_,Pme,xl;const ol=typeof self=="object"?self:typeof global=="object"?global:{};let So;typeof ol.vscode<"u"&&typeof ol.vscode.process<"u"?So=ol.vscode.process:typeof process<"u"&&(So=process);const Ome=typeof((KA=So==null?void 0:So.versions)===null||KA===void 0?void 0:KA.electron)=="string",Fme=Ome&&(So==null?void 0:So.type)==="renderer";if(typeof navigator=="object"&&!Fme)xl=navigator.userAgent,oE=xl.indexOf("Windows")>=0,rE=xl.indexOf("Macintosh")>=0,g8=(xl.indexOf("Macintosh")>=0||xl.indexOf("iPad")>=0||xl.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,eD=xl.indexOf("Linux")>=0,QZ=(xl==null?void 0:xl.indexOf("Mobi"))>=0,f8=!0,m({key:"ensureLoaderPluginIsLoaded",comment:["{Locked}"]},"_"),gL=J_,tD=gL,MV=navigator.language;else if(typeof So=="object"){oE=So.platform==="win32",rE=So.platform==="darwin",eD=So.platform==="linux",eD&&So.env.SNAP&&So.env.SNAP_REVISION,So.env.CI||So.env.BUILD_ARTIFACTSTAGINGDIRECTORY,gL=J_,tD=J_;const n=So.env.VSCODE_NLS_CONFIG;if(n)try{const e=JSON.parse(n),t=e.availableLanguages["*"];gL=e.locale,MV=e.osLocale,tD=t||J_,Pme=e._translationsConfigFile}catch{}XZ=!0}else console.error("Unable to resolve platform.");const zs=oE,Kt=rE,Co=eD,nc=XZ,yg=f8,Bme=f8&&typeof ol.importScripts=="function",uc=g8,Wme=QZ,yd=xl,Vme=tD,Hme=typeof ol.postMessage=="function"&&!ol.importScripts,JZ=(()=>{if(Hme){const n=[];ol.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}),ol.postMessage({vscodeScheduleAsyncWork:i},"*")}}return n=>setTimeout(n)})(),$r=rE||g8?2:oE?1:3;let RV=!0,PV=!1;function eX(){if(!PV){PV=!0;const n=new Uint8Array(2);n[0]=1,n[1]=2,RV=new Uint16Array(n.buffer)[0]===512+1}return RV}const tX=!!(yd&&yd.indexOf("Chrome")>=0),$me=!!(yd&&yd.indexOf("Firefox")>=0),zme=!!(!tX&&yd&&yd.indexOf("Safari")>=0),Ume=!!(yd&&yd.indexOf("Edg/")>=0);yd&&yd.indexOf("Android")>=0;const Qs={tabSize:4,indentSize:4,insertSpaces:!0,detectIndentation:!0,trimAutoWhitespace:!0,largeFileOptimizations:!0,bracketPairColorizationOptions:{enabled:!0,independentColorPoolPerBracketType:!1}};var Pt;(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 C=b.length-1;C>=0;C--)yield b[C]}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,C){for(const w of b)if(C(w))return!0;return!1}n.some=d;function u(b,C){for(const w of b)if(C(w))return w}n.find=u;function*h(b,C){for(const w of b)C(w)&&(yield w)}n.filter=h;function*f(b,C){let w=0;for(const y of b)yield C(y,w++)}n.map=f;function*g(...b){for(const C of b)for(const w of C)yield w}n.concat=g;function p(b,C,w){let y=w;for(const L of b)y=C(y,L);return y}n.reduce=p;function*_(b,C,w=b.length){for(C<0&&(C+=b.length),w<0?w+=b.length:w>b.length&&(w=b.length);C{s||(s=!0,this._remove(i))}}shift(){if(this._first!==Vn.Undefined){const e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==Vn.Undefined){const e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==Vn.Undefined&&e.next!==Vn.Undefined){const t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===Vn.Undefined&&e.next===Vn.Undefined?(this._first=Vn.Undefined,this._last=Vn.Undefined):e.next===Vn.Undefined?(this._last=this._last.prev,this._last.next=Vn.Undefined):e.prev===Vn.Undefined&&(this._first=this._first.next,this._first.prev=Vn.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==Vn.Undefined;)yield e.element,e=e.next}}const iX="`~!@#$%^&*()-=+[{]}\\|;:'\",.<>/?";function jme(n=""){let e="(-?\\d*\\.\\d\\w*)|([^";for(const t of iX)n.indexOf(t)>=0||(e+="\\"+t);return e+="\\s]+)",new RegExp(e,"g")}const p8=jme();function nX(n){let e=p8;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 sX=new To;sX.unshift({maxLen:1e3,windowSize:15,timeBudget:150});function fw(n,e,t,i,s){if(s||(s=Pt.first(sX)),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),fw(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=Kme(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 Kme(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 Dh=8;class oX{constructor(e){this._values=e}hasChanged(e){return this._values[e]}}class rX{constructor(){this.stableMinimapLayoutInput=null,this.stableFitMaxMinimapScale=0,this.stableFitRemainingWidth=0}}class Ji{constructor(e,t,i,s){this.id=e,this.name=t,this.defaultValue=i,this.schema=s}applyUpdate(e,t){return UT(e,t)}compute(e,t,i){return i}}class pC{constructor(e,t){this.newValue=e,this.didChange=t}}function UT(n,e){if(typeof n!="object"||typeof e!="object"||!n||!e)return new pC(e,n!==e);if(Array.isArray(n)||Array.isArray(e)){const i=Array.isArray(n)&&Array.isArray(e)&&yn(n,e);return new pC(e,!i)}let t=!1;for(const i in e)if(e.hasOwnProperty(i)){const s=UT(n[i],e[i]);s.didChange&&(n[i]=s.newValue,t=!0)}return new pC(n,t)}class oS{constructor(e){this.schema=void 0,this.id=e,this.name="_never_",this.defaultValue=void 0}applyUpdate(e,t){return UT(e,t)}validate(e){return this.defaultValue}}class w0{constructor(e,t,i,s){this.id=e,this.name=t,this.defaultValue=i,this.schema=s}applyUpdate(e,t){return UT(e,t)}validate(e){return typeof e>"u"?this.defaultValue:e}compute(e,t,i){return i}}function rt(n,e){return typeof n>"u"?e:n==="false"?!1:!!n}class Yt extends w0{constructor(e,t,i,s=void 0){typeof s<"u"&&(s.type="boolean",s.default=i),super(e,t,i,s)}validate(e){return rt(e,this.defaultValue)}}function ep(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 Li extends w0{static clampedInt(e,t,i,s){return ep(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 Li.clampedInt(e,this.defaultValue,this.minimum,this.maximum)}}function qme(n,e,t,i){if(typeof n>"u")return e;const s=Qa.float(n,e);return Qa.clamp(s,t,i)}class Qa extends w0{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(Qa.float(e,this.defaultValue))}}class gr extends w0{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 gr.string(e,this.defaultValue)}}function Dn(n,e,t,i){return typeof n!="string"?e:i&&n in i?i[n]:t.indexOf(n)===-1?e:n}class ln extends w0{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 Dn(e,this.defaultValue,this._allowedValues)}}class pL extends Ji{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 Gme(n){switch(n){case"none":return 0;case"keep":return 1;case"brackets":return 2;case"advanced":return 3;case"full":return 4}}class Yme extends Ji{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 Zme extends Ji{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:rt(t.insertSpace,this.defaultValue.insertSpace),ignoreEmptyLines:rt(t.ignoreEmptyLines,this.defaultValue.ignoreEmptyLines)}}}function Xme(n){switch(n){case"blink":return 1;case"smooth":return 2;case"phase":return 3;case"expand":return 4;case"solid":return 5}}var ws;(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"})(ws||(ws={}));function Qme(n){switch(n){case"line":return ws.Line;case"block":return ws.Block;case"underline":return ws.Underline;case"line-thin":return ws.LineThin;case"block-outline":return ws.BlockOutline;case"underline-thin":return ws.UnderlineThin}}class Jme extends oS{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 e_e extends Yt{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 t_e extends Ji{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:Kt},"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:rt(t.cursorMoveOnType,this.defaultValue.cursorMoveOnType),seedSearchStringFromSelection:typeof e.seedSearchStringFromSelection=="boolean"?e.seedSearchStringFromSelection?"always":"never":Dn(t.seedSearchStringFromSelection,this.defaultValue.seedSearchStringFromSelection,["never","always","selection"]),autoFindInSelection:typeof e.autoFindInSelection=="boolean"?e.autoFindInSelection?"always":"never":Dn(t.autoFindInSelection,this.defaultValue.autoFindInSelection,["never","always","multiline"]),globalFindClipboard:rt(t.globalFindClipboard,this.defaultValue.globalFindClipboard),addExtraSpaceOnTop:rt(t.addExtraSpaceOnTop,this.defaultValue.addExtraSpaceOnTop),loop:rt(t.loop,this.defaultValue.loop)}}}class Br extends Ji{constructor(){super(51,"fontLigatures",Br.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"?Br.OFF:e==="true"?Br.ON:e:e?Br.ON:Br.OFF}}Br.OFF='"liga" off, "calt" off';Br.ON='"liga" on, "calt" on';class Gl extends Ji{constructor(){super(54,"fontVariations",Gl.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"?Gl.OFF:e==="true"?Gl.TRANSLATE:e:e?Gl.TRANSLATE:Gl.OFF}compute(e,t,i){return e.fontInfo.fontVariationSettings}}Gl.OFF="normal";Gl.TRANSLATE="translate";class i_e extends oS{constructor(){super(50)}compute(e,t,i){return e.fontInfo}}class n_e extends w0{constructor(){super(52,"fontSize",wr.fontSize,{type:"number",minimum:6,maximum:100,default:wr.fontSize,description:m("fontSize","Controls the font size in pixels.")})}validate(e){const t=Qa.float(e,this.defaultValue);return t===0?wr.fontSize:Qa.clamp(t,6,100)}compute(e,t,i){return e.fontInfo.fontSize}}class jc extends Ji{constructor(){super(53,"fontWeight",wr.fontWeight,{anyOf:[{type:"number",minimum:jc.MINIMUM_VALUE,maximum:jc.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:jc.SUGGESTION_VALUES}],default:wr.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(Li.clampedInt(e,wr.fontWeight,jc.MINIMUM_VALUE,jc.MAXIMUM_VALUE))}}jc.SUGGESTION_VALUES=["normal","bold","100","200","300","400","500","600","700","800","900"];jc.MINIMUM_VALUE=1;jc.MAXIMUM_VALUE=1e3;class s_e extends Ji{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:Dn(a.multiple,this.defaultValue.multiple,["peek","gotoAndPeek","goto"]),multipleDefinitions:(t=a.multipleDefinitions)!==null&&t!==void 0?t:Dn(a.multipleDefinitions,"peek",["peek","gotoAndPeek","goto"]),multipleTypeDefinitions:(i=a.multipleTypeDefinitions)!==null&&i!==void 0?i:Dn(a.multipleTypeDefinitions,"peek",["peek","gotoAndPeek","goto"]),multipleDeclarations:(s=a.multipleDeclarations)!==null&&s!==void 0?s:Dn(a.multipleDeclarations,"peek",["peek","gotoAndPeek","goto"]),multipleImplementations:(o=a.multipleImplementations)!==null&&o!==void 0?o:Dn(a.multipleImplementations,"peek",["peek","gotoAndPeek","goto"]),multipleReferences:(r=a.multipleReferences)!==null&&r!==void 0?r:Dn(a.multipleReferences,"peek",["peek","gotoAndPeek","goto"]),alternativeDefinitionCommand:gr.string(a.alternativeDefinitionCommand,this.defaultValue.alternativeDefinitionCommand),alternativeTypeDefinitionCommand:gr.string(a.alternativeTypeDefinitionCommand,this.defaultValue.alternativeTypeDefinitionCommand),alternativeDeclarationCommand:gr.string(a.alternativeDeclarationCommand,this.defaultValue.alternativeDeclarationCommand),alternativeImplementationCommand:gr.string(a.alternativeImplementationCommand,this.defaultValue.alternativeImplementationCommand),alternativeReferenceCommand:gr.string(a.alternativeReferenceCommand,this.defaultValue.alternativeReferenceCommand)}}}class o_e extends Ji{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:rt(t.enabled,this.defaultValue.enabled),delay:Li.clampedInt(t.delay,this.defaultValue.delay,0,1e4),sticky:rt(t.sticky,this.defaultValue.sticky),hidingDelay:Li.clampedInt(t.hidingDelay,this.defaultValue.hidingDelay,0,6e5),above:rt(t.above,this.defaultValue.above)}}}class Pv extends oS{constructor(){super(143)}compute(e,t,i){return Pv.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,C=e.isViewportWrapping,w=u?2:3;let y=Math.floor(o*s);const L=y/o;let S=!1,k=!1,D=w*h,x=h/o,A=1;if(g==="fill"||g==="fit"){const{typicalViewportLineCount:Q,extraLinesBeforeFirstLine:le,extraLinesBeyondLastLine:de,desiredRatio:_e,minimapLineCount:ie}=Pv.computeContainedMinimapLineCount({viewLineCount:v,scrollBeyondLastLine:d,paddingTop:e.paddingTop,paddingBottom:e.paddingBottom,height:s,lineHeight:l,pixelRatio:o});if(v/ie>1)S=!0,k=!0,h=1,D=1,x=h/o;else{let Ye=!1,pe=h+1;if(g==="fit"){const Ee=Math.ceil((le+v+de)*D);C&&a&&b<=t.stableFitRemainingWidth?(Ye=!0,pe=t.stableFitMaxMinimapScale):Ye=Ee>y}if(g==="fill"||Ye){S=!0;const Ee=h;D=Math.min(l*o,Math.max(1,Math.floor(1/_e))),C&&a&&b<=t.stableFitRemainingWidth&&(pe=t.stableFitMaxMinimapScale),h=Math.min(pe,Math.max(1,Math.floor(D/w))),h>Ee&&(A=Math.min(2,h/Ee)),x=h/o/A,y=Math.ceil(Math.max(Q,le+v+de)*D),C?(t.stableMinimapLayoutInput=e,t.stableFitRemainingWidth=b,t.stableFitMaxMinimapScale=h):(t.stableMinimapLayoutInput=null,t.stableFitRemainingWidth=0)}}}const T=Math.floor(f*x),P=Math.min(T,Math.max(0,Math.floor((b-_-2)*x/(c+x)))+Dh);let W=Math.floor(o*P);const $=W/o;W=Math.floor(W*A);const X=u?1:2,J=p==="left"?0:i-P-_;return{renderMinimap:X,minimapLeft:J,minimapWidth:P,minimapHeightIsEditorHeight:S,minimapIsSampling:k,minimapScale:h,minimapLineHeight:D,minimapCanvasInnerWidth:W,minimapCanvasInnerHeight:y,minimapCanvasOuterWidth:$,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),C=e.get(104),w=e.get(83),y=e.get(72),L=e.get(102),S=L.verticalScrollbarSize,k=L.verticalHasArrows,D=L.arrowSize,x=L.horizontalScrollbarSize,A=e.get(43),T=e.get(109)!=="never";let P=e.get(65);A&&T&&(P+=16);let W=0;if(v){const It=Math.max(r,b);W=Math.round(It*l)}let $=0;_&&($=o*t.glyphMarginDecorationLaneCount);let X=0,J=X+$,Q=J+W,le=Q+P;const de=i-$-W-P;let _e=!1,ie=!1,ne=-1;h==="inherit"&&p?(_e=!0,ie=!0):f==="on"||f==="bounded"?ie=!0:f==="wordWrapColumn"&&(ne=g);const Ye=Pv._computeMinimapLayout({outerWidth:i,outerHeight:s,lineHeight:o,typicalHalfwidthCharacterWidth:a,pixelRatio:c,scrollBeyondLastLine:C,paddingTop:w.top,paddingBottom:w.bottom,minimap:y,verticalScrollbarWidth:S,viewLineCount:d,remainingWidth:de,isViewportWrapping:ie},t.memory||new rX);Ye.renderMinimap!==0&&Ye.minimapLeft===0&&(X+=Ye.minimapWidth,J+=Ye.minimapWidth,Q+=Ye.minimapWidth,le+=Ye.minimapWidth);const pe=de-Ye.minimapWidth,Ee=Math.max(1,Math.floor((pe-S-2)/a)),ze=k?D:0;return ie&&(ne=Math.max(1,Ee),f==="bounded"&&(ne=Math.min(ne,g))),{width:i,height:s,glyphMarginLeft:X,glyphMarginWidth:$,glyphMarginDecorationLaneCount:t.glyphMarginDecorationLaneCount,lineNumbersLeft:J,lineNumbersWidth:W,decorationsLeft:Q,decorationsWidth:P,contentLeft:le,contentWidth:pe,minimap:Ye,viewportColumn:Ee,isWordWrapMinified:_e,isViewportWrapping:ie,wrappingColumn:ne,verticalScrollbarWidth:S,horizontalScrollbarHeight:x,overviewRuler:{top:ze,width:S,height:s-2*ze,right:0}}}}class r_e extends Ji{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 Dn(e,"simple",["simple","advanced"])}compute(e,t,i){return t.get(2)===2?"advanced":i}}class a_e extends Ji{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:rt(e.enabled,this.defaultValue.enabled)}}}class l_e extends Ji{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:rt(t.enabled,this.defaultValue.enabled),maxLineCount:Li.clampedInt(t.maxLineCount,this.defaultValue.maxLineCount,1,10),defaultModel:Dn(t.defaultModel,this.defaultValue.defaultModel,["outlineModel","foldingProviderModel","indentationModel"]),scrollWithEditor:rt(t.scrollWithEditor,this.defaultValue.scrollWithEditor)}}}class c_e extends Ji{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}",Kt?"Ctrl+Option":"Ctrl+Alt"),m("editor.inlayHints.offUnlessPressed","Inlay hints are hidden by default and show when holding {0}",Kt?"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:Dn(t.enabled,this.defaultValue.enabled,["on","off","offUnlessPressed","onUnlessPressed"]),fontSize:Li.clampedInt(t.fontSize,this.defaultValue.fontSize,0,100),fontFamily:gr.string(t.fontFamily,this.defaultValue.fontFamily),padding:rt(t.padding,this.defaultValue.padding)}}}class d_e extends Ji{constructor(){super(65,"lineDecorationsWidth",10)}validate(e){return typeof e=="string"&&/^\d+(\.\d+)?ch$/.test(e)?-parseFloat(e.substring(0,e.length-2)):Li.clampedInt(e,this.defaultValue,0,1e3)}compute(e,t,i){return i<0?Li.clampedInt(-i*e.fontInfo.typicalHalfwidthCharacterWidth,this.defaultValue,0,1e3):i}}class u_e extends Qa{constructor(){super(66,"lineHeight",wr.lineHeight,e=>Qa.clamp(e,0,150),{markdownDescription:m("lineHeight","Controls the line height. \n - Use 0 to automatically compute the line height from the font size.\n - Values between 0 and 8 will be used as a multiplier with the font size.\n - Values greater than or equal to 8 will be used as effective values.")})}compute(e,t,i){return e.fontInfo.lineHeight}}class h_e extends Ji{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:rt(t.enabled,this.defaultValue.enabled),autohide:rt(t.autohide,this.defaultValue.autohide),size:Dn(t.size,this.defaultValue.size,["proportional","fill","fit"]),side:Dn(t.side,this.defaultValue.side,["right","left"]),showSlider:Dn(t.showSlider,this.defaultValue.showSlider,["always","mouseover"]),renderCharacters:rt(t.renderCharacters,this.defaultValue.renderCharacters),scale:Li.clampedInt(t.scale,1,1,3),maxColumn:Li.clampedInt(t.maxColumn,this.defaultValue.maxColumn,1,1e4)}}}function f_e(n){return n==="ctrlCmd"?Kt?"metaKey":"ctrlKey":"altKey"}class g_e extends Ji{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:Li.clampedInt(t.top,0,0,1e3),bottom:Li.clampedInt(t.bottom,0,0,1e3)}}}class p_e extends Ji{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:rt(t.enabled,this.defaultValue.enabled),cycle:rt(t.cycle,this.defaultValue.cycle)}}}class m_e extends oS{constructor(){super(141)}compute(e,t,i){return e.pixelRatio}}class __e extends Ji{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=Dn(t,this.defaultValue.other,o),typeof i=="boolean"?a=i?"on":"off":a=Dn(i,this.defaultValue.comments,o),typeof s=="boolean"?l=s?"on":"off":l=Dn(s,this.defaultValue.strings,o),{other:r,comments:a,strings:l}}}class v_e extends Ji{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 aE(n){const e=n.get(97);return e==="editable"?n.get(90):e!=="on"}class b_e extends Ji{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:Li.clampedInt(i,0,0,1e4),color:null});else if(i&&typeof i=="object"){const s=i;t.push({column:Li.clampedInt(s.column,0,0,1e4),color:s.color})}return t.sort((i,s)=>i.column-s.column),t}return this.defaultValue}}class C_e extends Ji{constructor(){super(91,"readOnlyMessage",void 0)}validate(e){return!e||typeof e!="object"?this.defaultValue:e}}function OV(n,e){if(typeof n!="string")return e;switch(n){case"hidden":return 2;case"visible":return 3;default:return 1}}let w_e=class extends Ji{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=Li.clampedInt(t.horizontalScrollbarSize,this.defaultValue.horizontalScrollbarSize,0,1e3),s=Li.clampedInt(t.verticalScrollbarSize,this.defaultValue.verticalScrollbarSize,0,1e3);return{arrowSize:Li.clampedInt(t.arrowSize,this.defaultValue.arrowSize,0,1e3),vertical:OV(t.vertical,this.defaultValue.vertical),horizontal:OV(t.horizontal,this.defaultValue.horizontal),useShadows:rt(t.useShadows,this.defaultValue.useShadows),verticalHasArrows:rt(t.verticalHasArrows,this.defaultValue.verticalHasArrows),horizontalHasArrows:rt(t.horizontalHasArrows,this.defaultValue.horizontalHasArrows),handleMouseWheel:rt(t.handleMouseWheel,this.defaultValue.handleMouseWheel),alwaysConsumeMouseWheel:rt(t.alwaysConsumeMouseWheel,this.defaultValue.alwaysConsumeMouseWheel),horizontalScrollbarSize:i,horizontalSliderSize:Li.clampedInt(t.horizontalSliderSize,i,0,1e3),verticalScrollbarSize:s,verticalSliderSize:Li.clampedInt(t.verticalSliderSize,s,0,1e3),scrollByPage:rt(t.scrollByPage,this.defaultValue.scrollByPage)}}};const Mr="inUntrustedWorkspace",Go={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 y_e extends Ji{constructor(){const e={nonBasicASCII:Mr,invisibleCharacters:!0,ambiguousCharacters:!0,includeComments:Mr,includeStrings:!0,allowedCharacters:{},allowedLocales:{_os:!0,_vscode:!0}};super(124,"unicodeHighlight",e,{[Go.nonBasicASCII]:{restricted:!0,type:["boolean","string"],enum:[!0,!1,Mr],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.")},[Go.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.")},[Go.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.")},[Go.includeComments]:{restricted:!0,type:["boolean","string"],enum:[!0,!1,Mr],default:e.includeComments,description:m("unicodeHighlight.includeComments","Controls whether characters in comments should also be subject to Unicode highlighting.")},[Go.includeStrings]:{restricted:!0,type:["boolean","string"],enum:[!0,!1,Mr],default:e.includeStrings,description:m("unicodeHighlight.includeStrings","Controls whether characters in strings should also be subject to Unicode highlighting.")},[Go.allowedCharacters]:{restricted:!0,type:"object",default:e.allowedCharacters,description:m("unicodeHighlight.allowedCharacters","Defines allowed characters that are not being highlighted."),additionalProperties:{type:"boolean"}},[Go.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&&(Gr(e.allowedCharacters,t.allowedCharacters)||(e=Object.assign(Object.assign({},e),{allowedCharacters:t.allowedCharacters}),i=!0)),t.allowedLocales&&e&&(Gr(e.allowedLocales,t.allowedLocales)||(e=Object.assign(Object.assign({},e),{allowedLocales:t.allowedLocales}),i=!0));const s=super.applyUpdate(e,t);return i?new pC(s.newValue,!0):s}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{nonBasicASCII:Ov(t.nonBasicASCII,Mr,[!0,!1,Mr]),invisibleCharacters:rt(t.invisibleCharacters,this.defaultValue.invisibleCharacters),ambiguousCharacters:rt(t.ambiguousCharacters,this.defaultValue.ambiguousCharacters),includeComments:Ov(t.includeComments,Mr,[!0,!1,Mr]),includeStrings:Ov(t.includeStrings,Mr,[!0,!1,Mr]),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 S_e extends Ji{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:rt(t.enabled,this.defaultValue.enabled),mode:Dn(t.mode,this.defaultValue.mode,["prefix","subword","subwordSmart"]),showToolbar:Dn(t.showToolbar,this.defaultValue.showToolbar,["always","onHover"]),suppressSuggestions:rt(t.suppressSuggestions,this.defaultValue.suppressSuggestions),keepOnBlur:rt(t.keepOnBlur,this.defaultValue.keepOnBlur)}}}class L_e extends Ji{constructor(){const e={enabled:Qs.bracketPairColorizationOptions.enabled,independentColorPoolPerBracketType:Qs.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:rt(t.enabled,this.defaultValue.enabled),independentColorPoolPerBracketType:rt(t.independentColorPoolPerBracketType,this.defaultValue.independentColorPoolPerBracketType)}}}class k_e extends Ji{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:Ov(t.bracketPairs,this.defaultValue.bracketPairs,[!0,!1,"active"]),bracketPairsHorizontal:Ov(t.bracketPairsHorizontal,this.defaultValue.bracketPairsHorizontal,[!0,!1,"active"]),highlightActiveBracketPair:rt(t.highlightActiveBracketPair,this.defaultValue.highlightActiveBracketPair),indentation:rt(t.indentation,this.defaultValue.indentation),highlightActiveIndentation:Ov(t.highlightActiveIndentation,this.defaultValue.highlightActiveIndentation,[!0,!1,"always"])}}}function Ov(n,e,t){const i=t.indexOf(n);return i===-1?e:t[i]}class D_e extends Ji{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:Dn(t.insertMode,this.defaultValue.insertMode,["insert","replace"]),filterGraceful:rt(t.filterGraceful,this.defaultValue.filterGraceful),snippetsPreventQuickSuggestions:rt(t.snippetsPreventQuickSuggestions,this.defaultValue.filterGraceful),localityBonus:rt(t.localityBonus,this.defaultValue.localityBonus),shareSuggestSelections:rt(t.shareSuggestSelections,this.defaultValue.shareSuggestSelections),selectionMode:Dn(t.selectionMode,this.defaultValue.selectionMode,["always","never","whenQuickSuggestion","whenTriggerCharacter"]),showIcons:rt(t.showIcons,this.defaultValue.showIcons),showStatusBar:rt(t.showStatusBar,this.defaultValue.showStatusBar),preview:rt(t.preview,this.defaultValue.preview),previewMode:Dn(t.previewMode,this.defaultValue.previewMode,["prefix","subword","subwordSmart"]),showInlineDetails:rt(t.showInlineDetails,this.defaultValue.showInlineDetails),showMethods:rt(t.showMethods,this.defaultValue.showMethods),showFunctions:rt(t.showFunctions,this.defaultValue.showFunctions),showConstructors:rt(t.showConstructors,this.defaultValue.showConstructors),showDeprecated:rt(t.showDeprecated,this.defaultValue.showDeprecated),matchOnWordStartOnly:rt(t.matchOnWordStartOnly,this.defaultValue.matchOnWordStartOnly),showFields:rt(t.showFields,this.defaultValue.showFields),showVariables:rt(t.showVariables,this.defaultValue.showVariables),showClasses:rt(t.showClasses,this.defaultValue.showClasses),showStructs:rt(t.showStructs,this.defaultValue.showStructs),showInterfaces:rt(t.showInterfaces,this.defaultValue.showInterfaces),showModules:rt(t.showModules,this.defaultValue.showModules),showProperties:rt(t.showProperties,this.defaultValue.showProperties),showEvents:rt(t.showEvents,this.defaultValue.showEvents),showOperators:rt(t.showOperators,this.defaultValue.showOperators),showUnits:rt(t.showUnits,this.defaultValue.showUnits),showValues:rt(t.showValues,this.defaultValue.showValues),showConstants:rt(t.showConstants,this.defaultValue.showConstants),showEnums:rt(t.showEnums,this.defaultValue.showEnums),showEnumMembers:rt(t.showEnumMembers,this.defaultValue.showEnumMembers),showKeywords:rt(t.showKeywords,this.defaultValue.showKeywords),showWords:rt(t.showWords,this.defaultValue.showWords),showColors:rt(t.showColors,this.defaultValue.showColors),showFiles:rt(t.showFiles,this.defaultValue.showFiles),showReferences:rt(t.showReferences,this.defaultValue.showReferences),showFolders:rt(t.showFolders,this.defaultValue.showFolders),showTypeParameters:rt(t.showTypeParameters,this.defaultValue.showTypeParameters),showSnippets:rt(t.showSnippets,this.defaultValue.showSnippets),showUsers:rt(t.showUsers,this.defaultValue.showUsers),showIssues:rt(t.showIssues,this.defaultValue.showIssues)}}}class E_e extends Ji{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:rt(e.selectLeadingAndTrailingWhitespace,this.defaultValue.selectLeadingAndTrailingWhitespace),selectSubwords:rt(e.selectSubwords,this.defaultValue.selectSubwords)}}}class I_e extends Ji{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 T_e extends oS{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 x_e extends Ji{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:rt(t.enabled,this.defaultValue.enabled),showDropSelector:Dn(t.showDropSelector,this.defaultValue.showDropSelector,["afterDrop","never"])}}}class N_e extends Ji{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:rt(t.enabled,this.defaultValue.enabled),showPasteSelector:Dn(t.showPasteSelector,this.defaultValue.showPasteSelector,["afterPaste","never"])}}}const A_e="Consolas, 'Courier New', monospace",M_e="Menlo, Monaco, 'Courier New', monospace",R_e="'Droid Sans Mono', 'monospace', monospace",wr={fontFamily:Kt?M_e:Co?R_e:A_e,fontWeight:"normal",fontSize:Kt?12:14,lineHeight:0,letterSpacing:0},ev=[];function ke(n){return ev[n.id]=n,n}const vc={acceptSuggestionOnCommitCharacter:ke(new Yt(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:ke(new ln(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:ke(new Yme),accessibilityPageSize:ke(new Li(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:ke(new gr(4,"ariaLabel",m("editorViewAccessibleLabel","Editor content"))),ariaRequired:ke(new Yt(5,"ariaRequired",!1,void 0)),screenReaderAnnounceInlineSuggestion:ke(new Yt(8,"screenReaderAnnounceInlineSuggestion",!0,{description:m("screenReaderAnnounceInlineSuggestion","Control whether inline suggestions are announced by a screen reader."),tags:["accessibility"]})),autoClosingBrackets:ke(new ln(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:ke(new ln(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:ke(new ln(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:ke(new ln(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:ke(new ln(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:ke(new pL(12,"autoIndent",4,"full",["none","keep","brackets","advanced","full"],Gme,{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:ke(new Yt(13,"automaticLayout",!1)),autoSurround:ke(new ln(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:ke(new L_e),bracketPairGuides:ke(new k_e),stickyTabStops:ke(new Yt(115,"stickyTabStops",!1,{description:m("stickyTabStops","Emulate selection behavior of tab characters when using spaces for indentation. Selection will stick to tab stops.")})),codeLens:ke(new Yt(17,"codeLens",!0,{description:m("codeLens","Controls whether the editor shows CodeLens.")})),codeLensFontFamily:ke(new gr(18,"codeLensFontFamily","",{description:m("codeLensFontFamily","Controls the font family for CodeLens.")})),codeLensFontSize:ke(new Li(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:ke(new Yt(20,"colorDecorators",!0,{description:m("colorDecorators","Controls whether the editor should render the inline color decorators and color picker.")})),colorDecoratorActivatedOn:ke(new ln(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:ke(new Li(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:ke(new Yt(22,"columnSelection",!1,{description:m("columnSelection","Enable that the selection with the mouse and keys is doing column selection.")})),comments:ke(new Zme),contextmenu:ke(new Yt(24,"contextmenu",!0)),copyWithSyntaxHighlighting:ke(new Yt(25,"copyWithSyntaxHighlighting",!0,{description:m("copyWithSyntaxHighlighting","Controls whether syntax highlighting should be copied into the clipboard.")})),cursorBlinking:ke(new pL(26,"cursorBlinking",1,"blink",["blink","smooth","phase","expand","solid"],Xme,{description:m("cursorBlinking","Control the cursor animation style.")})),cursorSmoothCaretAnimation:ke(new ln(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:ke(new pL(28,"cursorStyle",ws.Line,"line",["line","block","underline","line-thin","block-outline","underline-thin"],Qme,{description:m("cursorStyle","Controls the cursor style.")})),cursorSurroundingLines:ke(new Li(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:ke(new ln(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:ke(new Li(31,"cursorWidth",0,0,1073741824,{markdownDescription:m("cursorWidth","Controls the width of the cursor when `#editor.cursorStyle#` is set to `line`.")})),disableLayerHinting:ke(new Yt(32,"disableLayerHinting",!1)),disableMonospaceOptimizations:ke(new Yt(33,"disableMonospaceOptimizations",!1)),domReadOnly:ke(new Yt(34,"domReadOnly",!1)),dragAndDrop:ke(new Yt(35,"dragAndDrop",!0,{description:m("dragAndDrop","Controls whether the editor should allow moving selections via drag and drop.")})),emptySelectionClipboard:ke(new e_e),dropIntoEditor:ke(new x_e),stickyScroll:ke(new l_e),experimentalWhitespaceRendering:ke(new ln(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:ke(new gr(39,"extraEditorClassName","")),fastScrollSensitivity:ke(new Qa(40,"fastScrollSensitivity",5,n=>n<=0?5:n,{markdownDescription:m("fastScrollSensitivity","Scrolling speed multiplier when pressing `Alt`.")})),find:ke(new t_e),fixedOverflowWidgets:ke(new Yt(42,"fixedOverflowWidgets",!1)),folding:ke(new Yt(43,"folding",!0,{description:m("folding","Controls whether the editor has code folding enabled.")})),foldingStrategy:ke(new ln(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:ke(new Yt(45,"foldingHighlight",!0,{description:m("foldingHighlight","Controls whether the editor should highlight folded ranges.")})),foldingImportsByDefault:ke(new Yt(46,"foldingImportsByDefault",!1,{description:m("foldingImportsByDefault","Controls whether the editor automatically collapses import ranges.")})),foldingMaximumRegions:ke(new Li(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:ke(new Yt(48,"unfoldOnClickAfterEndOfLine",!1,{description:m("unfoldOnClickAfterEndOfLine","Controls whether clicking on the empty content after a folded line will unfold the line.")})),fontFamily:ke(new gr(49,"fontFamily",wr.fontFamily,{description:m("fontFamily","Controls the font family.")})),fontInfo:ke(new i_e),fontLigatures2:ke(new Br),fontSize:ke(new n_e),fontWeight:ke(new jc),fontVariations:ke(new Gl),formatOnPaste:ke(new Yt(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:ke(new Yt(56,"formatOnType",!1,{description:m("formatOnType","Controls whether the editor should automatically format the line after typing.")})),glyphMargin:ke(new Yt(57,"glyphMargin",!0,{description:m("glyphMargin","Controls whether the editor should render the vertical glyph margin. Glyph margin is mostly used for debugging.")})),gotoLocation:ke(new s_e),hideCursorInOverviewRuler:ke(new Yt(59,"hideCursorInOverviewRuler",!1,{description:m("hideCursorInOverviewRuler","Controls whether the cursor should be hidden in the overview ruler.")})),hover:ke(new o_e),inDiffEditor:ke(new Yt(61,"inDiffEditor",!1)),letterSpacing:ke(new Qa(63,"letterSpacing",wr.letterSpacing,n=>Qa.clamp(n,-5,20),{description:m("letterSpacing","Controls the letter spacing in pixels.")})),lightbulb:ke(new a_e),lineDecorationsWidth:ke(new d_e),lineHeight:ke(new u_e),lineNumbers:ke(new v_e),lineNumbersMinChars:ke(new Li(68,"lineNumbersMinChars",5,1,300)),linkedEditing:ke(new Yt(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:ke(new Yt(70,"links",!0,{description:m("links","Controls whether the editor should detect links and make them clickable.")})),matchBrackets:ke(new ln(71,"matchBrackets","always",["always","near","never"],{description:m("matchBrackets","Highlight matching brackets.")})),minimap:ke(new h_e),mouseStyle:ke(new ln(73,"mouseStyle","text",["text","default","copy"])),mouseWheelScrollSensitivity:ke(new Qa(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:ke(new Yt(75,"mouseWheelZoom",!1,{markdownDescription:m("mouseWheelZoom","Zoom the font of the editor when using mouse wheel and holding `Ctrl`.")})),multiCursorMergeOverlapping:ke(new Yt(76,"multiCursorMergeOverlapping",!0,{description:m("multiCursorMergeOverlapping","Merge multiple cursors when they are overlapping.")})),multiCursorModifier:ke(new pL(77,"multiCursorModifier","altKey","alt",["ctrlCmd","alt"],f_e,{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:ke(new ln(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:ke(new Li(79,"multiCursorLimit",1e4,1,1e5,{markdownDescription:m("multiCursorLimit","Controls the max number of cursors that can be in an active editor at once.")})),occurrencesHighlight:ke(new Yt(80,"occurrencesHighlight",!0,{description:m("occurrencesHighlight","Controls whether the editor should highlight semantic symbol occurrences.")})),overviewRulerBorder:ke(new Yt(81,"overviewRulerBorder",!0,{description:m("overviewRulerBorder","Controls whether a border should be drawn around the overview ruler.")})),overviewRulerLanes:ke(new Li(82,"overviewRulerLanes",3,0,3)),padding:ke(new g_e),pasteAs:ke(new N_e),parameterHints:ke(new p_e),peekWidgetDefaultFocus:ke(new ln(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:ke(new Yt(87,"definitionLinkOpensInPeek",!1,{description:m("definitionLinkOpensInPeek","Controls whether the Go to Definition mouse gesture always opens the peek widget.")})),quickSuggestions:ke(new __e),quickSuggestionsDelay:ke(new Li(89,"quickSuggestionsDelay",10,0,1073741824,{description:m("quickSuggestionsDelay","Controls the delay in milliseconds after which quick suggestions will show up.")})),readOnly:ke(new Yt(90,"readOnly",!1)),readOnlyMessage:ke(new C_e),renameOnType:ke(new Yt(92,"renameOnType",!1,{description:m("renameOnType","Controls whether the editor auto renames on type."),markdownDeprecationMessage:m("renameOnTypeDeprecate","Deprecated, use `editor.linkedEditing` instead.")})),renderControlCharacters:ke(new Yt(93,"renderControlCharacters",!0,{description:m("renderControlCharacters","Controls whether the editor should render control characters."),restricted:!0})),renderFinalNewline:ke(new ln(94,"renderFinalNewline",Co?"dimmed":"on",["off","on","dimmed"],{description:m("renderFinalNewline","Render last line number when the file ends with a newline.")})),renderLineHighlight:ke(new ln(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:ke(new Yt(96,"renderLineHighlightOnlyWhenFocus",!1,{description:m("renderLineHighlightOnlyWhenFocus","Controls if the editor should render the current line highlight only when the editor is focused.")})),renderValidationDecorations:ke(new ln(97,"renderValidationDecorations","editable",["editable","on","off"])),renderWhitespace:ke(new ln(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:ke(new Li(99,"revealHorizontalRightPadding",15,0,1e3)),roundedSelection:ke(new Yt(100,"roundedSelection",!0,{description:m("roundedSelection","Controls whether selections should have rounded corners.")})),rulers:ke(new b_e),scrollbar:ke(new w_e),scrollBeyondLastColumn:ke(new Li(103,"scrollBeyondLastColumn",4,0,1073741824,{description:m("scrollBeyondLastColumn","Controls the number of extra characters beyond which the editor will scroll horizontally.")})),scrollBeyondLastLine:ke(new Yt(104,"scrollBeyondLastLine",!0,{description:m("scrollBeyondLastLine","Controls whether the editor will scroll beyond the last line.")})),scrollPredominantAxis:ke(new Yt(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:ke(new Yt(106,"selectionClipboard",!0,{description:m("selectionClipboard","Controls whether the Linux primary clipboard should be supported."),included:Co})),selectionHighlight:ke(new Yt(107,"selectionHighlight",!0,{description:m("selectionHighlight","Controls whether the editor should highlight matches similar to the selection.")})),selectOnLineNumbers:ke(new Yt(108,"selectOnLineNumbers",!0)),showFoldingControls:ke(new ln(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:ke(new Yt(110,"showUnused",!0,{description:m("showUnused","Controls fading out of unused code.")})),showDeprecated:ke(new Yt(138,"showDeprecated",!0,{description:m("showDeprecated","Controls strikethrough deprecated variables.")})),inlayHints:ke(new c_e),snippetSuggestions:ke(new ln(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:ke(new E_e),smoothScrolling:ke(new Yt(113,"smoothScrolling",!1,{description:m("smoothScrolling","Controls whether the editor will scroll using an animation.")})),stopRenderingLineAfter:ke(new Li(116,"stopRenderingLineAfter",1e4,-1,1073741824)),suggest:ke(new D_e),inlineSuggest:ke(new S_e),inlineCompletionsAccessibilityVerbose:ke(new Yt(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:ke(new Li(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:ke(new Li(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:ke(new Yt(120,"suggestOnTriggerCharacters",!0,{description:m("suggestOnTriggerCharacters","Controls whether suggestions should automatically show up when typing trigger characters.")})),suggestSelection:ke(new ln(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:ke(new ln(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:ke(new Li(123,"tabIndex",0,-1,1073741824)),unicodeHighlight:ke(new y_e),unusualLineTerminators:ke(new ln(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:ke(new Yt(126,"useShadowDOM",!0)),useTabStops:ke(new Yt(127,"useTabStops",!0,{description:m("useTabStops","Inserting and deleting whitespace follows tab stops.")})),wordBreak:ke(new ln(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:ke(new gr(129,"wordSeparators",iX,{description:m("wordSeparators","Characters that will be used as word separators when doing word related navigations or operations.")})),wordWrap:ke(new ln(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:ke(new gr(131,"wordWrapBreakAfterCharacters"," })]?|/&.,;¢°′″‰℃、。。、¢,.:;?!%・・ゝゞヽヾーァィゥェォッャュョヮヵヶぁぃぅぇぉっゃゅょゎゕゖㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ々〻ァィゥェォャュョッー”〉》」』】〕)]}」")),wordWrapBreakBeforeCharacters:ke(new gr(132,"wordWrapBreakBeforeCharacters","([{‘“〈《「『【〔([{「£¥$£¥++")),wordWrapColumn:ke(new Li(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:ke(new ln(134,"wordWrapOverride1","inherit",["off","on","inherit"])),wordWrapOverride2:ke(new ln(135,"wordWrapOverride2","inherit",["off","on","inherit"])),editorClassName:ke(new Jme),defaultColorDecorators:ke(new Yt(145,"defaultColorDecorators",!1,{markdownDescription:m("defaultColorDecorators","Controls whether inline color decorations should be shown using the default document color provider")})),pixelRatio:ke(new m_e),tabFocusMode:ke(new Yt(142,"tabFocusMode",!1,{markdownDescription:m("tabFocusMode","Controls whether the editor receives tabs or defers them to the workbench for navigation.")})),layoutInfo:ke(new Pv),wrappingInfo:ke(new T_e),wrappingIndent:ke(new I_e),wrappingStrategy:ke(new r_e)};class P_e{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?_b.isErrorNoTelemetry(e)?new _b(e.message+"\n\n"+e.stack):new Error(e.message+"\n\n"+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 aX=new P_e;function Dt(n){bc(n)||aX.onUnexpectedError(n)}function Bn(n){bc(n)||aX.onUnexpectedExternalError(n)}function FV(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:_b.isErrorNoTelemetry(n)}}return n}const lE="Canceled";function bc(n){return n instanceof Sg?!0:n instanceof Error&&n.name===lE&&n.message===lE}class Sg extends Error{constructor(){super(lE),this.name=this.message}}function O_e(){const n=new Error(lE);return n.name=n.message,n}function La(n){return n?new Error("Illegal argument: ".concat(n)):new Error("Illegal argument")}function m8(n){return n?new Error("Illegal state: ".concat(n)):new Error("Illegal state")}class F_e extends Error{constructor(e){super("NotSupported"),e&&(this.message=e)}}class _b extends Error{constructor(e){super(e),this.name="CodeExpectedError"}static fromError(e){if(e instanceof _b)return e;const t=new _b;return t.message=e.message,t.stack=e.stack,t}static isErrorNoTelemetry(e){return e.name==="CodeExpectedError"}}class Rn extends Error{constructor(e){super(e||"An unexpected bug occurred."),Object.setPrototypeOf(this,Rn.prototype)}}function $f(n){const e=this;let t=!1,i;return function(){return t||(t=!0,i=n.apply(e,arguments)),i}}function _8(n){return typeof n.dispose=="function"&&n.dispose.length===0}function fi(n){if(Pt.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 rl(...n){return vt(()=>fi(n))}function vt(n){return{dispose:$f(()=>{n()})}}class be{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{fi(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?be.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)}}be.DISABLE_DISPOSED_WARNING=!1;class te{constructor(){this._store=new be,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)}}te.None=Object.freeze({dispose(){}});class Ts{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 B_e{constructor(e){this._disposable=e,this._counter=1}acquire(){return this._counter++,this}release(){return--this._counter===0&&this._disposable.dispose(),this}}class W_e{constructor(e){this.object=e}dispose(){}}class v8{constructor(){this._store=new Map,this._isDisposed=!1}dispose(){this._isDisposed=!0,this.clearAndDisposeAll()}clearAndDisposeAll(){if(this._store.size)try{fi(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 V_e=globalThis.performance&&typeof globalThis.performance.now=="function";class so{static create(e){return new so(e)}constructor(e){this._now=V_e&&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 We;(function(n){n.None=()=>te.None;function e(T,P){return u(T,()=>{},0,void 0,!0,void 0,P)}n.defer=e;function t(T){return(P,W=null,$)=>{let X=!1,J;return J=T(Q=>{if(!X)return J?J.dispose():X=!0,P.call(W,Q)},null,$),X&&J.dispose(),J}}n.once=t;function i(T,P,W){return c(($,X=null,J)=>T(Q=>$.call(X,P(Q)),null,J),W)}n.map=i;function s(T,P,W){return c(($,X=null,J)=>T(Q=>{P(Q),$.call(X,Q)},null,J),W)}n.forEach=s;function o(T,P,W){return c(($,X=null,J)=>T(Q=>P(Q)&&$.call(X,Q),null,J),W)}n.filter=o;function r(T){return T}n.signal=r;function a(...T){return(P,W=null,$)=>{const X=rl(...T.map(J=>J(Q=>P.call(W,Q))));return d(X,$)}}n.any=a;function l(T,P,W,$){let X=W;return i(T,J=>(X=P(X,J),X),$)}n.reduce=l;function c(T,P){let W;const $={onWillAddFirstListener(){W=T(X.fire,X)},onDidRemoveLastListener(){W==null||W.dispose()}},X=new j($);return P==null||P.add(X),X.event}function d(T,P){return P instanceof Array?P.push(T):P&&P.add(T),T}function u(T,P,W=100,$=!1,X=!1,J,Q){let le,de,_e,ie=0,ne;const Ye={leakWarningThreshold:J,onWillAddFirstListener(){le=T(Ee=>{ie++,de=P(de,Ee),$&&!_e&&(pe.fire(de),de=void 0),ne=()=>{const ze=de;de=void 0,_e=void 0,(!$||ie>1)&&pe.fire(ze),ie=0},typeof W=="number"?(clearTimeout(_e),_e=setTimeout(ne,W)):_e===void 0&&(_e=0,queueMicrotask(ne))})},onWillRemoveListener(){X&&ie>0&&(ne==null||ne())},onDidRemoveLastListener(){ne=void 0,le.dispose()}},pe=new j(Ye);return Q==null||Q.add(pe),pe.event}n.debounce=u;function h(T,P=0,W){return n.debounce(T,($,X)=>$?($.push(X),$):[X],P,void 0,!0,void 0,W)}n.accumulate=h;function f(T,P=($,X)=>$===X,W){let $=!0,X;return o(T,J=>{const Q=$||!P(J,X);return $=!1,X=J,Q},W)}n.latch=f;function g(T,P,W){return[n.filter(T,P,W),n.filter(T,$=>!P($),W)]}n.split=g;function p(T,P=!1,W=[],$){let X=W.slice(),J=T(de=>{X?X.push(de):le.fire(de)});$&&$.add(J);const Q=()=>{X==null||X.forEach(de=>le.fire(de)),X=null},le=new j({onWillAddFirstListener(){J||(J=T(de=>le.fire(de)),$&&$.add(J))},onDidAddFirstListener(){X&&(P?setTimeout(Q):Q())},onDidRemoveLastListener(){J&&J.dispose(),J=null}});return $&&$.add(le),le.event}n.buffer=p;function _(T,P){return($,X,J)=>{const Q=P(new b);return T(function(le){const de=Q.evaluate(le);de!==v&&$.call(X,de)},void 0,J)}}n.chain=_;const v=Symbol("HaltChainable");class b{constructor(){this.steps=[]}map(P){return this.steps.push(P),this}forEach(P){return this.steps.push(W=>(P(W),W)),this}filter(P){return this.steps.push(W=>P(W)?W:v),this}reduce(P,W){let $=W;return this.steps.push(X=>($=P($,X),$)),this}latch(P=(W,$)=>W===$){let W=!0,$;return this.steps.push(X=>{const J=W||!P(X,$);return W=!1,$=X,J?X:v}),this}evaluate(P){for(const W of this.steps)if(P=W(P),P===v)break;return P}}function C(T,P,W=$=>$){const $=(...le)=>Q.fire(W(...le)),X=()=>T.on(P,$),J=()=>T.removeListener(P,$),Q=new j({onWillAddFirstListener:X,onDidRemoveLastListener:J});return Q.event}n.fromNodeEventEmitter=C;function w(T,P,W=$=>$){const $=(...le)=>Q.fire(W(...le)),X=()=>T.addEventListener(P,$),J=()=>T.removeEventListener(P,$),Q=new j({onWillAddFirstListener:X,onDidRemoveLastListener:J});return Q.event}n.fromDOMEventEmitter=w;function y(T){return new Promise(P=>t(T)(P))}n.toPromise=y;function L(T){const P=new j;return T.then(W=>{P.fire(W)},()=>{P.fire(void 0)}).finally(()=>{P.dispose()}),P.event}n.fromPromise=L;function S(T,P){return P(void 0),T(W=>P(W))}n.runAndSubscribe=S;function k(T,P){let W=null;function $(J){W==null||W.dispose(),W=new be,P(J,W)}$(void 0);const X=T(J=>$(J));return vt(()=>{X.dispose(),W==null||W.dispose()})}n.runAndSubscribeWithStore=k;class D{constructor(P,W){this._observable=P,this._counter=0,this._hasChanged=!1;const $={onWillAddFirstListener:()=>{P.addObserver(this)},onDidRemoveLastListener:()=>{P.removeObserver(this)}};this.emitter=new j($),W&&W.add(this.emitter)}beginUpdate(P){this._counter++}handlePossibleChange(P){}handleChange(P,W){this._hasChanged=!0}endUpdate(P){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function x(T,P){return new D(T,P).emitter.event}n.fromObservable=x;function A(T){return P=>{let W=0,$=!1;const X={beginUpdate(){W++},endUpdate(){W--,W===0&&(T.reportChanges(),$&&($=!1,P()))},handlePossibleChange(){},handleChange(){$=!0}};return T.addObserver(X),T.reportChanges(),{dispose(){T.removeObserver(X)}}}}n.fromObservableLight=A})(We||(We={}));class vb{constructor(e){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name="".concat(e,"_").concat(vb._idPool++),vb.all.add(this)}start(e){this._stopWatch=new so,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}}}vb.all=new Set;vb._idPool=0;let H_e=-1;class $_e{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 b8{static create(){var e;return new b8((e=new Error().stack)!==null&&e!==void 0?e:"")}constructor(e){this.value=e}print(){console.warn(this.value.split("\n").slice(2).join("\n"))}}class qA{constructor(e){this.value=e}}const z_e=2;let j=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 $_e((s=(i=this._options)===null||i===void 0?void 0:i.leakWarningThreshold)!==null&&s!==void 0?s:H_e):void 0,this._perfMon=!((o=this._options)===null||o===void 0)&&o._profName?new vb(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("[".concat(this._leakageMon.name,"] REFUSES to accept new listeners because it exceeded its threshold by far")),te.None;if(this._disposed)return te.None;i&&(t=t.bind(i));const d=new qA(t);let u;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(d.stack=b8.create(),u=this._leakageMon.check(d.stack,this._size+1)),this._listeners?this._listeners instanceof qA?((c=this._deliveryQueue)!==null&&c!==void 0||(this._deliveryQueue=new lX),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=vt(()=>{u==null||u(),this._removeListener(d)});return s instanceof be?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*z_e<=r.length){let c=0;for(let d=0;d0}};const U_e=()=>new lX;class lX{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 nm extends j{constructor(e){super(e),this._isPaused=0,this._eventQueue=new To,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 cX extends nm{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 j_e extends j{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 K_e{constructor(){this.hasListeners=!1,this.events=[],this.emitter=new j({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),vt($f(()=>{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 C8{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 BV{constructor(){this.listening=!1,this.inputEvent=We.None,this.inputEventListener=te.None,this.emitter=new j({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 dX=Object.freeze(function(n,e){const t=setTimeout(n.bind(e),0);return{dispose(){clearTimeout(t)}}});var Ft;(function(n){function e(t){return t===n.None||t===n.Cancelled||t instanceof iD?!0:!t||typeof t!="object"?!1:typeof t.isCancellationRequested=="boolean"&&typeof t.onCancellationRequested=="function"}n.isCancellationToken=e,n.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:We.None}),n.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:dX})})(Ft||(Ft={}));class iD{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?dX:(this._emitter||(this._emitter=new j),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}}let Tn=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 iD),this._token}cancel(){this._token?this._token instanceof iD&&this._token.cancel():this._token=Ft.Cancelled}dispose(e=!1){var t;e&&this.cancel(),(t=this._parentListener)===null||t===void 0||t.dispose(),this._token?this._token instanceof iD&&this._token.dispose():this._token=Ft.None}};class w8{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 nD=new w8,$2=new w8,z2=new w8,uX=new Array(230),q_e=Object.create(null),G_e=Object.create(null),y8=[];for(let n=0;n<=193;n++)y8[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,q_e[a]=r,G_e[a.toLowerCase()]=r,o&&(y8[r]=l)),!t[l]){if(t[l]=!0,!c)throw new Error("String representation missing for key code ".concat(l," around scan code ").concat(a));nD.define(l,c),$2.define(l,h||c),z2.define(l,f||h||c)}d&&(uX[d]=l)}})();var pu;(function(n){function e(a){return nD.keyCodeToStr(a)}n.toString=e;function t(a){return nD.strToKeyCode(a)}n.fromString=t;function i(a){return $2.keyCodeToStr(a)}n.toUserSettingsUS=i;function s(a){return z2.keyCodeToStr(a)}n.toUserSettingsGeneral=s;function o(a){return $2.strToKeyCode(a)||z2.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 nD.keyCodeToStr(a)}n.toElectronAccelerator=r})(pu||(pu={}));function qn(n,e){const t=(e&65535)<<16>>>0;return(n|t)>>>0}let Fv;if(typeof ol.vscode<"u"&&typeof ol.vscode.process<"u"){const n=ol.vscode.process;Fv={get platform(){return n.platform},get arch(){return n.arch},get env(){return n.env},cwd(){return n.cwd()}}}else typeof process<"u"?Fv={get platform(){return process.platform},get arch(){return process.arch},get env(){return process.env},cwd(){return process.env.VSCODE_CWD||process.cwd()}}:Fv={get platform(){return zs?"win32":Kt?"darwin":"linux"},get arch(){},get env(){return{}},cwd(){return"/"}};const cE=Fv.cwd,hX=Fv.env,Y_e=Fv.platform,Z_e=65,X_e=97,Q_e=90,J_e=122,vf=46,ho=47,Nr=92,ph=58,eve=63;class fX 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 "'.concat(e,'" ').concat(o," ").concat(s," of type ").concat(t);r+=". Received type ".concat(typeof i),super(r),this.code="ERR_INVALID_ARG_TYPE"}}function tve(n,e){if(n===null||typeof n!="object")throw new fX(e,"Object",n)}function ls(n,e){if(typeof n!="string")throw new fX(e,"string",n)}const Lg=Y_e==="win32";function pi(n){return n===ho||n===Nr}function U2(n){return n===ho}function mh(n){return n>=Z_e&&n<=Q_e||n>=X_e&&n<=J_e}function dE(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?"".concat(t,".."):"..",o=2)}else s.length>0?s+="".concat(t).concat(n.slice(r+1,c)):s=n.slice(r+1,c),o=c-r-1;r=c,a=0}else l===vf&&a!==-1?++a:a=-1}return s}function gX(n,e){tve(e,"pathObject");const t=e.dir||e.root,i=e.base||"".concat(e.name||"").concat(e.ext||"");return t?t===e.root?"".concat(t).concat(i):"".concat(t).concat(n).concat(i):i}const vr={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],ls(o,"path"),o.length===0)continue}else e.length===0?o=cE():(o=hX["=".concat(e)]||cE(),(o===void 0||o.slice(0,2).toLowerCase()!==e.toLowerCase()&&o.charCodeAt(2)===Nr)&&(o="".concat(e,"\\")));const r=o.length;let a=0,l="",c=!1;const d=o.charCodeAt(0);if(r===1)pi(d)&&(a=1,c=!0);else if(pi(d))if(c=!0,pi(o.charCodeAt(1))){let u=2,h=u;for(;u2&&pi(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="".concat(o.slice(a),"\\").concat(t),i=c,c&&e.length>0)break}return t=dE(t,!i,"\\",pi),i?"".concat(e,"\\").concat(t):"".concat(e).concat(t)||"."},normalize(n){ls(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 U2(o)?"\\":n;if(pi(o))if(s=!0,pi(n.charCodeAt(1))){let a=2,l=a;for(;a2&&pi(n.charCodeAt(2))&&(s=!0,t=3));let r=t0&&pi(n.charCodeAt(e-1))&&(r+="\\"),i===void 0?s?"\\".concat(r):r:s?"".concat(i,"\\").concat(r):"".concat(i).concat(r)},isAbsolute(n){ls(n,"path");const e=n.length;if(e===0)return!1;const t=n.charCodeAt(0);return pi(t)||e>2&&mh(t)&&n.charCodeAt(1)===ph&&pi(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+="\\".concat(r))}if(e===void 0)return".";let i=!0,s=0;if(typeof t=="string"&&pi(t.charCodeAt(0))){++s;const o=t.length;o>1&&pi(t.charCodeAt(1))&&(++s,o>2&&(pi(t.charCodeAt(2))?++s:i=!1))}if(i){for(;s=2&&(e="\\".concat(e.slice(s)))}return vr.normalize(e)},relative(n,e){if(ls(n,"from"),ls(e,"to"),n===e)return"";const t=vr.resolve(n),i=vr.resolve(e);if(t===i||(n=t.toLowerCase(),e=i.toLowerCase(),n===e))return"";let s=0;for(;ss&&n.charCodeAt(o-1)===Nr;)o--;const r=o-s;let a=0;for(;aa&&e.charCodeAt(l-1)===Nr;)l--;const c=l-a,d=rd){if(e.charCodeAt(a+h)===Nr)return i.slice(a+h+1);if(h===2)return i.slice(a+h)}r>d&&(n.charCodeAt(s+h)===Nr?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)===Nr)&&(f+=f.length===0?"..":"\\..");return a+=u,f.length>0?"".concat(f).concat(i.slice(a,l)):(i.charCodeAt(a)===Nr&&++a,i.slice(a,l))},toNamespacedPath(n){if(typeof n!="string"||n.length===0)return n;const e=vr.resolve(n);if(e.length<=2)return n;if(e.charCodeAt(0)===Nr){if(e.charCodeAt(1)===Nr){const t=e.charCodeAt(2);if(t!==eve&&t!==vf)return"\\\\?\\UNC\\".concat(e.slice(2))}}else if(mh(e.charCodeAt(0))&&e.charCodeAt(1)===ph&&e.charCodeAt(2)===Nr)return"\\\\?\\".concat(e);return n},dirname(n){ls(n,"path");const e=n.length;if(e===0)return".";let t=-1,i=0;const s=n.charCodeAt(0);if(e===1)return pi(s)?n:".";if(pi(s)){if(t=i=1,pi(n.charCodeAt(1))){let a=2,l=a;for(;a2&&pi(n.charCodeAt(2))?3:2,i=t);let o=-1,r=!0;for(let a=e-1;a>=i;--a)if(pi(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&&ls(e,"ext"),ls(n,"path");let t=0,i=-1,s=!0,o;if(n.length>=2&&mh(n.charCodeAt(0))&&n.charCodeAt(1)===ph&&(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(pi(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(pi(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){ls(n,"path");let e=0,t=-1,i=0,s=-1,o=!0,r=0;n.length>=2&&n.charCodeAt(1)===ph&&mh(n.charCodeAt(0))&&(e=i=2);for(let a=n.length-1;a>=e;--a){const l=n.charCodeAt(a);if(pi(l)){if(!o){i=a+1;break}continue}s===-1&&(o=!1,s=a+1),l===vf?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:gX.bind(null,"\\"),parse(n){ls(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 pi(s)?(e.root=e.dir=n,e):(e.base=e.name=n,e);if(pi(s)){if(i=1,pi(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),pi(s)){if(!l){r=c+1;break}continue}a===-1&&(l=!1,a=c+1),s===vf?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},ive=(()=>{if(Lg){const n=/\\/g;return()=>{const e=cE().replace(n,"/");return e.slice(e.indexOf("/"))}}return()=>cE()})(),zn={resolve(...n){let e="",t=!1;for(let i=n.length-1;i>=-1&&!t;i--){const s=i>=0?n[i]:ive();ls(s,"path"),s.length!==0&&(e="".concat(s,"/").concat(e),t=s.charCodeAt(0)===ho)}return e=dE(e,!t,"/",U2),t?"/".concat(e):e.length>0?e:"."},normalize(n){if(ls(n,"path"),n.length===0)return".";const e=n.charCodeAt(0)===ho,t=n.charCodeAt(n.length-1)===ho;return n=dE(n,!e,"/",U2),n.length===0?e?"/":t?"./":".":(t&&(n+="/"),e?"/".concat(n):n)},isAbsolute(n){return ls(n,"path"),n.length>0&&n.charCodeAt(0)===ho},join(...n){if(n.length===0)return".";let e;for(let t=0;t0&&(e===void 0?e=i:e+="/".concat(i))}return e===void 0?".":zn.normalize(e)},relative(n,e){if(ls(n,"from"),ls(e,"to"),n===e||(n=zn.resolve(n),e=zn.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)===ho)return e.slice(o+c+1);if(c===0)return e.slice(o+c)}else s>a&&(n.charCodeAt(t+c)===ho?l=c:c===0&&(l=0));let d="";for(c=t+l+1;c<=i;++c)(c===i||n.charCodeAt(c)===ho)&&(d+=d.length===0?"..":"/..");return"".concat(d).concat(e.slice(o+l))},toNamespacedPath(n){return n},dirname(n){if(ls(n,"path"),n.length===0)return".";const e=n.charCodeAt(0)===ho;let t=-1,i=!0;for(let s=n.length-1;s>=1;--s)if(n.charCodeAt(s)===ho){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&&ls(e,"ext"),ls(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===ho){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)===ho){if(!s){t=o+1;break}}else i===-1&&(s=!1,i=o+1);return i===-1?"":n.slice(t,i)},extname(n){ls(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===ho){if(!s){t=r+1;break}continue}i===-1&&(s=!1,i=r+1),a===vf?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:gX.bind(null,"/"),parse(n){ls(n,"path");const e={root:"",dir:"",base:"",ext:"",name:""};if(n.length===0)return e;const t=n.charCodeAt(0)===ho;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===ho){if(!a){o=l+1;break}continue}r===-1&&(a=!1,r=l+1),d===vf?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};zn.win32=vr.win32=vr;zn.posix=vr.posix=zn;const pX=Lg?vr.normalize:zn.normalize,nve=Lg?vr.resolve:zn.resolve,sve=Lg?vr.relative:zn.relative,mX=Lg?vr.dirname:zn.dirname,bf=Lg?vr.basename:zn.basename,ove=Lg?vr.extname:zn.extname,sc=Lg?vr.sep:zn.sep,rve=/^\w[\w\d+.-]*$/,ave=/^\//,lve=/^\/\//;function cve(n,e){if(!n.scheme&&e)throw new Error('[UriError]: Scheme is missing: {scheme: "", authority: "'.concat(n.authority,'", path: "').concat(n.path,'", query: "').concat(n.query,'", fragment: "').concat(n.fragment,'"}'));if(n.scheme&&!rve.test(n.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(n.path){if(n.authority){if(!ave.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(lve.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 dve(n,e){return!n&&!e?"file":n}function uve(n,e){switch(n){case"https":case"http":case"file":e?e[0]!==zl&&(e=zl+e):e=zl;break}return e}const Ln="",zl="/",hve=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/;class ct{static isUri(e){return e instanceof ct?!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||Ln,this.authority=e.authority||Ln,this.path=e.path||Ln,this.query=e.query||Ln,this.fragment=e.fragment||Ln):(this.scheme=dve(e,r),this.authority=t||Ln,this.path=uve(this.scheme,i||Ln),this.query=s||Ln,this.fragment=o||Ln,cve(this,r))}get fsPath(){return uE(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=Ln),i===void 0?i=this.authority:i===null&&(i=Ln),s===void 0?s=this.path:s===null&&(s=Ln),o===void 0?o=this.query:o===null&&(o=Ln),r===void 0?r=this.fragment:r===null&&(r=Ln),t===this.scheme&&i===this.authority&&s===this.path&&o===this.query&&r===this.fragment?this:new b_(t,i,s,o,r)}static parse(e,t=!1){const i=hve.exec(e);return i?new b_(i[2]||Ln,mL(i[4]||Ln),mL(i[5]||Ln),mL(i[7]||Ln),mL(i[9]||Ln),t):new b_(Ln,Ln,Ln,Ln,Ln)}static file(e){let t=Ln;if(zs&&(e=e.replace(/\\/g,zl)),e[0]===zl&&e[1]===zl){const i=e.indexOf(zl,2);i===-1?(t=e.substring(2),e=zl):(t=e.substring(2,i),e=e.substring(i)||zl)}return new b_("file",t,e,Ln,Ln)}static from(e,t){return new b_(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 zs&&e.scheme==="file"?i=ct.file(vr.join(uE(e,!0),...t)).path:i=zn.join(e.path,...t),e.with({path:i})}toString(e=!1){return j2(this,e)}toJSON(){return this}static revive(e){var t,i;if(e){if(e instanceof ct)return e;{const s=new b_(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=zs?1:void 0;let b_=class extends ct{constructor(){super(...arguments),this._formatted=null,this._fsPath=null}get fsPath(){return this._fsPath||(this._fsPath=uE(this,!1)),this._fsPath}toString(e=!1){return e?j2(this,!0):(this._formatted||(this._formatted=j2(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 vX={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 WV(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=vX[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 fve(n){let e;for(let t=0;t1&&n.scheme==="file"?t="//".concat(n.authority).concat(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,zs&&(t=t.replace(/\//g,"\\")),t}function j2(n,e){const t=e?fve:WV;let i="",{scheme:s,authority:o,path:r,query:a,fragment:l}=n;if(s&&(i+=s,i+=":"),(o||s==="file")&&(i+=zl,i+=zl),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="/".concat(String.fromCharCode(c+32),":").concat(r.substr(3)))}else if(r.length>=2&&r.charCodeAt(1)===58){const c=r.charCodeAt(0);c>=65&&c<=90&&(r="".concat(String.fromCharCode(c+32),":").concat(r.substr(2)))}i+=t(r,!0,!1)}return a&&(i+="?",i+=t(a,!1,!1)),l&&(i+="#",i+=e?l:WV(l,!1,!1)),i}function bX(n){try{return decodeURIComponent(n)}catch{return n.length>3?n.substr(0,3)+bX(n.substr(3)):n}}const VV=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function mL(n){return n.match(VV)?n.replace(VV,e=>bX(e)):n}let Y=class tp{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 tp(e,t)}delta(e=0,t=0){return this.with(this.lineNumber+e,this.column+t)}equals(e){return tp.equals(this,e)}static equals(e,t){return!e&&!t?!0:!!e&&!!t&&e.lineNumber===t.lineNumber&&e.column===t.column}isBefore(e){return tp.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 gs.isEmpty(this)}static isEmpty(e){return e.startLineNumber===e.endLineNumber&&e.startColumn===e.endColumn}containsPosition(e){return gs.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 gs.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 gs.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 gs.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 gs(i,s,o,r)}intersectRanges(e){return gs.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 gs(i,s,o,r)}equalsRange(e){return gs.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 gs.getEndPosition(this)}static getEndPosition(e){return new Y(e.endLineNumber,e.endColumn)}getStartPosition(){return gs.getStartPosition(this)}static getStartPosition(e){return new Y(e.startLineNumber,e.startColumn)}toString(){return"["+this.startLineNumber+","+this.startColumn+" -> "+this.endLineNumber+","+this.endColumn+"]"}setEndPosition(e,t){return new gs(this.startLineNumber,this.startColumn,e,t)}setStartPosition(e,t){return new gs(e,t,this.endLineNumber,this.endColumn)}collapseToStart(){return gs.collapseToStart(this)}static collapseToStart(e){return new gs(e.startLineNumber,e.startColumn,e.startLineNumber,e.startColumn)}collapseToEnd(){return gs.collapseToEnd(this)}static collapseToEnd(e){return new gs(e.endLineNumber,e.endColumn,e.endLineNumber,e.endColumn)}delta(e){return new gs(this.startLineNumber+e,this.startColumn,this.endLineNumber+e,this.endColumn)}static fromPositions(e,t=e){return new gs(e.lineNumber,e.column,t.lineNumber,t.column)}static lift(e){return e?new gs(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}},Je=class qa extends I{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 qa.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 qa(this.startLineNumber,this.startColumn,e,t):new qa(e,t,this.startLineNumber,this.startColumn)}getPosition(){return new Y(this.positionLineNumber,this.positionColumn)}getSelectionStart(){return new Y(this.selectionStartLineNumber,this.selectionStartColumn)}setStartPosition(e,t){return this.getDirection()===0?new qa(e,t,this.endLineNumber,this.endColumn):new qa(this.endLineNumber,this.endColumn,e,t)}static fromPositions(e,t=e){return new qa(e.lineNumber,e.column,t.lineNumber,t.column)}static fromRange(e,t){return t===0?new qa(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn):new qa(e.endLineNumber,e.endColumn,e.startLineNumber,e.startColumn)}static liftSelection(e){return new qa(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 pve(this,e,t);return this._factories.set(e,s),vt(()=>{const o=this._factories.get(e);!o||o!==s||(this._factories.delete(e),o.dispose())})}getOrCreate(e){return q2(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 pve extends te{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 q2(this,void 0,void 0,function*(){return this._resolvePromise||(this._resolvePromise=this._create()),this._resolvePromise})}_create(){return q2(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 gw=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 S8{constructor(e,t){this.tokens=e,this.endState=t,this._tokenizationResultBrand=void 0}}class jT{constructor(e,t){this.tokens=e,this.endState=t,this._encodedTokenizationResultBrand=void 0}}var pw;(function(n){const e=new Map;e.set(0,Me.symbolMethod),e.set(1,Me.symbolFunction),e.set(2,Me.symbolConstructor),e.set(3,Me.symbolField),e.set(4,Me.symbolVariable),e.set(5,Me.symbolClass),e.set(6,Me.symbolStruct),e.set(7,Me.symbolInterface),e.set(8,Me.symbolModule),e.set(9,Me.symbolProperty),e.set(10,Me.symbolEvent),e.set(11,Me.symbolOperator),e.set(12,Me.symbolUnit),e.set(13,Me.symbolValue),e.set(15,Me.symbolEnum),e.set(14,Me.symbolConstant),e.set(15,Me.symbolEnum),e.set(16,Me.symbolEnumMember),e.set(17,Me.symbolKeyword),e.set(27,Me.symbolSnippet),e.set(18,Me.symbolText),e.set(19,Me.symbolColor),e.set(20,Me.symbolFile),e.set(21,Me.symbolReference),e.set(22,Me.symbolCustomColor),e.set(23,Me.symbolFolder),e.set(24,Me.symbolTypeParameter),e.set(25,Me.account),e.set(26,Me.issues);function t(o){let r=e.get(o);return r||(console.info("No codicon found for CompletionItemKind "+o),r=Me.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})(pw||(pw={}));var Ru;(function(n){n[n.Automatic=0]="Automatic",n[n.Explicit=1]="Explicit"})(Ru||(Ru={}));class wX{constructor(e,t,i,s){this.range=e,this.text=t,this.completionKind=i,this.isSnippetText=s}equals(e){return I.lift(this.range).equalsRange(e.range)&&this.text===e.text&&this.completionKind===e.completionKind&&this.isSnippetText===e.isSnippetText}}var gd;(function(n){n[n.Invoke=1]="Invoke",n[n.TriggerCharacter=2]="TriggerCharacter",n[n.ContentChange=3]="ContentChange"})(gd||(gd={}));var mw;(function(n){n[n.Text=0]="Text",n[n.Read=1]="Read",n[n.Write=2]="Write"})(mw||(mw={}));function mve(n){return n&&ct.isUri(n.uri)&&I.isIRange(n.range)&&(I.isIRange(n.originSelectionRange)||I.isIRange(n.targetSelectionRange))}const _ve={17:m("Array","array"),16:m("Boolean","boolean"),4:m("Class","class"),13:m("Constant","constant"),8:m("Constructor","constructor"),9:m("Enum","enumeration"),21:m("EnumMember","enumeration member"),23:m("Event","event"),7:m("Field","field"),0:m("File","file"),11:m("Function","function"),10:m("Interface","interface"),19:m("Key","key"),5:m("Method","method"),1:m("Module","module"),2:m("Namespace","namespace"),20:m("Null","null"),15:m("Number","number"),18:m("Object","object"),24:m("Operator","operator"),3:m("Package","package"),6:m("Property","property"),14:m("String","string"),22:m("Struct","struct"),25:m("TypeParameter","type parameter"),12:m("Variable","variable")};function vve(n,e){return m("symbolAriaLabel","{0} ({1})",n,_ve[e])}var hE;(function(n){const e=new Map;e.set(0,Me.symbolFile),e.set(1,Me.symbolModule),e.set(2,Me.symbolNamespace),e.set(3,Me.symbolPackage),e.set(4,Me.symbolClass),e.set(5,Me.symbolMethod),e.set(6,Me.symbolProperty),e.set(7,Me.symbolField),e.set(8,Me.symbolConstructor),e.set(9,Me.symbolEnum),e.set(10,Me.symbolInterface),e.set(11,Me.symbolFunction),e.set(12,Me.symbolVariable),e.set(13,Me.symbolConstant),e.set(14,Me.symbolString),e.set(15,Me.symbolNumber),e.set(16,Me.symbolBoolean),e.set(17,Me.symbolArray),e.set(18,Me.symbolObject),e.set(19,Me.symbolKey),e.set(20,Me.symbolNull),e.set(21,Me.symbolEnumMember),e.set(22,Me.symbolStruct),e.set(23,Me.symbolEvent),e.set(24,Me.symbolOperator),e.set(25,Me.symbolTypeParameter);function t(i){let s=e.get(i);return s||(console.info("No codicon found for SymbolKind "+i),s=Me.symbolProperty),s}n.toIcon=t})(hE||(hE={}));class xo{static fromValue(e){switch(e){case"comment":return xo.Comment;case"imports":return xo.Imports;case"region":return xo.Region}return new xo(e)}constructor(e){this.value=e}}xo.Comment=new xo("comment");xo.Imports=new xo("imports");xo.Region=new xo("region");var G2;(function(n){function e(t){return!t||typeof t!="object"?!1:typeof t.id=="string"&&typeof t.title=="string"}n.is=e})(G2||(G2={}));var fE;(function(n){n[n.Type=1]="Type",n[n.Parameter=2]="Parameter"})(fE||(fE={}));class bve{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 nn=new gve;var Y2;(function(n){n[n.Unknown=0]="Unknown",n[n.Disabled=1]="Disabled",n[n.Enabled=2]="Enabled"})(Y2||(Y2={}));var Z2;(function(n){n[n.Invoke=1]="Invoke",n[n.Auto=2]="Auto"})(Z2||(Z2={}));var X2;(function(n){n[n.None=0]="None",n[n.KeepWhitespace=1]="KeepWhitespace",n[n.InsertAsSnippet=4]="InsertAsSnippet"})(X2||(X2={}));var Q2;(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"})(Q2||(Q2={}));var J2;(function(n){n[n.Deprecated=1]="Deprecated"})(J2||(J2={}));var eP;(function(n){n[n.Invoke=0]="Invoke",n[n.TriggerCharacter=1]="TriggerCharacter",n[n.TriggerForIncompleteCompletions=2]="TriggerForIncompleteCompletions"})(eP||(eP={}));var tP;(function(n){n[n.EXACT=0]="EXACT",n[n.ABOVE=1]="ABOVE",n[n.BELOW=2]="BELOW"})(tP||(tP={}));var iP;(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"})(iP||(iP={}));var nP;(function(n){n[n.LF=1]="LF",n[n.CRLF=2]="CRLF"})(nP||(nP={}));var sP;(function(n){n[n.Text=0]="Text",n[n.Read=1]="Read",n[n.Write=2]="Write"})(sP||(sP={}));var oP;(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"})(oP||(oP={}));var rP;(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"})(rP||(rP={}));var aP;(function(n){n[n.TextDefined=0]="TextDefined",n[n.LF=1]="LF",n[n.CRLF=2]="CRLF"})(aP||(aP={}));var lP;(function(n){n[n.LF=0]="LF",n[n.CRLF=1]="CRLF"})(lP||(lP={}));var cP;(function(n){n[n.Left=1]="Left",n[n.Right=2]="Right"})(cP||(cP={}));var dP;(function(n){n[n.None=0]="None",n[n.Indent=1]="Indent",n[n.IndentOutdent=2]="IndentOutdent",n[n.Outdent=3]="Outdent"})(dP||(dP={}));var uP;(function(n){n[n.Both=0]="Both",n[n.Right=1]="Right",n[n.Left=2]="Left",n[n.None=3]="None"})(uP||(uP={}));var hP;(function(n){n[n.Type=1]="Type",n[n.Parameter=2]="Parameter"})(hP||(hP={}));var fP;(function(n){n[n.Automatic=0]="Automatic",n[n.Explicit=1]="Explicit"})(fP||(fP={}));var gP;(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"})(gP||(gP={}));var pP;(function(n){n[n.Hint=1]="Hint",n[n.Info=2]="Info",n[n.Warning=4]="Warning",n[n.Error=8]="Error"})(pP||(pP={}));var mP;(function(n){n[n.Unnecessary=1]="Unnecessary",n[n.Deprecated=2]="Deprecated"})(mP||(mP={}));var _P;(function(n){n[n.Inline=1]="Inline",n[n.Gutter=2]="Gutter"})(_P||(_P={}));var vP;(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"})(vP||(vP={}));var bP;(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"})(bP||(bP={}));var CP;(function(n){n[n.Left=1]="Left",n[n.Center=2]="Center",n[n.Right=4]="Right",n[n.Full=7]="Full"})(CP||(CP={}));var wP;(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"})(wP||(wP={}));var yP;(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"})(yP||(yP={}));var SP;(function(n){n[n.None=0]="None",n[n.Text=1]="Text",n[n.Blocks=2]="Blocks"})(SP||(SP={}));var LP;(function(n){n[n.Smooth=0]="Smooth",n[n.Immediate=1]="Immediate"})(LP||(LP={}));var kP;(function(n){n[n.Auto=1]="Auto",n[n.Hidden=2]="Hidden",n[n.Visible=3]="Visible"})(kP||(kP={}));var DP;(function(n){n[n.LTR=0]="LTR",n[n.RTL=1]="RTL"})(DP||(DP={}));var EP;(function(n){n[n.Invoke=1]="Invoke",n[n.TriggerCharacter=2]="TriggerCharacter",n[n.ContentChange=3]="ContentChange"})(EP||(EP={}));var IP;(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"})(IP||(IP={}));var TP;(function(n){n[n.Deprecated=1]="Deprecated"})(TP||(TP={}));var xP;(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"})(xP||(xP={}));var NP;(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"})(NP||(NP={}));var AP;(function(n){n[n.AlwaysGrowsWhenTypingAtEdges=0]="AlwaysGrowsWhenTypingAtEdges",n[n.NeverGrowsWhenTypingAtEdges=1]="NeverGrowsWhenTypingAtEdges",n[n.GrowsOnlyWhenTypingBefore=2]="GrowsOnlyWhenTypingBefore",n[n.GrowsOnlyWhenTypingAfter=3]="GrowsOnlyWhenTypingAfter"})(AP||(AP={}));var MP;(function(n){n[n.None=0]="None",n[n.Same=1]="Same",n[n.Indent=2]="Indent",n[n.DeepIndent=3]="DeepIndent"})(MP||(MP={}));let rS=class{static chord(e,t){return qn(e,t)}};rS.CtrlCmd=2048;rS.Shift=1024;rS.Alt=512;rS.WinCtrl=256;function yX(){return{editor:void 0,languages:void 0,CancellationTokenSource:Tn,Emitter:j,KeyCode:gP,KeyMod:rS,Position:Y,Range:I,Selection:Je,SelectionDirection:DP,MarkerSeverity:pP,MarkerTag:mP,Uri:ct,Token:gw}}class Cve{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 HV{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}}let kg=class{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 bb;function SX(n){return!n||typeof n!="string"?!0:n.trim().length===0}const wve=/{(\d+)}/g;function sm(n,...e){return e.length===0?n:n.replace(wve,function(t,i){const s=parseInt(i,10);return isNaN(s)||s<0||s>=e.length?t:e[s]})}function gE(n){return n.replace(/[<>&]/g,function(e){switch(e){case"<":return"<";case">":return">";case"&":return"&";default:return e}})}function Xr(n){return n.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}function yve(n,e=" "){const t=aS(n,e);return LX(t,e)}function aS(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 LX(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 Sve(n){return n.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}function Lve(n){return n.replace(/\*/g,"")}function kX(n,e,t={}){if(!n)throw new Error("Cannot create regex from empty string");e||(n=Xr(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 kve(n){return n.source==="^"||n.source==="^$"||n.source==="$"||n.source==="^\\s*$"?!1:!!(n.exec("")&&n.lastIndex===0)}function Sd(n){return n.split(/\r\n|\r|\n/)}function bo(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 _w(n,e){return ne?1:0}function L8(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 RP(n,e){return lS(n,e,0,n.length,0,e.length)}function lS(n,e,t=0,i=n.length,s=0,o=e.length){for(;t=128||c>=128)return L8(n.toLowerCase(),e.toLowerCase(),t,i,s,o);Xh(l)&&(l-=32),Xh(c)&&(c-=32);const d=l-c;if(d!==0)return d}const r=i-t,a=o-s;return ra?1:0}function _L(n){return n>=48&&n<=57}function Xh(n){return n>=97&&n<=122}function Vc(n){return n>=65&&n<=90}function tv(n,e){return n.length===e.length&&lS(n,e)===0}function k8(n,e){const t=e.length;return e.length>n.length?!1:lS(n,e,0,t)===0}function om(n,e){const t=Math.min(n.length,e.length);let i;for(i=0;i1){const i=n.charCodeAt(e-2);if(es(i))return D8(i,t)}return t}class E8{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=Dve(this._str,this._offset);return this._offset-=e>=65536?2:1,e}nextCodePoint(){const e=mE(this._str,this._len,this._offset);return this._offset+=e>=65536?2:1,e}eol(){return this._offset>=this._len}}class _E{get offset(){return this._iterator.offset}constructor(e,t=0){this._iterator=new E8(e,t)}nextGraphemeLength(){const e=Qh.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($V(s,r)){t.setOffset(o);break}s=r}return t.offset-i}prevGraphemeLength(){const e=Qh.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($V(r,s)){t.setOffset(o);break}s=r}return i-t.offset}eol(){return this._iterator.eol()}}function I8(n,e){return new _E(n,e).nextGraphemeLength()}function DX(n,e){return new _E(n,e).prevGraphemeLength()}function Eve(n,e){e>0&&rm(n.charCodeAt(e))&&e--;const t=e+I8(n,e);return[t-DX(n,t),t]}let GA;function Ive(){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 Cb(n){return GA||(GA=Ive()),GA.test(n)}const Tve=/^[\t\n\r\x20-\x7E]*$/;function cS(n){return Tve.test(n)}const EX=/[\u2028\u2029]/;function IX(n){return EX.test(n)}function zf(n){return n>=11904&&n<=55215||n>=63744&&n<=64255||n>=65281&&n<=65374}function T8(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 xve=String.fromCharCode(65279);function x8(n){return!!(n&&n.length>0&&n.charCodeAt(0)===65279)}function Nve(n,e=!1){return n?(e&&(n=n.replace(/\\./g,"")),n.toLowerCase()!==n):!1}function TX(n){return n=n%(2*26),n<26?String.fromCharCode(97+n):String.fromCharCode(65+n-26)}function $V(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 Qh{static getInstance(){return Qh._INSTANCE||(Qh._INSTANCE=new Qh),Qh._INSTANCE}constructor(){this._data=Ave()}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}}Qh._INSTANCE=null;function Ave(){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 Mve(n,e){if(n===0)return 0;const t=Rve(n,e);if(t!==void 0)return t;const i=new E8(e,n);return i.prevCodePoint(),i.offset}function Rve(n,e){const t=new E8(e,n);let i=t.prevCodePoint();for(;Pve(i)||i===65039||i===8419;){if(t.offset===0)return;i=t.prevCodePoint()}if(!T8(i))return;let s=t.offset;return s>0&&t.prevCodePoint()===8205&&(s=t.offset),s}function Pve(n){return 127995<=n&&n<=127999}const xX=" ";class am{static getInstance(e){return bb.cache.get(Array.from(e))}static getLocales(){return bb._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())}}bb=am;am.ambiguousCharacterData=new kg(()=>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]}'));am.cache=new Cve(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 bb(l)});am._locales=new kg(()=>Object.keys(bb.ambiguousCharacterData.value).filter(n=>!n.startsWith("_")));class pd{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(pd.getRawData())),this._data}static isInvisibleCharacter(e){return pd.getData().has(e)}static get codePoints(){return pd.getData()}}pd._data=void 0;class PP{constructor(){this._zoomFactor=1}getZoomFactor(){return this._zoomFactor}}PP.INSTANCE=new PP;class Ove extends te{constructor(){super(),this._onDidChange=this._register(new j),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: ".concat(window.devicePixelRatio,"dppx)")),this._mediaQueryList.addEventListener("change",this._listener),e&&this._onDidChange.fire()}}class Fve extends te{get value(){return this._value}constructor(){super(),this._onDidChange=this._register(new j),this.onDidChange=this._onDidChange.event,this._value=this._getPixelRatio();const e=this._register(new Ove);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 Bve{constructor(){this._pixelRatioMonitor=null}_getOrCreatePixelRatioMonitor(){return this._pixelRatioMonitor||(this._pixelRatioMonitor=new Fve),this._pixelRatioMonitor}get value(){return this._getOrCreatePixelRatioMonitor().value}get onDidChange(){return this._getOrCreatePixelRatioMonitor().onDidChange}}function NX(n,e){typeof n=="string"&&(n=window.matchMedia(n)),n.addEventListener("change",e)}const vw=new Bve;function Wve(){return PP.INSTANCE.getZoomFactor()}const y0=navigator.userAgent,Ta=y0.indexOf("Firefox")>=0,Hp=y0.indexOf("AppleWebKit")>=0,N8=y0.indexOf("Chrome")>=0,qu=!N8&&y0.indexOf("Safari")>=0,AX=!N8&&!qu&&Hp;y0.indexOf("Electron/")>=0;const zV=y0.indexOf("Android")>=0;let sD=!1;if(window.matchMedia){const n=window.matchMedia("(display-mode: standalone) or (display-mode: window-controls-overlay)"),e=window.matchMedia("(display-mode: fullscreen)");sD=n.matches,NX(n,({matches:t})=>{sD&&e.matches||(sD=t)})}function Vve(){return sD}class MX{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=El(e);this._maxWidth!==t&&(this._maxWidth=t,this.domNode.style.maxWidth=this._maxWidth)}setWidth(e){const t=El(e);this._width!==t&&(this._width=t,this.domNode.style.width=this._width)}setHeight(e){const t=El(e);this._height!==t&&(this._height=t,this.domNode.style.height=this._height)}setTop(e){const t=El(e);this._top!==t&&(this._top=t,this.domNode.style.top=this._top)}setLeft(e){const t=El(e);this._left!==t&&(this._left=t,this.domNode.style.left=this._left)}setBottom(e){const t=El(e);this._bottom!==t&&(this._bottom=t,this.domNode.style.bottom=this._bottom)}setRight(e){const t=El(e);this._right!==t&&(this._right=t,this.domNode.style.right=this._right)}setPaddingLeft(e){const t=El(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=El(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=El(e);this._lineHeight!==t&&(this._lineHeight=t,this.domNode.style.lineHeight=this._lineHeight)}setLetterSpacing(e){const t=El(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 El(n){return typeof n=="number"?"".concat(n,"px"):n}function ci(n){return new MX(n)}function Vs(n,e){n instanceof MX?(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 Hve{constructor(e,t){this.chr=e,this.type=t,this.width=0}fulfill(e){this.width=e}}class A8{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");Vs(t,this._bareFontInfo),e.appendChild(t);const i=document.createElement("div");Vs(i,this._bareFontInfo),i.style.fontWeight="bold",e.appendChild(i);const s=document.createElement("div");Vs(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");A8._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 OP({pixelRatio:vw.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 Hve(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),C=this._createRequest("·",0,t,i),w=this._createRequest(String.fromCharCode(11825),0,t,null),y="|/-_ilm%";for(let x=0,A=y.length;x.001){S=!1;break}}let D=!0;return S&&b.width!==k&&(D=!1),b.width>v.width&&(D=!1),new OP({pixelRatio:vw.value,fontFamily:e.fontFamily,fontWeight:e.fontWeight,fontSize:e.fontSize,fontFeatureSettings:e.fontFeatureSettings,fontVariationSettings:e.fontVariationSettings,lineHeight:e.lineHeight,letterSpacing:e.letterSpacing,isMonospace:S,typicalHalfwidthCharacterWidth:s.width,typicalFullwidthCharacterWidth:o.width,canUseHalfwidthRightwardsArrow:D,spaceWidth:r.width,middotWidth:C.width,wsmiddotWidth:w.width,maxDigitWidth:L},!0)}}class UV{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 FP=new jve;var Ql;(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})(Ql||(Ql={}));const _t=Wt("instantiationService");function Kve(n,e,t){e[Ql.DI_TARGET]===e?e[Ql.DI_DEPENDENCIES].push({id:n,index:t}):(e[Ql.DI_DEPENDENCIES]=[{id:n,index:t}],e[Ql.DI_TARGET]=e)}function Wt(n){if(Ql.serviceIds.has(n))return Ql.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");Kve(e,t,s)};return e.toString=()=>n,Ql.serviceIds.set(n,e),e}const ai=Wt("codeEditorService"),Zi=Wt("modelService"),sr=Wt("textModelService");var wb=globalThis&&globalThis.__awaiter||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 Ro extends te{constructor(e,t="",i="",s=!0,o){super(),this._onDidChange=this._register(new j),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 wb(this,void 0,void 0,function*(){this._actionCallback&&(yield this._actionCallback(e))})}}class yb extends te{constructor(){super(...arguments),this._onWillRun=this._register(new j),this.onWillRun=this._onWillRun.event,this._onDidRun=this._register(new j),this.onDidRun=this._onDidRun.event}run(e,t){return wb(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 wb(this,void 0,void 0,function*(){yield e.run(t)})}}class hs{constructor(){this.id=hs.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 hs,...i]:t=i);return t}run(){return wb(this,void 0,void 0,function*(){})}}hs.ID="vs.actions.separator";class Sb{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 wb(this,void 0,void 0,function*(){})}}class KT extends Ro{constructor(){super(KT.ID,m("submenu.empty","(empty)"),void 0,!1)}}KT.ID="vs.actions.empty";function Bv(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)=>wb(this,void 0,void 0,function*(){return n.run(...i)}),tooltip:n.label}}var BP;(function(n){function e(t){return t&&typeof t=="object"&&typeof t.id=="string"}n.isThemeColor=e})(BP||(BP={}));var dt;(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("^(".concat(n.iconNameExpression,")(").concat(n.iconModifierExpression,")?$"));function t(h){const f=e.exec(h.id);if(!f)return t(Me.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"||BP.isThemeColor(h.color))}n.isThemeIcon=o;const r=new RegExp("^\\$\\((".concat(n.iconNameExpression,"(?:").concat(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="".concat(g,"~").concat(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})(dt||(dt={}));const gn=Wt("commandService"),qt=new class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new j,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 Ime(c,r),a(l,...c)}}const{id:t}=n;let i=this._commands.get(t);i||(i=new To,this._commands.set(t,i));const s=i.unshift(n),o=vt(()=>{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(gn).executeCommand(e,...i))}getCommand(n){const e=this._commands.get(n);if(!(!e||e.isEmpty()))return Pt.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 ZA(...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 qve=m("contextkey.scanner.hint.didYouForgetToOpenOrCloseQuote","Did you forget to open or close the quote?"),Gve=m("contextkey.scanner.hint.didYouForgetToEscapeSlash","Did you forget to escape the '/' (slash) character? Put two backslashes before it to escape, e.g., '\\\\/'.");let fp=class WP{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 m8("unhandled token type: ".concat(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(ZA("==","=~"));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(ZA("&&"));break;case 124:this._match(124)?this._addToken(16):this._error(ZA("||"));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=WP._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(qve);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(Gve);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}};fp._regexFlags=new Set(["i","g","s","m","y","u"].map(n=>n.charCodeAt(0)));fp._keywords=new Map([["not",14],["in",13],["false",12],["true",11]]);const oo=new Map;oo.set("false",!1);oo.set("true",!0);oo.set("isMac",Kt);oo.set("isLinux",Co);oo.set("isWindows",zs);oo.set("isWeb",yg);oo.set("isMacNative",Kt&&!yg);oo.set("isEdge",Ume);oo.set("isFirefox",$me);oo.set("isChrome",tX);oo.set("isSafari",zme);const Yve=Object.prototype.hasOwnProperty,Zve={regexParsingWithErrorRecovery:!0},Xve=m("contextkey.parser.error.emptyString","Empty context key expression"),Qve=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."),Jve=m("contextkey.parser.error.noInAfterNot","'in' after 'not'."),jV=m("contextkey.parser.error.closingParenthesis","closing parenthesis ')'"),ebe=m("contextkey.parser.error.unexpectedToken","Unexpected token"),tbe=m("contextkey.parser.error.unexpectedToken.hint","Did you forget to put && or || before the token?"),ibe=m("contextkey.parser.error.unexpectedEOF","Unexpected end of expression"),nbe=m("contextkey.parser.error.unexpectedEOF.hint","Did you forget to put a context key?");let RX=class O1{constructor(e=Zve){this._config=e,this._scanner=new fp,this._tokens=[],this._current=0,this._parsingErrors=[],this._flagsGYRe=/g|y/g}parse(e){if(e===""){this._parsingErrors.push({message:Xve,offset:0,lexeme:"",additionalInfo:Qve});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?tbe:void 0;throw this._parsingErrors.push({message:ebe,offset:i.offset,lexeme:fp.getLexeme(i),additionalInfo:s}),O1._parseError}return t}catch(t){if(t!==O1._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]:fe.or(...e)}_and(){const e=[this._term()];for(;this._matchOne(15);){const t=this._term();e.push(t)}return e.length===1?e[0]:fe.and(...e)}_term(){if(this._matchOne(2)){const e=this._peek();switch(e.type){case 11:return this._advance(),Po.INSTANCE;case 12:return this._advance(),Jo.INSTANCE;case 0:{this._advance();const t=this._expr();return this._consume(1,jV),t==null?void 0:t.negate()}case 17:return this._advance(),qm.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(),fe.true();case 12:return this._advance(),fe.false();case 0:{this._advance();const t=this._expr();return this._consume(1,jV),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 bw.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 bw.create(t,r)}default:throw this._errExpectedButGot("REGEX",this._peek())}}if(this._matchOne(14)){this._consume(13,Jve);const s=this._value();return fe.notIn(t,s)}switch(this._peek().type){case 3:{this._advance();const s=this._value();if(this._previous().type===18)return fe.equals(t,s);switch(s){case"true":return fe.has(t);case"false":return fe.not(t);default:return fe.equals(t,s)}}case 4:{this._advance();const s=this._value();if(this._previous().type===18)return fe.notEquals(t,s);switch(s){case"true":return fe.not(t);case"false":return fe.has(t);default:return fe.notEquals(t,s)}}case 5:return this._advance(),JT.create(t,this._value());case 6:return this._advance(),ex.create(t,this._value());case 7:return this._advance(),XT.create(t,this._value());case 8:return this._advance(),QT.create(t,this._value());case 13:return this._advance(),fe.in(t,this._value());default:return fe.has(t)}}case 20:throw this._parsingErrors.push({message:ibe,offset:e.offset,lexeme:"",additionalInfo:nbe}),O1._parseError;default:throw this._errExpectedButGot("true | false | KEY \n | KEY '=~' REGEX \n | 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}\nReceived: '{1}'.",e,fp.getLexeme(t)),o=t.offset,r=fp.getLexeme(t);return this._parsingErrors.push({message:s,offset:o,lexeme:r,additionalInfo:i}),O1._parseError}_check(e){return this._peek().type===e}_peek(){return this._tokens[this._current]}_isAtEnd(){return this._peek().type===20}};RX._parseError=new Error;class fe{static false(){return Po.INSTANCE}static true(){return Jo.INSTANCE}static has(e){return Km.create(e)}static equals(e,t){return S0.create(e,t)}static notEquals(e,t){return YT.create(e,t)}static regex(e,t){return bw.create(e,t)}static in(e,t){return qT.create(e,t)}static notIn(e,t){return GT.create(e,t)}static not(e){return qm.create(e)}static and(...e){return Dp.create(e,null,!0)}static or(...e){return mu.create(e,null,!0)}static deserialize(e){return e==null?void 0:this._parser.parse(e)}}fe._parser=new RX({regexParsingWithErrorRecovery:!1});function sbe(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 mC(n,e){return n.cmp(e)}class Po{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 Jo.INSTANCE}}Po.INSTANCE=new Po;class Jo{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 Po.INSTANCE}}Jo.INSTANCE=new Jo;class Km{static create(e,t=null){const i=oo.get(e);return typeof i=="boolean"?i?Jo.INSTANCE:Po.INSTANCE:new Km(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:OX(this.key,e.key)}equals(e){return e.type===this.type?this.key===e.key:!1}substituteConstants(){const e=oo.get(this.key);return typeof e=="boolean"?e?Jo.INSTANCE:Po.INSTANCE:this}evaluate(e){return!!e.getValue(this.key)}serialize(){return this.key}keys(){return[this.key]}negate(){return this.negated||(this.negated=qm.create(this.key,this)),this.negated}}class S0{static create(e,t,i=null){if(typeof t=="boolean")return t?Km.create(e,i):qm.create(e,i);const s=oo.get(e);return typeof s=="boolean"?t===(s?"true":"false")?Jo.INSTANCE:Po.INSTANCE:new S0(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:Gm(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=oo.get(this.key);if(typeof e=="boolean"){const t=e?"true":"false";return this.value===t?Jo.INSTANCE:Po.INSTANCE}return this}evaluate(e){return e.getValue(this.key)==this.value}serialize(){return"".concat(this.key," == '").concat(this.value,"'")}keys(){return[this.key]}negate(){return this.negated||(this.negated=YT.create(this.key,this.value,this)),this.negated}}class qT{static create(e,t){return new qT(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:Gm(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?Yve.call(t,i):!1}serialize(){return"".concat(this.key," in '").concat(this.valueKey,"'")}keys(){return[this.key,this.valueKey]}negate(){return this.negated||(this.negated=GT.create(this.key,this.valueKey)),this.negated}}class GT{static create(e,t){return new GT(e,t)}constructor(e,t){this.key=e,this.valueKey=t,this.type=11,this._negated=qT.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"".concat(this.key," not in '").concat(this.valueKey,"'")}keys(){return this._negated.keys()}negate(){return this._negated}}class YT{static create(e,t,i=null){if(typeof t=="boolean")return t?qm.create(e,i):Km.create(e,i);const s=oo.get(e);return typeof s=="boolean"?t===(s?"true":"false")?Po.INSTANCE:Jo.INSTANCE:new YT(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:Gm(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=oo.get(this.key);if(typeof e=="boolean"){const t=e?"true":"false";return this.value===t?Po.INSTANCE:Jo.INSTANCE}return this}evaluate(e){return e.getValue(this.key)!=this.value}serialize(){return"".concat(this.key," != '").concat(this.value,"'")}keys(){return[this.key]}negate(){return this.negated||(this.negated=S0.create(this.key,this.value,this)),this.negated}}class qm{static create(e,t=null){const i=oo.get(e);return typeof i=="boolean"?i?Po.INSTANCE:Jo.INSTANCE:new qm(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:OX(this.key,e.key)}equals(e){return e.type===this.type?this.key===e.key:!1}substituteConstants(){const e=oo.get(this.key);return typeof e=="boolean"?e?Po.INSTANCE:Jo.INSTANCE:this}evaluate(e){return!e.getValue(this.key)}serialize(){return"!".concat(this.key)}keys(){return[this.key]}negate(){return this.negated||(this.negated=Km.create(this.key,this)),this.negated}}function ZT(n,e){if(typeof n=="string"){const t=parseFloat(n);isNaN(t)||(n=t)}return typeof n=="string"||typeof n=="number"?e(n):Po.INSTANCE}class XT{static create(e,t,i=null){return ZT(t,s=>new XT(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:Gm(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"".concat(this.key," > ").concat(this.value)}keys(){return[this.key]}negate(){return this.negated||(this.negated=ex.create(this.key,this.value,this)),this.negated}}class QT{static create(e,t,i=null){return ZT(t,s=>new QT(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:Gm(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"".concat(this.key," >= ").concat(this.value)}keys(){return[this.key]}negate(){return this.negated||(this.negated=JT.create(this.key,this.value,this)),this.negated}}class JT{static create(e,t,i=null){return ZT(t,s=>new JT(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:Gm(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 ex(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:Gm(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"".concat(this.key," <= ").concat(this.value)}keys(){return[this.key]}negate(){return this.negated||(this.negated=XT.create(this.key,this.value,this)),this.negated}}class bw{static create(e,t){return new bw(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?"/".concat(this.regexp.source,"/").concat(this.regexp.flags):"/invalid/";return"".concat(this.key," =~ ").concat(e)}keys(){return[this.key]}negate(){return this.negated||(this.negated=M8.create(this)),this.negated}}class M8{static create(e){return new M8(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"!(".concat(this._actual.serialize(),")")}keys(){return this._actual.keys()}negate(){return this._actual}}function PX(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=mu.create(r.expr.map(d=>Dp.create([d,a],null,i)),null,l);c&&(s.push(c),s.sort(mC))}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=mu.create(e,this,!0)}return this.negated}}class mu{static create(e,t,i){return mu._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 qV(t))for(const r of qV(i))s.push(Dp.create([o,r],null,!1));e.unshift(mu.create(s,null,!1))}this.negated=mu.create(e,this,!0)}return this.negated}}class Ve extends Km{static all(){return Ve._info.values()}constructor(e,t,i){super(e,null),this._defaultValue=t,typeof i=="object"?Ve._info.push(Object.assign(Object.assign({},i),{key:e})):i!==!0&&Ve._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 S0.create(this.key,e)}}Ve._info=[];const bt=Wt("contextKeyService");function OX(n,e){return ne?1:0}function Gm(n,e,t,i){return nt?1:ei?1:0}function VP(n,e){if(n.type===0||e.type===1)return!0;if(n.type===9)return e.type===9?KV(n.expr,e.expr):!1;if(e.type===9){for(const t of e.expr)if(VP(n,t))return!0;return!1}if(n.type===6){if(e.type===6)return KV(e.expr,n.expr);for(const t of n.expr)if(VP(t,e))return!0;return!1}return n.equals(e)}function KV(n,e){let t=0,i=0;for(;t>>0,i=(n&4294901760)>>>16;return i!==0?new XA([vL(t,e),vL(i,e)]):new XA([vL(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(cbe)),this._cachedMergedKeybindings.slice(0)}}const er=new R8,lbe={EditorModes:"platform.keybindingsRegistry"};en.add(lbe.EditorModes,er);function cbe(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 dbe=globalThis&&globalThis.__decorate||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},GV=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},ube=globalThis&&globalThis.__rest||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}}_u._all=new Map;const Ls=new class{constructor(){this._commands=new Map,this._menuItems=new Map,this._onDidChangeMenu=new j_e({merge:_u.merge}),this.onDidChangeMenu=this._onDidChangeMenu.event}addCommand(n){return this._commands.set(n.id,n),this._onDidChangeMenu.fire(_u.for(M.CommandPalette)),vt(()=>{this._commands.delete(n.id)&&this._onDidChangeMenu.fire(_u.for(M.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 To,this._menuItems.set(n,t));const i=t.push(e);return this._onDidChangeMenu.fire(_u.for(n)),vt(()=>{i(),this._onDidChangeMenu.fire(_u.for(n))})}appendMenuItems(n){const e=new be;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===M.CommandPalette&&this._appendImplicitItems(e),e}_appendImplicitItems(n){const e=new Set;for(const t of n)iv(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 ww extends Sb{constructor(e,t,i){super("submenuitem.".concat(e.submenu.id),typeof e.title=="string"?e.title:e.title.value,i,"submenu"),this.item=e,this.hideActions=t}}let fl=oD=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=oD.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&&dt.isThemeIcon(d.icon)&&(c=d.icon),this.checked&&d.title&&(this.label=typeof d.title=="string"?d.title:d.title.value)}c||(c=dt.isThemeIcon(e.icon)?e.icon:void 0),this.item=e,this.alt=t?new oD(t,void 0,i,s,o,r):void 0,this._options=i,this.class=c&&dt.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)}};fl=oD=dbe([GV(4,bt),GV(5,gn)],fl);class oa{constructor(e){this.desc=e}}function Ui(n){const e=new be,t=new n,i=t.desc,{f1:s,menu:o,keybinding:r,description:a}=i,l=ube(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(Ls.appendMenuItem(c.id,Object.assign({command:Object.assign(Object.assign({},l),{precondition:c.precondition===null?void 0:l.precondition})},c)));else o&&e.add(Ls.appendMenuItem(o.id,Object.assign({command:Object.assign(Object.assign({},l),{precondition:o.precondition===null?void 0:l.precondition})},o)));if(s&&(e.add(Ls.appendMenuItem(M.CommandPalette,{command:l,when:l.precondition})),e.add(Ls.addCommand(l))),Array.isArray(r))for(const c of r)e.add(er.registerKeybindingRule(Object.assign(Object.assign({},c),{id:l.id,when:l.precondition?fe.and(l.precondition,c.when):c.when})));else r&&e.add(er.registerKeybindingRule(Object.assign(Object.assign({},r),{id:l.id,when:l.precondition?fe.and(l.precondition,r.when):r.when})));return e}const ra=Wt("telemetryService"),aa=Wt("logService");var Os;(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"})(Os||(Os={}));const BX=Os.Info;class WX extends te{constructor(){super(...arguments),this.level=BX,this._onDidChangeLogLevel=this._register(new j),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!==Os.Off&&this.level<=e}}class fbe extends WX{constructor(e=BX,t=!0){super(),this.useColors=t,this.setLevel(e)}trace(e,...t){this.checkLogLevel(Os.Trace)&&(this.useColors?console.log("%cTRACE","color: #888",e,...t):console.log(e,...t))}debug(e,...t){this.checkLogLevel(Os.Debug)&&(this.useColors?console.log("%cDEBUG","background: #eee; color: #888",e,...t):console.log(e,...t))}info(e,...t){this.checkLogLevel(Os.Info)&&(this.useColors?console.log("%c INFO","color: #33f",e,...t):console.log(e,...t))}warn(e,...t){this.checkLogLevel(Os.Warning)&&(this.useColors?console.log("%c WARN","color: #993",e,...t):console.log(e,...t))}error(e,...t){this.checkLogLevel(Os.Error)&&(this.useColors?console.log("%c ERR","color: #f33",e,...t):console.error(e,...t))}dispose(){}}class gbe extends WX{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 pbe(n){switch(n){case Os.Trace:return"trace";case Os.Debug:return"debug";case Os.Info:return"info";case Os.Warning:return"warn";case Os.Error:return"error";case Os.Off:return"off"}}new Ve("logLevel",pbe(Os.Info));const P8={clipboard:{writeText:nc||document.queryCommandSupported&&document.queryCommandSupported("copy")||!!(navigator&&navigator.clipboard&&navigator.clipboard.writeText),readText:nc||!!(navigator&&navigator.clipboard&&navigator.clipboard.readText)},keyboard:(()=>nc||Vve()?0:navigator.keyboard||qu?1:2)(),touch:"ontouchstart"in window||navigator.maxTouchPoints>0,pointerEvents:window.PointerEvent&&("ontouchstart"in window||window.navigator.maxTouchPoints>0||navigator.maxTouchPoints>0)};function mbe(n){if(n.charCode){const t=String.fromCharCode(n.charCode).toUpperCase();return pu.fromString(t)}const e=n.keyCode;if(e===3)return 7;if(Ta)switch(e){case 59:return 85;case 60:if(Co)return 97;break;case 61:return 86;case 107:return 109;case 109:return 111;case 173:return 88;case 224:if(Kt)return 57;break}else if(Hp){if(Kt&&e===93)return 57;if(!Kt&&e===92)return 57}return uX[e]||0}const _be=Kt?256:2048,vbe=512,bbe=1024,Cbe=Kt?2048:256;class Oi{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=mbe(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|=_be),this.altKey&&(t|=vbe),this.shiftKey&&(t|=bbe),this.metaKey&&(t|=Cbe),t|=e,t}_computeKeyCodeChord(){let e=0;return this.keyCode!==5&&this.keyCode!==4&&this.keyCode!==6&&this.keyCode!==57&&(e=this.keyCode),new Gu(this.ctrlKey,this.shiftKey,this.altKey,this.metaKey,e)}}let YV=!1,J0=null;function wbe(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 YV=!0,null}catch{return YV=!0,null}return n.parent}class ybe{static getSameOriginWindowChain(){if(!J0){J0=[];let e=window,t;do t=wbe(e),t?J0.push({window:e,iframeElement:e.frameElement||null}):J0.push({window:e,iframeElement:null}),e=t;while(e)}return J0.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 ba{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=ybe.getPositionOfChildWindowRelativeToAncestorWindow(window,e.view);this.posx-=t.left,this.posy-=t.top}preventDefault(){this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent.stopPropagation()}}class lm{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?Ta&&!Kt?this.deltaY=-e.deltaY/3:this.deltaY=-e.deltaY:this.deltaY=-e.deltaY/40}if(typeof s.wheelDeltaX<"u")qu&&zs?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?Ta&&!Kt?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:VX,setPrototypeOf:ZV,isFrozen:Sbe,getPrototypeOf:Lbe,getOwnPropertyDescriptor:kbe}=Object;let{freeze:kr,seal:hc,create:Dbe}=Object,{apply:$P,construct:zP}=typeof Reflect<"u"&&Reflect;$P||($P=function(e,t,i){return e.apply(t,i)});kr||(kr=function(e){return e});hc||(hc=function(e){return e});zP||(zP=function(e,t){return new e(...t)});const Ebe=gl(Array.prototype.forEach),XV=gl(Array.prototype.pop),e1=gl(Array.prototype.push),rD=gl(String.prototype.toLowerCase),JA=gl(String.prototype.toString),Ibe=gl(String.prototype.match),Il=gl(String.prototype.replace),Tbe=gl(String.prototype.indexOf),xbe=gl(String.prototype.trim),da=gl(RegExp.prototype.test),t1=Nbe(TypeError);function gl(n){return function(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),s=1;s/gm),Obe=hc(/\${[\w\W]*}/gm),Fbe=hc(/^data-[\-\w.\u00B7-\uFFFF]/),Bbe=hc(/^aria-[\-\w]+$/),HX=hc(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Wbe=hc(/^(?:\w+script|data):/i),Vbe=hc(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),$X=hc(/^html$/i);var iH=Object.freeze({__proto__:null,MUSTACHE_EXPR:Rbe,ERB_EXPR:Pbe,TMPLIT_EXPR:Obe,DATA_ATTR:Fbe,ARIA_ATTR:Bbe,IS_ALLOWED_URI:HX,IS_SCRIPT_OR_DATA:Wbe,ATTR_WHITESPACE:Vbe,DOCTYPE_NAME:$X});const Hbe=()=>typeof window>"u"?null:window,$be=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 zX(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Hbe();const e=Rt=>zX(Rt);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=bL(g,"cloneNode"),_=bL(g,"nextSibling"),v=bL(g,"childNodes"),b=bL(g,"parentNode");if(typeof r=="function"){const Rt=s.createElement("template");Rt.content&&Rt.content.ownerDocument&&(s=Rt.content.ownerDocument)}let C,w="";const{implementation:y,createNodeIterator:L,createDocumentFragment:S,getElementsByTagName:k}=s,{importNode:D}=t;let x={};e.isSupported=typeof VX=="function"&&typeof b=="function"&&y&&y.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:A,ERB_EXPR:T,TMPLIT_EXPR:P,DATA_ATTR:W,ARIA_ATTR:$,IS_SCRIPT_OR_DATA:X,ATTR_WHITESPACE:J}=iH;let{IS_ALLOWED_URI:Q}=iH,le=null;const de=vi({},[...QV,...eM,...tM,...iM,...JV]);let _e=null;const ie=vi({},[...eH,...nM,...tH,...CL]);let ne=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}})),Ye=null,pe=null,Ee=!0,ze=!0,It=!1,Ke=!0,Xe=!1,je=!1,Z=!1,z=!1,ae=!1,we=!1,Ne=!1,Ce=!0,Be=!1;const Ae="user-content-";let K=!0,V=!1,G={},N=null;const R=vi({},["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 U=null;const H=vi({},["audio","video","img","source","image","track"]);let he=null;const Le=vi({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),qe="http://www.w3.org/1998/Math/MathML",ot="http://www.w3.org/2000/svg",yt="http://www.w3.org/1999/xhtml";let Et=yt,gi=!1,_i=null;const ft=vi({},[qe,ot,yt],JA);let Ci;const Xi=["application/xhtml+xml","text/html"],za="text/html";let ui,Gn=null;const Bg=s.createElement("form"),Wg=function(ue){return ue instanceof RegExp||ue instanceof Function},Dl=function(ue){if(!(Gn&&Gn===ue)){if((!ue||typeof ue!="object")&&(ue={}),ue=C_(ue),Ci=Xi.indexOf(ue.PARSER_MEDIA_TYPE)===-1?Ci=za:Ci=ue.PARSER_MEDIA_TYPE,ui=Ci==="application/xhtml+xml"?JA:rD,le="ALLOWED_TAGS"in ue?vi({},ue.ALLOWED_TAGS,ui):de,_e="ALLOWED_ATTR"in ue?vi({},ue.ALLOWED_ATTR,ui):ie,_i="ALLOWED_NAMESPACES"in ue?vi({},ue.ALLOWED_NAMESPACES,JA):ft,he="ADD_URI_SAFE_ATTR"in ue?vi(C_(Le),ue.ADD_URI_SAFE_ATTR,ui):Le,U="ADD_DATA_URI_TAGS"in ue?vi(C_(H),ue.ADD_DATA_URI_TAGS,ui):H,N="FORBID_CONTENTS"in ue?vi({},ue.FORBID_CONTENTS,ui):R,Ye="FORBID_TAGS"in ue?vi({},ue.FORBID_TAGS,ui):{},pe="FORBID_ATTR"in ue?vi({},ue.FORBID_ATTR,ui):{},G="USE_PROFILES"in ue?ue.USE_PROFILES:!1,Ee=ue.ALLOW_ARIA_ATTR!==!1,ze=ue.ALLOW_DATA_ATTR!==!1,It=ue.ALLOW_UNKNOWN_PROTOCOLS||!1,Ke=ue.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Xe=ue.SAFE_FOR_TEMPLATES||!1,je=ue.WHOLE_DOCUMENT||!1,ae=ue.RETURN_DOM||!1,we=ue.RETURN_DOM_FRAGMENT||!1,Ne=ue.RETURN_TRUSTED_TYPE||!1,z=ue.FORCE_BODY||!1,Ce=ue.SANITIZE_DOM!==!1,Be=ue.SANITIZE_NAMED_PROPS||!1,K=ue.KEEP_CONTENT!==!1,V=ue.IN_PLACE||!1,Q=ue.ALLOWED_URI_REGEXP||HX,Et=ue.NAMESPACE||yt,ne=ue.CUSTOM_ELEMENT_HANDLING||{},ue.CUSTOM_ELEMENT_HANDLING&&Wg(ue.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(ne.tagNameCheck=ue.CUSTOM_ELEMENT_HANDLING.tagNameCheck),ue.CUSTOM_ELEMENT_HANDLING&&Wg(ue.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(ne.attributeNameCheck=ue.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),ue.CUSTOM_ELEMENT_HANDLING&&typeof ue.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(ne.allowCustomizedBuiltInElements=ue.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Xe&&(ze=!1),we&&(ae=!0),G&&(le=vi({},[...JV]),_e=[],G.html===!0&&(vi(le,QV),vi(_e,eH)),G.svg===!0&&(vi(le,eM),vi(_e,nM),vi(_e,CL)),G.svgFilters===!0&&(vi(le,tM),vi(_e,nM),vi(_e,CL)),G.mathMl===!0&&(vi(le,iM),vi(_e,tH),vi(_e,CL))),ue.ADD_TAGS&&(le===de&&(le=C_(le)),vi(le,ue.ADD_TAGS,ui)),ue.ADD_ATTR&&(_e===ie&&(_e=C_(_e)),vi(_e,ue.ADD_ATTR,ui)),ue.ADD_URI_SAFE_ATTR&&vi(he,ue.ADD_URI_SAFE_ATTR,ui),ue.FORBID_CONTENTS&&(N===R&&(N=C_(N)),vi(N,ue.FORBID_CONTENTS,ui)),K&&(le["#text"]=!0),je&&vi(le,["html","head","body"]),le.table&&(vi(le,["tbody"]),delete Ye.tbody),ue.TRUSTED_TYPES_POLICY){if(typeof ue.TRUSTED_TYPES_POLICY.createHTML!="function")throw t1('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof ue.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw t1('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');C=ue.TRUSTED_TYPES_POLICY,w=C.createHTML("")}else C===void 0&&(C=$be(f,i)),C!==null&&typeof w=="string"&&(w=C.createHTML(""));kr&&kr(ue),Gn=ue}},uh=vi({},["mi","mo","mn","ms","mtext"]),Vg=vi({},["foreignobject","desc","title","annotation-xml"]),Hg=vi({},["title","style","font","a","script"]),p_=vi({},eM);vi(p_,tM),vi(p_,Abe);const $g=vi({},iM);vi($g,Mbe);const yA=function(ue){let it=b(ue);(!it||!it.tagName)&&(it={namespaceURI:Et,tagName:"template"});const Ct=rD(ue.tagName),pn=rD(it.tagName);return _i[ue.namespaceURI]?ue.namespaceURI===ot?it.namespaceURI===yt?Ct==="svg":it.namespaceURI===qe?Ct==="svg"&&(pn==="annotation-xml"||uh[pn]):!!p_[Ct]:ue.namespaceURI===qe?it.namespaceURI===yt?Ct==="math":it.namespaceURI===ot?Ct==="math"&&Vg[pn]:!!$g[Ct]:ue.namespaceURI===yt?it.namespaceURI===ot&&!Vg[pn]||it.namespaceURI===qe&&!uh[pn]?!1:!$g[Ct]&&(Hg[Ct]||!p_[Ct]):!!(Ci==="application/xhtml+xml"&&_i[ue.namespaceURI]):!1},Lc=function(ue){e1(e.removed,{element:ue});try{ue.parentNode.removeChild(ue)}catch{ue.remove()}},q0=function(ue,it){try{e1(e.removed,{attribute:it.getAttributeNode(ue),from:it})}catch{e1(e.removed,{attribute:null,from:it})}if(it.removeAttribute(ue),ue==="is"&&!_e[ue])if(ae||we)try{Lc(it)}catch{}else try{it.setAttribute(ue,"")}catch{}},G0=function(ue){let it,Ct;if(z)ue=""+ue;else{const Ua=Ibe(ue,/^[\r\n\t ]+/);Ct=Ua&&Ua[0]}Ci==="application/xhtml+xml"&&Et===yt&&(ue=''+ue+"");const pn=C?C.createHTML(ue):ue;if(Et===yt)try{it=new h().parseFromString(pn,Ci)}catch{}if(!it||!it.documentElement){it=y.createDocument(Et,"template",null);try{it.documentElement.innerHTML=gi?w:pn}catch{}}const ao=it.body||it.documentElement;return ue&&Ct&&ao.insertBefore(s.createTextNode(Ct),ao.childNodes[0]||null),Et===yt?k.call(it,je?"html":"body")[0]:je?it.documentElement:ao},tL=function(ue){return L.call(ue.ownerDocument||ue,ue,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT,null,!1)},Mce=function(ue){return ue instanceof u&&(typeof ue.nodeName!="string"||typeof ue.textContent!="string"||typeof ue.removeChild!="function"||!(ue.attributes instanceof d)||typeof ue.removeAttribute!="function"||typeof ue.setAttribute!="function"||typeof ue.namespaceURI!="string"||typeof ue.insertBefore!="function"||typeof ue.hasChildNodes!="function")},iL=function(ue){return typeof a=="object"?ue instanceof a:ue&&typeof ue=="object"&&typeof ue.nodeType=="number"&&typeof ue.nodeName=="string"},Ud=function(ue,it,Ct){x[ue]&&Ebe(x[ue],pn=>{pn.call(e,it,Ct,Gn)})},X6=function(ue){let it;if(Ud("beforeSanitizeElements",ue,null),Mce(ue))return Lc(ue),!0;const Ct=ui(ue.nodeName);if(Ud("uponSanitizeElement",ue,{tagName:Ct,allowedTags:le}),ue.hasChildNodes()&&!iL(ue.firstElementChild)&&(!iL(ue.content)||!iL(ue.content.firstElementChild))&&da(/<[/\w]/g,ue.innerHTML)&&da(/<[/\w]/g,ue.textContent))return Lc(ue),!0;if(!le[Ct]||Ye[Ct]){if(!Ye[Ct]&&J6(Ct)&&(ne.tagNameCheck instanceof RegExp&&da(ne.tagNameCheck,Ct)||ne.tagNameCheck instanceof Function&&ne.tagNameCheck(Ct)))return!1;if(K&&!N[Ct]){const pn=b(ue)||ue.parentNode,ao=v(ue)||ue.childNodes;if(ao&&pn){const Ua=ao.length;for(let Qn=Ua-1;Qn>=0;--Qn)pn.insertBefore(p(ao[Qn],!0),_(ue))}}return Lc(ue),!0}return ue instanceof l&&!yA(ue)||(Ct==="noscript"||Ct==="noembed"||Ct==="noframes")&&da(/<\/no(script|embed|frames)/i,ue.innerHTML)?(Lc(ue),!0):(Xe&&ue.nodeType===3&&(it=ue.textContent,it=Il(it,A," "),it=Il(it,T," "),it=Il(it,P," "),ue.textContent!==it&&(e1(e.removed,{element:ue.cloneNode()}),ue.textContent=it)),Ud("afterSanitizeElements",ue,null),!1)},Q6=function(ue,it,Ct){if(Ce&&(it==="id"||it==="name")&&(Ct in s||Ct in Bg))return!1;if(!(ze&&!pe[it]&&da(W,it))){if(!(Ee&&da($,it))){if(!_e[it]||pe[it]){if(!(J6(ue)&&(ne.tagNameCheck instanceof RegExp&&da(ne.tagNameCheck,ue)||ne.tagNameCheck instanceof Function&&ne.tagNameCheck(ue))&&(ne.attributeNameCheck instanceof RegExp&&da(ne.attributeNameCheck,it)||ne.attributeNameCheck instanceof Function&&ne.attributeNameCheck(it))||it==="is"&&ne.allowCustomizedBuiltInElements&&(ne.tagNameCheck instanceof RegExp&&da(ne.tagNameCheck,Ct)||ne.tagNameCheck instanceof Function&&ne.tagNameCheck(Ct))))return!1}else if(!he[it]){if(!da(Q,Il(Ct,J,""))){if(!((it==="src"||it==="xlink:href"||it==="href")&&ue!=="script"&&Tbe(Ct,"data:")===0&&U[ue])){if(!(It&&!da(X,Il(Ct,J,"")))){if(Ct)return!1}}}}}}return!0},J6=function(ue){return ue.indexOf("-")>0},eW=function(ue){let it,Ct,pn,ao;Ud("beforeSanitizeAttributes",ue,null);const{attributes:Ua}=ue;if(!Ua)return;const Qn={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:_e};for(ao=Ua.length;ao--;){it=Ua[ao];const{name:kc,namespaceURI:SA}=it;if(Ct=kc==="value"?it.value:xbe(it.value),pn=ui(kc),Qn.attrName=pn,Qn.attrValue=Ct,Qn.keepAttr=!0,Qn.forceKeepAttr=void 0,Ud("uponSanitizeAttribute",ue,Qn),Ct=Qn.attrValue,Qn.forceKeepAttr||(q0(kc,ue),!Qn.keepAttr))continue;if(!Ke&&da(/\/>/i,Ct)){q0(kc,ue);continue}Xe&&(Ct=Il(Ct,A," "),Ct=Il(Ct,T," "),Ct=Il(Ct,P," "));const tW=ui(ue.nodeName);if(Q6(tW,pn,Ct)){if(Be&&(pn==="id"||pn==="name")&&(q0(kc,ue),Ct=Ae+Ct),C&&typeof f=="object"&&typeof f.getAttributeType=="function"&&!SA)switch(f.getAttributeType(tW,pn)){case"TrustedHTML":{Ct=C.createHTML(Ct);break}case"TrustedScriptURL":{Ct=C.createScriptURL(Ct);break}}try{SA?ue.setAttributeNS(SA,kc,Ct):ue.setAttribute(kc,Ct),XV(e.removed)}catch{}}}Ud("afterSanitizeAttributes",ue,null)},Rce=function Rt(ue){let it;const Ct=tL(ue);for(Ud("beforeSanitizeShadowDOM",ue,null);it=Ct.nextNode();)Ud("uponSanitizeShadowNode",it,null),!X6(it)&&(it.content instanceof o&&Rt(it.content),eW(it));Ud("afterSanitizeShadowDOM",ue,null)};return e.sanitize=function(Rt){let ue=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},it,Ct,pn,ao;if(gi=!Rt,gi&&(Rt=""),typeof Rt!="string"&&!iL(Rt))if(typeof Rt.toString=="function"){if(Rt=Rt.toString(),typeof Rt!="string")throw t1("dirty is not a string, aborting")}else throw t1("toString is not a function");if(!e.isSupported)return Rt;if(Z||Dl(ue),e.removed=[],typeof Rt=="string"&&(V=!1),V){if(Rt.nodeName){const kc=ui(Rt.nodeName);if(!le[kc]||Ye[kc])throw t1("root node is forbidden and cannot be sanitized in-place")}}else if(Rt instanceof a)it=G0(""),Ct=it.ownerDocument.importNode(Rt,!0),Ct.nodeType===1&&Ct.nodeName==="BODY"||Ct.nodeName==="HTML"?it=Ct:it.appendChild(Ct);else{if(!ae&&!Xe&&!je&&Rt.indexOf("<")===-1)return C&&Ne?C.createHTML(Rt):Rt;if(it=G0(Rt),!it)return ae?null:Ne?w:""}it&&z&&Lc(it.firstChild);const Ua=tL(V?Rt:it);for(;pn=Ua.nextNode();)X6(pn)||(pn.content instanceof o&&Rce(pn.content),eW(pn));if(V)return Rt;if(ae){if(we)for(ao=S.call(it.ownerDocument);it.firstChild;)ao.appendChild(it.firstChild);else ao=it;return(_e.shadowroot||_e.shadowrootmode)&&(ao=D.call(t,ao,!0)),ao}let Qn=je?it.outerHTML:it.innerHTML;return je&&le["!doctype"]&&it.ownerDocument&&it.ownerDocument.doctype&&it.ownerDocument.doctype.name&&da($X,it.ownerDocument.doctype.name)&&(Qn="\n"+Qn),Xe&&(Qn=Il(Qn,A," "),Qn=Il(Qn,T," "),Qn=Il(Qn,P," ")),C&&Ne?C.createHTML(Qn):Qn},e.setConfig=function(Rt){Dl(Rt),Z=!0},e.clearConfig=function(){Gn=null,Z=!1},e.isValidAttribute=function(Rt,ue,it){Gn||Dl({});const Ct=ui(Rt),pn=ui(ue);return Q6(Ct,pn,it)},e.addHook=function(Rt,ue){typeof ue=="function"&&(x[Rt]=x[Rt]||[],e1(x[Rt],ue))},e.removeHook=function(Rt){if(x[Rt])return XV(x[Rt])},e.removeHooks=function(Rt){x[Rt]&&(x[Rt]=[])},e.removeAllHooks=function(){x={}},e}var Hd=zX();Hd.version;Hd.isSupported;const UX=Hd.sanitize;Hd.setConfig;Hd.clearConfig;Hd.isValidAttribute;const jX=Hd.addHook,KX=Hd.removeHook;Hd.removeHooks;Hd.removeAllHooks;var Nt;(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"})(Nt||(Nt={}));const zbe="tkn";class Ube{constructor(){this._hosts=Object.create(null),this._ports=Object.create(null),this._connectionTokens=Object.create(null),this._preferredWebSchema="http",this._delegate=null,this._remoteResourcesPath="/".concat(Nt.vscodeRemoteResource)}setPreferredWebSchema(e){this._preferredWebSchema=e}rewrite(e){if(this._delegate)try{return this._delegate(e)}catch(a){return Dt(a),e}const t=e.authority;let i=this._hosts[t];i&&i.indexOf(":")!==-1&&i.indexOf("[")===-1&&(i="[".concat(i,"]"));const s=this._ports[t],o=this._connectionTokens[t];let r="path=".concat(encodeURIComponent(e.path));return typeof o=="string"&&(r+="&".concat(zbe,"=").concat(encodeURIComponent(o))),ct.from({scheme:yg?this._preferredWebSchema:Nt.vscodeRemoteResource,authority:"".concat(i,":").concat(s),path:this._remoteResourcesPath,query:r})}}const qX=new Ube;class yw{uriToBrowserUri(e){return e.scheme===Nt.vscodeRemote?qX.rewrite(e):e.scheme===Nt.file&&(nc||Bme&&ol.origin==="".concat(Nt.vscodeFileResource,"://").concat(yw.FALLBACK_AUTHORITY))?e.with({scheme:Nt.vscodeFileResource,authority:e.authority||yw.FALLBACK_AUTHORITY,query:null,fragment:null}):e}}yw.FALLBACK_AUTHORITY="vscode-app";const GX=new yw;var nH;(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:ct.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})(nH||(nH={}));const{registerWindow:Tit,getWindows:jbe,onDidCreateWindow:xit}=function(){const n=[],e=new j;return{onDidCreateWindow:e.event,registerWindow(t){n.push(t);const i=new be;return i.add(vt(()=>{const s=n.indexOf(t);s!==-1&&n.splice(s,1)})),e.fire({window:t,disposableStore:i}),i},getWindows(){return n}}}();function Ds(n){for(;n.firstChild;)n.firstChild.remove()}function O8(n){var e;return(e=n==null?void 0:n.isConnected)!==null&&e!==void 0?e:!1}class Kbe{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 ce(n,e,t,i){return new Kbe(n,e,t,i)}function YX(n){return function(e){return n(new ba(e))}}function qbe(n){return function(e){return n(new Oi(e))}}const In=function(e,t,i,s){let o=i;return t==="click"||t==="mousedown"?o=YX(i):(t==="keydown"||t==="keypress"||t==="keyup")&&(o=qbe(i)),ce(e,t,o,s)},Gbe=function(e,t,i){const s=YX(t);return Ybe(e,s,i)};function Ybe(n,e,t){return ce(n,uc&&P8.pointerEvents?Pe.POINTER_DOWN:Pe.MOUSE_DOWN,e,t)}let vE,xa;class sM{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){Dt(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(sM.sort),e.shift().execute();i=!1};xa=(o,r=0)=>{const a=new sM(o,r);return n.push(a),t||(t=!0,requestAnimationFrame(s)),a},vE=(o,r)=>{if(i){const a=new sM(o,r);return e.push(a),a}else return xa(o,r)}})();function ix(n){return n.ownerDocument.defaultView.getComputedStyle(n,null)}function L0(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 ii(n.clientWidth,n.clientHeight);if(uc&&(i!=null&&i.visualViewport))return new ii(i.visualViewport.width,i.visualViewport.height);if(i!=null&&i.innerWidth&&i.innerHeight)return new ii(i.innerWidth,i.innerHeight);if(t.body&&t.body.clientWidth&&t.body.clientHeight)return new ii(t.body.clientWidth,t.body.clientHeight);if(t.documentElement&&t.documentElement.clientWidth&&t.documentElement.clientHeight)return new ii(t.documentElement.clientWidth,t.documentElement.clientHeight);throw new Error("Unable to figure out browser width and height")}class vn{static convertToPixels(e,t){return parseFloat(t)||0}static getDimension(e,t,i){const s=ix(e),o=s?s.getPropertyValue(t):"0";return vn.convertToPixels(e,o)}static getBorderLeftWidth(e){return vn.getDimension(e,"border-left-width","borderLeftWidth")}static getBorderRightWidth(e){return vn.getDimension(e,"border-right-width","borderRightWidth")}static getBorderTopWidth(e){return vn.getDimension(e,"border-top-width","borderTopWidth")}static getBorderBottomWidth(e){return vn.getDimension(e,"border-bottom-width","borderBottomWidth")}static getPaddingLeft(e){return vn.getDimension(e,"padding-left","paddingLeft")}static getPaddingRight(e){return vn.getDimension(e,"padding-right","paddingRight")}static getPaddingTop(e){return vn.getDimension(e,"padding-top","paddingTop")}static getPaddingBottom(e){return vn.getDimension(e,"padding-bottom","paddingBottom")}static getMarginLeft(e){return vn.getDimension(e,"margin-left","marginLeft")}static getMarginTop(e){return vn.getDimension(e,"margin-top","marginTop")}static getMarginRight(e){return vn.getDimension(e,"margin-right","marginRight")}static getMarginBottom(e){return vn.getDimension(e,"margin-bottom","marginBottom")}}class ii{constructor(e,t){this.width=e,this.height=t}with(e=this.width,t=this.height){return e!==this.width||t!==this.height?new ii(e,t):this}static is(e){return typeof e=="object"&&typeof e.height=="number"&&typeof e.width=="number"}static lift(e){return e instanceof ii?e:new ii(e.width,e.height)}static equals(e,t){return e===t?!0:!e||!t?!1:e.width===t.width&&e.height===t.height}}ii.None=new ii(0,0);function ZX(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=XX(n)?null:ix(n);s&&(i-=s.direction!=="rtl"?n.scrollLeft:-n.scrollLeft),n===e&&(i+=vn.getBorderLeftWidth(n),t+=vn.getBorderTopWidth(n),t+=n.offsetTop,i+=n.offsetLeft,e=n.offsetParent)}return{left:i,top:t}}function Zbe(n,e,t){typeof e=="number"&&(n.style.width="".concat(e,"px")),typeof t=="number"&&(n.style.height="".concat(t,"px"))}function Un(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 Xbe(n){let e=n,t=1;do{const i=ix(e).zoom;i!=null&&i!=="1"&&(t*=i),e=e.parentElement}while(e!==null&&e!==e.ownerDocument.documentElement);return t}function Ko(n){const e=vn.getMarginLeft(n)+vn.getMarginRight(n);return n.offsetWidth+e}function oM(n){const e=vn.getBorderLeftWidth(n)+vn.getBorderRightWidth(n),t=vn.getPaddingLeft(n)+vn.getPaddingRight(n);return n.offsetWidth-e-t}function Qbe(n){const e=vn.getBorderTopWidth(n)+vn.getBorderBottomWidth(n),t=vn.getPaddingTop(n)+vn.getPaddingBottom(n);return n.offsetHeight-e-t}function Ep(n){const e=vn.getMarginTop(n)+vn.getMarginBottom(n);return n.offsetHeight+e}function Ws(n,e){for(;n;){if(n===e)return!0;n=n.parentNode}return!1}function Jbe(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 rM(n,e,t){return!!Jbe(n,e,t)}function XX(n){return n&&!!n.host&&!!n.mode}function bE(n){return!!cm(n)}function cm(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 XX(n)?n:null}function al(){let n=nx().activeElement;for(;n!=null&&n.shadowRoot;)n=n.shadowRoot.activeElement;return n}function nx(){var n;return(n=[document,...jbe().map(t=>t.document)].find(t=>t.hasFocus()))!==null&&n!==void 0?n:document}function Na(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 aM=null;function QX(){return aM||(aM=Na()),aM}function e0e(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 UP(n,e,t=QX()){!t||!e||t.sheet.insertRule(n+"{"+e+"}",0)}function sH(n,e=QX()){if(!e)return;const t=e0e(e),i=[];for(let s=0;s=0;s--)e.sheet.deleteRule(i[s])}function F8(n){return typeof HTMLElement=="object"?n instanceof HTMLElement:n&&typeof n=="object"&&n.nodeType===1&&typeof n.nodeName=="string"}const Pe={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:Hp?"webkitAnimationStart":"animationstart",ANIMATION_END:Hp?"webkitAnimationEnd":"animationend",ANIMATION_ITERATION:Hp?"webkitAnimationIteration":"animationiteration"};function t0e(n){const e=n;return!!(e&&typeof e.preventDefault=="function"&&typeof e.stopPropagation=="function")}const xt={stop:(n,e)=>(n.preventDefault(),e&&n.stopPropagation(),n)};function i0e(n){const e=[];for(let t=0;n&&n.nodeType===n.ELEMENT_NODE;t++)e[t]=n.scrollTop,n=n.parentNode;return e}function n0e(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 CE extends te{static hasFocusWithin(e){if(F8(e)){const t=cm(e),i=t?t.activeElement:e.ownerDocument.activeElement;return Ws(i,e)}else return Ws(window.document.activeElement,window.document)}constructor(e){super(),this._onDidFocus=this._register(new j),this.onDidFocus=this._onDidFocus.event,this._onDidBlur=this._register(new j),this.onDidBlur=this._onDidBlur.event;let t=CE.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=()=>{CE.hasFocusWithin(e)!==t&&(t?o():s())},this._register(ce(e,Pe.FOCUS,s,!0)),this._register(ce(e,Pe.BLUR,o,!0)),e instanceof HTMLElement&&(this._register(ce(e,Pe.FOCUS_IN,()=>this._refreshStateHandler())),this._register(ce(e,Pe.FOCUS_OUT,()=>this._refreshStateHandler())))}}function Ld(n){return new CE(n)}function ge(n,...e){if(n.append(...e),e.length===1&&typeof e[0]!="string")return e[0]}function JX(n,e){return n.insertBefore(e,n.firstChild),e}function Es(n,...e){n.innerText="",ge(n,...e)}const s0e=/([\w\-]+)?(#([\w\-]+))?((\.([\w\-]+))*)/;var Sw;(function(n){n.HTML="http://www.w3.org/1999/xhtml",n.SVG="http://www.w3.org/2000/svg"})(Sw||(Sw={}));function eQ(n,e,t,...i){const s=s0e.exec(e);if(!s)throw new Error("Bad use of emmet");const o=s[1]||"div";let r;return n!==Sw.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 ye(n,e,...t){return eQ(Sw.HTML,n,e,...t)}ye.SVG=function(n,e,...t){return eQ(Sw.SVG,n,e,...t)};function o0e(n,...e){n?mr(...e):Lo(...e)}function mr(...n){for(const e of n)e.style.display="",e.removeAttribute("aria-hidden")}function Lo(...n){for(const e of n)e.style.display="none",e.setAttribute("aria-hidden","true")}function oH(n){const e=window.devicePixelRatio*n;return Math.max(1,Math.floor(e))/window.devicePixelRatio}function tQ(n){window.open(n,"_blank","noopener")}function r0e(n){const e=()=>{n(),t=xa(e)};let t=xa(e);return vt(()=>t.dispose())}qX.setPreferredWebSchema(/^https:/.test(window.location.href)?"https":"http");function Uf(n){return n?"url('".concat(GX.uriToBrowserUri(n).toString(!0).replace(/'/g,"%27"),"')"):"url('')"}function rH(n){return"'".concat(n.replace(/'/g,"%27"),"'")}function zp(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=zp(i[1].trim(),e)),"var(".concat(i[0],", ").concat(e,")")}return n}return e}function a0e(n,e=!1){const t=document.createElement("a");return jX("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)}}}),vt(()=>{KX("afterSanitizeAttributes")})}const l0e=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 wu extends j{constructor(){super(),this._subscriptions=new be,this._keyStatus={altKey:!1,shiftKey:!1,ctrlKey:!1,metaKey:!1},this._subscriptions.add(ce(window,"keydown",e=>{if(e.defaultPrevented)return;const t=new Oi(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(ce(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(ce(document.body,"mousedown",()=>{this._keyStatus.lastKeyPressed=void 0},!0)),this._subscriptions.add(ce(document.body,"mouseup",()=>{this._keyStatus.lastKeyPressed=void 0},!0)),this._subscriptions.add(ce(document.body,"mousemove",e=>{e.buttons&&(this._keyStatus.lastKeyPressed=void 0)},!0)),this._subscriptions.add(ce(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 wu.instance||(wu.instance=new wu),wu.instance}dispose(){super.dispose(),this._subscriptions.dispose()}}class c0e extends te{constructor(e,t){super(),this.element=e,this.callbacks=t,this.counter=0,this.dragStartTime=0,this.registerListeners()}registerListeners(){this._register(ce(this.element,Pe.DRAG_ENTER,e=>{this.counter++,this.dragStartTime=e.timeStamp,this.callbacks.onDragEnter(e)})),this._register(ce(this.element,Pe.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(ce(this.element,Pe.DRAG_LEAVE,e=>{this.counter--,this.counter===0&&(this.dragStartTime=0,this.callbacks.onDragLeave(e))})),this._register(ce(this.element,Pe.DRAG_END,e=>{this.counter=0,this.dragStartTime=0,this.callbacks.onDragEnd(e)})),this._register(ce(this.element,Pe.DROP,e=>{this.counter=0,this.dragStartTime=0,this.callbacks.onDrop(e)}))}}const d0e=/(?[\w\-]+)?(?:#(?[\w\-]+))?(?(?:\.(?:[\w\-]+))*)(?:@(?(?:[\w\_])+))?/;function vs(n,...e){let t,i;Array.isArray(e[0])?(t={},i=e[0]):(t=e[0]||{},i=e[1]);const s=d0e.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(aH(u),typeof h=="number"?h+"px":""+h);else c==="tabIndex"?r.tabIndex=d:r.setAttribute(aH(c),d.toString());return l.root=r,l}function aH(n){return n.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}class sx{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=fe.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};er.registerKeybindingRule(s)}}qt.registerCommand({id:this.id,handler:(e,t)=>this.runCommand(e,t),description:this._description})}_registerMenuItem(e){Ls.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 k0 extends sx{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(bt).contextMatchesRules(i!=null?i:void 0))return s(a,r,t)})}runCommand(e,t){return fs.runEditorCommand(e,t,this.precondition,(i,s,o)=>this.runEditorCommand(i,s,o))}}class Ue extends fs{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=M.EditorContext),s.title||(s.title=e.label),s.when=fe.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(Ue.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(ra).publicLog2("editorActionInvoked",{name:this.label,id:this.id})}}class nQ extends Ue{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(bt),c=o.get(aa);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 $d(n,e){qt.registerCommand(n,function(t,...i){const s=t.get(_t),[o,r]=i;bi(ct.isUri(o)),bi(Y.isIPosition(r));const a=t.get(Zi).getModel(o);if(a){const l=Y.lift(r);return s.invokeFunction(e,a,l,...i.slice(2))}return t.get(sr).createModelReference(o).then(l=>new Promise((c,d)=>{try{const u=s.invokeFunction(e,l.object.textEditorModel,Y.lift(r),i.slice(2));c(u)}catch(u){d(u)}}).finally(()=>{l.dispose()}))})}function Re(n){return _a.INSTANCE.registerEditorCommand(n),n}function De(n){const e=new n;return _a.INSTANCE.registerEditorAction(e),e}function sQ(n){return _a.INSTANCE.registerEditorAction(n),n}function u0e(n){_a.INSTANCE.registerEditorAction(n)}function ti(n,e,t){_a.INSTANCE.registerEditorContribution(n,e,t)}var Wv;(function(n){function e(r){return _a.INSTANCE.getEditorCommand(r)}n.getEditorCommand=e;function t(){return _a.INSTANCE.getEditorActions()}n.getEditorActions=t;function i(){return _a.INSTANCE.getEditorContributions()}n.getEditorContributions=i;function s(r){return _a.INSTANCE.getEditorContributions().filter(a=>r.indexOf(a.id)>=0)}n.getSomeEditorContributions=s;function o(){return _a.INSTANCE.getDiffEditorContributions()}n.getDiffEditorContributions=o})(Wv||(Wv={}));const h0e={EditorCommonContributions:"editor.contributions"};class _a{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}}_a.INSTANCE=new _a;en.add(h0e.EditorCommonContributions,_a.INSTANCE);function dS(n){return n.register(),n}const oQ=dS(new k0({id:"undo",precondition:void 0,kbOpts:{weight:0,primary:2104},menuOpts:[{menuId:M.MenubarEditMenu,group:"1_do",title:m({key:"miUndo",comment:["&& denotes a mnemonic"]},"&&Undo"),order:1},{menuId:M.CommandPalette,group:"",title:m("undo","Undo"),order:1}]}));dS(new iQ(oQ,{id:"default:undo",precondition:void 0}));const rQ=dS(new k0({id:"redo",precondition:void 0,kbOpts:{weight:0,primary:2103,secondary:[3128],mac:{primary:3128}},menuOpts:[{menuId:M.MenubarEditMenu,group:"1_do",title:m({key:"miRedo",comment:["&& denotes a mnemonic"]},"&&Redo"),order:2},{menuId:M.CommandPalette,group:"",title:m("redo","Redo"),order:1}]}));dS(new iQ(rQ,{id:"default:redo",precondition:void 0}));const f0e=dS(new k0({id:"editor.action.selectAll",precondition:void 0,kbOpts:{weight:0,kbExpr:null,primary:2079},menuOpts:[{menuId:M.MenubarSelectionMenu,group:"1_basic",title:m({key:"miSelectAll",comment:["&& denotes a mnemonic"]},"&&Select All"),order:1},{menuId:M.CommandPalette,group:"",title:m("selectAll","Select All"),order:1}]})),aQ=Symbol("MicrotaskDelay");var fa=globalThis&&globalThis.__awaiter||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())})},F1=globalThis&&globalThis.__asyncValues||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 jP(n){return!!n&&typeof n.then=="function"}function Xn(n){const e=new Tn,t=n(e.token),i=new Promise((s,o)=>{const r=e.token.onCancellationRequested(()=>{r.dispose(),e.dispose(),o(new Sg)});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 ox(n,e,t){return new Promise((i,s)=>{const o=e.onCancellationRequested(()=>{o.dispose(),i(t)});n.then(i,s).finally(()=>o.dispose())})}class g0e{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 p0e=(n,e)=>{let t=!0;const i=setTimeout(()=>{t=!1,e()},n);return{isTriggered:()=>t,dispose:()=>{clearTimeout(i),t=!1}}},m0e=n=>{let e=!0;return queueMicrotask(()=>{e&&(e=!1,n())}),{isTriggered:()=>e,dispose:()=>{e=!1}}};class pl{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===aQ?m0e(i):p0e(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 Sg),this.completionPromise=null)}cancelTimeout(){var e;(e=this.deferred)===null||e===void 0||e.dispose(),this.deferred=null}dispose(){this.cancel()}}class lQ{constructor(e){this.delayer=new pl(e),this.throttler=new g0e}trigger(e,t){return this.delayer.trigger(()=>this.throttler.queue(e),t)}cancel(){this.delayer.cancel()}dispose(){this.delayer.dispose(),this.throttler.dispose()}}function jf(n,e){return e?new Promise((t,i)=>{const s=setTimeout(()=>{o.dispose(),t()},n),o=e.onCancellationRequested(()=>{clearTimeout(s),o.dispose(),i(new Sg)})}):Xn(t=>jf(n,t))}function Kf(n,e=0,t){const i=setTimeout(()=>{n(),t&&s.dispose()},e),s=vt(()=>{clearTimeout(i),t==null||t.deleteAndLeak(s)});return t==null||t.add(s),s}function cQ(n,e=i=>!!i,t=null){let i=0;const s=n.length,o=()=>{if(i>=s)return Promise.resolve(t);const r=n[i++];return Promise.resolve(r()).then(l=>e(l)?Promise.resolve(l):o())};return o()}class _l{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 uS{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 Si{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 yu;(function(){typeof requestIdleCallback!="function"||typeof cancelIdleCallback!="function"?yu=n=>{JZ(()=>{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)}}}:yu=(n,e)=>{const t=requestIdleCallback(n,typeof e=="number"?{timeout:e}:void 0);let i=!1;return{dispose(){i||(i=!0,cancelIdleCallback(t))}}}})();class aD{constructor(e){this._didRun=!1,this._executor=()=>{try{this._value=e()}catch(t){this._error=t}finally{this._didRun=!0}},this._handle=yu(()=>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 rx{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 Sg)}}var KP;(function(n){function e(i){return fa(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)=>fa(this,void 0,void 0,function*(){try{yield i(s,o)}catch(r){o(r)}}))}n.withAsyncBody=t})(KP||(KP={}));class Mn{static fromArray(e){return new Mn(t=>{t.emitMany(e)})}static fromPromise(e){return new Mn(t=>fa(this,void 0,void 0,function*(){t.emitMany(yield e)}))}static fromPromises(e){return new Mn(t=>fa(this,void 0,void 0,function*(){yield Promise.all(e.map(i=>fa(this,void 0,void 0,function*(){return t.emitOne(yield i)})))}))}static merge(e){return new Mn(t=>fa(this,void 0,void 0,function*(){yield Promise.all(e.map(i=>{var s,o,r;return fa(this,void 0,void 0,function*(){var a,l,c,d;try{for(s=!0,o=F1(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 j,queueMicrotask(()=>fa(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:()=>fa(this,void 0,void 0,function*(){do{if(this._state===2)throw this._error;if(efa(this,void 0,void 0,function*(){var s,o,r,a;try{for(var l=!0,c=F1(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 Mn.map(this,e)}static filter(e,t){return new Mn(i=>fa(this,void 0,void 0,function*(){var s,o,r,a;try{for(var l=!0,c=F1(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 Mn.filter(this,e)}static coalesce(e){return Mn.filter(e,t=>!!t)}coalesce(){return Mn.coalesce(this)}static toPromise(e){var t,i,s,o,r,a,l;return fa(this,void 0,void 0,function*(){const c=[];try{for(t=!0,i=F1(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 Mn.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())}}Mn.EMPTY=Mn.fromArray([]);class _0e extends Mn{constructor(e,t){super(t),this._source=e}cancel(){this._source.cancel()}}function v0e(n){const e=new Tn,t=n(e.token);return new _0e(e,i=>fa(this,void 0,void 0,function*(){var s,o,r,a;const l=e.token.onCancellationRequested(()=>{l.dispose(),e.dispose(),i.reject(new Sg)});try{try{for(var c=!0,d=F1(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 b0e="$initialize";let lH=!1;function qP(n){yg&&(lH||(lH=!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 C0e{constructor(e,t,i,s){this.vsWorker=e,this.req=t,this.method=i,this.args=s,this.type=0}}class cH{constructor(e,t,i,s){this.vsWorker=e,this.seq=t,this.res=i,this.err=s,this.type=1}}class w0e{constructor(e,t,i,s){this.vsWorker=e,this.req=t,this.eventName=i,this.arg=s,this.type=2}}class y0e{constructor(e,t,i){this.vsWorker=e,this.req=t,this.event=i,this.type=3}}class S0e{constructor(e,t){this.vsWorker=e,this.req=t,this.type=4}}class L0e{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 C0e(this._workerId,i,e,t))})}listen(e,t){let i=null;const s=new j({onWillAddFirstListener:()=>{i=String(++this._lastSentReq),this._pendingEmitters.set(i,s),this._send(new w0e(this._workerId,i,e,t))},onDidRemoveLastListener:()=>{this._pendingEmitters.delete(i),this._send(new S0e(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 cH(this._workerId,t,s,void 0))},s=>{s.detail instanceof Error&&(s.detail=FV(s.detail)),this._send(new cH(this._workerId,t,void 0,FV(s)))})}_handleSubscribeEventMessage(e){const t=e.req,i=this._handler.handleEvent(e.eventName,e.arg)(s=>{this._send(new y0e(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 L0e({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(uQ(d)){const h=i[d].call(i,u);if(typeof h!="function")throw new Error("Missing dynamic event ".concat(d," on main thread host."));return h}if(dQ(d)){const h=i[d];if(typeof h!="function")throw new Error("Missing event ".concat(d," on main thread host."));return h}throw new Error("Malformed event name ".concat(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=h8(i);this._onModuleLoaded=this._protocol.sendMessage(b0e,[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(D0e(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 dQ(n){return n[0]==="o"&&n[1]==="n"&&Vc(n.charCodeAt(2))}function uQ(n){return/^onDynamic/.test(n)&&Vc(n.charCodeAt(9))}function D0e(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(uQ(r)){o[r]=s(r);continue}if(dQ(r)){o[r]=t(r,void 0);continue}o[r]=i(r)}return o}function sh(n,e){var t;const i=globalThis.MonacoEnvironment;if(i!=null&&i.createTrustedTypesPolicy)try{return i.createTrustedTypesPolicy(n,e)}catch(s){Dt(s);return}try{return(t=window.trustedTypes)===null||t===void 0?void 0:t.createPolicy(n,e)}catch(s){Dt(s);return}}const dH=sh("defaultWorkerFactory",{createScriptURL:n=>n});function E0e(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(dH?dH.createScriptURL(t):t,{name:n})}}throw new Error("You must define a function MonacoEnvironment.getWorkerUrl or MonacoEnvironment.getWorker")}function I0e(n){return typeof n.then=="function"}class T0e{constructor(e,t,i,s,o){this.id=t,this.label=i;const r=E0e(i);I0e(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){Dt(o),Dt(new Error("FAILED to post message to '".concat(this.label,"'-worker"),{cause:o}))}})}dispose(){var e;(e=this.worker)===null||e===void 0||e.then(t=>t.terminate()),this.worker=null}}class ax{constructor(e){this._label=e,this._webWorkerFailedBeforeError=!1}create(e,t,i){const s=++ax.LAST_WORKER_ID;if(this._webWorkerFailedBeforeError)throw this._webWorkerFailedBeforeError;return new T0e(e,s,this._label||"anonymous"+s,t,o=>{qP(o),this._webWorkerFailedBeforeError=o,i(o)})}}ax.LAST_WORKER_ID=0;var Pn;(function(n){n[n.None=0]="None",n[n.Indent=1]="Indent",n[n.IndentOutdent=2]="IndentOutdent",n[n.Outdent=3]="Outdent"})(Pn||(Pn={}));class lM{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 N0e(n,s,r,o+1,n.getStartOffset(r),n.getEndOffset(o))}class N0e{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 Nc(n){return(n&3)!==0}class Lb{constructor(e){if(e.autoClosingPairs?this._autoClosingPairs=e.autoClosingPairs.map(t=>new lM(t)):e.brackets?this._autoClosingPairs=e.brackets.map(t=>new lM({open:t[0],close:t[1]})):this._autoClosingPairs=[],e.__electricCharacterSupport&&e.__electricCharacterSupport.docComment){const t=e.__electricCharacterSupport.docComment;this._autoClosingPairs.push(new lM({open:t.open,close:t.close||""}))}this._autoCloseBeforeForQuotes=typeof e.autoCloseBefore=="string"?e.autoCloseBefore:Lb.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_QUOTES,this._autoCloseBeforeForBrackets=typeof e.autoCloseBefore=="string"?e.autoCloseBefore:Lb.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}}Lb.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_QUOTES=";:.,=}])> \n ";Lb.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_BRACKETS="'\"`;:.,=}])> \n ";const uH=typeof Buffer<"u";let cM;class cx{static wrap(e){return uH&&!Buffer.isBuffer(e)&&(e=Buffer.from(e.buffer,e.byteOffset,e.byteLength)),new cx(e)}constructor(e){this.buffer=e,this.byteLength=this.buffer.byteLength}toString(){return uH?this.buffer.toString():(cM||(cM=new TextDecoder),cM.decode(this.buffer))}}function A0e(n,e){return n[e+0]<<0>>>0|n[e+1]<<8>>>0}function M0e(n,e,t){n[t+0]=e&255,e=e>>>8,n[t+1]=e&255}function Ol(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 Fl(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 hH(n,e){return n[e]}function fH(n,e,t){n[t]=e}let dM;function hQ(){return dM||(dM=new TextDecoder("UTF-16LE")),dM}let uM;function R0e(){return uM||(uM=new TextDecoder("UTF-16BE")),uM}let hM;function fQ(){return hM||(hM=eX()?hQ():R0e()),hM}function P0e(n,e,t){const i=new Uint16Array(n.buffer,e,t);return t>0&&(i[0]===65279||i[0]===65534)?O0e(n,e,t):hQ().decode(i)}function O0e(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 B0e{constructor(e,t){this._richEditBracketsBrand=void 0;const i=F0e(t);this.brackets=i.map((s,o)=>new wE(e,o,s.open,s.close,W0e(s.open,s.close,i,o),V0e(s.open,s.close,i,o))),this.forwardRegex=H0e(this.brackets),this.reversedRegex=$0e(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 gQ(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 pQ(n,e){return n.length-e.length}function dx(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 W0e(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 fQ().decode(s)}let e=null,t=null;return function(s){return e!==s&&(e=s,t=n(e)),t}}();class Ga{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 I(t,l-a+1,t,l+1)}static findPrevBracketInRange(e,t,i,s,o){const a=B8(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 I(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 U0e{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 Vf(e)}onElectricCharacter(e,t,i){if(!this._richEditBrackets||this._richEditBrackets.brackets.length===0)return null;const s=t.findTokenIndexAtOffset(i-1);if(Nc(t.getStandardTokenType(s)))return null;const o=this._richEditBrackets.reversedRegex,r=t.getLineContent().substring(0,i-1)+e,a=Ga.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 wL(n){return n.global&&(n.lastIndex=0),!0}class j0e{constructor(e){this._indentationRules=e}shouldIncrease(e){return!!(this._indentationRules&&this._indentationRules.increaseIndentPattern&&wL(this._indentationRules.increaseIndentPattern)&&this._indentationRules.increaseIndentPattern.test(e))}shouldDecrease(e){return!!(this._indentationRules&&this._indentationRules.decreaseIndentPattern&&wL(this._indentationRules.decreaseIndentPattern)&&this._indentationRules.decreaseIndentPattern.test(e))}shouldIndentNextLine(e){return!!(this._indentationRules&&this._indentationRules.indentNextLinePattern&&wL(this._indentationRules.indentNextLinePattern)&&this._indentationRules.indentNextLinePattern.test(e))}shouldIgnore(e){return!!(this._indentationRules&&this._indentationRules.unIndentedLinePattern&&wL(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 nv{constructor(e){e=e||{},e.brackets=e.brackets||[["(",")"],["{","}"],["[","]"]],this._brackets=[],e.brackets.forEach(t=>{const i=nv._createOpenBracketRegExp(t[0]),s=nv._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 q0e(n){return n.replace(/[\[\]]/g,"")}const qi=Wt("languageService");class Hc{constructor(e,t=[],i=!1){this.ctor=e,this.staticArguments=t,this.supportsDelayedInstantiation=i}}const vQ=[];function Gt(n,e,t){e instanceof Hc||(e=new Hc(e,[],!!t)),vQ.push([n,e])}function pH(){return vQ}const wn=Object.freeze({text:"text/plain",binary:"application/octet-stream",unknown:"application/unknown",markdown:"text/markdown",latex:"text/latex",uriList:"text/uri-list"}),hx={JSONContribution:"base.contributions.json"};function G0e(n){return n.length>0&&n.charAt(n.length-1)==="#"?n.substring(0,n.length-1):n}class Y0e{constructor(){this._onDidChangeSchema=new j,this.schemasById={}}registerSchema(e,t){this.schemasById[G0e(e)]=t,this._onDidChangeSchema.fire(e)}notifySchemaChanged(e){this._onDidChangeSchema.fire(e)}}const Z0e=new Y0e;en.add(hx.JSONContribution,Z0e);const wc={Configuration:"base.contributions.configuration"},n1="vscode://schemas/settings/resourceLanguage",mH=en.as(hx.JSONContribution);class X0e{constructor(){this.overrideIdentifiers=new Set,this._onDidSchemaChange=new j,this._onDidUpdateConfiguration=new j,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={},mH.registerSchema(n1,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),mH.registerSchema(n1,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),qf.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=q0e(a),h={type:"object",default:d,description:m("defaultLanguageConfiguration.description","Configure settings to be overridden for the {0} language.",u),$ref:n1,defaultDefaultValue:d,source:Mo(r)?void 0:r,defaultValueSource:r};s.push(...yE(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=Fr(e.scope)?o:e.scope;const l=e.properties;if(l)for(const d in l){const u=l[d];if(t&&e1e(d,u)){delete l[d];continue}if(u.source=i,u.defaultDefaultValue=l[d].default,this.updatePropertyDefaultValue(d,u),qf.test(d)?u.scope=void 0:(u.scope=Fr(u.scope)?o:u.scope,u.restricted=Fr(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="[".concat(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:n1};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;_r(s)&&(s=t.defaultDefaultValue,o=void 0),_r(s)&&(s=J0e(t.type)),t.default=s,t.defaultValueSource=o}}const bQ="\\[([^\\]]+)\\]",_H=new RegExp(bQ,"g"),Q0e="^(".concat(bQ,")+$"),qf=new RegExp(Q0e);function yE(n){const e=[];if(qf.test(n)){let t=_H.exec(n);for(;t!=null&&t.length;){const i=t[1].trim();i&&e.push(i),t=_H.exec(n)}}return Vf(e)}function J0e(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 lD=new X0e;en.add(wc.Configuration,lD);function e1e(n,e){var t,i,s,o;return n.trim()?qf.test(n)?m("config.property.languageDefault","Cannot register '{0}'. This matches property pattern '\\\\[.*\\\\]$' for describing language specific editor settings. Use 'configurationDefaults' contribution.",n):lD.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&&lD.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,lD.getPolicyConfigurations().get((o=e.policy)===null||o===void 0?void 0:o.name)):null:m("config.property.empty","Cannot register an empty property")}const t1e={ModesRegistry:"editor.modesRegistry"};class i1e{constructor(){this._onDidChangeLanguages=new j,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 o1e(this,a,l),closing:l}}),o=new HV(a=>{const l=new Set,c=new Set;return{info:new r1e(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?vH(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 vH(n){return n.filter(([e,t])=>e!==""&&t!=="")}class CQ{constructor(e,t){this.config=e,this.bracketText=t}get languageId(){return this.config.languageId}}class o1e extends CQ{constructor(e,t,i){super(e,t),this.openedBrackets=i,this.isOpeningBracket=!0}}class r1e extends CQ{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 a1e=globalThis&&globalThis.__decorate||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},bH=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};class fM{constructor(e){this.languageId=e}affects(e){return this.languageId?this.languageId===e:!0}}const Ni=Wt("languageConfigurationService");let YP=class extends te{constructor(e,t){super(),this.configurationService=e,this.languageService=t,this._registry=this._register(new u1e),this.onDidChangeEmitter=this._register(new j),this.onDidChange=this.onDidChangeEmitter.event,this.configurations=new Map;const i=new Set(Object.values(ZP));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 fM(void 0));else for(const a of r)this.languageService.isRegisteredLanguageId(a)&&(this.configurations.delete(a),this.onDidChangeEmitter.fire(new fM(a)))})),this._register(this._registry.onDidChange(s=>{this.configurations.delete(s.languageId),this.onDidChangeEmitter.fire(new fM(s.languageId))}))}register(e,t,i){return this._registry.register(e,t,i)}getLanguageConfiguration(e){let t=this.configurations.get(e);return t||(t=l1e(e,this._registry,this.configurationService,this.languageService),this.configurations.set(e,t)),t}};YP=a1e([bH(0,zt),bH(1,qi)],YP);function l1e(n,e,t,i){let s=e.getLanguageConfiguration(n);if(!s){if(!i.isRegisteredLanguageId(n))return new Hv(n,{});s=new Hv(n,{})}const o=c1e(s.languageId,t),r=yQ([s.underlyingConfig,o]);return new Hv(s.languageId,r)}const ZP={brackets:"editor.language.brackets",colorizedBracketPairs:"editor.language.colorizedBracketPairs"};function c1e(n,e){const t=e.getValue(ZP.brackets,{overrideIdentifier:n}),i=e.getValue(ZP.colorizedBracketPairs,{overrideIdentifier:n});return{brackets:CH(t),colorizedBracketPairs:CH(i)}}function CH(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 wQ(n,e,t){const i=n.getLineContent(e);let s=ki(i);return s.length>t-1&&(s=s.substring(0,t-1)),s}function Vv(n,e,t){n.tokenization.forceTokenization(e);const i=n.tokenization.getLineTokens(e),s=typeof t>"u"?n.getLineMaxColumn(e)-1:t-1;return lx(i,s)}class d1e{constructor(e){this.languageId=e,this._resolved=null,this._entries=[],this._order=0,this._resolved=null}register(e,t){const i=new wH(e,t,++this._order);return this._entries.push(i),this._resolved=null,vt(()=>{for(let s=0;se.configuration)))}}function yQ(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 wH{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 yH{constructor(e){this.languageId=e}}class u1e extends te{constructor(){super(),this._entries=new Map,this._onDidChange=this._register(new j),this.onDidChange=this._onDidChange.event,this._register(this.register(Yr,{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 d1e(e),this._entries.set(e,s));const o=s.register(t,i);return this._onDidChange.fire(new yH(e)),vt(()=>{o.dispose(),this._onDidChange.fire(new yH(e))})}getLanguageConfiguration(e){const t=this._entries.get(e);return(t==null?void 0:t.getResolvedConfiguration())||null}}class Hv{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 nv(this.underlyingConfig):null,this.comments=Hv._handleComments(this.underlyingConfig),this.characterPair=new Lb(this.underlyingConfig),this.wordDefinition=this.underlyingConfig.wordPattern||p8,this.indentationRules=this.underlyingConfig.indentationRules,this.underlyingConfig.indentationRules?this.indentRulesSupport=new j0e(this.underlyingConfig.indentationRules):this.indentRulesSupport=null,this.foldingRules=this.underlyingConfig.folding||{},this.bracketsNew=new s1e(e,this.underlyingConfig)}getWordDefinition(){return nX(this.wordDefinition)}get brackets(){return!this._brackets&&this.underlyingConfig.brackets&&(this._brackets=new B0e(this.languageId,this.underlyingConfig.brackets)),this._brackets}get electricCharacter(){return this._electricCharacter||(this._electricCharacter=new U0e(this.brackets)),this._electricCharacter}onEnter(e,t,i,s){return this._onEnterSupport?this._onEnterSupport.onEnter(e,t,i,s):null}getAutoClosingPairs(){return new x0e(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}}Gt(Ni,YP,1);class Eh{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 SQ(n){return fx(n,0)}function fx(n,e){switch(typeof n){case"object":return n===null?Su(349,e):Array.isArray(n)?f1e(n,e):g1e(n,e);case"string":return W8(n,e);case"boolean":return h1e(n,e);case"number":return Su(n,e);case"undefined":return Su(937,e);default:return Su(617,e)}}function Su(n,e){return(e<<5)-e+n|0}function h1e(n,e){return Su(n?433:863,e)}function W8(n,e){e=Su(149417,e);for(let t=0,i=n.length;tfx(i,t),e)}function g1e(n,e){return e=Su(181387,e),Object.keys(n).sort().reduce((t,i)=>(t=W8(i,t),fx(n[i],t)),e)}function gM(n,e,t=32){const i=t-e,s=~((1<>>i)>>>0}function SH(n,e=0,t=n.byteLength,i=0){for(let s=0;st.toString(16).padStart(2,"0")).join(""):p1e((n>>>0).toString(16),e/4)}class gx{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(es(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()),s1(this._h0)+s1(this._h1)+s1(this._h2)+s1(this._h3)+s1(this._h4)}_wrapUp(){this._buff[this._buffLen++]=128,SH(this._buff,this._buffLen),this._buffLen>56&&(this._step(),SH(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=gx._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,gM(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=gM(i,5)+l+a+c+e.getUint32(u*4,!1)&4294967295,a=r,r=o,o=gM(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}}gx._bigBlock32=new DataView(new ArrayBuffer(320));class LH{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 Eh(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 Kc{constructor(e,t,i=null){this.ContinueProcessingPredicate=i,this._originalSequence=e,this._modifiedSequence=t;const[s,o,r]=Kc._getElements(e),[a,l,c]=Kc._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(Kc._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?(w_.Assert(e===t+1,"originalStart should only be one more than originalEnd"),u=[new Eh(e,0,i,s-i+1)]):e<=t?(w_.Assert(i===s+1,"modifiedStart should only be one more than modifiedEnd"),u=[new Eh(e,t-e+1,i,0)]):(w_.Assert(e===t+1,"originalStart should only be one more than originalEnd"),w_.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 Eh(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 Eh(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 C=null,w=null,y=new kH,L=t,S=i,k=f[0]-_[0]-s,D=-1073741824,x=this.m_forwardHistory.length-1;do{const A=k+e;A===L||A=0&&(c=this.m_forwardHistory[x],e=c[0],L=1,S=c.length-1)}while(--x>=-1);if(C=y.getReverseChanges(),b[0]){let A=f[0]+1,T=_[0]+1;if(C!==null&&C.length>0){const P=C[C.length-1];A=Math.max(A,P.getOriginalEnd()),T=Math.max(T,P.getModifiedEnd())}w=[new Eh(A,h-A+1,T,p-T+1)]}else{y=new kH,L=r,S=a,k=f[0]-_[0]-l,D=1073741824,x=v?this.m_reverseHistory.length-1:this.m_reverseHistory.length-2;do{const A=k+o;A===L||A=d[A+1]?(u=d[A+1]-1,g=u-k-l,u>D&&y.MarkNextChange(),D=u+1,y.AddOriginalElement(u+1,g+1),k=A+1-o):(u=d[A-1],g=u-k-l,u>D&&y.MarkNextChange(),D=u,y.AddModifiedElement(u+1,g+1),k=A-1-o),x>=0&&(d=this.m_reverseHistory[x],o=d[0],L=1,S=d.length-1)}while(--x>=-1);w=y.getChanges()}return this.ConcatenateChanges(C,w)}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,C=t-e,w=e-i,y=t-s,S=(C-b)%2===0;_[b]=e,v[C]=t,a[0]=!1;for(let k=1;k<=g/2+1;k++){let D=0,x=0;d=this.ClipDiagonalBound(b-k,k,b,p),u=this.ClipDiagonalBound(b+k,k,b,p);for(let T=d;T<=u;T+=2){T===d||TD+x&&(D=l,x=c),!S&&Math.abs(T-C)<=k-1&&l>=v[T])return o[0]=l,r[0]=c,P<=v[T]&&1447>0&&k<=1447+1?this.WALKTRACE(b,d,u,w,C,h,f,y,_,v,l,t,o,c,s,r,S,a):null}const A=(D-e+(x-i)-k)/2;if(this.ContinueProcessingPredicate!==null&&!this.ContinueProcessingPredicate(D,A))return a[0]=!0,o[0]=D,r[0]=x,A>0&&1447>0&&k<=1447+1?this.WALKTRACE(b,d,u,w,C,h,f,y,_,v,l,t,o,c,s,r,S,a):(e++,i++,[new Eh(e,t-e+1,i,s-i+1)]);h=this.ClipDiagonalBound(C-k,k,C,p),f=this.ClipDiagonalBound(C+k,k,C,p);for(let T=h;T<=f;T+=2){T===h||T=v[T+1]?l=v[T+1]-1:l=v[T-1],c=l-(T-C)-y;const P=l;for(;l>e&&c>i&&this.ElementsAreEqual(l,c);)l--,c--;if(v[T]=l,S&&Math.abs(T-b)<=k&&l<=_[T])return o[0]=l,r[0]=c,P>=_[T]&&1447>0&&k<=1447+1?this.WALKTRACE(b,d,u,w,C,h,f,y,_,v,l,t,o,c,s,r,S,a):null}if(k<=1447){let T=new Int32Array(u-d+2);T[0]=b-d+1,y_.Copy2(_,d,T,1,u-d+1),this.m_forwardHistory.push(T),T=new Int32Array(f-h+2),T[0]=C-h+1,y_.Copy2(v,h,T,1,f-h+1),this.m_reverseHistory.push(T)}}return this.WALKTRACE(b,d,u,w,C,h,f,y,_,v,l,t,o,c,s,r,S,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 y_.Copy(e,0,s,0,e.length-1),s[e.length-1]=i[0],y_.Copy(t,1,s,e.length,t.length-1),s}else{const s=new Array(e.length+t.length);return y_.Copy(e,0,s,0,e.length),y_.Copy(t,0,s,e.length,t.length),s}}ChangesOverlap(e,t,i){if(w_.Assert(e.originalStart<=t.originalStart,"Left change is not less than or equal to right change"),w_.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 Eh(s,o,r,a),!0}else return i[0]=null,!1}ClipDiagonalBound(e,t,i,s){if(e>=0&&e255?255:n|0}function S_(n){return n<0?0:n>4294967295?4294967295:n|0}class _1e{constructor(e){this.values=e,this.prefixSum=new Uint32Array(e.length),this.prefixSumValidIndex=new Int32Array(1),this.prefixSumValidIndex[0]=-1}insertValues(e,t){e=S_(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=S_(e),t=S_(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=S_(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 LQ(s,e-r)}}class v1e{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 LQ(t,e-i)}removeValues(e,t){this._values.splice(e,t),this._invalidate(e)}insertValues(e,t){this._values=$T(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 LE{constructor(){this._actual=new E0(0)}add(e){this._actual.set(e,1)}has(e){return this._actual.get(e)===1}clear(){return this._actual.clear()}}class C1e{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 C1e(i,t,0);for(let o=0,r=e.length;o=this._maxCharCode?0:this._states.get(e,t)}}let pM=null;function y1e(){return pM===null&&(pM=new w1e([[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]])),pM}let o1=null;function S1e(){if(o1===null){o1=new E0(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=y1e()){const i=S1e(),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}}XP.INSTANCE=new XP;class k1e extends E0{constructor(e){super(0);for(let t=0,i=e.length;t(e.hasOwnProperty(t)||(e[t]=n(t)),e[t])}const Aa=D1e(n=>new k1e(n));var Qr;(function(n){n[n.Left=1]="Left",n[n.Center=2]="Center",n[n.Right=4]="Right",n[n.Full=7]="Full"})(Qr||(Qr={}));var $v;(function(n){n[n.Left=1]="Left",n[n.Right=2]="Right"})($v||($v={}));var yr;(function(n){n[n.Inline=1]="Inline",n[n.Gutter=2]="Gutter"})(yr||(yr={}));var Jl;(function(n){n[n.Both=0]="Both",n[n.Right=1]="Right",n[n.Left=2]="Left",n[n.None=3]="None"})(Jl||(Jl={}));class cD{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&&Gr(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 Lw{constructor(e,t){this._findMatchBrand=void 0,this.range=e,this.matches=t}}function E1e(n){return n&&typeof n.read=="function"}class mM{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 I1e{constructor(e,t,i){this.regex=e,this.wordSeparators=t,this.simpleSearch=i}}class T1e{constructor(e,t,i){this.reverseEdits=e,this.changes=t,this.trimAutoWhitespaceLineNumbers=i}}function x1e(n){return!n.isTooLargeForSyncing()&&!n.isForSimpleWidget}const N1e=999;class ip{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=A1e(this.searchString):e=this.searchString.indexOf("\n")>=0;let t=null;try{t=kX(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 I1e(t,this.wordSeparators?Aa(this.wordSeparators):null,i?this.searchString:null)}}function A1e(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 gp(n,e,t){if(!t)return new Lw(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 yL{static findMatches(e,t,i,s,o){const r=t.parseSearchRequest();return r?r.regex.multiline?this._doFindMatchesMultiline(e,i,new sv(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 I(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\n"?new DH(a):null,c=[];let d=0,u;for(i.reset(0);u=i.next(a);)if(c[d++]=gp(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 sv(e.wordSeparators,e.regex);let u;d.reset(0);do if(u=d.next(t),u&&(r[o++]=gp(new I(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 sv(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 Y(t.lineNumber,1),r=e.getOffsetAt(o),a=e.getLineCount(),l=e.getValueInRange(new I(o.lineNumber,o.column,a,e.getLineMaxColumn(a)),1),c=e.getEOL()==="\r\n"?new DH(l):null;i.reset(t.column-1);const d=i.next(l);return d?gp(this._getMultilineMatchRange(e,r,l,c,d.index,d[0]),d,s):t.lineNumber!==1||t.column!==1?this._doFindNextMatchMultiline(e,new Y(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?gp(new I(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 sv(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 I(1,1,t.lineNumber,t.column),i,s,10*N1e);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 Y(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=gp(new I(i,r.index+1,i,r.index+1+r[0].length),r,s);return o}}function M1e(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 R1e(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 V8(n,e,t,i,s){return M1e(n,e,t,i,s)&&R1e(n,e,t,i,s)}class sv{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){mE(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||V8(this._wordSeparators,e,t,s,o))return i}while(i);return null}}class H8{static computeUnicodeHighlights(e,t,i){const s=i?i.startLineNumber:1,o=i?i.endLineNumber:e.getLineCount(),r=new EH(t),a=r.getCandidateCodePoints();let l;a==="allNonBasicAscii"?l=new RegExp("[^\\t\\n\\r\\x20-\\x7E]","g"):l=new RegExp("".concat(P1e(Array.from(a))),"g");const c=new sv(null,l),d=[];let u=!1,h,f=0,g=0,p=0;e:for(let _=s,v=o;_<=v;_++){const b=e.getLineContent(_),C=b.length;c.reset(0);do if(h=c.next(b),h){let w=h.index,y=h.index+h[0].length;if(w>0){const D=b.charCodeAt(w-1);es(D)&&w--}if(y+1=D){u=!0;break e}d.push(new I(_,w+1,_,y+1))}}while(h)}return{ranges:d,hasMore:u,ambiguousCharacterCount:f,invisibleCharacterCount:g,nonBasicAsciiCharacterCount:p}}static computeUnicodeHighlightReason(e,t){const i=new EH(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=am.getLocales().filter(l=>!am.getInstance(new Set([...t.allowedLocales,l])).isAmbiguous(o));return{kind:0,confusableWith:String.fromCodePoint(r),notAmbiguousInLocales:a}}case 1:return{kind:2}}}}function P1e(n,e){return"[".concat(Xr(n.map(i=>String.fromCodePoint(i)).join("")),"]")}class EH{constructor(e){this.options=e,this.allowedCodePoints=new Set(e.allowedCodePoints),this.ambiguousCharacters=am.getInstance(new Set(e.allowedLocales))}getCandidateCodePoints(){if(this.options.nonBasicASCII)return"allNonBasicAscii";const e=new Set;if(this.options.invisibleCharacters)for(const t of pd.codePoints)IH(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=cS(r);s=s||l,!l&&!this.ambiguousCharacters.isAmbiguous(a)&&!pd.isInvisibleCharacter(a)&&(o=!0)}return!s&&o?0:this.options.invisibleCharacters&&!IH(e)&&pd.isInvisibleCharacter(i)?2:this.options.ambiguousCharacters&&this.ambiguousCharacters.isAmbiguous(i)?3:0}}function IH(n){return n===" "||n==="\n"||n===" "}class dD{constructor(e,t,i){this.changes=e,this.moves=t,this.hitTimeout=i}}class kQ{constructor(e,t){this.lineRangeMapping=e,this.changes=t}}class Bt{static addRange(e,t){let i=0;for(;it))return new Bt(e,t)}static ofLength(e){return new Bt(0,e)}constructor(e,t){if(this.start=e,this.endExclusive=t,e>t)throw new Rn("Invalid range: ".concat(this.toString()))}get isEmpty(){return this.start===this.endExclusive}delta(e){return new Bt(this.start+e,this.endExclusive+e)}deltaStart(e){return new Bt(this.start+e,this.endExclusive)}deltaEnd(e){return new Bt(this.start,this.endExclusive+e)}get length(){return this.endExclusive-this.start}toString(){return"[".concat(this.start,", ").concat(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 DE(n,e,t){const i=O1e(n,e);if(i!==-1)return n[i]}function O1e(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 kw(n,e){const t=Dw(n,e);return t===-1?void 0:n[t]}function Dw(n,e,t=0,i=n.length){let s=t,o=i;for(;s0&&(t=s)}return t}function B1e(n,e){if(n.length===0)return;let t=n[0];for(let i=1;i=0&&(t=s)}return t}function W1e(n,e){return DQ(n,(t,i)=>-e(t,i))}function V1e(n,e){if(n.length===0)return-1;let t=0;for(let i=1;i0&&(t=i)}return t}function H1e(n,e){for(const t of n){const i=e(t);if(i!==void 0)return i}}let Ht=class Ih{static fromRange(e){return new Ih(e.startLineNumber,e.endLineNumber)}static joinMany(e){if(e.length===0)return[];let t=new qc(e[0].slice());for(let i=1;it)throw new Rn("startLineNumber ".concat(e," cannot be after endLineNumberExclusive ").concat(t));this.startLineNumber=e,this.endLineNumberExclusive=t}contains(e){return this.startLineNumber<=e&&es.endLineNumberExclusive>=e.startLineNumber),i=Dw(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=kw(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 Ht(o.startLineNumber,Math.max(o.endLineNumberExclusive,r.endLineNumberExclusive)):(t.push(o),o=r)}return o!==null&&t.push(o),new qc(t)}subtractFrom(e){const t=Ew(this._normalizedRanges,r=>r.endLineNumberExclusive>=e.startLineNumber),i=Dw(this._normalizedRanges,r=>r.startLineNumber<=e.endLineNumberExclusive)+1;if(t===i)return new qc([e]);const s=[];let o=e.startLineNumber;for(let r=t;ro&&s.push(new Ht(o,a.startLineNumber)),o=a.endLineNumberExclusive}return oe.toString()).join(", ")}getIntersection(e){const t=[];let i=0,s=0;for(;it.delta(e)))}}class kd{static inverse(e,t,i){const s=[];let o=1,r=1;for(const l of e){const c=new Ma(new Ht(o,l.original.startLineNumber),new Ht(r,l.modified.startLineNumber),void 0);c.modified.isEmpty||s.push(c),o=l.original.endLineNumberExclusive,r=l.modified.endLineNumberExclusive}const a=new Ma(new Ht(o,t+1),new Ht(r,i+1),void 0);return a.modified.isEmpty||s.push(a),s}constructor(e,t){this.original=e,this.modified=t}toString(){return"{".concat(this.original.toString(),"->").concat(this.modified.toString(),"}")}flip(){return new kd(this.modified,this.original)}join(e){return new kd(this.original.join(e.original),this.modified.join(e.modified))}}class Ma extends kd{constructor(e,t,i){super(e,t),this.innerChanges=i}flip(){var e;return new Ma(this.modified,this.original,(e=this.innerChanges)===null||e===void 0?void 0:e.map(t=>t.flip()))}}class Gf{constructor(e,t){this.originalRange=e,this.modifiedRange=t}toString(){return"{".concat(this.originalRange.toString(),"->").concat(this.modifiedRange.toString(),"}")}flip(){return new Gf(this.modifiedRange,this.originalRange)}}const $1e=3;class z1e{computeDiff(e,t,i){var s;const r=new K1e(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 Ht(c.originalStartLineNumber+1,c.originalStartLineNumber+1):d=new Ht(c.originalStartLineNumber,c.originalEndLineNumber+1);let u;c.modifiedEndLineNumber===0?u=new Ht(c.modifiedStartLineNumber+1,c.modifiedStartLineNumber+1):u=new Ht(c.modifiedStartLineNumber,c.modifiedEndLineNumber+1);let h=new Ma(d,u,(s=c.charChanges)===null||s===void 0?void 0:s.map(f=>new Gf(new I(f.originalStartLineNumber,f.originalStartColumn,f.originalEndLineNumber,f.originalEndColumn),new I(f.modifiedStartLineNumber,f.modifiedStartColumn,f.modifiedEndLineNumber,f.modifiedEndColumn))));l&&(l.modified.endLineNumberExclusive===h.modified.startLineNumber||l.original.endLineNumberExclusive===h.original.startLineNumber)&&(h=new Ma(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 Cw(()=>FX(a,(c,d)=>d.original.startLineNumber-c.original.endLineNumberExclusive===d.modified.startLineNumber-c.modified.endLineNumberExclusive&&c.original.endLineNumberExclusive(e===10?"\\n":String.fromCharCode(e))+"-(".concat(this._lineNumbers[t],",").concat(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 zv{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 zv(s,o,r,a,l,c,d,u)}}function j1e(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=EQ(f,g,o,!0).changes;a&&(p=j1e(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=JP(h,1),p=JP(f,1);const _=h.length+1,v=f.length+1;for(;g<_&&p!0;const e=Date.now();return()=>Date.now()-e{i.push(bs.fromOffsetPairs(s?s.getEndExclusives():td.zero,o?o.getStarts():new td(t,(s?s.seq2Range.endExclusive-s.seq1Range.endExclusive:0)+t)))}),i}static fromOffsetPairs(e,t){return new bs(new Bt(e.offset1,t.offset1),new Bt(e.offset2,t.offset2))}constructor(e,t){this.seq1Range=e,this.seq2Range=t}swap(){return new bs(this.seq2Range,this.seq1Range)}toString(){return"".concat(this.seq1Range," <-> ").concat(this.seq2Range)}join(e){return new bs(this.seq1Range.join(e.seq1Range),this.seq2Range.join(e.seq2Range))}delta(e){return e===0?this:new bs(this.seq1Range.delta(e),this.seq2Range.delta(e))}deltaStart(e){return e===0?this:new bs(this.seq1Range.deltaStart(e),this.seq2Range.deltaStart(e))}deltaEnd(e){return e===0?this:new bs(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 bs(t,i)}getStarts(){return new td(this.seq1Range.start,this.seq2Range.start)}getEndExclusives(){return new td(this.seq1Range.endExclusive,this.seq2Range.endExclusive)}}class td{constructor(e,t){this.offset1=e,this.offset2=t}toString(){return"".concat(this.offset1," <-> ").concat(this.offset2)}}td.zero=new td(0,0);td.max=new td(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER);class Iw{isValid(){return!0}}Iw.instance=new Iw;class q1e{constructor(e){if(this.timeout=e,this.startTime=Date.now(),this.valid=!0,e<=0)throw new Rn("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 C=Math.max(_,v,b);if(C===b){const w=g>0&&p>0?a.get(g-1,p-1):0;a.set(g,p,w+1),r.set(g,p,3)}else C===_?(a.set(g,p,0),r.set(g,p,1)):C===v&&(a.set(g,p,0),r.set(g,p,2));o.set(g,p,C)}const l=[];let c=e.length,d=t.length;function u(g,p){(g+1!==c||p+1!==d)&&l.push(new bs(new Bt(g+1,c),new Bt(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 Pu(l,!1)}}class IQ{compute(e,t,i=Iw.instance){if(e.length===0||t.length===0)return Pu.trivial(e,t);const s=e,o=t;function r(p,_){for(;ps.length||w>o.length)continue;const y=r(C,w);l.set(d,y);const L=C===v?c.get(d+1):c.get(d-1);if(c.set(d,y!==C?new NH(L,C,w,y-C):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 bs(new Bt(p,f),new Bt(_,g))),!u)break;f=u.x,g=u.y,u=u.prev}return h.reverse(),new Pu(h,!1)}}class NH{constructor(e,t,i,s){this.prev=e,this.x=t,this.y=i,this.length=s}}class Y1e{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 Z1e{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 AH,MH;class X1e{constructor(e,t){this.uri=e,this.value=t}}function Q1e(n){return Array.isArray(n)}class Js{constructor(e,t){if(this[AH]="ResourceMap",e instanceof Js)this.map=new Map(e.map),this.toKey=t!=null?t:Js.defaultToKey;else if(Q1e(e)){this.map=new Map,this.toKey=t!=null?t:Js.defaultToKey;for(const[i,s]of e)this.set(i,s)}else this.map=new Map,this.toKey=e!=null?e:Js.defaultToKey}set(e,t){return this.map.set(this.toKey(e),new X1e(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]}*[(AH=Symbol.toStringTag,Symbol.iterator)](){for(const[,e]of this.map)yield[e.uri,e.value]}}Js.defaultToKey=n=>n.toString();class J1e{constructor(){this[MH]="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}[(MH=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 Dg extends J1e{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 eCe{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 z8{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 EE{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 Bt(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=PH(e>0?this.elements[e-1]:-1),i=PH(ei<=e);return new Y(this.lineRange.start+t+1,e-this.firstCharOffsetByLine[t]+this.additionalOffsetByLine[t]+1)}translateRange(e){return I.fromPositions(this.translateOffset(e.start),this.translateOffset(e.endExclusive))}findWordContaining(e){if(e<0||e>=this.elements.length||!vM(this.elements[e]))return;let t=e;for(;t>0&&vM(this.elements[t-1]);)t--;let i=e;for(;ir<=e.start))!==null&&t!==void 0?t:0,o=(i=F1e(this.firstCharOffsetByLine,r=>e.endExclusive<=r))!==null&&i!==void 0?i:this.elements.length;return new Bt(s,o)}}function vM(n){return n>=97&&n<=122||n>=65&&n<=90||n>=48&&n<=57}const tCe={0:0,1:0,2:0,3:10,4:2,5:3,6:10,7:10};function RH(n){return tCe[n]}function PH(n){return n===10?7:n===13?6:eO(n)?5:n>=97&&n<=122?0:n>=65&&n<=90?1:n>=48&&n<=57?2:n===-1?3:4}function iCe(n,e,t,i,s,o){let{moves:r,excludedChanges:a}=nCe(n,e,t,o);if(!o.isValid())return[];const l=n.filter(d=>!a.has(d)),c=sCe(l,i,s,e,t,o);return W2(r,c),r=oCe(r),r=r.filter(d=>d.original.toOffsetRange().slice(e).map(h=>h.trim()).join("\n").length>=10),r=rCe(n,r),r}function nCe(n,e,t,i){const s=[],o=n.filter(l=>l.modified.isEmpty&&l.original.length>=3).map(l=>new Db(l.original,e,l)),r=new Set(n.filter(l=>l.original.isEmpty&&l.modified.length>=3).map(l=>new Db(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 kd(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 sCe(n,e,t,i,s,o){const r=[],a=new z8;for(const h of n)for(let f=h.original.startLineNumber;fh.modified.startLineNumber,Mu));for(const h of n){let f=[];for(let g=h.modified.startLineNumber;g{for(const w of f)if(w.originalLineRange.endLineNumberExclusive+1===b.endLineNumberExclusive&&w.modifiedLineRange.endLineNumberExclusive+1===_.endLineNumberExclusive){w.originalLineRange=new Ht(w.originalLineRange.startLineNumber,b.endLineNumberExclusive),w.modifiedLineRange=new Ht(w.modifiedLineRange.startLineNumber,_.endLineNumberExclusive),v.push(w);return}const C={modifiedLineRange:_,originalLineRange:b};l.push(C),v.push(C)}),f=v}if(!o.isValid())return[]}l.sort(qZ(Sa(h=>h.modifiedLineRange.length,Mu)));const c=new qc,d=new qc;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,C=v.delta(-f);r.push(new kd(C,b)),c.addRange(b),d.addRange(C)}}r.sort(Sa(h=>h.original.startLineNumber,Mu));const u=new hS(n);for(let h=0;hL.original.startLineNumber<=f.original.startLineNumber),p=kw(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||S>s.length||c.contains(S)||d.contains(L)||!OH(i[L-1],s[S-1],o))break}w>0&&(d.addRange(new Ht(f.original.startLineNumber-w,f.original.startLineNumber)),c.addRange(new Ht(f.modified.startLineNumber-w,f.modified.startLineNumber)));let y;for(y=0;yi.length||S>s.length||c.contains(S)||d.contains(L)||!OH(i[L-1],s[S-1],o))break}y>0&&(d.addRange(new Ht(f.original.endLineNumberExclusive,f.original.endLineNumberExclusive+y)),c.addRange(new Ht(f.modified.endLineNumberExclusive,f.modified.endLineNumberExclusive+y))),(w>0||y>0)&&(r[h]=new kd(new Ht(f.original.startLineNumber-w,f.original.endLineNumberExclusive+y),new Ht(f.modified.startLineNumber-w,f.modified.endLineNumberExclusive+y)))}return r}function OH(n,e,t){if(n.trim()===e.trim())return!0;if(n.length>300&&e.length>300)return!1;const s=new IQ().compute(new EE([n],new Bt(0,1),!1),new EE([e],new Bt(0,1),!1),t);let o=0;const r=bs.invert(s.diffs,n.length);for(const d of r)d.seq1Range.forEach(u=>{eO(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 oCe(n){if(n.length===0)return n;n.sort(Sa(t=>t.original.startLineNumber,Mu));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 rCe(n,e){const t=new hS(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 lCe(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 cCe(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 bs(o.seq1Range.join(s.seq1Range),o.seq2Range.join(s.seq2Range)):i.push(s)}return i}function dCe(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 bs(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 hCe(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 fCe(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),C=f.seq1Range.length,w=e.countLinesIn(f.seq2Range),y=f.seq2Range.length,L=n.countLinesIn(g.seq1Range),S=g.seq1Range.length,k=e.countLinesIn(g.seq2Range),D=g.seq2Range.length,x=2*40+50;function A(T){return Math.min(T,x)}return Math.pow(Math.pow(A(b*40+C),1.5)+Math.pow(A(w*40+y),1.5),1.5)+Math.pow(Math.pow(A(L*40+S),1.5)+Math.pow(A(k*40+D),1.5),1.5)>Math.pow(Math.pow(x,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 Sme(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 Bt(h.start,l.seq1Range.start));u(f)&&(d=d.deltaStart(-f.length));const g=n.getText(new Bt(l.seq1Range.endExclusive,h.endExclusive));u(g)&&(d=d.deltaEnd(g.length));const p=bs.fromOffsetPairs(a?a.getEndExclusives():td.zero,c?c.getStarts():td.max),_=d.intersect(p);r.push(_)}),r}class BH{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:WH(this.lines[e-1]),i=e===this.lines.length?0:WH(this.lines[e]);return 1e3-(t+i)}getText(e){return this.lines.slice(e.start,e.endExclusive).join("\n")}isStronglyEqual(e,t){return this.lines[e]===this.lines[t]}}function WH(n){let e=0;for(;ey===L))return new dD([],[],!1);if(e.length===1&&e[0].length===0||t.length===1&&t[0].length===0)return new dD([new Ma(new Ht(1,e.length+1),new Ht(1,t.length+1),[new Gf(new I(1,1,e.length,e[0].length+1),new I(1,1,t.length,t[0].length+1))])],[],!1);const s=i.maxComputationTimeMs===0?Iw.instance:new q1e(i.maxComputationTimeMs),o=!i.ignoreTrimWhitespace,r=new Map;function a(y){let L=r.get(y);return L===void 0&&(L=r.size,r.set(y,L)),L}const l=e.map(y=>a(y.trim())),c=t.map(y=>a(y.trim())),d=new BH(l,e),u=new BH(c,t),h=(()=>d.length+u.length<1700?this.dynamicProgrammingDiffing.compute(d,u,s,(y,L)=>e[y]===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=tO(d,u,f),f=hCe(d,u,f);const p=[],_=y=>{if(o)for(let L=0;Ly.seq1Range.start-v===y.seq2Range.start-b);const L=y.seq1Range.start-v;_(L),v=y.seq1Range.endExclusive,b=y.seq2Range.endExclusive;const S=this.refineDiff(e,t,y,s,o);S.hitTimeout&&(g=!0);for(const k of S.mappings)p.push(k)}_(e.length-v);const C=VH(p,e,t);let w=[];return i.computeMoves&&(w=this.computeMoves(C,e,t,l,c,s,o)),Cw(()=>{function y(S,k){if(S.lineNumber<1||S.lineNumber>k.length)return!1;const D=k[S.lineNumber-1];return!(S.column<1||S.column>D.length+1)}function L(S,k){return!(S.startLineNumber<1||S.startLineNumber>k.length+1||S.endLineNumberExclusive<1||S.endLineNumberExclusive>k.length+1)}for(const S of C){if(!S.innerChanges)return!1;for(const k of S.innerChanges)if(!(y(k.modifiedRange.getStartPosition(),t)&&y(k.modifiedRange.getEndPosition(),t)&&y(k.originalRange.getStartPosition(),e)&&y(k.originalRange.getEndPosition(),e)))return!1;if(!L(S.modified,t)||!L(S.original,e))return!1}return!0}),new dD(C,w,g)}computeMoves(e,t,i,s,o,r,a){return iCe(e,t,i,s,o,r).map(d=>{const u=this.refineDiff(t,i,new bs(d.original.toOffsetRange(),d.modified.toOffsetRange()),r,a),h=VH(u.mappings,t,i,!0);return new kQ(d,h)})}refineDiff(e,t,i,s,o){const r=new EE(e,i.seq1Range,o),a=new EE(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=tO(r,a,c),c=dCe(r,a,c),c=cCe(r,a,c),c=fCe(r,a,c),{mappings:c.map(u=>new Gf(r.translateRange(u.seq1Range),a.translateRange(u.seq2Range))),hitTimeout:l.hitTimeout}}}function VH(n,e,t,i=!1){const s=[];for(const o of $Z(n.map(r=>gCe(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 Ma(r.original.join(a.original),r.modified.join(a.modified),o.map(l=>l.innerChanges[0])))}return Cw(()=>!i&&s.length>0&&s[0].original.startLineNumber!==s[0].modified.startLineNumber?!1:FX(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 Ht(n.originalRange.startLineNumber+i,n.originalRange.endLineNumber+1+s),r=new Ht(n.modifiedRange.startLineNumber+i,n.modifiedRange.endLineNumber+1+s);return new Ma(o,r,[n])}const HH={getLegacy:()=>new z1e,getDefault:()=>new TQ};function Cf(n,e){const t=Math.pow(10,e);return Math.round(n*t)/t}class jt{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=Cf(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 Xa{constructor(e,t,i,s){this._hslaBrand=void 0,this.h=Math.max(Math.min(360,e),0)|0,this.s=Cf(Math.max(Math.min(1,t),0),3),this.l=Cf(Math.max(Math.min(1,i),0),3),this.a=Cf(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=Xa._hue2rgb(d,c,t+1/3),a=Xa._hue2rgb(d,c,t),l=Xa._hue2rgb(d,c,t-1/3)}return new jt(Math.round(r*255),Math.round(a*255),Math.round(l*255),o)}}class id{constructor(e,t,i,s){this._hsvaBrand=void 0,this.h=Math.max(Math.min(360,e),0)|0,this.s=Cf(Math.max(Math.min(1,t),0),3),this.v=Cf(Math.max(Math.min(1,i),0),3),this.a=Cf(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 id(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 jt(c,d,u,o)}}class ee{static fromHex(e){return ee.Format.CSS.parseHex(e)||ee.red}static equals(e,t){return!e&&!t?!0:!e||!t?!1:e.equals(t)}get hsla(){return this._hsla?this._hsla:Xa.fromRGBA(this.rgba)}get hsva(){return this._hsva?this._hsva:id.fromRGBA(this.rgba)}constructor(e){if(e)if(e instanceof jt)this.rgba=e;else if(e instanceof Xa)this._hsla=e,this.rgba=Xa.toRGBA(e);else if(e instanceof id)this._hsva=e,this.rgba=id.toRGBA(e);else throw new Error("Invalid color ctor argument");else throw new Error("Color needs a value")}equals(e){return!!e&&jt.equals(this.rgba,e.rgba)&&Xa.equals(this.hsla,e.hsla)&&id.equals(this.hsva,e.hsva)}getRelativeLuminance(){const e=ee._relativeLuminanceForComponent(this.rgba.r),t=ee._relativeLuminanceForComponent(this.rgba.g),i=ee._relativeLuminanceForComponent(this.rgba.b),s=.2126*e+.7152*t+.0722*i;return Cf(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=$H(r1(n,s),a1(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=$H(r1(n,s),a1(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=zH(r1(n,s),a1(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=zH(r1(n,s),a1(a,c),!0)}else r==="#"&&(l=pCe(r1(n,s),r+a));l&&e.push(l)}return e}function _Ce(n){return!n||typeof n.getValue!="function"||typeof n.positionAt!="function"?[]:mCe(n)}var _h=globalThis&&globalThis.__awaiter||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 vCe extends b1e{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 wf{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 vCe(ct.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 _h(this,void 0,void 0,function*(){const s=this._getModel(e);return s?H8.computeUnicodeHighlights(s,t,i):{ranges:[],hasMore:!1,ambiguousCharacterCount:0,invisibleCharacterCount:0,nonBasicAsciiCharacterCount:0}})}computeDiff(e,t,i,s){return _h(this,void 0,void 0,function*(){const o=this._getModel(e),r=this._getModel(t);return!o||!r?null:wf.computeDiff(o,r,i,s)})}static computeDiff(e,t,i,s){const o=s==="advanced"?HH.getDefault():HH.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 _h(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 I.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;lwf._diffLimit){o.push({range:l,text:c});continue}const h=m1e(u,c,i),f=s.offsetAt(I.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 _h(this,void 0,void 0,function*(){const t=this._getModel(e);return t?L1e(t):null})}computeDefaultDocumentColors(e){return _h(this,void 0,void 0,function*(){const t=this._getModel(e);return t?_Ce(t):null})}textualSuggest(e,t,i,s){return _h(this,void 0,void 0,function*(){const o=new so,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>wf._suggestionsLimit))break e}}return{words:Array.from(a),duration:o.elapsed()}})}computeWordRanges(e,t,i,s){return _h(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(h8(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)}}}wf._diffLimit=1e5;wf._suggestionsLimit=1e4;typeof importScripts=="function"&&(globalThis.monaco=yX());const j8=Wt("textResourceConfigurationService"),NQ=Wt("textResourcePropertiesService"),Ze=Wt("ILanguageFeaturesService");var bCe=globalThis&&globalThis.__decorate||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},l1=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},IE=globalThis&&globalThis.__awaiter||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 UH=60*1e3,jH=5*60*1e3;function pp(n,e){const t=n.getModel(e);return!(!t||t.isTooLargeForSyncing())}let iO=class extends te{constructor(e,t,i,s,o){super(),this._modelService=e,this._workerManager=this._register(new wCe(this._modelService,s)),this._logService=i,this._register(o.linkProvider.register({language:"*",hasAccessToAllModels:!0},{provideLinks:(r,a)=>pp(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 CCe(this._workerManager,t,this._modelService,s)))}dispose(){super.dispose()}canComputeUnicodeHighlights(e){return pp(this._modelService,e)}computedUnicodeHighlights(e,t,i){return this._workerManager.withWorker().then(s=>s.computedUnicodeHighlights(e,t,i))}computeDiff(e,t,i,s){return IE(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 kQ(new kd(new Ht(l[0],l[1]),new Ht(l[2],l[3])),a(l[4])))};function a(l){return l.map(c=>{var d;return new Ma(new Ht(c[0],c[1]),new Ht(c[2],c[3]),(d=c[4])===null||d===void 0?void 0:d.map(u=>new Gf(new I(u[0],u[1],u[2],u[3]),new I(u[4],u[5],u[6],u[7]))))})}})}computeMoreMinimalEdits(e,t,i=!1){if(io(t)){if(!pp(this._modelService,e))return Promise.resolve(t);const s=so.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,jf(1e3).then(()=>t)])}else return Promise.resolve(void 0)}canNavigateValueSet(e){return pp(this._modelService,e)}navigateValueSet(e,t,i){return this._workerManager.withWorker().then(s=>s.navigateValueSet(e,t,i))}canComputeWordRanges(e){return pp(this._modelService,e)}computeWordRanges(e,t){return this._workerManager.withWorker().then(i=>i.computeWordRanges(e,t))}};iO=bCe([l1(0,Zi),l1(1,j8),l1(2,aa),l1(3,Ni),l1(4,Ze)],iO);class CCe{constructor(e,t,i,s){this.languageConfigurationService=s,this._debugDisplayName="wordbasedCompletions",this._workerManager=e,this._configurationService=t,this._modelService=i}provideCompletionItems(e,t){return IE(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")pp(this._modelService,e.uri)&&s.push(e.uri);else for(const u of this._modelService.getModels())pp(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 I(t.lineNumber,r.startColumn,t.lineNumber,r.endColumn):I.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 wCe extends te{constructor(e,t){super(),this.languageConfigurationService=t,this._modelService=e,this._editorWorkerClient=null,this._lastWorkerUsedTime=new Date().getTime(),this._register(new uS).cancelAndSet(()=>this._checkStopIdleWorker(),Math.round(jH/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>jH&&(this._editorWorkerClient.dispose(),this._editorWorkerClient=null)}withWorker(){return this._lastWorkerUsedTime=new Date().getTime(),this._editorWorkerClient||(this._editorWorkerClient=new K8(this._modelService,!1,"editorWorkerService",this.languageConfigurationService)),Promise.resolve(this._editorWorkerClient)}}class yCe extends te{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 uS;s.cancelAndSet(()=>this._checkStopModelSync(),Math.round(UH/2)),this._register(s)}}dispose(){for(const e in this._syncedModels)fi(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]>UH&&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 be;o.add(i.onDidChangeContent(r=>{this._proxy.acceptModelChanged(s.toString(),r)})),o.add(i.onWillDispose(()=>{this._stopModelSync(s)})),o.add(vt(()=>{this._proxy.acceptRemovedModel(s)})),this._syncedModels[s]=o}_stopModelSync(e){const t=this._syncedModels[e];delete this._syncedModels[e],delete this._syncedModelsLastUsedTime[e],fi(t)}}class KH{constructor(e){this._instance=e,this._proxyObj=Promise.resolve(this._instance)}dispose(){this._instance.dispose()}getProxyObject(){return this._proxyObj}}class bM{constructor(e){this._workerClient=e}fhr(e,t){return this._workerClient.fhr(e,t)}}class K8 extends te{constructor(e,t,i,s){super(),this.languageConfigurationService=s,this._disposed=!1,this._modelService=e,this._keepIdleModels=t,this._workerFactory=new ax(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 k0e(this._workerFactory,"vs/editor/common/services/editorSimpleWorker",new bM(this)))}catch(e){qP(e),this._worker=new KH(new wf(new bM(this),null))}return this._worker}_getProxy(){return this._getOrCreateWorker().getProxyObject().then(void 0,e=>(qP(e),this._worker=new KH(new wf(new bM(this),null)),this._getOrCreateWorker().getProxyObject()))}_getOrCreateModelManager(e){return this._modelManager||(this._modelManager=this._register(new yCe(e,this._modelService,this._keepIdleModels))),this._modelManager}_withSyncedResources(e,t=!1){return IE(this,void 0,void 0,function*(){return this._disposed?Promise.reject(O_e()):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 IE(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 SCe(n,e,t){return new LCe(n,e,t)}class LCe extends K8{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?h8(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 fS={ICodeEditor:"vs.editor.ICodeEditor",IDiffEditor:"vs.editor.IDiffEditor"},Eb=new class{clone(){return this}equals(n){return this===n}};function q8(n,e){return new S8([new gw(0,"",n)],e)}function px(n,e){const t=new Uint32Array(2);return t[0]=0,t[1]=(n<<0|0|0|32768|2<<24)>>>0,new jT(t,e===null?Eb:e)}class Fs{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: ".concat(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:".concat(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 ts{static createEmpty(e,t){const i=ts.defaultTokenMetadata,s=new Uint32Array(2);return s[0]=e.length,s[1]=i,new ts(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 ts?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=Fs.getLanguageId(t);return this._languageIdCodec.decodeLanguageId(i)}getStandardTokenType(e){const t=this._tokens[(e<<1)+1];return Fs.getTokenType(t)}getForeground(e){const t=this._tokens[(e<<1)+1];return Fs.getForeground(t)}getClassName(e){const t=this._tokens[(e<<1)+1];return Fs.getClassNameFromMetadata(t)}getInlineStyle(e,t){const i=this._tokens[(e<<1)+1];return Fs.getInlineStyleFromMetadata(i,t)}getPresentation(e){const t=this._tokens[(e<<1)+1];return Fs.getPresentationFromMetadata(t)}getEndOffset(e){return this._tokens[e<<1]}findTokenIndexAtOffset(e){return ts.findIndexInTokensArray(this._tokens,e)}inflate(){return this}sliceAndInflate(e,t,i){return new G8(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 ts(new Uint32Array(o),s,this._languageIdCodec)}}ts.defaultTokenMetadata=(32768|2<<24)>>>0;class G8{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 G8?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 br{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 br(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 br(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=br._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 kCe{static normalize(e,t){if(t.length===0)return[];const i=[],s=new TE;let o=0;for(let r=0,a=t.length;r1){const p=e.charCodeAt(c-2);es(p)&&c--}if(d>1){const p=e.charCodeAt(d-2);es(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 ds{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 AQ{constructor(e,t){this.startOffset=e,this.endOffset=t}equals(e){return this.startOffset===e.startOffset&&this.endOffset===e.endOffset}}class Eg{constructor(e,t,i,s,o,r,a,l,c,d,u,h,f,g,p,_,v,b,C){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(br.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=C&&C.sort((L,S)=>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=$c.getPartIndex(t),s=$c.getCharIndex(t);return new MQ(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=$c.getPartIndex(a),d=$c.getCharIndex(a),u=$c.getPartIndex(l);let h;c!==u?h=t:h=$c.getCharIndex(l);const f=i-d,g=h-i;return f<=g?o:r}}class nO{constructor(e,t,i){this._renderLineOutputBrand=void 0,this.characterMapping=e,this.containsRTL=t,this.containsForeignElements=i}}function gS(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 $c(1,t+i);return o.setColumnInfo(1,t,0,0),new nO(o,!1,s)}return e.appendString(""),new nO(new $c(0,0),!1,0)}return RCe(ICe(n),e)}class DCe{constructor(e,t,i,s){this.characterMapping=e,this.html=t,this.containsRTL=i,this.containsForeignElements=s}}function mx(n){const e=new D0(1e4),t=gS(n,e);return new DCe(t.characterMapping,e.build(),t.containsRTL,t.containsForeignElements)}class ECe{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 ICe(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 ds(i,"",0,!1));let a=i;for(let l=0,c=t.getCount();l=s){const f=e?Cb(n.substring(a,s)):!1;o[r++]=new ds(s,u,0,f);break}const h=e?Cb(n.substring(a,d)):!1;o[r++]=new ds(d,u,0,h),a=d}return o}function xCe(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 ds(f+1,d,u,h),g=f+1,f=-1);g!==c&&(s[o++]=new ds(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 NCe(n,e){const t=[];let i=new ds(0,"",0,!1),s=0;for(const o of e){const r=o.endIndex;for(;si.endIndex&&(i=new ds(s,o.type,o.metadata,o.containsRTL),t.push(i)),i=new ds(s+1,"mtkcontrol",o.metadata,!1),t.push(i))}s>i.endIndex&&(i=new ds(r,o.type,o.metadata,o.containsRTL),t.push(i))}return t}function ACe(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 C=i.length;let w=!1,y=bo(e),L;y===-1?(w=!0,y=t,L=t):L=oc(e);let S=!1,k=0,D=c&&c[k],x=a%r;for(let T=o;T=D.endOffset&&(k++,D=c&&c[k]);let W;if(TL)W=!0;else if(P===9)W=!0;else if(P===32)if(d)if(S)W=!0;else{const $=T+1T),W&&u&&(W=w||T>L),W&&v&&T>=y&&T<=L&&(W=!1),S){if(!W||!l&&x>=r){if(h){const $=g>0?f[g-1].endIndex:o;for(let X=$+1;X<=T;X++)f[g++]=new ds(X,"mtkw",1,!1)}else f[g++]=new ds(T,"mtkw",1,!1);x=x%r}}else(T===b||W&&T>o)&&(f[g++]=new ds(T,_,0,v),x=x%r);for(P===9?x=r:zf(P)?x+=2:x++,S=W;T===b&&(p++,p0?e.charCodeAt(t-1):0,P=t>1?e.charCodeAt(t-2):0;T===32&&P!==32&&P!==9||(A=!0)}else A=!0;if(A)if(h){const T=g>0?f[g-1].endIndex:o;for(let P=T+1;P<=t;P++)f[g++]=new ds(P,"mtkw",1,!1)}else f[g++]=new ds(t,"mtkw",1,!1);else f[g++]=new ds(t,_,0,v);return f}function MCe(n,e,t,i){i.sort(br.compare);const s=kCe.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 ds(c,p,_,v)),b.endOffset+1<=g)c=b.endOffset+1,a[l++]=new ds(c,p+" "+b.className,_|b.metadata,v),r++;else{c=g,a[l++]=new ds(c,p+" "+b.className,_|b.metadata,v);break}}g>c&&(c=g,a[l++]=new ds(c,p,_,v))}const d=t[t.length-1].endIndex;if(r'):e.appendString("");for(let D=0,x=c.length;D=d&&(de+=ie)}}for(X&&(e.appendString(' style="width:'),e.appendString(String(g*Q)),e.appendString('px"')),e.appendASCIICharCode(62);w1?e.appendCharCode(8594):e.appendCharCode(65515);for(let ie=2;ie<=_e;ie++)e.appendCharCode(160)}else de=2,_e=1,e.appendCharCode(p),e.appendCharCode(8204);L+=de,S+=_e,w>=d&&(y+=_e)}}else for(e.appendASCIICharCode(62);w=d&&(y+=de)}J?k++:k=0,w>=r&&!C&&A.isPseudoAfter()&&(C=!0,b.setColumnInfo(w+1,D,L,S)),e.appendString("")}return C||b.setColumnInfo(r+1,c.length-1,L,S),a&&(e.appendString(''),e.appendString(m("showMore","Show more ({0})",OCe(l))),e.appendString("")),e.appendString(""),new nO(b,f,s)}function PCe(n){return n.toString(16).toUpperCase().padStart(4,"0")}function OCe(n){return n<1024?m("overflow.chars","{0} chars",n):n<1024*1024?"".concat((n/1024).toFixed(1)," KB"):"".concat((n/1024/1024).toFixed(1)," MB")}class GH{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 FCe{constructor(e,t){this.tabSize=e,this.data=t}}class Y8{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 Jr{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=Jr.isBasicASCII(i,r),this.containsRTL=Jr.containsRTL(i,this.isBasicASCII,o),this.tokens=a,this.inlineDecorations=l,this.tabSize=c,this.startVisibleColumn=d}static isBasicASCII(e,t){return t?cS(e):!0}static containsRTL(e,t,i){return!t&&i?Cb(e):!1}}class vC{constructor(e,t,i){this.range=e,this.inlineClassName=t,this.type=i}}class BCe{constructor(e,t,i,s){this.startOffset=e,this.endOffset=t,this.inlineClassName=i,this.inlineClassNameAffectsLetterSpacing=s}toInlineDecoration(e){return new vC(new I(e,this.startOffset+1,e,this.endOffset+1),this.inlineClassName,this.inlineClassNameAffectsLetterSpacing?3:0)}}class PQ{constructor(e,t){this._viewModelDecorationBrand=void 0,this.range=e,this.options=t}}class Tw{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&&yn(e.data,t.data)}static equalsArr(e,t){return yn(e,t,Tw.equals)}}function WCe(n){return Array.isArray(n)}function VCe(n){return!WCe(n)}function OQ(n){return typeof n=="string"}function YH(n){return!OQ(n)}function K_(n){return!n}function yf(n,e){return n.ignoreCase&&e?e.toLowerCase():e}function ZH(n){return n.replace(/[&<>'"_]/g,"-")}function HCe(n,e){console.log("".concat(n.languageId,": ").concat(e))}function Wi(n,e){return new Error("".concat(n.languageId,": ").concat(e))}function $h(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 K_(c)?K_(d)?!K_(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 $Ce(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 zCe=globalThis&&globalThis.__decorate||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},UCe=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},sO;const FQ=5;class xw{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 Uv(e,t);let i=Uv.getStackElementId(e);i.length>0&&(i+="|"),i+=t;let s=this._entries[i];return s||(s=new Uv(e,t),this._entries[i]=s,s)}}xw._INSTANCE=new xw(FQ);class Uv{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 Uv._equals(this,e)}push(e){return xw.create(this,e)}pop(){return this.parent}popall(){let e=this;for(;e.parent;)e=e.parent;return e}switchTo(e){return xw.create(this.parent,e)}}class ov{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 ov(this.languageId,this.state)}}class zh{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 bC(e,t);if(e!==null&&e.depth>=this._maxCacheDepth)return new bC(e,t);const i=Uv.getStackElementId(e);let s=this._entries[i];return s||(s=new bC(e,null),this._entries[i]=s,s)}}zh._INSTANCE=new zh(FQ);class bC{constructor(e,t){this.stack=e,this.embeddedLanguageData=t}clone(){return(this.embeddedLanguageData?this.embeddedLanguageData.clone():null)===this.embeddedLanguageData?this:zh.create(this.stack,this.embeddedLanguageData)}equals(e){return!(e instanceof bC)||!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 jCe{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 gw(e,t,this._languageId)))}nestedLanguageTokenize(e,t,i,s){const o=i.languageId,r=i.state,a=nn.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 gw(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 S8(this._tokens,e)}}class xE{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=nn.get(t);if(i){if(i instanceof sO){const s=i.getLoadStatus();s.loaded===!1&&e.push(s.promise)}continue}nn.isResolved(t)||e.push(nn.getOrCreate(t))}return e.length===0?{loaded:!0}:{loaded:!1,promise:Promise.all(e).then(t=>{})}}getInitialState(){const e=xw.create(null,this._lexer.start);return zh.create(e,null)}tokenize(e,t,i){if(e.length>=this._maxTokenizationLineLength)return q8(this._languageId,i);const s=new jCe,o=this._tokenize(e,t,i,s);return s.finalize(o)}tokenizeEncoded(e,t,i){if(e.length>=this._maxTokenizationLineLength)return px(this._languageService.languageIdCodec.encodeLanguageId(this._languageId),i);const s=new xE(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=SL(this._lexer,t.stack.state),!i))throw Wi(this._lexer,"tokenizer state is not defined: "+t.stack.state);let s=-1,o=!1;for(const r of i){if(!YH(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+"\n":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 D=this._lexer.tokenizer[v];if(!D&&(D=SL(this._lexer,v),!D))throw Wi(this._lexer,"tokenizer state is not defined: "+v);const x=a.substr(u);for(const A of D)if((u===0||!A.matchOnlyAtLineStart)&&(b=x.match(A.regex),b)){C=b[0],w=A.action;break}}if(b||(b=[""],C=""),w||(u=this._lexer.maxStack)throw Wi(this._lexer,"maximum tokenizer stack size reached: ["+d.state+","+d.parent.state+",...]");d=d.push(v)}else if(w.next==="@pop"){if(d.depth<=1)throw Wi(this._lexer,"trying to pop an empty stack in rule: "+this._safeRuleName(y));d=d.pop()}else if(w.next==="@popall")d=d.popall();else{let D=$h(this._lexer,w.next,C,b,v);if(D[0]==="@"&&(D=D.substr(1)),SL(this._lexer,D))d=d.push(D);else throw Wi(this._lexer,"trying to set a next state '"+D+"' that is undefined in rule: "+this._safeRuleName(y))}}w.log&&typeof w.log=="string"&&HCe(this._lexer,this._lexer.languageId+": "+$h(this._lexer,w.log,C,b,v))}if(S===null)throw Wi(this._lexer,"lexer rule has no well-defined action in rule: "+this._safeRuleName(y));const k=D=>{const x=this._languageService.getLanguageIdByLanguageName(D)||this._languageService.getLanguageIdByMimeType(D)||D,A=this._getNestedEmbeddedLanguageData(x);if(u0)throw Wi(this._lexer,"groups cannot be nested: "+this._safeRuleName(y));if(b.length!==S.length+1)throw Wi(this._lexer,"matched number of groups does not match the number of actions in rule: "+this._safeRuleName(y));let D=0;for(let x=1;xn});class Z8{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=CM==null?void 0:CM.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 qCe(this,void 0,void 0,function*(){const o=e.languageIdCodec;let r=4;s&&typeof s.tabSize=="number"&&(r=s.tabSize),x8(t)&&(t=t.substr(1));const a=Sd(t);if(!e.isRegisteredLanguageId(i))return XH(a,r,o);const l=yield nn.getOrCreate(i);return l?GCe(a,r,l,o):XH(a,r,o)})}static colorizeLine(e,t,i,s,o=4){const r=Jr.isBasicASCII(e,t),a=Jr.containsRTL(e,r,i);return mx(new Eg(!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 GCe(n,e,t,i){return new Promise((s,o)=>{const r=()=>{const a=YCe(n,e,t,i);if(t instanceof Nw){const l=t.getLoadStatus();if(l.loaded===!1){l.promise.then(r,o);return}}s(a)};r()})}function XH(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 YCe(n,e,t,i){let s=[],o=t.getInitialState();for(let r=0,a=n.length;r"),o=c.endState}return s.join("")}const QH=2e4;let mp,uD,oO,hD,rO;function ZCe(n){mp=document.createElement("div"),mp.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"),mp.appendChild(i),i};uD=e(),oO=e();const t=()=>{const i=document.createElement("div");return i.className="monaco-status",i.setAttribute("aria-live","polite"),i.setAttribute("aria-atomic","true"),mp.appendChild(i),i};hD=t(),rO=t(),n.appendChild(mp)}function to(n){mp&&(uD.textContent!==n?(Ds(oO),NE(uD,n)):(Ds(uD),NE(oO,n)))}function Yf(n){mp&&(hD.textContent!==n?(Ds(rO),NE(hD,n)):(Ds(hD),NE(rO,n)))}function NE(n,e){Ds(n),e.length>QH&&(e=e.substr(0,QH)),n.textContent=e,n.style.visibility="hidden",n.style.visibility="visible"}const X8=Wt("markerDecorationsService");var XCe=globalThis&&globalThis.__decorate||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},QCe=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let Aw=class{constructor(e,t){}dispose(){}};Aw.ID="editor.contrib.markerDecorations";Aw=XCe([QCe(1,X8)],Aw);ti(Aw.ID,Aw,0);class BQ extends te{constructor(e,t){super(),this._onDidChange=this._register(new j),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 Sf{constructor(e,t){this.key=e,this.migrate=t}apply(e){const t=Sf._read(e,this.key),i=o=>Sf._read(e,o),s=(o,r)=>Sf._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}}Sf.items=[];function Ig(n,e){Sf.items.push(new Sf(n,e))}function Wa(n,e){Ig(n,(t,i,s)=>{if(typeof t<"u"){for(const[o,r]of e)if(t===o){s(n,r);return}}})}function JCe(n){Sf.items.forEach(e=>e.apply(n))}Wa("wordWrap",[[!0,"on"],[!1,"off"]]);Wa("lineNumbers",[[!0,"on"],[!1,"off"]]);Wa("cursorBlinking",[["visible","solid"]]);Wa("renderWhitespace",[[!0,"boundary"],[!1,"none"]]);Wa("renderLineHighlight",[[!0,"line"],[!1,"none"]]);Wa("acceptSuggestionOnEnter",[[!0,"on"],[!1,"off"]]);Wa("tabCompletion",[[!1,"off"],[!0,"onlySnippets"]]);Wa("hover",[[!0,{enabled:!0}],[!1,{enabled:!1}]]);Wa("parameterHints",[[!0,{enabled:!0}],[!1,{enabled:!1}]]);Wa("autoIndent",[[!1,"advanced"],[!0,"full"]]);Wa("matchBrackets",[[!0,"always"],[!1,"never"]]);Wa("renderFinalNewline",[[!0,"on"],[!1,"off"]]);Wa("cursorSmoothCaretAnimation",[[!0,"on"],[!1,"off"]]);Ig("autoClosingBrackets",(n,e,t)=>{n===!1&&(t("autoClosingBrackets","never"),typeof e("autoClosingQuotes")>"u"&&t("autoClosingQuotes","never"),typeof e("autoSurround")>"u"&&t("autoSurround","never"))});Ig("renderIndentGuides",(n,e,t)=>{typeof n<"u"&&(t("renderIndentGuides",void 0),typeof e("guides.indentation")>"u"&&t("guides.indentation",!!n))});Ig("highlightActiveIndentGuide",(n,e,t)=>{typeof n<"u"&&(t("highlightActiveIndentGuide",void 0),typeof e("guides.highlightActiveIndentation")>"u"&&t("guides.highlightActiveIndentation",!!n))});const ewe={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"};Ig("suggest.filteredTypes",(n,e,t)=>{if(n&&typeof n=="object"){for(const i of Object.entries(ewe))n[i[0]]===!1&&typeof e("suggest.".concat(i[1]))>"u"&&t("suggest.".concat(i[1]),!1);t("suggest.filteredTypes",void 0)}});Ig("quickSuggestions",(n,e,t)=>{if(typeof n=="boolean"){const i=n?"on":"off";t("quickSuggestions",{comments:i,strings:i,other:i})}});Ig("experimental.stickyScroll.enabled",(n,e,t)=>{typeof n=="boolean"&&(t("experimental.stickyScroll.enabled",void 0),typeof e("stickyScroll.enabled")>"u"&&t("stickyScroll.enabled",n))});Ig("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 twe{constructor(){this._tabFocus=!1,this._onDidChangeTabFocus=new j,this.onDidChangeTabFocus=this._onDidChangeTabFocus.event}getTabFocusMode(){return this._tabFocus}setTabFocusMode(e){this._tabFocus=e,this._onDidChangeTabFocus.fire(this._tabFocus)}}const Ib=new twe,oh=Wt("accessibilityService"),pS=new Ve("accessibilityModeEnabled",!1);var iwe=globalThis&&globalThis.__decorate||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},nwe=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let aO=class extends te{constructor(e,t,i,s){super(),this._accessibilityService=s,this._onDidChange=this._register(new j),this.onDidChange=this._onDidChange.event,this._onDidChangeFast=this._register(new j),this.onDidChangeFast=this._onDidChangeFast.event,this._isDominatedByLongLines=!1,this._viewLineCount=1,this._lineNumbersDigitCount=1,this._reservedHeight=0,this._glyphMarginDecorationLaneCount=1,this._computeOptionsMemory=new rX,this.isSimpleWidget=e,this._containerObserver=this._register(new BQ(i,t.dimension)),this._rawOptions=JH(t),this._validatedOptions=Uh.validateOptions(this._rawOptions),this.options=this._computeOptions(),this.options.get(13)&&this._containerObserver.startObserving(),this._register(ma.onDidChangeZoomLevel(()=>this._recomputeOptions())),this._register(Ib.onDidChangeTabFocus(()=>this._recomputeOptions())),this._register(this._containerObserver.onDidChange(()=>this._recomputeOptions())),this._register(FP.onDidChange(()=>this._recomputeOptions())),this._register(vw.onDidChange(()=>this._recomputeOptions())),this._register(this._accessibilityService.onDidChangeScreenReaderOptimized(()=>this._recomputeOptions()))}_recomputeOptions(){const e=this._computeOptions(),t=Uh.checkEquals(this.options,e);t!==null&&(this.options=e,this._onDidChangeFast.fire(t),this._onDidChange.fire(t))}_computeOptions(){const e=this._readEnvConfiguration(),t=$p.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:Ib.getTabFocusMode(),accessibilitySupport:e.accessibilitySupport,glyphMarginDecorationLaneCount:this._glyphMarginDecorationLaneCount};return Uh.computeOptions(this._validatedOptions,s)}_readEnvConfiguration(){return{extraEditorClassName:owe(),outerWidth:this._containerObserver.getWidth(),outerHeight:this._containerObserver.getHeight(),emptySelectionClipboard:Hp||Ta,pixelRatio:vw.value,accessibilitySupport:this._accessibilityService.isScreenReaderOptimized()?2:this._accessibilityService.getAccessibilitySupport()}}_readFontInfo(e){return FP.readFontInfo(e)}getRawOptions(){return this._rawOptions}updateOptions(e){const t=JH(e);Uh.applyUpdate(this._rawOptions,t)&&(this._validatedOptions=Uh.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=swe(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())}};aO=iwe([nwe(3,oh)],aO);function swe(n){let e=0;for(;n;)n=Math.floor(n/10),e++;return e||1}function owe(){let n="";return!qu&&!AX&&(n+="no-user-select "),qu&&(n+="no-minimap-shadow ",n+="enable-user-select "),Kt&&(n+="mac "),n}class rwe{constructor(){this._values=[]}_read(e){return this._values[e]}get(e){return this._values[e]}_write(e,t){this._values[e]=t}}class awe{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 Uh{static validateOptions(e){const t=new rwe;for(const i of ev){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 awe;for(const s of ev)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)?yn(e,t):!1;if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const i in e)if(!Uh._deepEquals(e[i],t[i]))return!1;return!0}static checkEquals(e,t){const i=[];let s=!1;for(const o of ev){const r=!Uh._deepEquals(e._read(o.id),t._read(o.id));i[o.id]=r,r&&(s=!0)}return s?new oX(i):null}static applyUpdate(e,t){let i=!1;for(const s of ev)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 JH(n){const e=du(n);return JCe(e),e}function xn(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$".concat(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 lwe=globalThis&&globalThis.__decorate||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},Ti;(function(n){n.Tap="-monaco-gesturetap",n.Change="-monaco-gesturechange",n.Start="-monaco-gesturestart",n.End="-monaco-gesturesend",n.Contextmenu="-monaco-gesturecontextmenu"})(Ti||(Ti={}));class Ii extends te{constructor(){super(),this.dispatched=!1,this.targets=new To,this.ignoreTargets=new To,this.activeTouches={},this.handle=null,this._lastSetTapCountTime=0,this._register(ce(document,"touchstart",e=>this.onTouchStart(e),{passive:!1})),this._register(ce(document,"touchend",e=>this.onTouchEnd(e))),this._register(ce(document,"touchmove",e=>this.onTouchMove(e),{passive:!1}))}static addTarget(e){if(!Ii.isTouchDevice())return te.None;Ii.INSTANCE||(Ii.INSTANCE=new Ii);const t=Ii.INSTANCE.targets.push(e);return vt(t)}static ignoreTarget(e){if(!Ii.isTouchDevice())return te.None;Ii.INSTANCE||(Ii.INSTANCE=new Ii);const t=Ii.INSTANCE.ignoreTargets.push(e);return vt(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=Ii.HOLD_DELAY&&Math.abs(a.initialPageX-ca(a.rollingPageX))<30&&Math.abs(a.initialPageY-ca(a.rollingPageY))<30){const c=this.newGestureEvent(Ti.Contextmenu,a.initialTarget);c.pageX=ca(a.rollingPageX),c.pageY=ca(a.rollingPageY),this.dispatchEvent(c)}else if(i===1){const c=ca(a.rollingPageX),d=ca(a.rollingPageY),u=ca(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(Ti.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===Ti.Tap){const t=new Date().getTime();let i=0;t-this._lastSetTapCountTime>Ii.CLEAR_TAP_COUNT_TIME?i=1:i=2,this._lastSetTapCountTime=t,e.tapCount=i}else(e.type===Ti.Change||e.type===Ti.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=xa(()=>{const c=Date.now(),d=c-t;let u=0,h=0,f=!0;i+=Ii.SCROLL_FRICTION*d,r+=Ii.SCROLL_FRICTION*d,i>0&&(f=!1,u=s*i*d),r>0&&(f=!1,h=a*r*d);const g=this.newGestureEvent(Ti.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)}}Ii.SCROLL_FRICTION=-.005;Ii.HOLD_DELAY=700;Ii.CLEAR_TAP_COUNT_TIME=400;lwe([xn],Ii,"isTouchDevice",null);class I0{constructor(){this._hooks=new be,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(vt(()=>{try{e.releasePointerCapture(t)}catch{}}))}catch{r=window}this._hooks.add(ce(r,Pe.POINTER_MOVE,a=>{if(a.buttons!==i){this.stopMonitoring(!0);return}a.preventDefault(),this._pointerMoveCallback(a)})),this._hooks.add(ce(r,Pe.POINTER_UP,a=>this.stopMonitoring(!0)))}}function Q8(n){return"--vscode-".concat(n.replace(/\./g,"-"))}function He(n){return"var(".concat(Q8(n),")")}function cwe(n,e){return"var(".concat(Q8(n),", ").concat(e,")")}const WQ={ColorContribution:"base.contributions.colors"};class dwe{constructor(){this._onDidChangeSchema=new j,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 Nl(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=>"- `".concat(t,"`: ").concat(this.colorsById[t].description)).join("\n")}}const _x=new dwe;en.add(WQ.ColorContribution,_x);function F(n,e,t,i,s){return _x.registerColor(n,e,t,i,s)}const Te=F("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."));F("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 uwe=F("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."));F("descriptionForeground",{light:"#717171",dark:nt(Te,.7),hcDark:nt(Te,.7),hcLight:nt(Te,.7)},m("descriptionForeground","Foreground color for description text providing additional information, for example for a label."));const Jh=F("icon.foreground",{dark:"#C5C5C5",light:"#424242",hcDark:"#FFFFFF",hcLight:"#292929"},m("iconForeground","The default color for icons in the workbench.")),zr=F("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.")),$t=F("contrastBorder",{light:null,dark:null,hcDark:"#6FC3DF",hcLight:"#0F4A85"},m("contrastBorder","An extra border around elements to separate them from others for greater contrast.")),$i=F("contrastActiveBorder",{light:null,dark:null,hcDark:zr,hcLight:zr},m("activeContrastBorder","An extra border around active elements to separate them from others for greater contrast."));F("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."));F("textSeparator.foreground",{light:"#0000002e",dark:"#ffffff2e",hcDark:ee.black,hcLight:"#292929"},m("textSeparatorForeground","Color for text separators."));const hwe=F("textLink.foreground",{light:"#006AB1",dark:"#3794FF",hcDark:"#3794FF",hcLight:"#0F4A85"},m("textLinkForeground","Foreground color for links in text."));F("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."));F("textPreformat.foreground",{light:"#A31515",dark:"#D7BA7D",hcDark:"#D7BA7D",hcLight:"#292929"},m("textPreformatForeground","Foreground color for preformatted text segments."));F("textBlockQuote.background",{light:"#7f7f7f1a",dark:"#7f7f7f1a",hcDark:null,hcLight:"#F2F2F2"},m("textBlockQuoteBackground","Background color for block quotes in text."));F("textBlockQuote.border",{light:"#007acc80",dark:"#007acc80",hcDark:ee.white,hcLight:"#292929"},m("textBlockQuoteBorder","Border color for block quotes in text."));F("textCodeBlock.background",{light:"#dcdcdc66",dark:"#0a0a0a66",hcDark:ee.black,hcLight:"#F2F2F2"},m("textCodeBlockBackground","Background color for code blocks in text."));const nd=F("widget.shadow",{dark:nt(ee.black,.36),light:nt(ee.black,.16),hcDark:null,hcLight:null},m("widgetShadow","Shadow color of widgets such as find/replace inside the editor.")),J8=F("widget.border",{dark:null,light:null,hcDark:$t,hcLight:$t},m("widgetBorder","Border color of widgets such as find/replace inside the editor.")),VQ=F("input.background",{dark:"#3C3C3C",light:ee.white,hcDark:ee.black,hcLight:ee.white},m("inputBoxBackground","Input box background.")),HQ=F("input.foreground",{dark:Te,light:Te,hcDark:Te,hcLight:Te},m("inputBoxForeground","Input box foreground.")),$Q=F("input.border",{dark:null,light:null,hcDark:$t,hcLight:$t},m("inputBoxBorder","Input box border.")),e9=F("inputOption.activeBorder",{dark:"#007ACC",light:"#007ACC",hcDark:$t,hcLight:$t},m("inputBoxActiveOptionBorder","Border color of activated options in input fields."));F("inputOption.hoverBackground",{dark:"#5a5d5e80",light:"#b8b8b850",hcDark:null,hcLight:null},m("inputOption.hoverBackground","Background color of activated options in input fields."));const Ip=F("inputOption.activeBackground",{dark:nt(zr,.4),light:nt(zr,.2),hcDark:ee.transparent,hcLight:ee.transparent},m("inputOption.activeBackground","Background hover color of options in input fields.")),t9=F("inputOption.activeForeground",{dark:ee.white,light:ee.black,hcDark:Te,hcLight:Te},m("inputOption.activeForeground","Foreground color of activated options in input fields."));F("input.placeholderForeground",{light:nt(Te,.5),dark:nt(Te,.5),hcDark:nt(Te,.7),hcLight:nt(Te,.7)},m("inputPlaceholderForeground","Input box foreground color for placeholder text."));const fwe=F("inputValidation.infoBackground",{dark:"#063B49",light:"#D6ECF2",hcDark:ee.black,hcLight:ee.white},m("inputValidationInfoBackground","Input validation background color for information severity.")),gwe=F("inputValidation.infoForeground",{dark:null,light:null,hcDark:null,hcLight:Te},m("inputValidationInfoForeground","Input validation foreground color for information severity.")),pwe=F("inputValidation.infoBorder",{dark:"#007acc",light:"#007acc",hcDark:$t,hcLight:$t},m("inputValidationInfoBorder","Input validation border color for information severity.")),mwe=F("inputValidation.warningBackground",{dark:"#352A05",light:"#F6F5D2",hcDark:ee.black,hcLight:ee.white},m("inputValidationWarningBackground","Input validation background color for warning severity.")),_we=F("inputValidation.warningForeground",{dark:null,light:null,hcDark:null,hcLight:Te},m("inputValidationWarningForeground","Input validation foreground color for warning severity.")),vwe=F("inputValidation.warningBorder",{dark:"#B89500",light:"#B89500",hcDark:$t,hcLight:$t},m("inputValidationWarningBorder","Input validation border color for warning severity.")),bwe=F("inputValidation.errorBackground",{dark:"#5A1D1D",light:"#F2DEDE",hcDark:ee.black,hcLight:ee.white},m("inputValidationErrorBackground","Input validation background color for error severity.")),Cwe=F("inputValidation.errorForeground",{dark:null,light:null,hcDark:null,hcLight:Te},m("inputValidationErrorForeground","Input validation foreground color for error severity.")),wwe=F("inputValidation.errorBorder",{dark:"#BE1100",light:"#BE1100",hcDark:$t,hcLight:$t},m("inputValidationErrorBorder","Input validation border color for error severity.")),sd=F("dropdown.background",{dark:"#3C3C3C",light:ee.white,hcDark:ee.black,hcLight:ee.white},m("dropdownBackground","Dropdown background.")),ywe=F("dropdown.listBackground",{dark:null,light:null,hcDark:ee.black,hcLight:ee.white},m("dropdownListBackground","Dropdown list background.")),Lu=F("dropdown.foreground",{dark:"#F0F0F0",light:Te,hcDark:ee.white,hcLight:Te},m("dropdownForeground","Dropdown foreground.")),rv=F("dropdown.border",{dark:sd,light:"#CECECE",hcDark:$t,hcLight:$t},m("dropdownBorder","Dropdown border.")),B1=F("button.foreground",{dark:ee.white,light:ee.white,hcDark:ee.white,hcLight:ee.white},m("buttonForeground","Button foreground color.")),Swe=F("button.separator",{dark:nt(B1,.4),light:nt(B1,.4),hcDark:nt(B1,.4),hcLight:nt(B1,.4)},m("buttonSeparator","Button separator color.")),W1=F("button.background",{dark:"#0E639C",light:"#007ACC",hcDark:null,hcLight:"#0F4A85"},m("buttonBackground","Button background color.")),Lwe=F("button.hoverBackground",{dark:rc(W1,.2),light:Ym(W1,.2),hcDark:W1,hcLight:W1},m("buttonHoverBackground","Button background color when hovering.")),kwe=F("button.border",{dark:$t,light:$t,hcDark:$t,hcLight:$t},m("buttonBorder","Button border color.")),Dwe=F("button.secondaryForeground",{dark:ee.white,light:ee.white,hcDark:ee.white,hcLight:Te},m("buttonSecondaryForeground","Secondary button foreground color.")),lO=F("button.secondaryBackground",{dark:"#3A3D41",light:"#5F6A79",hcDark:null,hcLight:ee.white},m("buttonSecondaryBackground","Secondary button background color.")),Ewe=F("button.secondaryHoverBackground",{dark:rc(lO,.2),light:Ym(lO,.2),hcDark:null,hcLight:null},m("buttonSecondaryHoverBackground","Secondary button background color when hovering.")),fD=F("badge.background",{dark:"#4D4D4D",light:"#C4C4C4",hcDark:ee.black,hcLight:"#0F4A85"},m("badgeBackground","Badge background color. Badges are small information labels, e.g. for search results count.")),Iwe=F("badge.foreground",{dark:ee.white,light:"#333",hcDark:ee.white,hcLight:ee.white},m("badgeForeground","Badge foreground color. Badges are small information labels, e.g. for search results count.")),Twe=F("scrollbar.shadow",{dark:"#000000",light:"#DDDDDD",hcDark:null,hcLight:null},m("scrollbarShadow","Scrollbar shadow to indicate that the view is scrolled.")),V1=F("scrollbarSlider.background",{dark:ee.fromHex("#797979").transparent(.4),light:ee.fromHex("#646464").transparent(.4),hcDark:nt($t,.6),hcLight:nt($t,.4)},m("scrollbarSliderBackground","Scrollbar slider background color.")),H1=F("scrollbarSlider.hoverBackground",{dark:ee.fromHex("#646464").transparent(.7),light:ee.fromHex("#646464").transparent(.7),hcDark:nt($t,.8),hcLight:nt($t,.8)},m("scrollbarSliderHoverBackground","Scrollbar slider background color when hovering.")),$1=F("scrollbarSlider.activeBackground",{dark:ee.fromHex("#BFBFBF").transparent(.4),light:ee.fromHex("#000000").transparent(.6),hcDark:$t,hcLight:$t},m("scrollbarSliderActiveBackground","Scrollbar slider background color when clicked on.")),xwe=F("progressBar.background",{dark:ee.fromHex("#0E70C0"),light:ee.fromHex("#0E70C0"),hcDark:$t,hcLight:$t},m("progressBarBackground","Background color of the progress bar that can show for long running operations."));F("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 od=F("editorError.foreground",{dark:"#F14C4C",light:"#E51400",hcDark:"#F48771",hcLight:"#B5200D"},m("editorError.foreground","Foreground color of error squigglies in the editor.")),Nwe=F("editorError.border",{dark:null,light:null,hcDark:ee.fromHex("#E47777").transparent(.8),hcLight:"#B5200D"},m("errorBorder","If set, color of double underlines for errors in the editor."));F("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 Ur=F("editorWarning.foreground",{dark:"#CCA700",light:"#BF8803",hcDark:"#FFD370",hcLight:"#895503"},m("editorWarning.foreground","Foreground color of warning squigglies in the editor.")),Mw=F("editorWarning.border",{dark:null,light:null,hcDark:ee.fromHex("#FFCC00").transparent(.8),hcLight:ee.fromHex("#FFCC00").transparent(.8)},m("warningBorder","If set, color of double underlines for warnings in the editor."));F("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 Xo=F("editorInfo.foreground",{dark:"#3794FF",light:"#1a85ff",hcDark:"#3794FF",hcLight:"#1a85ff"},m("editorInfo.foreground","Foreground color of info squigglies in the editor.")),Rw=F("editorInfo.border",{dark:null,light:null,hcDark:ee.fromHex("#3794FF").transparent(.8),hcLight:"#292929"},m("infoBorder","If set, color of double underlines for infos in the editor.")),Awe=F("editorHint.foreground",{dark:ee.fromHex("#eeeeee").transparent(.7),light:"#6c6c6c",hcDark:null,hcLight:null},m("editorHint.foreground","Foreground color of hint squigglies in the editor."));F("editorHint.border",{dark:null,light:null,hcDark:ee.fromHex("#eeeeee").transparent(.8),hcLight:"#292929"},m("hintBorder","If set, color of double underlines for hints in the editor."));F("sash.hoverBorder",{dark:zr,light:zr,hcDark:zr,hcLight:zr},m("sashActiveBorder","Border color of active sashes."));const is=F("editor.background",{light:"#ffffff",dark:"#1E1E1E",hcDark:ee.black,hcLight:ee.white},m("editorBackground","Editor background color.")),Ja=F("editor.foreground",{light:"#333333",dark:"#BBBBBB",hcDark:ee.white,hcLight:Te},m("editorForeground","Editor default foreground color."));F("editorStickyScroll.background",{light:is,dark:is,hcDark:is,hcLight:is},m("editorStickyScrollBackground","Sticky scroll background color for the editor"));F("editorStickyScrollHover.background",{dark:"#2A2D2E",light:"#F0F0F0",hcDark:null,hcLight:ee.fromHex("#0F4A85").transparent(.1)},m("editorStickyScrollHoverBackground","Sticky scroll on hover background color for the editor"));const un=F("editorWidget.background",{dark:"#252526",light:"#F3F3F3",hcDark:"#0C141F",hcLight:ee.white},m("editorWidgetBackground","Background color of editor widgets, such as find/replace.")),rd=F("editorWidget.foreground",{dark:Te,light:Te,hcDark:Te,hcLight:Te},m("editorWidgetForeground","Foreground color of editor widgets, such as find/replace.")),ad=F("editorWidget.border",{dark:"#454545",light:"#C8C8C8",hcDark:$t,hcLight:$t},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.")),Mwe=F("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.")),e$=F("quickInput.background",{dark:un,light:un,hcDark:un,hcLight:un},m("pickerBackground","Quick picker background color. The quick picker widget is the container for pickers like the command palette.")),Rwe=F("quickInput.foreground",{dark:rd,light:rd,hcDark:rd,hcLight:rd},m("pickerForeground","Quick picker foreground color. The quick picker widget is the container for pickers like the command palette.")),Pwe=F("quickInputTitle.background",{dark:new ee(new jt(255,255,255,.105)),light:new ee(new jt(0,0,0,.06)),hcDark:"#000000",hcLight:ee.white},m("pickerTitleBackground","Quick picker title background color. The quick picker widget is the container for pickers like the command palette.")),zQ=F("pickerGroup.foreground",{dark:"#3794FF",light:"#0066BF",hcDark:ee.white,hcLight:"#0F4A85"},m("pickerGroupForeground","Quick picker color for grouping labels.")),Owe=F("pickerGroup.border",{dark:"#3F3F46",light:"#CCCEDB",hcDark:ee.white,hcLight:"#0F4A85"},m("pickerGroupBorder","Quick picker color for grouping borders.")),Fwe=F("keybindingLabel.background",{dark:new ee(new jt(128,128,128,.17)),light:new ee(new jt(221,221,221,.4)),hcDark:ee.transparent,hcLight:ee.transparent},m("keybindingLabelBackground","Keybinding label background color. The keybinding label is used to represent a keyboard shortcut.")),Bwe=F("keybindingLabel.foreground",{dark:ee.fromHex("#CCCCCC"),light:ee.fromHex("#555555"),hcDark:ee.white,hcLight:Te},m("keybindingLabelForeground","Keybinding label foreground color. The keybinding label is used to represent a keyboard shortcut.")),Wwe=F("keybindingLabel.border",{dark:new ee(new jt(51,51,51,.6)),light:new ee(new jt(204,204,204,.4)),hcDark:new ee(new jt(111,195,223)),hcLight:$t},m("keybindingLabelBorder","Keybinding label border color. The keybinding label is used to represent a keyboard shortcut.")),Vwe=F("keybindingLabel.bottomBorder",{dark:new ee(new jt(68,68,68,.6)),light:new ee(new jt(187,187,187,.4)),hcDark:new ee(new jt(111,195,223)),hcLight:Te},m("keybindingLabelBottomBorder","Keybinding label border bottom color. The keybinding label is used to represent a keyboard shortcut.")),ef=F("editor.selectionBackground",{light:"#ADD6FF",dark:"#264F78",hcDark:"#f3f518",hcLight:"#0F4A85"},m("editorSelectionBackground","Color of the editor selection.")),Hwe=F("editor.selectionForeground",{light:null,dark:null,hcDark:"#000000",hcLight:ee.white},m("editorSelectionForeground","Color of the selected text for high contrast.")),UQ=F("editor.inactiveSelectionBackground",{light:nt(ef,.5),dark:nt(ef,.5),hcDark:nt(ef,.7),hcLight:nt(ef,.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),i9=F("editor.selectionHighlightBackground",{light:a$(ef,is,.3,.6),dark:a$(ef,is,.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);F("editor.selectionHighlightBorder",{light:null,dark:null,hcDark:$i,hcLight:$i},m("editorSelectionHighlightBorder","Border color for regions with the same content as the selection."));const $we=F("editor.findMatchBackground",{light:"#A8AC94",dark:"#515C6A",hcDark:null,hcLight:null},m("editorFindMatch","Color of the current search match.")),ld=F("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),zwe=F("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),Uwe=F("editor.findMatchBorder",{light:null,dark:null,hcDark:$i,hcLight:$i},m("editorFindMatchBorder","Border color of the current search match.")),tf=F("editor.findMatchHighlightBorder",{light:null,dark:null,hcDark:$i,hcLight:$i},m("findMatchHighlightBorder","Border color of the other search matches.")),jwe=F("editor.findRangeHighlightBorder",{dark:null,light:null,hcDark:nt($i,.4),hcLight:nt($i,.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);F("searchEditor.findMatchBackground",{light:nt(ld,.66),dark:nt(ld,.66),hcDark:ld,hcLight:ld},m("searchEditor.queryMatch","Color of the Search Editor query matches."));F("searchEditor.findMatchBorder",{light:nt(tf,.66),dark:nt(tf,.66),hcDark:tf,hcLight:tf},m("searchEditor.editorFindMatchBorder","Border color of the Search Editor query matches."));F("search.resultsInfoForeground",{light:Te,dark:nt(Te,.65),hcDark:Te,hcLight:Te},m("search.resultsInfoForeground","Color of the text in the search viewlet's completion message."));F("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 AE=F("editorHoverWidget.background",{light:un,dark:un,hcDark:un,hcLight:un},m("hoverBackground","Background color of the editor hover."));F("editorHoverWidget.foreground",{light:rd,dark:rd,hcDark:rd,hcLight:rd},m("hoverForeground","Foreground color of the editor hover."));const Kwe=F("editorHoverWidget.border",{light:ad,dark:ad,hcDark:ad,hcLight:ad},m("hoverBorder","Border color of the editor hover."));F("editorHoverWidget.statusBarBackground",{dark:rc(AE,.2),light:Ym(AE,.05),hcDark:un,hcLight:un},m("statusBarBackground","Background color of the editor hover status bar."));const qwe=F("editorLink.activeForeground",{dark:"#4E94CE",light:ee.blue,hcDark:ee.cyan,hcLight:"#292929"},m("activeLinkForeground","Color of active links.")),ku=F("editorInlayHint.foreground",{dark:"#969696",light:"#969696",hcDark:ee.white,hcLight:ee.black},m("editorInlayHintForeground","Foreground color of inline hints")),Du=F("editorInlayHint.background",{dark:nt(fD,.1),light:nt(fD,.1),hcDark:nt(ee.white,.1),hcLight:nt(fD,.1)},m("editorInlayHintBackground","Background color of inline hints")),Gwe=F("editorInlayHint.typeForeground",{dark:ku,light:ku,hcDark:ku,hcLight:ku},m("editorInlayHintForegroundTypes","Foreground color of inline hints for types")),Ywe=F("editorInlayHint.typeBackground",{dark:Du,light:Du,hcDark:Du,hcLight:Du},m("editorInlayHintBackgroundTypes","Background color of inline hints for types")),Zwe=F("editorInlayHint.parameterForeground",{dark:ku,light:ku,hcDark:ku,hcLight:ku},m("editorInlayHintForegroundParameter","Foreground color of inline hints for parameters")),Xwe=F("editorInlayHint.parameterBackground",{dark:Du,light:Du,hcDark:Du,hcLight:Du},m("editorInlayHintBackgroundParameter","Background color of inline hints for parameters"));F("editorLightBulb.foreground",{dark:"#FFCC00",light:"#DDB100",hcDark:"#FFCC00",hcLight:"#007ACC"},m("editorLightBulbForeground","The color used for the lightbulb actions icon."));F("editorLightBulbAutoFix.foreground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},m("editorLightBulbAutoFixForeground","The color used for the lightbulb auto fix actions icon."));const cO=new ee(new jt(155,185,85,.2)),dO=new ee(new jt(255,0,0,.2)),Qwe=F("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),Jwe=F("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);F("diffEditor.insertedLineBackground",{dark:cO,light:cO,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);F("diffEditor.removedLineBackground",{dark:dO,light:dO,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);F("diffEditorGutter.insertedLineBackground",{dark:null,light:null,hcDark:null,hcLight:null},m("diffEditorInsertedLineGutter","Background color for the margin where lines got inserted."));F("diffEditorGutter.removedLineBackground",{dark:null,light:null,hcDark:null,hcLight:null},m("diffEditorRemovedLineGutter","Background color for the margin where lines got removed."));const eye=F("diffEditorOverview.insertedForeground",{dark:null,light:null,hcDark:null,hcLight:null},m("diffEditorOverviewInserted","Diff overview ruler foreground for inserted content.")),tye=F("diffEditorOverview.removedForeground",{dark:null,light:null,hcDark:null,hcLight:null},m("diffEditorOverviewRemoved","Diff overview ruler foreground for removed content."));F("diffEditor.insertedTextBorder",{dark:null,light:null,hcDark:"#33ff2eff",hcLight:"#374E06"},m("diffEditorInsertedOutline","Outline color for the text that got inserted."));F("diffEditor.removedTextBorder",{dark:null,light:null,hcDark:"#FF008F",hcLight:"#AD0707"},m("diffEditorRemovedOutline","Outline color for text that got removed."));F("diffEditor.border",{dark:null,light:null,hcDark:$t,hcLight:$t},m("diffEditorBorder","Border color between the two text editors."));F("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."));F("diffEditor.unchangedRegionBackground",{dark:"#3e3e3e",light:"#e4e4e4",hcDark:null,hcLight:null},m("diffEditor.unchangedRegionBackground","The background color of unchanged blocks in the diff editor."));F("diffEditor.unchangedRegionForeground",{dark:"#a3a2a2",light:"#4d4c4c",hcDark:null,hcLight:null},m("diffEditor.unchangedRegionForeground","The foreground color of unchanged blocks in the diff editor."));F("diffEditor.unchangedCodeBackground",{dark:"#74747429",light:"#b8b8b829",hcDark:null,hcLight:null},m("diffEditor.unchangedCodeBackground","The background color of unchanged code in the diff editor."));const iye=F("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.")),nye=F("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.")),sye=F("list.focusOutline",{dark:zr,light:zr,hcDark:$i,hcLight:$i},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.")),oye=F("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.")),Eu=F("list.activeSelectionBackground",{dark:"#04395E",light:"#0060C0",hcDark:null,hcLight:ee.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.")),cd=F("list.activeSelectionForeground",{dark:ee.white,light:ee.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.")),z1=F("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.")),rye=F("list.inactiveSelectionBackground",{dark:"#37373D",light:"#E4E6F1",hcDark:null,hcLight:ee.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.")),aye=F("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.")),lye=F("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.")),cye=F("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.")),dye=F("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.")),jQ=F("list.hoverBackground",{dark:"#2A2D2E",light:"#F0F0F0",hcDark:ee.white.transparent(.1),hcLight:ee.fromHex("#0F4A85").transparent(.1)},m("listHoverBackground","List/Tree background when hovering over items using the mouse.")),KQ=F("list.hoverForeground",{dark:null,light:null,hcDark:null,hcLight:null},m("listHoverForeground","List/Tree foreground when hovering over items using the mouse.")),uye=F("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.")),el=F("list.highlightForeground",{dark:"#2AAAFF",light:"#0066BF",hcDark:zr,hcLight:zr},m("highlight","List/Tree foreground color of the match highlights when searching inside the list/tree.")),LL=F("list.focusHighlightForeground",{dark:el,light:Hye(Eu,el,"#BBE7FF"),hcDark:el,hcLight:el},m("listFocusHighlightForeground","List/Tree foreground color of the match highlights on actively focused items when searching inside the list/tree."));F("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."));F("list.errorForeground",{dark:"#F88070",light:"#B01011",hcDark:null,hcLight:null},m("listErrorForeground","Foreground color of list items containing errors."));F("list.warningForeground",{dark:"#CCA700",light:"#855F00",hcDark:null,hcLight:null},m("listWarningForeground","Foreground color of list items containing warnings."));const hye=F("listFilterWidget.background",{light:Ym(un,0),dark:rc(un,0),hcDark:un,hcLight:un},m("listFilterWidgetBackground","Background color of the type filter widget in lists and trees.")),fye=F("listFilterWidget.outline",{dark:ee.transparent,light:ee.transparent,hcDark:"#f38518",hcLight:"#007ACC"},m("listFilterWidgetOutline","Outline color of the type filter widget in lists and trees.")),gye=F("listFilterWidget.noMatchesOutline",{dark:"#BE1100",light:"#BE1100",hcDark:$t,hcLight:$t},m("listFilterWidgetNoMatchesOutline","Outline color of the type filter widget in lists and trees, when there are no matches.")),pye=F("listFilterWidget.shadow",{dark:nd,light:nd,hcDark:nd,hcLight:nd},m("listFilterWidgetShadow","Shadow color of the type filter widget in lists and trees."));F("list.filterMatchBackground",{dark:ld,light:ld,hcDark:null,hcLight:null},m("listFilterMatchHighlight","Background color of the filtered match."));F("list.filterMatchBorder",{dark:tf,light:tf,hcDark:$t,hcLight:$i},m("listFilterMatchHighlightBorder","Border color of the filtered match."));const U1=F("tree.indentGuidesStroke",{dark:"#585858",light:"#a9a9a9",hcDark:"#a9a9a9",hcLight:"#a5a5a5"},m("treeIndentGuidesStroke","Tree stroke color for the indentation guides.")),mye=F("tree.inactiveIndentGuidesStroke",{dark:nt(U1,.4),light:nt(U1,.4),hcDark:nt(U1,.4),hcLight:nt(U1,.4)},m("treeInactiveIndentGuidesStroke","Tree stroke color for the indentation guides that are not active.")),_ye=F("tree.tableColumnsBorder",{dark:"#CCCCCC20",light:"#61616120",hcDark:null,hcLight:null},m("tableColumnsBorder","Table border color between columns.")),vye=F("tree.tableOddRowsBackground",{dark:nt(Te,.04),light:nt(Te,.04),hcDark:null,hcLight:null},m("tableOddRowsBackgroundColor","Background color for odd table rows."));F("list.deemphasizedForeground",{dark:"#8C8C8C",light:"#8E8E90",hcDark:"#A7A8A9",hcLight:"#666666"},m("listDeemphasizedForeground","List/Tree foreground color for items that are deemphasized. "));const bye=F("checkbox.background",{dark:sd,light:sd,hcDark:sd,hcLight:sd},m("checkbox.background","Background color of checkbox widget."));F("checkbox.selectBackground",{dark:un,light:un,hcDark:un,hcLight:un},m("checkbox.select.background","Background color of checkbox widget when the element it's in is selected."));const Cye=F("checkbox.foreground",{dark:Lu,light:Lu,hcDark:Lu,hcLight:Lu},m("checkbox.foreground","Foreground color of checkbox widget.")),wye=F("checkbox.border",{dark:rv,light:rv,hcDark:rv,hcLight:rv},m("checkbox.border","Border color of checkbox widget."));F("checkbox.selectBorder",{dark:Jh,light:Jh,hcDark:Jh,hcLight:Jh},m("checkbox.select.border","Border color of checkbox widget when the element it's in is selected."));const t$=F("quickInput.list.focusBackground",{dark:null,light:null,hcDark:null,hcLight:null},"",void 0,m("quickInput.list.focusBackground deprecation","Please use quickInputList.focusBackground instead")),Tp=F("quickInputList.focusForeground",{dark:cd,light:cd,hcDark:cd,hcLight:cd},m("quickInput.listFocusForeground","Quick picker foreground color for the focused item.")),av=F("quickInputList.focusIconForeground",{dark:z1,light:z1,hcDark:z1,hcLight:z1},m("quickInput.listFocusIconForeground","Quick picker icon foreground color for the focused item.")),xp=F("quickInputList.focusBackground",{dark:Pw(t$,Eu),light:Pw(t$,Eu),hcDark:null,hcLight:null},m("quickInput.listFocusBackground","Quick picker background color for the focused item.")),yye=F("menu.border",{dark:null,light:null,hcDark:$t,hcLight:$t},m("menuBorder","Border color of menus.")),Sye=F("menu.foreground",{dark:Lu,light:Lu,hcDark:Lu,hcLight:Lu},m("menuForeground","Foreground color of menu items.")),Lye=F("menu.background",{dark:sd,light:sd,hcDark:sd,hcLight:sd},m("menuBackground","Background color of menu items.")),kye=F("menu.selectionForeground",{dark:cd,light:cd,hcDark:cd,hcLight:cd},m("menuSelectionForeground","Foreground color of the selected menu item in menus.")),Dye=F("menu.selectionBackground",{dark:Eu,light:Eu,hcDark:Eu,hcLight:Eu},m("menuSelectionBackground","Background color of the selected menu item in menus.")),Eye=F("menu.selectionBorder",{dark:null,light:null,hcDark:$i,hcLight:$i},m("menuSelectionBorder","Border color of the selected menu item in menus.")),Iye=F("menu.separatorBackground",{dark:"#606060",light:"#D4D4D4",hcDark:$t,hcLight:$t},m("menuSeparatorBackground","Color of a separator menu item in menus.")),uO=F("toolbar.hoverBackground",{dark:"#5a5d5e50",light:"#b8b8b850",hcDark:null,hcLight:null},m("toolbarHoverBackground","Toolbar background when hovering over actions using the mouse"));F("toolbar.hoverOutline",{dark:null,light:null,hcDark:$i,hcLight:$i},m("toolbarHoverOutline","Toolbar outline when hovering over actions using the mouse"));F("toolbar.activeBackground",{dark:rc(uO,.1),light:Ym(uO,.1),hcDark:null,hcLight:null},m("toolbarActiveBackground","Toolbar background when holding the mouse over actions"));F("editor.snippetTabstopHighlightBackground",{dark:new ee(new jt(124,124,124,.3)),light:new ee(new jt(10,50,100,.2)),hcDark:new ee(new jt(124,124,124,.3)),hcLight:new ee(new jt(10,50,100,.2))},m("snippetTabstopHighlightBackground","Highlight background color of a snippet tabstop."));F("editor.snippetTabstopHighlightBorder",{dark:null,light:null,hcDark:null,hcLight:null},m("snippetTabstopHighlightBorder","Highlight border color of a snippet tabstop."));F("editor.snippetFinalTabstopHighlightBackground",{dark:null,light:null,hcDark:null,hcLight:null},m("snippetFinalTabstopHighlightBackground","Highlight background color of the final tabstop of a snippet."));F("editor.snippetFinalTabstopHighlightBorder",{dark:"#525252",light:new ee(new jt(10,50,100,.5)),hcDark:"#525252",hcLight:"#292929"},m("snippetFinalTabstopHighlightBorder","Highlight border color of the final tabstop of a snippet."));const Tye=F("breadcrumb.foreground",{light:nt(Te,.8),dark:nt(Te,.8),hcDark:nt(Te,.8),hcLight:nt(Te,.8)},m("breadcrumbsFocusForeground","Color of focused breadcrumb items.")),xye=F("breadcrumb.background",{light:is,dark:is,hcDark:is,hcLight:is},m("breadcrumbsBackground","Background color of breadcrumb items.")),i$=F("breadcrumb.focusForeground",{light:Ym(Te,.2),dark:rc(Te,.1),hcDark:rc(Te,.1),hcLight:rc(Te,.1)},m("breadcrumbsFocusForeground","Color of focused breadcrumb items.")),Nye=F("breadcrumb.activeSelectionForeground",{light:Ym(Te,.2),dark:rc(Te,.1),hcDark:rc(Te,.1),hcLight:rc(Te,.1)},m("breadcrumbsSelectedForeground","Color of selected breadcrumb items."));F("breadcrumbPicker.background",{light:un,dark:un,hcDark:un,hcLight:un},m("breadcrumbsSelectedBackground","Background color of breadcrumb item picker."));const qQ=.5,n$=ee.fromHex("#40C8AE").transparent(qQ),s$=ee.fromHex("#40A6FF").transparent(qQ),o$=ee.fromHex("#606060").transparent(.4),tl=.4,Tb=1,lv=F("merge.currentHeaderBackground",{dark:n$,light:n$,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);F("merge.currentContentBackground",{dark:nt(lv,tl),light:nt(lv,tl),hcDark:nt(lv,tl),hcLight:nt(lv,tl)},m("mergeCurrentContentBackground","Current content background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);const cv=F("merge.incomingHeaderBackground",{dark:s$,light:s$,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);F("merge.incomingContentBackground",{dark:nt(cv,tl),light:nt(cv,tl),hcDark:nt(cv,tl),hcLight:nt(cv,tl)},m("mergeIncomingContentBackground","Incoming content background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);const dv=F("merge.commonHeaderBackground",{dark:o$,light:o$,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);F("merge.commonContentBackground",{dark:nt(dv,tl),light:nt(dv,tl),hcDark:nt(dv,tl),hcLight:nt(dv,tl)},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 xb=F("merge.border",{dark:null,light:null,hcDark:"#C3DF6F",hcLight:"#007ACC"},m("mergeBorder","Border color on headers and the splitter in inline merge-conflicts."));F("editorOverviewRuler.currentContentForeground",{dark:nt(lv,Tb),light:nt(lv,Tb),hcDark:xb,hcLight:xb},m("overviewRulerCurrentContentForeground","Current overview ruler foreground for inline merge-conflicts."));F("editorOverviewRuler.incomingContentForeground",{dark:nt(cv,Tb),light:nt(cv,Tb),hcDark:xb,hcLight:xb},m("overviewRulerIncomingContentForeground","Incoming overview ruler foreground for inline merge-conflicts."));F("editorOverviewRuler.commonContentForeground",{dark:nt(dv,Tb),light:nt(dv,Tb),hcDark:xb,hcLight:xb},m("overviewRulerCommonContentForeground","Common ancestor overview ruler foreground for inline merge-conflicts."));const n9=F("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),j1=F("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),uv=F("minimap.findMatchHighlight",{light:"#d18616",dark:"#d18616",hcDark:"#AB5A00",hcLight:"#0F4A85"},m("minimapFindMatchHighlight","Minimap marker color for find matches."),!0),vx=F("minimap.selectionOccurrenceHighlight",{light:"#c9c9c9",dark:"#676767",hcDark:"#ffffff",hcLight:"#0F4A85"},m("minimapSelectionOccurrenceHighlight","Minimap marker color for repeating editor selections."),!0),r$=F("minimap.selectionHighlight",{light:"#ADD6FF",dark:"#264F78",hcDark:"#ffffff",hcLight:"#0F4A85"},m("minimapSelectionHighlight","Minimap marker color for the editor selection."),!0),Aye=F("minimap.infoHighlight",{dark:Xo,light:Xo,hcDark:Rw,hcLight:Rw},m("minimapInfo","Minimap marker color for infos.")),Mye=F("minimap.warningHighlight",{dark:Ur,light:Ur,hcDark:Mw,hcLight:Mw},m("overviewRuleWarning","Minimap marker color for warnings.")),Rye=F("minimap.errorHighlight",{dark:new ee(new jt(255,18,18,.7)),light:new ee(new jt(255,18,18,.7)),hcDark:new ee(new jt(255,50,50,1)),hcLight:"#B5200D"},m("minimapError","Minimap marker color for errors.")),Pye=F("minimap.background",{dark:null,light:null,hcDark:null,hcLight:null},m("minimapBackground","Minimap background color.")),Oye=F("minimap.foregroundOpacity",{dark:ee.fromHex("#000f"),light:ee.fromHex("#000f"),hcDark:ee.fromHex("#000f"),hcLight:ee.fromHex("#000f")},m("minimapForegroundOpacity",'Opacity of foreground elements rendered in the minimap. For example, "#000000c0" will render the elements with 75% opacity.'));F("minimapSlider.background",{light:nt(V1,.5),dark:nt(V1,.5),hcDark:nt(V1,.5),hcLight:nt(V1,.5)},m("minimapSliderBackground","Minimap slider background color."));F("minimapSlider.hoverBackground",{light:nt(H1,.5),dark:nt(H1,.5),hcDark:nt(H1,.5),hcLight:nt(H1,.5)},m("minimapSliderHoverBackground","Minimap slider background color when hovering."));F("minimapSlider.activeBackground",{light:nt($1,.5),dark:nt($1,.5),hcDark:nt($1,.5),hcLight:nt($1,.5)},m("minimapSliderActiveBackground","Minimap slider background color when clicked on."));const Fye=F("problemsErrorIcon.foreground",{dark:od,light:od,hcDark:od,hcLight:od},m("problemsErrorIconForeground","The color used for the problems error icon.")),Bye=F("problemsWarningIcon.foreground",{dark:Ur,light:Ur,hcDark:Ur,hcLight:Ur},m("problemsWarningIconForeground","The color used for the problems warning icon.")),Wye=F("problemsInfoIcon.foreground",{dark:Xo,light:Xo,hcDark:Xo,hcLight:Xo},m("problemsInfoIconForeground","The color used for the problems info icon."));F("charts.foreground",{dark:Te,light:Te,hcDark:Te,hcLight:Te},m("chartsForeground","The foreground color used in charts."));F("charts.lines",{dark:nt(Te,.5),light:nt(Te,.5),hcDark:nt(Te,.5),hcLight:nt(Te,.5)},m("chartsLines","The color used for horizontal lines in charts."));F("charts.red",{dark:od,light:od,hcDark:od,hcLight:od},m("chartsRed","The red color used in chart visualizations."));F("charts.blue",{dark:Xo,light:Xo,hcDark:Xo,hcLight:Xo},m("chartsBlue","The blue color used in chart visualizations."));F("charts.yellow",{dark:Ur,light:Ur,hcDark:Ur,hcLight:Ur},m("chartsYellow","The yellow color used in chart visualizations."));F("charts.orange",{dark:uv,light:uv,hcDark:uv,hcLight:uv},m("chartsOrange","The orange color used in chart visualizations."));F("charts.green",{dark:"#89D185",light:"#388A34",hcDark:"#89D185",hcLight:"#374e06"},m("chartsGreen","The green color used in chart visualizations."));F("charts.purple",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},m("chartsPurple","The purple color used in chart visualizations."));function Vye(n,e){var t,i,s,o;switch(n.op){case 0:return(t=Nl(n.value,e))===null||t===void 0?void 0:t.darken(n.factor);case 1:return(i=Nl(n.value,e))===null||i===void 0?void 0:i.lighten(n.factor);case 2:return(s=Nl(n.value,e))===null||s===void 0?void 0:s.transparent(n.factor);case 3:{const r=Nl(n.background,e);return r?(o=Nl(n.value,e))===null||o===void 0?void 0:o.makeOpaque(r):Nl(n.value,e)}case 4:for(const r of n.values){const a=Nl(r,e);if(a)return a}return;case 6:return Nl(e.defines(n.if)?n.then:n.else,e);case 5:{const r=Nl(n.value,e);if(!r)return;const a=Nl(n.background,e);return a?r.isDarkerThan(a)?ee.getLighterColor(r,a,n.factor).transparent(n.transparency):ee.getDarkerColor(r,a,n.factor).transparent(n.transparency):r.transparent(n.factor*n.transparency)}default:throw tx()}}function Ym(n,e){return{op:0,value:n,factor:e}}function rc(n,e){return{op:1,value:n,factor:e}}function nt(n,e){return{op:2,value:n,factor:e}}function Pw(...n){return{op:4,values:n}}function Hye(n,e,t){return{op:6,if:n,then:e,else:t}}function a$(n,e,t,i){return{op:5,value:n,background:e,factor:t,transparency:i}}function Nl(n,e){if(n!==null){if(typeof n=="string")return n[0]==="#"?ee.fromHex(n):e.getColor(n);if(n instanceof ee)return n;if(typeof n=="object")return Vye(n,e)}}const GQ="vscode://schemas/workbench-colors",YQ=en.as(hx.JSONContribution);YQ.registerSchema(GQ,_x.getColorSchema());const l$=new Si(()=>YQ.notifySchemaChanged(GQ),200);_x.onDidChangeSchema(()=>{l$.isScheduled()||l$.schedule()});class bx{constructor(e,t){this.x=e,this.y=t,this._pageCoordinatesBrand=void 0}toClientCoordinates(){return new ZQ(this.x-window.scrollX,this.y-window.scrollY)}}class ZQ{constructor(e,t){this.clientX=e,this.clientY=t,this._clientCoordinatesBrand=void 0}toPageCoordinates(){return new bx(this.clientX+window.scrollX,this.clientY+window.scrollY)}}class $ye{constructor(e,t,i,s){this.x=e,this.y=t,this.width=i,this.height=s,this._editorPagePositionBrand=void 0}}class zye{constructor(e,t){this.x=e,this.y=t,this._positionRelativeToEditorBrand=void 0}}function s9(n){const e=Un(n);return new $ye(e.left,e.top,e.width,e.height)}function o9(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 zye(o,r)}class Zf extends ba{constructor(e,t,i){super(e),this._editorMouseEventBrand=void 0,this.isFromPointerCapture=t,this.pos=new bx(this.posx,this.posy),this.editorPos=s9(i),this.relativePos=o9(i,this.editorPos,this.pos)}}class Uye{constructor(e){this._editorViewDomNode=e}_create(e){return new Zf(e,!1,this._editorViewDomNode)}onContextMenu(e,t){return ce(e,"contextmenu",i=>{t(this._create(i))})}onMouseUp(e,t){return ce(e,"mouseup",i=>{t(this._create(i))})}onMouseDown(e,t){return ce(e,Pe.MOUSE_DOWN,i=>{t(this._create(i))})}onPointerDown(e,t){return ce(e,Pe.POINTER_DOWN,i=>{t(this._create(i),i.pointerId)})}onMouseLeave(e,t){return ce(e,Pe.MOUSE_LEAVE,i=>{t(this._create(i))})}onMouseMove(e,t){return ce(e,"mousemove",i=>t(this._create(i)))}}class jye{constructor(e){this._editorViewDomNode=e}_create(e){return new Zf(e,!1,this._editorViewDomNode)}onPointerUp(e,t){return ce(e,"pointerup",i=>{t(this._create(i))})}onPointerDown(e,t){return ce(e,Pe.POINTER_DOWN,i=>{t(this._create(i),i.pointerId)})}onPointerLeave(e,t){return ce(e,Pe.POINTER_LEAVE,i=>{t(this._create(i))})}onPointerMove(e,t){return ce(e,"pointermove",i=>t(this._create(i)))}}class Kye extends te{constructor(e){super(),this._editorViewDomNode=e,this._globalPointerMoveMonitor=this._register(new I0),this._keydownListener=null}startMonitoring(e,t,i,s,o){this._keydownListener=In(e.ownerDocument,"keydown",r=>{r.toKeyCodeChord().isModifierKey()||this._globalPointerMoveMonitor.stopMonitoring(!0,r.browserEvent)},!0),this._globalPointerMoveMonitor.startMonitoring(e,t,i,r=>{s(new Zf(r,!0,this._editorViewDomNode))},r=>{this._keydownListener.dispose(),o(r)})}stopMonitoring(){this._globalPointerMoveMonitor.stopMonitoring(!0)}}class mS{constructor(e){this._editor=e,this._instanceId=++mS._idPool,this._counter=0,this._rules=new Map,this._garbageCollectionScheduler=new Si(()=>this.garbageCollect(),1e3)}createClassNameRef(e){const t=this.getOrCreateRule(e);return t.increaseRefCount(),{className:t.className,dispose:()=>{t.decreaseRefCount(),this._garbageCollectionScheduler.schedule()}}}getOrCreateRule(e){const t=this.computeUniqueKey(e);let i=this._rules.get(t);if(!i){const s=this._counter++;i=new qye(t,"dyn-rule-".concat(this._instanceId,"-").concat(s),bE(this._editor.getContainerDomNode())?this._editor.getContainerDomNode():void 0,e),this._rules.set(t,i)}return i}computeUniqueKey(e){return JSON.stringify(e)}garbageCollect(){for(const e of this._rules.values())e.hasReferences()||(this._rules.delete(e.key),e.dispose())}}mS._idPool=0;class qye{constructor(e,t,i,s){this.key=e,this.className=t,this.properties=s,this._referenceCount=0,this._styleElement=Na(i),this._styleElement.textContent=this.getCssText(this.className,this.properties)}getCssText(e,t){let i=".".concat(e," {");for(const s in t){const o=t[s];let r;typeof o=="object"?r=He(o.id):r=o;const a=Gye(s);i+="\n ".concat(a,": ").concat(r,";")}return i+="\n}",i}dispose(){this._styleElement.remove()}increaseRefCount(){this._referenceCount++}decreaseRefCount(){this._referenceCount--}hasReferences(){return this._referenceCount>0}}function Gye(n){return n.replace(/(^[A-Z])/,([e])=>e.toLowerCase()).replace(/([A-Z])/g,([e])=>"-".concat(e.toLowerCase()))}class _S extends te{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 Ca;(function(n){n.DARK="dark",n.LIGHT="light",n.HIGH_CONTRAST_DARK="hcDark",n.HIGH_CONTRAST_LIGHT="hcLight"})(Ca||(Ca={}));function ac(n){return n===Ca.HIGH_CONTRAST_DARK||n===Ca.HIGH_CONTRAST_LIGHT}function Nb(n){return n===Ca.DARK||n===Ca.HIGH_CONTRAST_DARK}const Jye=function(){return nc?!0:!(Co||Ta||qu)}();let jv=!0;class d${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 Gc{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=ci(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 ac(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=br.filter(o.inlineDecorations,e,o.minColumn,o.maxColumn);let l=null;if(ac(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=gS(c,s);s.appendString("");let u=null;return jv&&Jye&&o.isBasicASCII&&r.useMonospaceOptimizations&&d.containsForeignElements===0&&(u=new kL(this._renderedViewLine?this._renderedViewLine.domNode:null,c,d.characterMapping)),u||(u=QQ(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 kL:!1}monospaceAssumptionsAreValid(){return this._renderedViewLine&&this._renderedViewLine instanceof kL?this._renderedViewLine.monospaceAssumptionsAreValid():jv}onMonospaceAssumptionsInvalidated(){this._renderedViewLine&&this._renderedViewLine instanceof kL&&(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 c$(!0,[new Up(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 c$(!1,r):null}getColumnOfNodeOffset(e,t){return this._renderedViewLine?this._renderedViewLine.getColumnOfNodeOffset(e,t):1}}Gc.CLASS_NAME="view-line";class kL{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!"),jv=!1)}return jv}toSlowRenderedLine(){return QQ(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 Up(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=gD.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 r9(this._characterMapping,e,t)}}class XQ{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 Up(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 Up(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=gD.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=gD.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 Up(0,this.getWidth(s))];const o=this._characterMapping.getDomPosition(t),r=this._characterMapping.getDomPosition(i);return gD.readHorizontalRanges(this._getReadingTarget(e),o.partIndex,o.charIndex,r.partIndex,r.charIndex,s)}getColumnOfNodeOffset(e,t){return r9(this._characterMapping,e,t)}}class eSe extends XQ{_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 Ab{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 Ab.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 Y(i.afterLineNumber+1,1)),i.afterLineNumber>0&&(r=new Y(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,Ms._getMouseColumn(this.mouseContentHorizontalOffset,e.typicalHalfwidthCharacterWidth))}}class a9 extends sSe{constructor(e,t,i,s,o){super(e,t,i,s),this._ctx=e,o?(this.target=o,this.targetPath=Dd.collect(o,e.viewDomNode)):(this.target=null,this.targetPath=new Uint8Array(0))}toString(){return"pos(".concat(this.pos.x,",").concat(this.pos.y,"), editorPos(").concat(this.editorPos.x,",").concat(this.editorPos.y,"), relativePos(").concat(this.relativePos.x,",").concat(this.relativePos.y,"), mouseVerticalOffset: ").concat(this.mouseVerticalOffset,", mouseContentHorizontalOffset: ").concat(this.mouseContentHorizontalOffset,"\n target: ").concat(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 Tr.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(!Tr.isChildOfViewLines(t.targetPath))return null;if(e.isInTopPadding(t.mouseVerticalOffset))return t.fulfillContentEmpty(new Y(1,1),u$);if(e.isAfterLines(t.mouseVerticalOffset)||e.isInBottomPadding(t.mouseVerticalOffset)){const o=e.viewModel.getLineCount(),r=e.viewModel.getLineMaxColumn(o);return t.fulfillContentEmpty(new Y(o,r),u$)}if(i){if(Tr.isStrictChildOfViewLines(t.targetPath)){const o=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset);if(e.viewModel.getLineLength(o)===0){const a=e.getLineWidth(o),l=wM(t.mouseContentHorizontalOffset-a);return t.fulfillContentEmpty(new Y(o,1),l)}const r=e.getLineWidth(o);if(t.mouseContentHorizontalOffset>=r){const a=wM(t.mouseContentHorizontalOffset-r),l=new Y(o,e.viewModel.getLineMaxColumn(o));return t.fulfillContentEmpty(l,a)}}return t.fulfillUnknown()}const s=Ms._doHitTest(e,t);return s.type===1?Ms.createMouseTargetFromHitTestPosition(e,t,s.spanNode,s.position,s.injectedText):this._createMouseTarget(e,t.withTarget(s.hitTarget),!0)}static _hitTestMinimap(e,t){if(Tr.isChildOfMinimap(t.targetPath)){const i=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),s=e.viewModel.getLineMaxColumn(i);return t.fulfillScrollbar(new Y(i,s))}return null}static _hitTestScrollbarSlider(e,t){if(Tr.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 Y(s,o))}}return null}static _hitTestScrollbar(e,t){if(Tr.isChildOfScrollableElement(t.targetPath)){const i=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),s=e.viewModel.getLineMaxColumn(i);return t.fulfillScrollbar(new Y(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 Ms._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=wM(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 bx(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=cm(e.viewDomNode);let s;if(i?typeof i.caretRangeFromPoint>"u"?s=oSe(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 Th;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)===Gc.CLASS_NAME?_p.createFromDOMInfo(e,r,s.startOffset):new Th(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)===Gc.CLASS_NAME?_p.createFromDOMInfo(e,o,o.textContent.length):new Th(o)}return new Th}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)===Gc.CLASS_NAME?_p.createFromDOMInfo(e,i.offsetNode.parentNode,i.offset):new Th(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===Gc.CLASS_NAME){const l=i.offsetNode.childNodes[Math.min(i.offset,i.offsetNode.childNodes.length-1)];if(l)return _p.createFromDOMInfo(e,l,0)}else if(a===Gc.CLASS_NAME)return _p.createFromDOMInfo(e,i.offsetNode,0)}return new Th(i.offsetNode)}static _snapToSoftTabBoundary(e,t){const i=t.getLineContent(e.lineNumber),{tabSize:s}=t.model.getOptions(),o=Ow.atomicPosition(i,e.column-1,s,2);return o!==-1?new Y(e.lineNumber,o+1):e}static _doHitTest(e,t){let i=new Th;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 JQ(o,i.spanNode,s))}return i}}function oSe(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="".concat(r," ").concat(a," ").concat(l," ").concat(c,"/").concat(d," ").concat(u),f=s.innerText;let g=o.left,p=0,_;if(e>o.left+o.width)p=f.length;else{const v=Np.getInstance();for(let b=0;bt(new ba(i))))}onmousedown(e,t){this._register(ce(e,Pe.MOUSE_DOWN,i=>t(new ba(i))))}onmouseover(e,t){this._register(ce(e,Pe.MOUSE_OVER,i=>t(new ba(i))))}onmouseleave(e,t){this._register(ce(e,Pe.MOUSE_LEAVE,i=>t(new ba(i))))}onkeydown(e,t){this._register(ce(e,Pe.KEY_DOWN,i=>t(new Oi(i))))}onkeyup(e,t){this._register(ce(e,Pe.KEY_UP,i=>t(new Oi(i))))}oninput(e,t){this._register(ce(e,Pe.INPUT,t))}onblur(e,t){this._register(ce(e,Pe.BLUR,t))}onfocus(e,t){this._register(ce(e,Pe.FOCUS,t))}ignoreGesture(e){return Ii.ignoreTarget(e)}};const Mb=11;class rSe extends vl{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(...dt.asClassNameArray(e.icon)),this.domNode.style.position="absolute",this.domNode.style.width=Mb+"px",this.domNode.style.height=Mb+"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 I0),this._register(In(this.bgDomNode,Pe.POINTER_DOWN,t=>this._arrowPointerDown(t))),this._register(In(this.domNode,Pe.POINTER_DOWN,t=>this._arrowPointerDown(t))),this._pointerdownRepeatTimer=this._register(new uS),this._pointerdownScheduleRepeatTimer=this._register(new _l)}_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 aSe extends te{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 _l)}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 lSe=140;class eJ extends vl{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 aSe(e.visibility,"visible scrollbar "+e.extraScrollbarClassName,"invisible scrollbar "+e.extraScrollbarClassName)),this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._pointerMoveMonitor=this._register(new I0),this._shouldRender=!0,this.domNode=ci(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(ce(this.domNode.domNode,Pe.POINTER_DOWN,t=>this._domNodePointerDown(t)))}_createArrow(e){const t=this._register(new rSe(e));this.domNode.domNode.appendChild(t.bgDomNode),this.domNode.domNode.appendChild(t.domNode)}_createSlider(e,t,i,s){this.slider=ci(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(ce(this.slider.domNode,Pe.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=Un(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(zs&&a>lSe){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 cSe=20;class Rb{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 Rb(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(cSe,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=Rb._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 lm(null,1,0))}),this._createArrow({className:"scra",icon:Me.scrollbarButtonRight,top:a,left:void 0,bottom:void 0,right:r,bgWidth:t.arrowSize,bgHeight:t.horizontalScrollbarSize,onActivate:()=>this._host.onMouseWheel(new lm(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 uSe extends eJ{constructor(e,t,i){const s=e.getScrollDimensions(),o=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:i,scrollbarState:new Rb(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-Mb)/2,a=(t.verticalScrollbarSize-Mb)/2;this._createArrow({className:"scra",icon:Me.scrollbarButtonUp,top:r,left:a,bottom:void 0,right:void 0,bgWidth:t.verticalScrollbarSize,bgHeight:t.arrowSize,onActivate:()=>this._host.onMouseWheel(new lm(null,0,1))}),this._createArrow({className:"scra",icon:Me.scrollbarButtonDown,top:void 0,left:a,bottom:r,right:void 0,bgWidth:t.verticalScrollbarSize,bgHeight:t.arrowSize,onActivate:()=>this._host.onMouseWheel(new lm(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 ME{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 ME(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 ME(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 vS extends te{constructor(e){super(),this._scrollableBrand=void 0,this._onScroll=this._register(new j),this.onScroll=this._onScroll.event,this._smoothScrollDuration=e.smoothScrollDuration,this._scheduleAtNextAnimationFrame=e.scheduleAtNextAnimationFrame,this._state=new ME(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 Fw(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=Fw.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 h${constructor(e,t,i){this.scrollLeft=e,this.scrollTop=t,this.isDone=i}}function yM(n,e){const t=e-n;return function(i){return n+t*gSe(i)}}function hSe(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}}RE.INSTANCE=new RE;class l9 extends vl{get options(){return this._options}constructor(e,t,i){super(),this._onScroll=this._register(new j),this.onScroll=this._onScroll.event,this._onWillScroll=this._register(new j),e.style.overflow="hidden",this._options=_Se(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 uSe(this._scrollable,this._options,s)),this._horizontalScrollbar=this._register(new dSe(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=ci(document.createElement("div")),this._leftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._leftShadowDomNode.domNode),this._topShadowDomNode=ci(document.createElement("div")),this._topShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topShadowDomNode.domNode),this._topLeftShadowDomNode=ci(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 _l),this._isDragging=!1,this._mouseIsOver=!1,this._shouldRender=!0,this._revealOnScroll=!0}dispose(){this._mouseWheelToDispose=fi(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,Kt&&(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 lm(e))}_setListeningToMouseWheel(e){if(this._mouseWheelToDispose.length>0!==e&&(this._mouseWheelToDispose=fi(this._mouseWheelToDispose),e)){const i=s=>{this._onMouseWheel(new lm(s))};this._mouseWheelToDispose.push(ce(this._listenOnDomNode,Pe.MOUSE_WHEEL,i,{passive:!1}))}}_onMouseWheel(e){var t;if(!((t=e.browserEvent)===null||t===void 0)&&t.defaultPrevented)return;const i=RE.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=!Kt&&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=f$*r,h=c.scrollTop-(u<0?Math.floor(u):Math.ceil(u));this._verticalScrollbar.writeScrollPosition(d,h)}if(a){const u=f$*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".concat(s)),this._topShadowDomNode.setClassName("shadow".concat(o)),this._topLeftShadowDomNode.setClassName("shadow".concat(r).concat(o).concat(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(),pSe)}}class tJ extends l9{constructor(e,t){t=t||{},t.mouseWheelSmoothScroll=!1;const i=new vS({forceIntegerValues:!0,smoothScrollDuration:0,scheduleAtNextAnimationFrame:s=>xa(s)});super(e,t,i),this._register(i)}setScrollPosition(e){this._scrollable.setScrollPositionNow(e)}}class c9 extends l9{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 bS extends l9{constructor(e,t){t=t||{},t.mouseWheelSmoothScroll=!1;const i=new vS({forceIntegerValues:!1,smoothScrollDuration:0,scheduleAtNextAnimationFrame:s=>xa(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 _Se(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,Kt&&(e.className+=" mac"),e}class d9 extends _S{constructor(e,t,i){super(),this._mouseLeaveMonitor=null,this._context=e,this.viewController=t,this.viewHelper=i,this.mouseTargetFactory=new Ms(this._context,i),this._mouseDownOperation=this._register(new vSe(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 Uye(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=ce(this.viewHelper.viewDomNode.ownerDocument,"mousemove",a=>{this.viewHelper.viewDomNode.contains(a.target)||this._onMouseLeave(new Zf(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(ce(this.viewHelper.viewDomNode,Pe.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=RE.INSTANCE;let t=0,i=ma.getZoomLevel(),s=!1,o=0;const r=l=>{if(this.viewController.emitMouseWheel(l),!this._context.configuration.options.get(75))return;const c=new lm(l);if(e.acceptStandardWheelEvent(c),e.isPhysicalMouseWheel()){if(a(l)){const d=ma.getZoomLevel(),u=c.deltaY>0?1:-1;ma.setZoomLevel(d+u),c.preventDefault(),c.stopPropagation()}}else Date.now()-t>50&&(i=ma.getZoomLevel(),s=a(l),o=0),t=Date.now(),o+=c.deltaY,s&&(ma.setZoomLevel(i+o/5),c.preventDefault(),c.stopPropagation())};this._register(ce(this.viewHelper.viewDomNode,Pe.MOUSE_WHEEL,r,{capture:!0,passive:!1}));function a(l){return Kt?(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 ZQ(e,t).toPageCoordinates(),o=s9(this.viewHelper.viewDomNode);if(s.yo.y+o.height||s.xo.x+o.width)return null;const r=o9(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=cm(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 vSe extends te{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 Kye(this._viewHelper.viewDomNode)),this._topBottomDragScrolling=this._register(new bSe(this._context,this._viewHelper,this._mouseTargetFactory,(a,l,c)=>this._dispatchMouse(a,l,c))),this._mouseState=new wx,this._currentSelection=new Je(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=Ab.getZoneAtCoord(this._context,l);if(c){const u=this._helpPositionJumpOverViewZone(c);if(u)return po.createOutsideEditor(o,u,"below",a)}const d=s.getLineNumberAtVerticalOffset(l);return po.createOutsideEditor(o,new Y(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 po.createOutsideEditor(o,new Y(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 po.createViewZone(s.type,s.element,s.mouseColumn,r,s.detail)}return s}_helpPositionJumpOverViewZone(e){const t=new Y(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 bSe extends te{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 CSe(this._context,this._viewHelper,this._mouseTargetFactory,this._dispatchMouse,e,t)}stop(){this._operation&&(this._operation.dispose(),this._operation=null)}}class CSe extends te{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=xa(()=>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=s9(this._viewHelper.viewDomNode),d=this._context.configuration.options.get(143).horizontalScrollbarHeight,u=new bx(this._mouseEvent.pos.x,c.y+c.height-d-.1),h=o9(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=po.createOutsideEditor(this._position.mouseColumn,new Y(a,1),"above",this._position.outsideDistance):l=po.createOutsideEditor(this._position.mouseColumn,new Y(a,this._context.viewModel.getLineMaxColumn(a)),"below",this._position.outsideDistance)),this._dispatchMouse(l,!0,2),this._animationFrameDisposable=xa(()=>this._execute())}}class wx{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>wx.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)}}wx.CLEAR_MOUSE_DOWN_COUNT_TIME=400;class Vt{get event(){return this.emitter.event}constructor(e,t,i){const s=o=>this.emitter.fire(o);this.emitter=new j({onWillAddFirstListener:()=>e.addEventListener(t,s,i),onDidRemoveLastListener:()=>e.removeEventListener(t,s,i)})}dispose(){this.emitter.dispose()}}var nf;(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++,C())}function b(S,k){const D=performance.getEntriesByName(S)[0].duration;k.total+=D,k.min=Math.min(k.min,D),k.max=Math.max(k.max,D)}function C(){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 w(){if(o===0)return;const S={keydown:y(e),input:y(t),render:y(i),total:y(s),sampleCount:o};return L(e),L(t),L(i),L(s),o=0,S}n.getAndClearMeasurements=w;function y(S){return{average:S.total/o,max:S.max,min:S.min}}function L(S){S.total=0,S.min=Number.MAX_VALUE,S.max=0}})(nf||(nf={}));class _s{constructor(e,t,i,s,o){this.value=e,this.selectionStart=t,this.selectionEnd=i,this.selection=s,this.newlineCountBeforeSelection=o}toString(){return"[ <".concat(this.value,">, selectionStart: ").concat(this.selectionStart,", selectionEnd: ").concat(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 _s(i,s,o,null,r)}collapseSelection(){return this.selectionStart===this.value.length?this:new _s(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("\n",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(om(e.value,t.value),e.selectionStart,t.selectionStart),o=Math.min(pE(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(om(e.value,t.value),e.selectionEnd),s=Math.min(pE(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}}}_s.EMPTY=new _s("",0,0,null,void 0);class hv{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 I(s,1,o+1,1)}static fromEditorSelection(e,t,i,s){const r=hv._getPageOfLine(t.startLineNumber,i),a=hv._getRangeForPage(r,i),l=hv._getPageOfLine(t.endLineNumber,i),c=hv._getRangeForPage(l,i);let d=a.intersectRanges(new I(1,1,t.startLineNumber,t.startColumn));if(s&&e.getValueLengthInRange(d,1)>500){const v=e.modifyPosition(d.getEndPosition(),-500);d=I.fromPositions(v,d.getEndPosition())}const u=e.getValueInRange(d,1),h=e.getLineCount(),f=e.getLineMaxColumn(h);let g=c.intersectRanges(new I(t.endLineNumber,t.endColumn,h,f));if(s&&e.getValueLengthInRange(g,1)>500){const v=e.modifyPosition(g.getStartPosition(),500);g=I.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 _s(u+_+p,u.length,u.length+_.length,t,d.endLineNumber-d.startLineNumber)}}var PE;(function(n){n.Tap="-monaco-textarea-synthetic-tap"})(PE||(PE={}));const hO={forceCopyWithSyntaxHighlighting:!1};class Bw{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)}}Bw.INSTANCE=new Bw;class wSe{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 ySe extends te{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 j),this.onFocus=this._onFocus.event,this._onBlur=this._register(new j),this.onBlur=this._onBlur.event,this._onKeyDown=this._register(new j),this.onKeyDown=this._onKeyDown.event,this._onKeyUp=this._register(new j),this.onKeyUp=this._onKeyUp.event,this._onCut=this._register(new j),this.onCut=this._onCut.event,this._onPaste=this._register(new j),this.onPaste=this._onPaste.event,this._onType=this._register(new j),this.onType=this._onType.event,this._onCompositionStart=this._register(new j),this.onCompositionStart=this._onCompositionStart.event,this._onCompositionUpdate=this._register(new j),this.onCompositionUpdate=this._onCompositionUpdate.event,this._onCompositionEnd=this._register(new j),this.onCompositionEnd=this._onCompositionEnd.event,this._onSelectionChangeRequest=this._register(new j),this.onSelectionChangeRequest=this._onSelectionChangeRequest.event,this._asyncTriggerCut=this._register(new Si(()=>this._onCut.fire(),0)),this._asyncFocusGainWriteScreenReaderContent=this._register(new Si(()=>this.writeScreenReaderContent("asyncFocusGain"),0)),this._textAreaState=_s.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 Oi(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 Oi(r);this._onKeyUp.fire(a)})),this._register(this._textArea.onCompositionStart(r=>{const a=new wSe;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=_s.readFromTextArea(this._textArea,this._textAreaState),d=_s.deduceAndroidCompositionInput(this._textAreaState,c);this._textAreaState=c,this._onType.fire(d),this._onCompositionUpdate.fire(r);return}const l=a.handleCompositionUpdate(r.data);this._textAreaState=_s.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=_s.readFromTextArea(this._textArea,this._textAreaState),d=_s.deduceAndroidCompositionInput(this._textAreaState,c);this._textAreaState=c,this._onType.fire(d),this._onCompositionEnd.fire();return}const l=a.handleCompositionUpdate(r.data);this._textAreaState=_s.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=_s.readFromTextArea(this._textArea,this._textAreaState),l=_s.deduceInput(this._textAreaState,a,this._OS===2);l.replacePrevCharCnt===0&&l.text.length===1&&(es(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]=fO.getTextData(r.clipboardData);a&&(l=l||Bw.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 ce(this._textArea.ownerDocument,"selectionchange",t=>{if(nf.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 Je(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};Bw.INSTANCE.set(this._browser.isFirefox?t.text.replace(/\r\n/g,"\n"):t.text,i),e.preventDefault(),e.clipboardData&&fO.setTextData(e.clipboardData,t.text,t.html,i)}}const fO={getTextData(n){const e=n.getData(wn.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("\n"),null]:[e,t]},setTextData(n,e,t,i){n.setData(wn.text,e),typeof t=="string"&&n.setData("text/html",t),n.setData("vscode-editor-data",JSON.stringify(i))}};class SSe extends te{get ownerDocument(){return this._actual.ownerDocument}constructor(e){super(),this._actual=e,this.onKeyDown=this._register(new Vt(this._actual,"keydown")).event,this.onKeyUp=this._register(new Vt(this._actual,"keyup")).event,this.onCompositionStart=this._register(new Vt(this._actual,"compositionstart")).event,this.onCompositionUpdate=this._register(new Vt(this._actual,"compositionupdate")).event,this.onCompositionEnd=this._register(new Vt(this._actual,"compositionend")).event,this.onBeforeInput=this._register(new Vt(this._actual,"beforeinput")).event,this.onInput=this._register(new Vt(this._actual,"input")).event,this.onCut=this._register(new Vt(this._actual,"cut")).event,this.onCopy=this._register(new Vt(this._actual,"copy")).event,this.onPaste=this._register(new Vt(this._actual,"paste")).event,this.onFocus=this._register(new Vt(this._actual,"focus")).event,this.onBlur=this._register(new Vt(this._actual,"blur")).event,this._onSyntheticTap=this._register(new j),this.onSyntheticTap=this._onSyntheticTap.event,this._ignoreSelectionChangeTime=0,this._register(this.onKeyDown(()=>nf.onKeyDown())),this._register(this.onBeforeInput(()=>nf.onBeforeInput())),this._register(this.onInput(()=>nf.onInput())),this._register(this.onKeyUp(()=>nf.onKeyUp())),this._register(ce(this._actual,PE.Tap,()=>this._onSyntheticTap.fire()))}hasFocus(){const e=cm(this._actual);return e?e.activeElement===this._actual:O8(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=cm(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){Ta&&window.parent!==window&&s.focus();return}if(a){this.setIgnoreSelectionChangeTime("setSelectionRange"),s.setSelectionRange(t,i),Ta&&window.parent!==window&&s.focus();return}try{const d=i0e(s);this.setIgnoreSelectionChangeTime("setSelectionRange"),s.focus(),s.setSelectionRange(t,i),n0e(s,d)}catch{}}}class LSe extends d9{constructor(e,t,i){super(e,t,i),this._register(Ii.addTarget(this.viewHelper.linesContentDomNode)),this._register(ce(this.viewHelper.linesContentDomNode,Ti.Tap,o=>this.onTap(o))),this._register(ce(this.viewHelper.linesContentDomNode,Ti.Change,o=>this.onChange(o))),this._register(ce(this.viewHelper.linesContentDomNode,Ti.Contextmenu,o=>this._onContextMenu(new Zf(o,!1,this.viewHelper.viewDomNode),!1))),this._lastPointerType="mouse",this._register(ce(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 jye(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 Zf(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 kSe extends d9{constructor(e,t,i){super(e,t,i),this._register(Ii.addTarget(this.viewHelper.linesContentDomNode)),this._register(ce(this.viewHelper.linesContentDomNode,Ti.Tap,s=>this.onTap(s))),this._register(ce(this.viewHelper.linesContentDomNode,Ti.Change,s=>this.onChange(s))),this._register(ce(this.viewHelper.linesContentDomNode,Ti.Contextmenu,s=>this._onContextMenu(new Zf(s,!1,this.viewHelper.viewDomNode),!1)))}onTap(e){e.preventDefault(),this.viewHelper.focusTextArea();const t=this._createMouseTarget(new Zf(e,!1,this.viewHelper.viewDomNode),!1);if(t.position){const i=document.createEvent("CustomEvent");i.initEvent(PE.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 DSe extends te{constructor(e,t,i){super(),uc&&P8.pointerEvents?this.handler=this._register(new LSe(e,t,i)):window.TouchEvent?this.handler=this._register(new kSe(e,t,i)):this.handler=this._register(new d9(e,t,i))}getTargetAtClientPoint(e,t){return this.handler.getTargetAtClientPoint(e,t)}}class Zm extends _S{}const os=Wt("themeService");function sn(n){return{id:n}}function gO(n){switch(n){case Ca.DARK:return"vs-dark";case Ca.HIGH_CONTRAST_DARK:return"hc-black";case Ca.HIGH_CONTRAST_LIGHT:return"hc-light";default:return"vs"}}const iJ={ThemingContribution:"base.contributions.theming"};class ESe{constructor(){this.themingParticipants=[],this.themingParticipants=[],this.onThemingParticipantAddedEmitter=new j}onColorThemeChange(e){return this.themingParticipants.push(e),this.onThemingParticipantAddedEmitter.fire(e),vt(()=>{const t=this.themingParticipants.indexOf(e);this.themingParticipants.splice(t,1)})}getThemingParticipants(){return this.themingParticipants}}const nJ=new ESe;en.add(iJ.ThemingContribution,nJ);function bl(n){return nJ.onColorThemeChange(n)}class ISe extends te{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 sJ=F("editor.lineHighlightBackground",{dark:null,light:null,hcDark:null,hcLight:null},m("lineHighlight","Background color for the highlight of line at the cursor position.")),g$=F("editor.lineHighlightBorder",{dark:"#282828",light:"#eeeeee",hcDark:"#f38518",hcLight:$t},m("lineHighlightBorderBox","Background color for the border around the line at the cursor position."));F("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);F("editor.rangeHighlightBorder",{dark:null,light:null,hcDark:$i,hcLight:$i},m("rangeHighlightBorder","Background color of the border around highlighted ranges."),!0);F("editor.symbolHighlightBackground",{dark:ld,light:ld,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);F("editor.symbolHighlightBorder",{dark:null,light:null,hcDark:$i,hcLight:$i},m("symbolHighlightBorder","Background color of the border around highlighted symbols."),!0);const oJ=F("editorCursor.foreground",{dark:"#AEAFAD",light:ee.black,hcDark:ee.white,hcLight:"#0F4A85"},m("caret","Color of the editor cursor.")),TSe=F("editorCursor.background",null,m("editorCursorBackground","The background color of the editor cursor. Allows customizing the color of a character overlapped by a block cursor.")),Iu=F("editorWhitespace.foreground",{dark:"#e3e4e229",light:"#33333333",hcDark:"#e3e4e229",hcLight:"#CCCCCC"},m("editorWhitespaces","Color of whitespace characters in the editor.")),xSe=F("editorLineNumber.foreground",{dark:"#858585",light:"#237893",hcDark:ee.white,hcLight:"#292929"},m("editorLineNumbers","Color of editor line numbers.")),DL=F("editorIndentGuide.background",{dark:Iu,light:Iu,hcDark:Iu,hcLight:Iu},m("editorIndentGuides","Color of the editor indentation guides."),!1,m("deprecatedEditorIndentGuides","'editorIndentGuide.background' is deprecated. Use 'editorIndentGuide.background1' instead.")),EL=F("editorIndentGuide.activeBackground",{dark:Iu,light:Iu,hcDark:Iu,hcLight:Iu},m("editorActiveIndentGuide","Color of the active editor indentation guides."),!1,m("deprecatedEditorActiveIndentGuide","'editorIndentGuide.activeBackground' is deprecated. Use 'editorIndentGuide.activeBackground1' instead.")),CS=F("editorIndentGuide.background1",{dark:DL,light:DL,hcDark:DL,hcLight:DL},m("editorIndentGuides1","Color of the editor indentation guides (1).")),NSe=F("editorIndentGuide.background2",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},m("editorIndentGuides2","Color of the editor indentation guides (2).")),ASe=F("editorIndentGuide.background3",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},m("editorIndentGuides3","Color of the editor indentation guides (3).")),MSe=F("editorIndentGuide.background4",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},m("editorIndentGuides4","Color of the editor indentation guides (4).")),RSe=F("editorIndentGuide.background5",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},m("editorIndentGuides5","Color of the editor indentation guides (5).")),PSe=F("editorIndentGuide.background6",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},m("editorIndentGuides6","Color of the editor indentation guides (6).")),wS=F("editorIndentGuide.activeBackground1",{dark:EL,light:EL,hcDark:EL,hcLight:EL},m("editorActiveIndentGuide1","Color of the active editor indentation guides (1).")),OSe=F("editorIndentGuide.activeBackground2",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},m("editorActiveIndentGuide2","Color of the active editor indentation guides (2).")),FSe=F("editorIndentGuide.activeBackground3",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},m("editorActiveIndentGuide3","Color of the active editor indentation guides (3).")),BSe=F("editorIndentGuide.activeBackground4",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},m("editorActiveIndentGuide4","Color of the active editor indentation guides (4).")),WSe=F("editorIndentGuide.activeBackground5",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},m("editorActiveIndentGuide5","Color of the active editor indentation guides (5).")),VSe=F("editorIndentGuide.activeBackground6",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},m("editorActiveIndentGuide6","Color of the active editor indentation guides (6).")),IL=F("editorActiveLineNumber.foreground",{dark:"#c6c6c6",light:"#0B216F",hcDark:$i,hcLight:$i},m("editorActiveLineNumber","Color of editor active line number"),!1,m("deprecatedEditorActiveLineNumber","Id is deprecated. Use 'editorLineNumber.activeForeground' instead."));F("editorLineNumber.activeForeground",{dark:IL,light:IL,hcDark:IL,hcLight:IL},m("editorActiveLineNumber","Color of editor active line number"));const HSe=F("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."));F("editorRuler.foreground",{dark:"#5A5A5A",light:ee.lightgrey,hcDark:ee.white,hcLight:"#292929"},m("editorRuler","Color of the editor rulers."));F("editorCodeLens.foreground",{dark:"#999999",light:"#919191",hcDark:"#999999",hcLight:"#292929"},m("editorCodeLensForeground","Foreground color of editor CodeLens"));F("editorBracketMatch.background",{dark:"#0064001a",light:"#0064001a",hcDark:"#0064001a",hcLight:"#0000"},m("editorBracketMatchBackground","Background color behind matching brackets"));F("editorBracketMatch.border",{dark:"#888",light:"#B9B9B9",hcDark:$t,hcLight:$t},m("editorBracketMatchBorder","Color for matching brackets boxes"));const $Se=F("editorOverviewRuler.border",{dark:"#7f7f7f4d",light:"#7f7f7f4d",hcDark:"#7f7f7f4d",hcLight:"#666666"},m("editorOverviewRulerBorder","Color of the overview ruler border.")),zSe=F("editorOverviewRuler.background",null,m("editorOverviewRulerBackground","Background color of the editor overview ruler."));F("editorGutter.background",{dark:is,light:is,hcDark:is,hcLight:is},m("editorGutter","Background color of the editor gutter. The gutter contains the glyph margins and the line numbers."));F("editorUnnecessaryCode.border",{dark:null,light:null,hcDark:ee.fromHex("#fff").transparent(.8),hcLight:$t},m("unnecessaryCodeBorder","Border color of unnecessary (unused) source code in the editor."));const USe=F("editorUnnecessaryCode.opacity",{dark:ee.fromHex("#000a"),light:ee.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."));F("editorGhostText.border",{dark:null,light:null,hcDark:ee.fromHex("#fff").transparent(.8),hcLight:ee.fromHex("#292929").transparent(.8)},m("editorGhostTextBorder","Border color of ghost text in the editor."));F("editorGhostText.foreground",{dark:ee.fromHex("#ffffff56"),light:ee.fromHex("#0007"),hcDark:null,hcLight:null},m("editorGhostTextForeground","Foreground color of the ghost text in the editor."));F("editorGhostText.background",{dark:null,light:null,hcDark:null,hcLight:null},m("editorGhostTextBackground","Background color of the ghost text in the editor."));const TL=new ee(new jt(0,122,204,.6)),rJ=F("editorOverviewRuler.rangeHighlightForeground",{dark:TL,light:TL,hcDark:TL,hcLight:TL},m("overviewRulerRangeHighlight","Overview ruler marker color for range highlights. The color must not be opaque so as not to hide underlying decorations."),!0),jSe=F("editorOverviewRuler.errorForeground",{dark:new ee(new jt(255,18,18,.7)),light:new ee(new jt(255,18,18,.7)),hcDark:new ee(new jt(255,50,50,1)),hcLight:"#B5200D"},m("overviewRuleError","Overview ruler marker color for errors.")),KSe=F("editorOverviewRuler.warningForeground",{dark:Ur,light:Ur,hcDark:Mw,hcLight:Mw},m("overviewRuleWarning","Overview ruler marker color for warnings.")),qSe=F("editorOverviewRuler.infoForeground",{dark:Xo,light:Xo,hcDark:Rw,hcLight:Rw},m("overviewRuleInfo","Overview ruler marker color for infos.")),aJ=F("editorBracketHighlight.foreground1",{dark:"#FFD700",light:"#0431FAFF",hcDark:"#FFD700",hcLight:"#0431FAFF"},m("editorBracketHighlightForeground1","Foreground color of brackets (1). Requires enabling bracket pair colorization.")),lJ=F("editorBracketHighlight.foreground2",{dark:"#DA70D6",light:"#319331FF",hcDark:"#DA70D6",hcLight:"#319331FF"},m("editorBracketHighlightForeground2","Foreground color of brackets (2). Requires enabling bracket pair colorization.")),cJ=F("editorBracketHighlight.foreground3",{dark:"#179FFF",light:"#7B3814FF",hcDark:"#87CEFA",hcLight:"#7B3814FF"},m("editorBracketHighlightForeground3","Foreground color of brackets (3). Requires enabling bracket pair colorization.")),dJ=F("editorBracketHighlight.foreground4",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},m("editorBracketHighlightForeground4","Foreground color of brackets (4). Requires enabling bracket pair colorization.")),uJ=F("editorBracketHighlight.foreground5",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},m("editorBracketHighlightForeground5","Foreground color of brackets (5). Requires enabling bracket pair colorization.")),hJ=F("editorBracketHighlight.foreground6",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},m("editorBracketHighlightForeground6","Foreground color of brackets (6). Requires enabling bracket pair colorization.")),GSe=F("editorBracketHighlight.unexpectedBracket.foreground",{dark:new ee(new jt(255,18,18,.8)),light:new ee(new jt(255,18,18,.8)),hcDark:new ee(new jt(255,50,50,1)),hcLight:""},m("editorBracketHighlightUnexpectedBracketForeground","Foreground color of unexpected brackets.")),YSe=F("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.")),ZSe=F("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.")),XSe=F("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.")),QSe=F("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.")),JSe=F("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.")),eLe=F("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.")),tLe=F("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.")),iLe=F("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.")),nLe=F("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.")),sLe=F("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.")),oLe=F("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.")),rLe=F("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."));F("editorUnicodeHighlight.border",{dark:"#BD9B03",light:"#CEA33D",hcDark:"#ff0000",hcLight:"#CEA33D"},m("editorUnicodeHighlight.border","Border color used to highlight unicode characters."));F("editorUnicodeHighlight.background",{dark:"#bd9b0326",light:"#cea33d14",hcDark:"#00000000",hcLight:"#cea33d14"},m("editorUnicodeHighlight.background","Background color used to highlight unicode characters."));bl((n,e)=>{const t=n.getColor(is),i=n.getColor(sJ),s=i&&!i.isTransparent()?i:t;s&&e.addRule(".monaco-editor .inputarea.ime-input { background-color: ".concat(s,"; }"))});class yS extends Zm{constructor(e){super(),this._context=e,this._readConfig(),this._lastCursorModelPosition=new Y(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 Y(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=Co?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]='
').concat(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]}}yS.CLASS_NAME="line-numbers";bl((n,e)=>{const t=n.getColor(xSe),i=n.getColor(HSe);i?e.addRule(".monaco-editor .line-numbers.dimmed-line-number { color: ".concat(i,"; }")):t&&e.addRule(".monaco-editor .line-numbers.dimmed-line-number { color: ".concat(t.transparent(.4),"; }"))});class dm extends Er{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=ci(document.createElement("div")),this._domNode.setClassName(dm.OUTER_CLASS_NAME),this._domNode.setPosition("absolute"),this._domNode.setAttribute("role","presentation"),this._domNode.setAttribute("aria-hidden","true"),this._glyphMarginBackgroundDomNode=ci(document.createElement("div")),this._glyphMarginBackgroundDomNode.setClassName(dm.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)}}dm.CLASS_NAME="glyph-margin";dm.OUTER_CLASS_NAME="margin";const Kv="monaco-mouse-cursor-text";class aLe{constructor(){this._onDidChange=new j,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 CC=new aLe,Di=Wt("keybindingService");var lLe=globalThis&&globalThis.__decorate||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},cLe=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};class dLe{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 Y(this.modelLineNumber,this.distanceToModelLineStart+1),i=new Y(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 SM=Ta;let pO=class extends Er{constructor(e,t,i,s){super(e),this._keybindingService=s,this._primaryCursorPosition=new Y(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 Je(1,1,1,1)],this._modelSelections=[new Je(1,1,1,1)],this._lastRenderPosition=null,this.textArea=ci(document.createElement("textarea")),Dd.write(this.textArea,6),this.textArea.setClassName("inputarea ".concat(Kv)),this.textArea.setAttribute("wrap",this._textAreaWrapping&&!this._visibleTextArea?"on":"off");const{tabSize:a}=this._context.viewModel.model.getOptions();this.textArea.domNode.style.tabSize="".concat(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=ci(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,zs),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(hO.forceCopyWithSyntaxHighlighting||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(Kt&&u.isEmpty()){const f=u.getStartPosition();let g=this._getWordBeforePosition(f);if(g.length===0&&(g=this._getCharacterBeforePosition(f)),g.length>0)return new _s(g,g.length,g.length,I.fromPositions(f),0)}const h=500;if(Kt&&!u.isEmpty()&&l.getValueLengthInRange(u,0)0)return new _s(f,g,g,I.fromPositions(h),0)}return _s.EMPTY}return hv.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 SSe(this.textArea.domNode));this._textAreaInput=this._register(new ySe(c,d,$r,{isAndroid:zV,isChrome:N8,isFirefox:Ta,isSafari:qu})),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("\n"),C=v.substring(b+1),w=C.lastIndexOf(" "),y=C.length-w-1,L=f.getStartPosition(),S=Math.min(L.column-1,y),k=L.column-1-S,D=C.substring(0,C.length-S),{tabSize:x}=this._context.viewModel.model.getOptions(),A=uLe(this.textArea.domNode.ownerDocument,D,this._fontInfo,x);return{distanceToModelLineStart:k,widthOfHiddenTextBefore:A}})(),{distanceToModelLineEnd:_}=(()=>{const v=h.value.substring(Math.max(h.selectionStart,h.selectionEnd)),b=v.indexOf("\n"),C=b===-1?v:v.substring(0,b),w=C.indexOf(" "),y=w===-1?C.length:C.length-w-1,L=f.getEndPosition(),S=Math.min(this._context.viewModel.model.getLineMaxColumn(L.lineNumber)-L.column,y);return{distanceToModelLineEnd:this._context.viewModel.model.getLineMaxColumn(L.lineNumber)-L.column-S}})();this._context.viewModel.revealRange("keyboard",!0,I.fromPositions(this._selections[0].getStartPosition()),0,1),this._visibleTextArea=new dLe(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 ".concat(Kv," 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 ".concat(Kv)),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(CC.onDidChange(()=>{this._ensureReadOnlyAttribute()}))}writeScreenReaderContent(e){this._textAreaInput.writeScreenReaderContent(e)}dispose(){super.dispose()}_getAndroidWordAtPosition(e){const t='`~!@#$%^&*()-=+[{]}\\|;:",.<>/?',i=this._context.viewModel.getLineContent(e.lineNumber),s=Aa(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=Aa(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(!es(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===vc.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=SM?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="".concat(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;!CC.enabled||e.get(34)&&e.get(90)?this.textArea.setAttribute("readonly","true"):this.textArea.removeAttribute("readonly")}prepareRender(e){var t;this._primaryCursorPosition=new Y(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:(nn.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(Kt){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:SM?0:1,useCover:!1})}_newlinecount(e){let t=0,i=-1;do{if(i=e.indexOf("\n",i+1),i===-1)break;t++}while(!0);return t}_renderAtTopLeft(){this._doRender({lastRenderPosition:null,top:0,left:0,width:this._textAreaWidth,height:SM?0:1,useCover:!0})}_doRender(e){this._lastRenderPosition=e.lastRenderPosition;const t=this.textArea,i=this.textAreaCover;Vs(t,this._fontInfo),t.setTop(e.top),t.setLeft(e.left),t.setWidth(e.width),t.setHeight(e.height),t.setColor(e.color?ee.Format.CSS.formatHex(e.color):""),t.setFontStyle(e.italic?"italic":""),e.bold&&t.setFontWeight("bold"),t.setTextDecoration("".concat(e.underline?" underline":"").concat(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 "+dm.OUTER_CLASS_NAME):s.get(67).renderType!==0?i.setClassName("monaco-editor-background textAreaCover "+yS.CLASS_NAME):i.setClassName("monaco-editor-background textAreaCover")}};pO=lLe([cLe(3,Di)],pO);function uLe(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");Vs(o,t),o.style.whiteSpace="pre",o.style.tabSize="".concat(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 hLe(n,e,t){let i=0;for(let o=0;o!0,gLe=()=>!1,pLe=n=>n===" "||n===" ";class L_{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=lx(t,i-1),o=this.languageConfigurationService.getLanguageConfiguration(s.languageId).electricCharacter;return o?o.onElectricCharacter(e,s,i-s.firstCharOffset):null}normalizeIndentation(e){return OE(e,this.indentSize,this.insertSpaces)}_getShouldAutoClose(e,t,i){switch(t){case"beforeWhitespace":return pLe;case"languageDefined":return this._getLanguageDefinedShouldAutoClose(e,i);case"always":return fLe;case"never":return gLe}}_getLanguageDefinedShouldAutoClose(e,t){const i=this.languageConfigurationService.getLanguageConfiguration(e).getAutoCloseBeforeSet(t);return s=>i.indexOf(s)!==-1}visibleColumnFromColumn(e,t){return Zn.visibleColumnFromColumn(e.getLineContent(t.lineNumber),t.column,this.tabSize)}columnFromVisibleColumn(e,t,i){const s=Zn.columnFromVisibleColumn(e.getLineContent(t),i,this.tabSize),o=e.getLineMinColumn(t);if(sr?r:s}}let Qt=class fJ{static fromModelState(e){return new mLe(e)}static fromViewState(e){return new _Le(e)}static fromModelSelection(e){const t=Je.liftSelection(e),i=new Cs(I.fromPositions(t.getSelectionStart()),0,0,t.getPosition(),0);return fJ.fromModelState(i)}static fromModelSelections(e){const t=[];for(let i=0,s=e.length;io,c=s>r,d=sr||vs||_0&&s--,vp.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 Y(l,c));s=Math.max(s,d)}let a=i.toViewVisualColumn;return ae.getLineMinColumn(t.lineNumber))return t.delta(void 0,-DX(e.getLineContent(t.lineNumber),t.column-1));if(t.lineNumber>1){const i=t.lineNumber-1;return new Y(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=Ow.atomicPosition(o,t.column-1,i,0);if(r!==-1&&r+1>=s)return new Y(t.lineNumber,r+1)}return this.leftPosition(e,t)}static left(e,t,i){const s=e.stickyTabStops?di.leftPositionAtomicSoftTabs(t,i,e.tabSize):di.leftPosition(t,i);return new LM(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(di.clipPositionColumn(l,t),0),d=di.left(e,t,c);r=d.lineNumber,a=d.column}return i.move(s,r,a,0)}static clipPositionColumn(e,t){return new Y(e.lineNumber,di.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-Zn.visibleColumnFromColumn(t.getLineContent(i),s,e.tabSize),l!==void 0){const g=new Y(i,s),p=t.normalizePosition(g,l);o=o+(s-p.column),i=p.lineNumber,s=p.column}return new LM(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=di.down(e,t,r+l,a,i.leftoverVisibleColumns,o,!0),t.normalizePosition(new Y(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(xh(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,C=a.length;b1){const o=t.getLineContent(s.lineNumber),r=bo(o),a=r===-1?o.length+1:r+1;if(s.column<=a){const l=i.visibleColumnFromColumn(t,s),c=Zn.prevIndentTabStop(l,i.indentSize),d=i.columnFromVisibleColumn(t,s.lineNumber,c);return new I(s.lineNumber,d,s.lineNumber,s.column)}}return I.fromPositions(um.getPositionAfterDeleteLeft(s,t),s)}static getPositionAfterDeleteLeft(e,t){if(e.column>1){const i=Mve(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 Y(i,t.getLineMaxColumn(i))}else return e}static cut(e,t,i){const s=[];let o=null;i.sort((r,a)=>Y.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 I(d,u,h,f);o=g,g.isEmpty()?s[r]=null:s[r]=new Rs(g,"")}else s[r]=null;else s[r]=new Rs(l,"")}return new Uo(0,s,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!0})}}class oi{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=oi._findPreviousWordOnLine(e,t,new Y(o,r));if(s===0)return new Y(o,a?a.start+1:1);if(s===1)return a&&a.wordType===2&&a.end-a.start===1&&a.nextCharClass===0&&(a=oi._findPreviousWordOnLine(e,t,new Y(o,a.start+1))),new Y(o,a?a.start+1:1);if(s===3){for(;a&&a.wordType===2;)a=oi._findPreviousWordOnLine(e,t,new Y(o,a.start+1));return new Y(o,a?a.start+1:1)}return a&&r<=a.end+1&&(a=oi._findPreviousWordOnLine(e,t,new Y(o,a.start+1))),new Y(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 Y(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 Y(i,r);if(a===45&&l!==45)return new Y(i,r);if((Xh(a)||_L(a))&&Vc(l))return new Y(i,r);if(Vc(a)&&Vc(l)&&r+1=l.start+1&&(l=oi._findNextWordOnLine(e,t,new Y(o,l.end+1))),l?r=l.start+1:r=t.getLineMaxColumn(o);return new Y(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=oi._findPreviousWordOnLine(i,s,new Y(l,d.start+1))),d?c=d.end+1:c>1?c=1:(l--,c=s.getLineMaxColumn(l))),new I(l,c,a.lineNumber,a.column)}static deleteInsideWord(e,t,i){if(!i.isEmpty())return i;const s=new Y(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 I(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 I(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=oi._findPreviousWordOnLine(e,t,i);if(c&&r(c))return l(c);const d=oi._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=oi._moveWordPartLeft(e,i);return new I(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=oi._findNextWordOnLine(i,s,new Y(l,h.end+1))),h?c=h.start+1:c!!e)}class ms{static addCursorDown(e,t,i){const s=[];let o=0;for(let r=0,a=t.length;rc&&(d=c,u=e.model.getLineMaxColumn(d)),Qt.fromModelState(new Cs(new I(r.lineNumber,1,d,u),2,0,new Y(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)),Qt.fromViewState(t.viewState.move(!0,d,u,0))}else{const c=t.modelState.selectionStart.getEndPosition();return Qt.fromModelState(t.modelState.move(!0,c.lineNumber,c.column,0))}}static word(e,t,i,s){const o=e.model.validatePosition(s);return Qt.fromModelState(oi.word(e.cursorConfig,e.model,t.modelState,i,o))}static cancelSelection(e,t){if(!t.modelState.hasSelection())return new Qt(t.modelState,t.viewState);const i=t.viewState.position.lineNumber,s=t.viewState.position.column;return Qt.fromViewState(new Cs(new I(i,s,i,s),0,0,new Y(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 Y(o.lineNumber,o.column),r):e.coordinatesConverter.convertModelPositionToViewPosition(r);return Qt.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=>Qt.fromViewState(di.moveToPrevBlankLine(e.cursorConfig,e,a.viewState,s))):t.map(a=>Qt.fromModelState(di.moveToPrevBlankLine(e.cursorConfig,e.model,a.modelState,s)));case 5:return r===2?t.map(a=>Qt.fromViewState(di.moveToNextBlankLine(e.cursorConfig,e,a.viewState,s))):t.map(a=>Qt.fromModelState(di.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:oQt.fromViewState(di.moveLeft(e.cursorConfig,e,o.viewState,i,s)))}static _moveHalfLineLeft(e,t,i){const s=[];for(let o=0,r=t.length;oQt.fromViewState(di.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=Vv(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===Pn.Indent&&(h=" "+h):u===Pn.Indent||u===Pn.IndentOutdent?h=" ":h="";let g=wQ(e,t.startLineNumber,t.startColumn);return f&&(g=g.substring(0,g.length-f)),{indentAction:u,appendText:h,removeText:f,indentation:g}}var bLe=globalThis&&globalThis.__decorate||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},CLe=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},mD;const kM=Object.create(null);function Kg(n,e){if(e<=0)return"";kM[n]||(kM[n]=["",n]);const t=kM[n];for(let i=t.length;i<=e;i++)t[i]=t[i-1]+n;return t[e]}let va=mD=class{static unshiftIndent(e,t,i,s,o){const r=Zn.visibleColumnFromColumn(e,t,i);if(o){const a=Kg(" ",s),c=Zn.prevIndentTabStop(r,s)/s;return Kg(a,c)}else{const a=" ",c=Zn.prevRenderTabStop(r,i)/i;return Kg(a,c)}}static shiftIndent(e,t,i,s,o){const r=Zn.visibleColumnFromColumn(e,t,i);if(o){const a=Kg(" ",s),c=Zn.nextIndentTabStop(r,s)/s;return Kg(a,c)}else{const a=" ",c=Zn.nextRenderTabStop(r,i)/i;return Kg(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=bo(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&&Zn.visibleColumnFromColumn(h,f+1,o)%r!==0&&e.tokenization.isCheapToTokenize(u-1)){const _=qv(this._opts.autoIndent,e,new I(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 Sx(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=SLe(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:ki(a),action:Pn.Indent,line:r};if(o.shouldDecrease(a))return{indentation:ki(a),action:null,line:r};{if(r===1)return{indentation:ki(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:ki(e.getLineContent(d+1)),action:null,line:d+1}}if(i)return{indentation:ki(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:ki(u),action:Pn.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:ki(e.getLineContent(h+1)),action:null,line:h+1}}else if(o.shouldDecrease(u))return{indentation:ki(u),action:null,line:d}}return{indentation:ki(e.getLineContent(1)),action:null,line:1}}}function wC(n,e,t,i,s,o){if(n<4)return null;const r=o.getLanguageConfiguration(t);if(!r)return null;const a=o.getLanguageConfiguration(t).indentRulesSupport;if(!a)return null;const l=Sx(n,e,i,void 0,o),c=e.getLineContent(i);if(l){const d=l.line;if(d!==void 0){let u=!0;for(let h=d;h0&&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=Vv(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=ki(c),g={tokenization:{getLineTokens:b=>e.tokenization.getLineTokens(b),getLanguageId:()=>e.getLanguageId(),getLanguageIdAtPosition:(b,C)=>e.getLanguageIdAtPosition(b,C)},getLineContent:b=>b===t.startLineNumber?h:e.getLineContent(b)},p=ki(o.getLineContent()),_=Sx(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===Pn.Indent&&(v=i.shiftIndent(v)),u.shouldDecrease(d)&&(v=i.unshiftIndent(v)),{beforeEnter:l?p:f,afterEnter:v}}function kLe(n,e,t,i,s,o){if(n<4)return null;const r=Vv(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=Vv(e,t.endLineNumber,t.endColumn).getLineContent().substr(t.endColumn-1-r.firstCharOffset),!a.shouldDecrease(c+d)&&a.shouldDecrease(c+i+d)){const u=Sx(n,e,t.startLineNumber,!1,o);if(!u)return null;let h=u.indentation;return u.action!==Pn.Indent&&(h=s.unshiftIndent(h)),h}return null}function gJ(n,e,t){const i=t.getLanguageConfiguration(n.getLanguageId()).indentRulesSupport;return!i||e<1||e>n.getLineCount()?null:i.getIndentMetadata(n.getLineContent(e))}class Qi{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(oc(d)>=0)break}if(a<1)return null;const l=t.getLineMaxColumn(a),c=qv(e.autoIndent,t,new I(a,l,a,l),e.languageConfigurationService);c&&(o=c.indentation+c.appendText)}return s&&(s===Pn.Indent&&(o=Qi.shiftIndent(e,o)),s===Pn.Outdent&&(o=Qi.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 Uo(4,c,{shouldPushStackElementBefore:AL(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 I(a.lineNumber,l,a.lineNumber,c);return e.getValueInRange(d)===i&&r===0?null:new pD(d,i,0,r)}static _typeCommand(e,t,i){return i?new xL(e,t,!0):new Rs(e,t,!0)}static _enter(e,t,i,s){if(e.autoIndent===0)return Qi._typeCommand(s,"\n",i);if(!t.tokenization.isCheapToTokenize(s.getStartPosition().lineNumber)||e.autoIndent===1){const l=t.getLineContent(s.startLineNumber),c=ki(l).substring(0,s.startColumn-1);return Qi._typeCommand(s,"\n"+e.normalizeIndentation(c),i)}const o=qv(e.autoIndent,t,s,e.languageConfigurationService);if(o){if(o.indentAction===Pn.None)return Qi._typeCommand(s,"\n"+e.normalizeIndentation(o.indentation+o.appendText),i);if(o.indentAction===Pn.Indent)return Qi._typeCommand(s,"\n"+e.normalizeIndentation(o.indentation+o.appendText),i);if(o.indentAction===Pn.IndentOutdent){const l=e.normalizeIndentation(o.indentation),c=e.normalizeIndentation(o.indentation+o.appendText),d="\n"+c+"\n"+l;return i?new xL(s,d,!0):new pD(s,d,-1,c.length-l.length,!0)}else if(o.indentAction===Pn.Outdent){const l=Qi.unshiftIndent(e,o.indentation);return Qi._typeCommand(s,"\n"+e.normalizeIndentation(l+o.appendText),i)}}const r=t.getLineContent(s.startLineNumber),a=ki(r).substring(0,s.startColumn-1);if(e.autoIndent>=4){const l=LLe(e.autoIndent,t,s,{unshiftIndent:c=>Qi.unshiftIndent(e,c),shiftIndent:c=>Qi.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=bo(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 xL(s,"\n"+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 pD(s,"\n"+e.normalizeIndentation(l.afterEnter),0,f,!0)}}}return Qi._typeCommand(s,"\n"+e.normalizeIndentation(a),i)}static _isAutoIndentType(e,t,i){if(e.autoIndent<4)return!1;for(let s=0,o=i.length;sQi.shiftIndent(e,a),unshiftIndent:a=>Qi.unshiftIndent(e,a)},e.languageConfigurationService);if(r===null)return null;if(r!==e.normalizeIndentation(o)){const a=t.getLineFirstNonWhitespaceColumn(i.startLineNumber);return a===0?Qi._typeCommand(new I(i.startLineNumber,1,i.endLineNumber,i.endColumn),e.normalizeIndentation(r)+s,!1):Qi._typeCommand(new I(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 I(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 Y(g.lineNumber,g.beforeColumn)),s);if(!a)return null;let l,c;if(xh(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),C=b.substring(0,_-1),w=b.substring(v-1);if(w.startsWith(h)||(f=!1),w.length>0){const k=w.charAt(0);if(!Qi._isBeforeClosingBrace(e,w)&&!c(k))return null}if(a.open.length===1&&(s==="'"||s==='"')&&l!=="always"){const k=Aa(e.wordSeparators);if(C.length>0){const D=C.charCodeAt(C.length-1);if(k.get(D)===0)return null}}if(!t.tokenization.isCheapToTokenize(p))return null;t.tokenization.forceTokenization(p);const y=t.tokenization.getLineTokens(p),L=lx(y,_-1);if(!a.shouldAutoClose(L,_-L.firstCharOffset))return null;const S=a.findNeutralCharacter();if(S){const k=t.tokenization.getTokenTypeIfInsertingCharacter(p,_,S);if(!a.isOK(k))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 Rs(new I(h.positionLineNumber,h.positionColumn,h.positionLineNumber,h.positionColumn+1),"",!1));return new Uo(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==="\n"){const d=[];for(let u=0,h=o.length;u{const s=t.get(ai).getFocusedCodeEditor();return s&&s.hasTextFocus()?this._runEditorCommand(t,s,i):!1}),e.addImplementation(1e3,"generic-dom-input-textarea",(t,i)=>{const s=al();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(ai).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 rs;(function(n){class e extends cn{constructor(b){super(b),this._inSelectionMode=b.inSelectionMode}runCoreEditorCommand(b,C){if(!C.position)return;b.model.pushStackElement(),b.setCursorStates(C.source,3,[ms.moveTo(b,b.getPrimaryCursorState(),this._inSelectionMode,C.position,C.viewPosition)])&&C.revealType!==2&&b.revealPrimaryCursor(C.source,!0,!0)}}n.MoveTo=Re(new e({id:"_moveTo",inSelectionMode:!1,precondition:void 0})),n.MoveToSelect=Re(new e({id:"_moveToSelect",inSelectionMode:!0,precondition:void 0}));class t extends cn{runCoreEditorCommand(b,C){b.model.pushStackElement();const w=this._getColumnSelectResult(b,b.getPrimaryCursorState(),b.getCursorColumnSelectData(),C);w!==null&&(b.setCursorStates(C.source,3,w.viewStates.map(y=>Qt.fromViewState(y))),b.setCursorColumnSelectData({isReal:!0,fromViewLineNumber:w.fromLineNumber,fromViewVisualColumn:w.fromVisualColumn,toViewLineNumber:w.toLineNumber,toViewVisualColumn:w.toVisualColumn}),w.reversed?b.revealTopMostCursor(C.source):b.revealBottomMostCursor(C.source))}}n.ColumnSelect=Re(new class extends t{constructor(){super({id:"columnSelect",precondition:void 0})}_getColumnSelectResult(v,b,C,w){if(typeof w.position>"u"||typeof w.viewPosition>"u"||typeof w.mouseColumn>"u")return null;const y=v.model.validatePosition(w.position),L=v.coordinatesConverter.validateViewPosition(new Y(w.viewPosition.lineNumber,w.viewPosition.column),y),S=w.doColumnSelect?C.fromViewLineNumber:L.lineNumber,k=w.doColumnSelect?C.fromViewVisualColumn:w.mouseColumn-1;return vp.columnSelect(v.cursorConfig,v,S,k,L.lineNumber,w.mouseColumn-1)}}),n.CursorColumnSelectLeft=Re(new class extends t{constructor(){super({id:"cursorColumnSelectLeft",precondition:void 0,kbOpts:{weight:ni,kbExpr:O.textInputFocus,primary:3599,linux:{primary:0}}})}_getColumnSelectResult(v,b,C,w){return vp.columnSelectLeft(v.cursorConfig,v,C)}}),n.CursorColumnSelectRight=Re(new class extends t{constructor(){super({id:"cursorColumnSelectRight",precondition:void 0,kbOpts:{weight:ni,kbExpr:O.textInputFocus,primary:3601,linux:{primary:0}}})}_getColumnSelectResult(v,b,C,w){return vp.columnSelectRight(v.cursorConfig,v,C)}});class i extends t{constructor(b){super(b),this._isPaged=b.isPaged}_getColumnSelectResult(b,C,w,y){return vp.columnSelectUp(b.cursorConfig,b,w,this._isPaged)}}n.CursorColumnSelectUp=Re(new i({isPaged:!1,id:"cursorColumnSelectUp",precondition:void 0,kbOpts:{weight:ni,kbExpr:O.textInputFocus,primary:3600,linux:{primary:0}}})),n.CursorColumnSelectPageUp=Re(new i({isPaged:!0,id:"cursorColumnSelectPageUp",precondition:void 0,kbOpts:{weight:ni,kbExpr:O.textInputFocus,primary:3595,linux:{primary:0}}}));class s extends t{constructor(b){super(b),this._isPaged=b.isPaged}_getColumnSelectResult(b,C,w,y){return vp.columnSelectDown(b.cursorConfig,b,w,this._isPaged)}}n.CursorColumnSelectDown=Re(new s({isPaged:!1,id:"cursorColumnSelectDown",precondition:void 0,kbOpts:{weight:ni,kbExpr:O.textInputFocus,primary:3602,linux:{primary:0}}})),n.CursorColumnSelectPageDown=Re(new s({isPaged:!0,id:"cursorColumnSelectPageDown",precondition:void 0,kbOpts:{weight:ni,kbExpr:O.textInputFocus,primary:3596,linux:{primary:0}}}));class o extends cn{constructor(){super({id:"cursorMove",precondition:void 0,description:FE.description})}runCoreEditorCommand(b,C){const w=FE.parse(C);w&&this._runCursorMove(b,C.source,w)}_runCursorMove(b,C,w){b.model.pushStackElement(),b.setCursorStates(C,3,o._move(b,b.getCursorStates(),w)),b.revealPrimaryCursor(C,!0)}static _move(b,C,w){const y=w.select,L=w.value;switch(w.direction){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:case 10:return ms.simpleMove(b,C,w.direction,y,L,w.unit);case 11:case 13:case 12:case 14:return ms.viewportMove(b,C,w.direction,y,L);default:return null}}}n.CursorMoveImpl=o,n.CursorMove=Re(new o);class r extends cn{constructor(b){super(b),this._staticArgs=b.args}runCoreEditorCommand(b,C){let w=this._staticArgs;this._staticArgs.value===-1&&(w={direction:this._staticArgs.direction,unit:this._staticArgs.unit,select:this._staticArgs.select,value:C.pageSize||b.cursorConfig.pageSize}),b.model.pushStackElement(),b.setCursorStates(C.source,3,ms.simpleMove(b,b.getCursorStates(),w.direction,w.select,w.value,w.unit)),b.revealPrimaryCursor(C.source,!0)}}n.CursorLeft=Re(new r({args:{direction:0,unit:0,select:!1,value:1},id:"cursorLeft",precondition:void 0,kbOpts:{weight:ni,kbExpr:O.textInputFocus,primary:15,mac:{primary:15,secondary:[288]}}})),n.CursorLeftSelect=Re(new r({args:{direction:0,unit:0,select:!0,value:1},id:"cursorLeftSelect",precondition:void 0,kbOpts:{weight:ni,kbExpr:O.textInputFocus,primary:1039}})),n.CursorRight=Re(new r({args:{direction:1,unit:0,select:!1,value:1},id:"cursorRight",precondition:void 0,kbOpts:{weight:ni,kbExpr:O.textInputFocus,primary:17,mac:{primary:17,secondary:[292]}}})),n.CursorRightSelect=Re(new r({args:{direction:1,unit:0,select:!0,value:1},id:"cursorRightSelect",precondition:void 0,kbOpts:{weight:ni,kbExpr:O.textInputFocus,primary:1041}})),n.CursorUp=Re(new r({args:{direction:2,unit:2,select:!1,value:1},id:"cursorUp",precondition:void 0,kbOpts:{weight:ni,kbExpr:O.textInputFocus,primary:16,mac:{primary:16,secondary:[302]}}})),n.CursorUpSelect=Re(new r({args:{direction:2,unit:2,select:!0,value:1},id:"cursorUpSelect",precondition:void 0,kbOpts:{weight:ni,kbExpr:O.textInputFocus,primary:1040,secondary:[3088],mac:{primary:1040},linux:{primary:1040}}})),n.CursorPageUp=Re(new r({args:{direction:2,unit:2,select:!1,value:-1},id:"cursorPageUp",precondition:void 0,kbOpts:{weight:ni,kbExpr:O.textInputFocus,primary:11}})),n.CursorPageUpSelect=Re(new r({args:{direction:2,unit:2,select:!0,value:-1},id:"cursorPageUpSelect",precondition:void 0,kbOpts:{weight:ni,kbExpr:O.textInputFocus,primary:1035}})),n.CursorDown=Re(new r({args:{direction:3,unit:2,select:!1,value:1},id:"cursorDown",precondition:void 0,kbOpts:{weight:ni,kbExpr:O.textInputFocus,primary:18,mac:{primary:18,secondary:[300]}}})),n.CursorDownSelect=Re(new r({args:{direction:3,unit:2,select:!0,value:1},id:"cursorDownSelect",precondition:void 0,kbOpts:{weight:ni,kbExpr:O.textInputFocus,primary:1042,secondary:[3090],mac:{primary:1042},linux:{primary:1042}}})),n.CursorPageDown=Re(new r({args:{direction:3,unit:2,select:!1,value:-1},id:"cursorPageDown",precondition:void 0,kbOpts:{weight:ni,kbExpr:O.textInputFocus,primary:12}})),n.CursorPageDownSelect=Re(new r({args:{direction:3,unit:2,select:!0,value:-1},id:"cursorPageDownSelect",precondition:void 0,kbOpts:{weight:ni,kbExpr:O.textInputFocus,primary:1036}})),n.CreateCursor=Re(new class extends cn{constructor(){super({id:"createCursor",precondition:void 0})}runCoreEditorCommand(v,b){if(!b.position)return;let C;b.wholeLine?C=ms.line(v,v.getPrimaryCursorState(),!1,b.position,b.viewPosition):C=ms.moveTo(v,v.getPrimaryCursorState(),!1,b.position,b.viewPosition);const w=v.getCursorStates();if(w.length>1){const y=C.modelState?C.modelState.position:null,L=C.viewState?C.viewState.position:null;for(let S=0,k=w.length;SL&&(y=L);const S=new I(y,1,y,v.model.getLineMaxColumn(y));let k=0;if(C.at)switch(C.at){case fv.RawAtArgument.Top:k=3;break;case fv.RawAtArgument.Center:k=1;break;case fv.RawAtArgument.Bottom:k=4;break}const D=v.coordinatesConverter.convertModelRangeToViewRange(S);v.revealRange(b.source,!1,D,k,0)}}),n.SelectAll=new class extends mO{constructor(){super(f0e)}runDOMCommand(v){Ta&&(v.focus(),v.select()),v.ownerDocument.execCommand("selectAll")}runEditorCommand(v,b,C){const w=b._getViewModel();w&&this.runCoreEditorCommand(w,C)}runCoreEditorCommand(v,b){v.model.pushStackElement(),v.setCursorStates("keyboard",3,[ms.selectAll(v,v.getPrimaryCursorState())])}},n.SetSelection=Re(new class extends cn{constructor(){super({id:"setSelection",precondition:void 0})}runCoreEditorCommand(v,b){b.selection&&(v.model.pushStackElement(),v.setCursorStates(b.source,3,[Qt.fromModelSelection(b.selection)]))}})})(rs||(rs={}));const ELe=fe.and(O.textInputFocus,O.columnSelection);function T0(n,e){er.registerKeybindingRule({id:n,primary:e,when:ELe,weight:ni+1})}T0(rs.CursorColumnSelectLeft.id,1039);T0(rs.CursorColumnSelectRight.id,1041);T0(rs.CursorColumnSelectUp.id,1040);T0(rs.CursorColumnSelectPageUp.id,1035);T0(rs.CursorColumnSelectDown.id,1042);T0(rs.CursorColumnSelectPageDown.id,1036);function _$(n){return n.register(),n}var Gv;(function(n){class e extends fs{runEditorCommand(i,s,o){const r=s._getViewModel();r&&this.runCoreEditingCommand(s,r,o||{})}}n.CoreEditingCommand=e,n.LineBreakInsert=Re(new class extends e{constructor(){super({id:"lineBreakInsert",precondition:O.writable,kbOpts:{weight:ni,kbExpr:O.textInputFocus,primary:0,mac:{primary:301}}})}runCoreEditingCommand(t,i,s){t.pushUndoStop(),t.executeCommands(this.id,Qi.lineBreakInsert(i.cursorConfig,i.model,i.getCursorStates().map(o=>o.modelState.selection)))}}),n.Outdent=Re(new class extends e{constructor(){super({id:"outdent",precondition:O.writable,kbOpts:{weight:ni,kbExpr:fe.and(O.editorTextFocus,O.tabDoesNotMoveFocus),primary:1026}})}runCoreEditingCommand(t,i,s){t.pushUndoStop(),t.executeCommands(this.id,Qi.outdent(i.cursorConfig,i.model,i.getCursorStates().map(o=>o.modelState.selection))),t.pushUndoStop()}}),n.Tab=Re(new class extends e{constructor(){super({id:"tab",precondition:O.writable,kbOpts:{weight:ni,kbExpr:fe.and(O.editorTextFocus,O.tabDoesNotMoveFocus),primary:2}})}runCoreEditingCommand(t,i,s){t.pushUndoStop(),t.executeCommands(this.id,Qi.tab(i.cursorConfig,i.model,i.getCursorStates().map(o=>o.modelState.selection))),t.pushUndoStop()}}),n.DeleteLeft=Re(new class extends e{constructor(){super({id:"deleteLeft",precondition:void 0,kbOpts:{weight:ni,kbExpr:O.textInputFocus,primary:1,secondary:[1025],mac:{primary:1,secondary:[1025,294,257]}}})}runCoreEditingCommand(t,i,s){const[o,r]=um.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=Re(new class extends e{constructor(){super({id:"deleteRight",precondition:void 0,kbOpts:{weight:ni,kbExpr:O.textInputFocus,primary:20,mac:{primary:20,secondary:[290,276]}}})}runCoreEditingCommand(t,i,s){const[o,r]=um.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 mO{constructor(){super(oQ)}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 mO{constructor(){super(rQ)}runDOMCommand(t){t.ownerDocument.execCommand("redo")}runEditorCommand(t,i,s){if(!(!i.hasModel()||i.getOption(90)===!0))return i.getModel().redo()}}})(Gv||(Gv={}));class v$ extends sx{constructor(e,t,i){super({id:e,precondition:void 0,description:i}),this._handlerId=t}runCommand(e,t){const i=e.get(ai).getFocusedCodeEditor();i&&i.trigger("keyboard",this._handlerId,t)}}function Xm(n,e){_$(new v$("default:"+n,n)),_$(new v$(n,n,e))}Xm("type",{description:"Type",args:[{name:"args",schema:{type:"object",required:["text"],properties:{text:{type:"string"}}}}]});Xm("replacePreviousChar");Xm("compositionType");Xm("compositionStart");Xm("compositionEnd");Xm("paste");Xm("cut");class ILe{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){rs.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){rs.MoveTo.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_moveToSelect(e,t){rs.MoveToSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_columnSelect(e,t,i){e=this._validateViewColumn(e),rs.ColumnSelect.runCoreEditorCommand(this.viewModel,{source:"mouse",position:this._convertViewToModelPosition(e),viewPosition:e,mouseColumn:t,doColumnSelect:i})}_createCursor(e,t){e=this._validateViewColumn(e),rs.CreateCursor.runCoreEditorCommand(this.viewModel,{source:"mouse",position:this._convertViewToModelPosition(e),viewPosition:e,wholeLine:t})}_lastCursorMoveToSelect(e,t){rs.LastCursorMoveToSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_wordSelect(e,t){rs.WordSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_wordSelectDrag(e,t){rs.WordSelectDrag.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lastCursorWordSelect(e,t){rs.LastCursorWordSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lineSelect(e,t){rs.LineSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lineSelectDrag(e,t){rs.LineSelectDrag.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lastCursorLineSelect(e,t){rs.LastCursorLineSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lastCursorLineSelectDrag(e,t){rs.LastCursorLineSelectDrag.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_selectAll(){rs.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 Lx{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 Lx.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 Y(e.afterLineNumber,1)).lineNumber}}}class mJ{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 Rn("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 _J{constructor(e){this._host=e,this.domNode=this._createDomNode(),this._linesCollection=new mJ(()=>this._host.createVisibleLine())}_createDomNode(){const e=ci(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");vu._ttPolicy&&(t=vu._ttPolicy.createHTML(t)),s.innerHTML=t;for(let o=0;on});vu._sb=new D0(1e5);class vJ extends Er{constructor(e){super(e),this._visibleLines=new _J(this),this.domNode=this._visibleLines.domNode;const i=this._context.configuration.options.get(50);Vs(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 xLe 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 NLe 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),Vs(this.domNode,t.get(50))}onConfigurationChanged(e){const t=this._context.configuration.options;Vs(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 ALe extends Er{constructor(e,t){super(e),this._viewDomNode=t,this._widgets={},this.domNode=ci(document.createElement("div")),Dd.write(this.domNode,1),this.domNode.setClassName("contentWidgets"),this.domNode.setPosition("absolute"),this.domNode.setTop(0),this.overflowingContentWidgetsDomNode=ci(document.createElement("div")),Dd.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 MLe(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 MLe{constructor(e,t,i){this._primaryAnchor=new c1(null,null),this._secondaryAnchor=new c1(null,null),this._context=e,this._viewDomNode=t,this._actual=i,this.domNode=ci(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 c1(null,null);const l=r.model.validatePosition(o);if(r.coordinatesConverter.modelPositionIsVisible(l)){const c=r.coordinatesConverter.convertModelPositionToViewPosition(l,a!=null?a:void 0);return new c1(o,c)}return new c1(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,w=f+i<=g.height-b;return this._fixedOverflowWidgets?{fitsAbove:C,aboveTop:Math.max(h,v),fitsBelow:w,belowTop:f,left:_}:{fitsAbove:C,aboveTop:a,fitsBelow:w,belowTop:l,left:p}}_prepareRenderWidgetAtExactPositionOverflowing(e){return new d1(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 b$(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"&&EM(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"&&EM(this._actual.afterRender,this._actual,this._renderData.position)}}class c1{constructor(e,t){this.modelPosition=e,this.viewPosition=t}}class d1{constructor(e,t){this.top=e,this.left=t,this._coordinateBrand=void 0}}class b${constructor(e,t,i){this.top=e,this.left=t,this.height=i,this._anchorCoordinateBrand=void 0}}function EM(n,e,...t){try{return n.call(e,...t)}catch{return null}}class bJ extends Zm{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 Je(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),yn(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 RLe extends bJ{_renderOne(e){const t="current-line"+(this._shouldRenderOther()?" current-line-both":"");return'
')}_shouldRenderThis(){return this._shouldRenderInContent()}_shouldRenderOther(){return this._shouldRenderInMargin()}}class PLe extends bJ{_renderOne(e){const t="current-line"+(this._shouldRenderInMargin()?" current-line-margin":"")+(this._shouldRenderOther()?" current-line-margin-both":"");return'
')}_shouldRenderThis(){return!0}_shouldRenderOther(){return this._shouldRenderInContent()}}bl((n,e)=>{const t=n.getColor(sJ);if(t&&(e.addRule(".monaco-editor .view-overlays .current-line { background-color: ".concat(t,"; }")),e.addRule(".monaco-editor .margin-view-overlays .current-line-margin { background-color: ".concat(t,"; border: none; }"))),!t||t.isTransparent()||n.defines(g$)){const i=n.getColor(g$);i&&(e.addRule(".monaco-editor .view-overlays .current-line { border: 2px solid ".concat(i,"; }")),e.addRule(".monaco-editor .margin-view-overlays .current-line-margin { border: 2px solid ".concat(i,"; }")),ac(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 OLe extends Zm{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:I.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 FLe extends Er{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 "+gO(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 c9(t.domNode,d,this._context.viewLayout.getScrollable())),Dd.write(this.scrollbar.getDomNode(),5),this.scrollbarDomNode=ci(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(ce(i.domNode,"scroll",h=>u(i.domNode,!0,!0))),this._register(ce(t.domNode,"scroll",h=>u(t.domNode,!0,!1))),this._register(ce(s.domNode,"scroll",h=>u(s.domNode,!0,!1))),this._register(ce(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 "+gO(this._context.theme.type)),!0}prepareRender(e){}render(e){this.scrollbar.renderNow()}}class CJ extends te{constructor(){super(...arguments),this._isDisposed=!1}dispose(){super.dispose(),this._isDisposed=!0}assertNotDisposed(){if(this._isDisposed)throw new Error("TextModelPart is disposed!")}}function kx(n,e){let t=0,i=0;const s=n.length;for(;is)throw new Rn("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=S=>{if(a!==-1&&(a===-2||a>S-1)){a=-1,l=-1;for(let k=S-2;k>=0;k--){const D=this._computeIndentLevel(k);if(D>=0){a=k,l=D;break}}}if(c===-2){c=-1,d=-1;for(let k=S;k=0){c=k,d=D;break}}}};let h=-2,f=-1,g=-2,p=-1;const _=S=>{if(h===-2){h=-1,f=-1;for(let k=S-2;k>=0;k--){const D=this._computeIndentLevel(k);if(D>=0){h=k,f=D;break}}}if(g!==-1&&(g===-2||g=0){g=k,p=D;break}}}};let v=0,b=!0,C=0,w=!0,y=0,L=0;for(let S=0;b||w;S++){const k=e-S,D=e+S;S>1&&(k<1||k1&&(D>s||D>i)&&(w=!1),S>5e4&&(b=!1,w=!1);let x=-1;if(b&&k>=1){const T=this._computeIndentLevel(k-1);T>=0?(c=k-1,d=T,x=Math.ceil(T/this.textModel.getOptions().indentSize)):(u(k),x=this._getIndentLevelForWhitespaceLine(r,l,d))}let A=-1;if(w&&D<=s){const T=this._computeIndentLevel(D-1);T>=0?(h=D-1,f=T,A=Math.ceil(T/this.textModel.getOptions().indentSize)):(_(D),A=this._getIndentLevelForWhitespaceLine(r,f,p))}if(S===0){L=x;continue}if(S===1){if(D<=s&&A>=0&&L+1===A){b=!1,v=D,C=D,y=A;continue}if(k>=1&&x>=0&&x-1===L){w=!1,v=k,C=k,y=x;continue}if(v=e,C=e,y=L,y===0)return{startLineNumber:v,endLineNumber:C,indent:y}}b&&(x>=y?v=k:b=!1),w&&(A>=y?C=D:w=!1)}return{startLineNumber:v,endLineNumber:C,indent:y}}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 I(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(I.fromPositions(i)).toArray()).filter(f=>I.strictContainsPosition(f.range,i));c=(o=DE(h,f=>a))===null||o===void 0?void 0:o.range}const d=this.textModel.getOptions().bracketPairColorizationOptions.independentColorPoolPerBracketType,u=new wJ;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===jp.Enabled||s.horizontalGuides===jp.EnabledForActive&&f;if(h.range.startLineNumber===h.range.endLineNumber){v&&r[h.range.startLineNumber-e].push(new Ap(-1,h.openingBracketRange.getEndPosition().column,g,new yC(!1,_.column),-1,-1));continue}const b=this.getVisibleColumnFromPosition(_),C=this.getVisibleColumnFromPosition(h.openingBracketRange.getStartPosition()),w=Math.min(C,b,h.minVisibleColumnIndentation+1);let y=!1;bo(this.textModel.getLineContent(h.closingBracketRange.startLineNumber))=e&&C>w&&r[p.lineNumber-e].push(new Ap(w,-1,g,new yC(!1,p.column),-1,-1)),_.lineNumber<=t&&b>w&&r[_.lineNumber-e].push(new Ap(w,-1,g,new yC(!y,_.column),-1,-1)))}for(const h of r)h.sort((f,g)=>f.visibleColumn-g.visibleColumn);return r}getVisibleColumnFromPosition(e){return Zn.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&&C>this._maxIndentLeft)break;const w=b.horizontalLine?b.horizontalLine.top?"horizontal-top":"horizontal-bottom":"vertical",y=b.horizontalLine?((o=(s=e.visibleRangeForPosition(new Y(f,b.horizontalLine.endColumn)))===null||s===void 0?void 0:s.left)!==null&&o!==void 0?o:C+this._spaceWidth)-C: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?jp.Enabled:this._bracketPairGuideOptions.bracketPairsHorizontal==="active"?jp.EnabledForActive:jp.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 Ku(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(w=>w.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 k_(n){if(!(n&&n.isTransparent()))return n}bl((n,e)=>{const t=[{bracketColor:aJ,guideColor:YSe,guideColorActive:tLe},{bracketColor:lJ,guideColor:ZSe,guideColorActive:iLe},{bracketColor:cJ,guideColor:XSe,guideColorActive:nLe},{bracketColor:dJ,guideColor:QSe,guideColorActive:sLe},{bracketColor:uJ,guideColor:JSe,guideColorActive:oLe},{bracketColor:hJ,guideColor:eLe,guideColorActive:rLe}],i=new wJ,s=[{indentColor:CS,indentColorActive:wS},{indentColor:NSe,indentColorActive:OSe},{indentColor:ASe,indentColorActive:FSe},{indentColor:MSe,indentColorActive:BSe},{indentColor:RSe,indentColorActive:WSe},{indentColor:PSe,indentColorActive:VSe}],o=t.map(a=>{var l,c;const d=n.getColor(a.bracketColor),u=n.getColor(a.guideColor),h=n.getColor(a.guideColorActive),f=k_((l=k_(u))!==null&&l!==void 0?l:d==null?void 0:d.transparent(.3)),g=k_((c=k_(h))!==null&&c!==void 0?c:d);if(!(!f||!g))return{guideColor:f,guideColorActive:g}}).filter(uw),r=s.map(a=>{const l=n.getColor(a.indentColor),c=n.getColor(a.indentColorActive),d=k_(l),u=k_(c);if(!(!d||!u))return{indentColor:d,indentColorActive:u}}).filter(uw);if(o.length>0){for(let a=0;a<30;a++){const l=o[a%o.length];e.addRule(".monaco-editor .".concat(i.getInlineClassNameOfLevel(a).replace(/ /g,".")," { --guide-color: ").concat(l.guideColor,"; --guide-color-active: ").concat(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.".concat(i.activeClassName," { box-shadow: 1px 0 0 0 var(--guide-color-active) inset; }")),e.addRule(".monaco-editor .horizontal-top.".concat(i.activeClassName," { border-top: 1px solid var(--guide-color-active); }")),e.addRule(".monaco-editor .horizontal-bottom.".concat(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-".concat(a," { --indent-color: ").concat(l.indentColor,"; --indent-color-active: ").concat(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 IM{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 VLe{constructor(){this._currentVisibleRange=new I(1,1,1,1)}getCurrentVisibleRange(){return this._currentVisibleRange}setCurrentVisibleRange(e){this._currentVisibleRange=e}}class HLe{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 $Le{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 Si(()=>{this._checkMonospaceFontAssumptions()},2e3),this._lastRenderedData=new VLe,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 Gc(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,Vs(this.domNode,i),this._onOptionsMaybeChanged(),e.hasChanged(143)&&(this._maxLineWidth=0),!0}_onOptionsMaybeChanged(){const e=this._context.configuration,t=new d$(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 HLe(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 $Le(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 Y(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 IM(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=I.intersectRanges(e,this._lastRenderedData.getCurrentVisibleRange());if(!s)return null;const o=[];let r=0;const a=new IM(this.domNode.domNode,this._textRangeRestingSpot);let l=0;t&&(l=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(new Y(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 IM(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 Qye(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(),Co&&!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 C=1,w=o.length;Cl){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,C=h-l;_=Math.max(C,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-Dx.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}}Dx.HORIZONTAL_EXTRA_PX=30;class _O{constructor(e,t,i,s){this._decorationToRenderBrand=void 0,this.startLineNumber=+e,this.endLineNumber=+t,this.className=String(i),this.zIndex=s!=null?s:0}}class zLe{constructor(e,t){this.className=e,this.zIndex=t}}class ULe{constructor(){this.decorations=[]}add(e){this.decorations.push(e)}getDecorations(){return this.decorations}}class yJ extends Zm{_render(e,t,i){const s=[];for(let a=e;a<=t;a++){const l=a-e;s[l]=new ULe}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 qLe(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 KLe{constructor(e,t,i,s){this.lineNumber=e,this.lane=t,this.zIndex=i,this.className=s,this.type=0}accept(e){return new GLe(this.lineNumber,this.lane,e)}}class qLe{constructor(e,t,i,s){this.lineNumber=e,this.lane=t,this.zIndex=i,this.widget=s,this.type=1}}class GLe{constructor(e,t,i){this.lineNumber=e,this.lane=t,this.combinedClassName=i}}class YLe extends yJ{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 wa{constructor(e,t,i,s){this._rgba8Brand=void 0,this.r=wa._clamp(e),this.g=wa._clamp(t),this.b=wa._clamp(i),this.a=wa._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}}wa.Empty=new wa(0,0,0,0);class SS extends te{static getInstance(){return this._INSTANCE||(this._INSTANCE=new SS),this._INSTANCE}constructor(){super(),this._onDidChange=new j,this.onDidChange=this._onDidChange.event,this._updateColorMap(),this._register(nn.onDidChange(e=>{e.changedColorMap&&this._updateColorMap()}))}_updateColorMap(){const e=nn.getColorMap();if(!e){this._colors=[wa.Empty],this._backgroundIsLight=!0;return}this._colors=[wa.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}}SS._INSTANCE=null;const XLe=(()=>{const n=[];for(let e=32;e<=126;e++)n.push(e);return n.push(65533),n})(),QLe=(n,e)=>(n-=32,n<0||n>96?e<=2?(n+96)%96:96-1:n);class Ww{constructor(e,t){this.scale=t,this._minimapCharRendererBrand=void 0,this.charDataNormal=Ww.soften(e,12/15),this.charDataLight=Ww.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,_=QLe(s,c),v=e.width*4,b=a.r,C=a.g,w=a.b,y=o.r-b,L=o.g-C,S=o.b-w,k=Math.max(r,l),D=e.data;let x=_*h*f,A=i*v+t*4;for(let T=0;Te.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,C=s.b-_,w=g+v*f,y=p+b*f,L=_+C*f,S=Math.max(o,a),k=e.data;let D=i*h+t*4;for(let x=0;x{const e=new Uint8ClampedArray(n.length/2);for(let t=0;t>1]=C$[n[t]]<<4|C$[n[t+1]]&15;return e},y$={1:$f(()=>w$("0000511D6300CF609C709645A78432005642574171487021003C451900274D35D762755E8B629C5BA856AF57BA649530C167D1512A272A3F6038604460398526BCA2A968DB6F8957C768BE5FBE2FB467CF5D8D5B795DC7625B5DFF50DE64C466DB2FC47CD860A65E9A2EB96CB54CE06DA763AB2EA26860524D3763536601005116008177A8705E53AB738E6A982F88BAA35B5F5B626D9C636B449B737E5B7B678598869A662F6B5B8542706C704C80736A607578685B70594A49715A4522E792")),2:$f(()=>w$("000000000000000055394F383D2800008B8B1F210002000081B1CBCBCC820000847AAF6B9AAF2119BE08B8881AD60000A44FD07DCCF107015338130C00000000385972265F390B406E2437634B4B48031B12B8A0847000001E15B29A402F0000000000004B33460B00007A752C2A0000000000004D3900000084394B82013400ABA5CFC7AD9C0302A45A3E5A98AB000089A43382D97900008BA54AA087A70A0248A6A7AE6DBE0000BF6F94987EA40A01A06DCFA7A7A9030496C32F77891D0000A99FB1A0AFA80603B29AB9CA75930D010C0948354D3900000C0948354F37460D0028BE673D8400000000AF9D7B6E00002B007AA8933400007AA642675C2700007984CFB9C3985B768772A8A6B7B20000CAAECAAFC4B700009F94A6009F840009D09F9BA4CA9C0000CC8FC76DC87F0000C991C472A2000000A894A48CA7B501079BA2C9C69BA20000B19A5D3FA89000005CA6009DA2960901B0A7F0669FB200009D009E00B7890000DAD0F5D092820000D294D4C48BD10000B5A7A4A3B1A50402CAB6CBA6A2000000B5A7A4A3B1A8044FCDADD19D9CB00000B7778F7B8AAE0803C9AB5D3F5D3F00009EA09EA0BAB006039EA0989A8C7900009B9EF4D6B7C00000A9A7816CACA80000ABAC84705D3F000096DA635CDC8C00006F486F266F263D4784006124097B00374F6D2D6D2D6D4A3A95872322000000030000000000008D8939130000000000002E22A5C9CBC70600AB25C0B5C9B400061A2DB04CA67001082AA6BEBEBFC606002321DACBC19E03087AA08B6768380000282FBAC0B8CA7A88AD25BBA5A29900004C396C5894A6000040485A6E356E9442A32CD17EADA70000B4237923628600003E2DE9C1D7B500002F25BBA5A2990000231DB6AFB4A804023025C0B5CAB588062B2CBDBEC0C706882435A75CA20000002326BD6A82A908048B4B9A5A668000002423A09CB4BB060025259C9D8A7900001C1FCAB2C7C700002A2A9387ABA200002626A4A47D6E9D14333163A0C87500004B6F9C2D643A257049364936493647358A34438355497F1A0000A24C1D590000D38DFFBDD4CD3126"))};class SC{static create(e,t){if(this.lastCreated&&e===this.lastCreated.scale&&t===this.lastFontFamily)return this.lastCreated;let i;return y$[e]?i=new Ww(y$[e](),e):i=SC.createFromSampleData(SC.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 ".concat(e),i.textBaseline="middle";let s=0;for(const o of XLe)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=SC._downsample(e,t);return new Ww(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;dSC.create(this.fontScale,l.fontFamily)),this.defaultBackgroundColor=i.getColor(2),this.backgroundColor=Vw._getMinimapBackground(t,this.defaultBackgroundColor),this.foregroundAlpha=Vw._getMinimapForegroundOpacity(t)}static _getMinimapBackground(e,t){const i=e.getColor(Pye);return i?new wa(i.rgba.r,i.rgba.g,i.rgba.b,Math.round(255*i.rgba.a)):t}static _getMinimapForegroundOpacity(e){const t=e.getColor(Oye);return t?wa._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 LC{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 S=Math.max(1,Math.floor(o*o/L)),k=Math.max(0,e.minimapHeight-S),D=k/(d-o),x=c*D,A=k>0,T=Math.floor(e.canvasInnerHeight/e.minimapLineHeight),P=Math.floor(e.paddingTop/e.lineHeight);return new LC(c,d,A,D,x,S,P,1,Math.min(a,T))}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 C;if(b>0){const L=o/p;C=(v+a+b-L-1)*f/h}else C=Math.max(0,(v+a)*f/h-_);C=Math.min(e.minimapHeight-_,C);const w=C/(d-o),y=c*w;if(g>=v+a+b){const L=C>0;return new LC(c,d,L,w,y,_,v,1,a)}else{let L;t>1?L=t+v:L=Math.max(1,c/p);let S,k=Math.max(1,Math.floor(L-y*h/f));kc&&(k=Math.min(k,u.startLineNumber),S=Math.max(S,u.topPaddingLineCount)),u.scrollTop=e.paddingTop?A=(t-k+S+x)*f/h:A=c/e.paddingTop*(S+x)*f/h,new LC(c,d,!0,w,A,_,S,k,D)}}}class BE{constructor(e){this.dy=e}onContentChanged(){this.dy=-1}onTokensChanged(){this.dy=-1}}BE.INVALID=new BE(-1);class S${constructor(e,t,i){this.renderedLayout=e,this._imageData=t,this._renderedLines=new mJ(()=>BE.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]=Hw.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=Un(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 I0,this._sliderPointerDownListener=In(this._slider.domNode,Pe.POINTER_DOWN,i=>{i.preventDefault(),i.stopPropagation(),i.button===0&&this._lastRenderData&&this._startSliderDragging(i,i.pageY,this._lastRenderData.renderedLayout)}),this._gestureDisposable=Ii.addTarget(this._domNode.domNode),this._sliderTouchStartListener=ce(this._domNode.domNode,Ti.Start,i=>{i.preventDefault(),i.stopPropagation(),this._lastRenderData&&(this._slider.toggleClassName("active",!0),this._gestureInProgress=!0,this.scrollDueToTouchEvent(i))},{passive:!1}),this._sliderTouchMoveListener=ce(this._domNode.domNode,Ti.Change,i=>{i.preventDefault(),i.stopPropagation(),this._lastRenderData&&this._gestureInProgress&&this.scrollDueToTouchEvent(i)},{passive:!1}),this._sliderTouchEndListener=In(this._domNode.domNode,Ti.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=Un(this._domNode.domNode),c=Math.min(Math.abs(a-s),Math.abs(a-l.left),Math.abs(a-l.left-l.width));if(zs&&c>JLe){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 h9(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(r$),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=LC.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(I.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 L$(e.startLineNumber,e.endLineNumber,!1);this._renderSelectionLineHighlights(c,t,d,e,r),this._renderDecorationsLineHighlights(c,i,d,e,r);const u=new L$(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(Dh,r,e.canvas.width,a-r),r=h),a=f}a>r&&e.fillRect(Dh,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!==yr.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(Dh,_,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 yr.Inline:this.renderDecorationOnLine(e,i,c.range,g,s,p,o,o,r,a,l);continue;case yr.Gutter:{const _=s.getYForLineNumber(p,o),v=2;this.renderDecoration(e,g,v,_,eke,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 Dh;if((i-1)*o>=r)return r;let l=e.get(t);if(!l){const c=this._model.getLineContent(t);l=[Dh];let d=Dh;for(let u=1;u=r){l[u]=r;break}l[u]=g,d=g}e.set(t,l)}return i-1y?Math.floor((s-y)/2):0,S=h.a/255,k=new wa(Math.round((h.r-u.r)*S+u.r),Math.round((h.g-u.g)*S+u.g),Math.round((h.b-u.b)*S+u.b),255);let D=e.topPaddingLineCount*s;const x=[];for(let $=0,X=i-t+1;$=0&&Ab)return;const T=_.charCodeAt(y);if(T===9){const P=h-(y+L)%h;L+=P-1,w+=P*r}else if(T===32)w+=r;else{const P=zf(T)?2:1;for(let W=0;Wb)return}}}}}class L${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 ike extends Er{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=ci(document.createElement("div")),Dd.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=ci(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&&ee.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 ske extends Er{constructor(e){super(e),this._actualShouldRender=0,this._renderedDecorations=[],this._renderedCursorPositions=[],this._domNode=ci(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=nn.onDidChange(t=>{t.changedColorMap&&this._updateSettings(!0)}),this._cursorPositions=[]}dispose(){super.dispose(),this._tokensColorTrackerListener.dispose()}_updateSettings(e){const t=new nke(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=ee.Format.CSS.formatHexA(e),u.fillRect(0,0,i,s)):(u.clearRect(0,0,i,s),u.fillStyle=ee.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,C=0;for(let w=0,y=_.length/3;ws&&(T=s-d),D=T-d,x=T+d}D>C+1||L!==v?(w!==0&&u.fillRect(h[v],b,f[v],C-b),v=L,b=D,C=x):x>C&&(C=x)}u.fillRect(h[v],b,f[v],C-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,C=-100;for(let w=0,y=this._cursorPositions.length;ws&&(S=s-p);const k=S-p,D=k+g;k>C+1?(w!==0&&u.fillRect(_,b,v,C-b),b=k,C=D):D>C&&(C=D)}u.fillRect(_,b,v,C-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 k${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 SJ{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 C=new k$(p-_,p+_,b);d.setColorZone(C),a.push(C)}return this._colorZonesInvalid=!1,a.sort(k$.compare),a}}class rke extends _S{constructor(e,t){super(),this._context=e;const i=this._context.configuration.options;this._domNode=ci(document.createElement("canvas")),this._domNode.setClassName(t),this._domNode.setPosition("absolute"),this._domNode.setLayerHinting(!0),this._domNode.setContain("strict"),this._zoneManager=new oke(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 ake extends Er{constructor(e){super(e),this.domNode=ci(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=ci(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 cke{constructor(e){this.left=e.left,this.width=e.width,this.startStyle=null,this.endStyle=null}}class dke{constructor(e,t){this.lineNumber=e,this.ranges=t}}function uke(n){return new cke(n)}function hke(n){return new dke(n.lineNumber,n.ranges.map(uke))}class _n extends Zm{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;ML(d-g)g&&(h.top=1),ML(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]}}_n.SELECTION_CLASS_NAME="selected-text";_n.SELECTION_TOP_LEFT="top-left-radius";_n.SELECTION_BOTTOM_LEFT="bottom-left-radius";_n.SELECTION_TOP_RIGHT="top-right-radius";_n.SELECTION_BOTTOM_RIGHT="bottom-right-radius";_n.EDITOR_BACKGROUND_CLASS_NAME="monaco-editor-background";_n.ROUNDED_PIECE_WIDTH=10;bl((n,e)=>{const t=n.getColor(Hwe);t&&!t.isTransparent()&&e.addRule(".monaco-editor .view-line span.inline-selected-text { color: ".concat(t,"; }"))});function ML(n){return n<0?-n:n}class D${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 E${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=ci(document.createElement("div")),this._domNode.setClassName("cursor ".concat(Kv)),this._domNode.setHeight(this._lineHeight),this._domNode.setTop(0),this._domNode.setLeft(0),Vs(this._domNode,i),this._domNode.setDisplay("none"),this._position=new Y(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),Vs(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]=Eve(i,t-1);return[new Y(e,s+1),i.substring(s,o)]}_prepareRender(e){let t="",i="";const[s,o]=this._getGraphemeAwarePosition();if(this._cursorStyle===ws.Line||this._cursorStyle===ws.LineThin){const h=e.visibleRangeForPosition(s);if(!h||h.outsideRenderedLine)return null;let f;this._cursorStyle===ws.Line?(f=oH(this._lineCursorWidth>0?this._lineCursorWidth:2),f>2&&(t=o,i=this._getTokenClassName(s))):f=oH(1);let g=h.left,p=0;f>=2&&g>=1&&(p=1,g-=p);const _=e.getVerticalOffsetForLineNumber(s.lineNumber)-e.bigNumbersDelta;return new D$(_,g,p,f,this._lineHeight,t,i)}const r=e.linesVisibleRangesForRange(new I(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===ws.Block&&(t=o,i=this._getTokenClassName(s));let d=e.getVerticalOffsetForLineNumber(s.lineNumber)-e.bigNumbersDelta,u=this._lineHeight;return(this._cursorStyle===ws.Underline||this._cursorStyle===ws.UnderlineThin)&&(d+=this._lineHeight-2,u=2),new D$(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 ".concat(Kv," ").concat(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 $w extends Er{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 E$(this._context),this._secondaryCursors=[],this._renderData=[],this._domNode=ci(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 _l,this._cursorFlatBlinkInterval=new uS,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()},$w.BLINK_INTERVAL):this._startCursorBlinkAnimation.setIfNotSet(()=>{this._blinkingEnabled=!0,this._updateDomClassName()},$w.BLINK_INTERVAL))}_updateDomClassName(){this._domNode.setClassName(this._getClassName())}_getClassName(){let e="cursors-layer";switch(this._selectionIsEmpty||(e+=" has-selection"),this._cursorStyle){case ws.Line:e+=" cursor-line-style";break;case ws.Block:e+=" cursor-block-style";break;case ws.Underline:e+=" cursor-underline-style";break;case ws.LineThin:e+=" cursor-line-thin-style";break;case ws.BlockOutline:e+=" cursor-block-outline-style";break;case ws.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(oJ);if(t){let i=n.getColor(TSe);i||(i=t.opposite()),e.addRule(".monaco-editor .cursors-layer .cursor { background-color: ".concat(t,"; border-color: ").concat(t,"; color: ").concat(i,"; }")),ac(n.type)&&e.addRule(".monaco-editor .cursors-layer.has-selection .cursor { border-left: 1px solid ".concat(i,"; border-right: 1px solid ").concat(i,"; }"))}});const TM=()=>{throw new Error("Invalid change accessor")};class fke extends Er{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=ci(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=ci(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)}};gke(e,s),s.addZone=TM,s.removeZone=TM,s.layoutZone=TM}),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:ci(t.domNode),marginDomNode:t.marginDomNode?ci(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){Dt(i)}}_safeCallOnDomNodeTop(e,t){if(typeof e.onDomNodeTop=="function")try{e.onDomNodeTop(t)}catch(i){Dt(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=x.endOffset&&(D++,x=i&&i[D]),P!==9&&P!==32||h&&!L&&T<=k)continue;if(u&&T>=S&&T<=k&&P===32){const $=T-1>=0?a.charCodeAt(T-1):0,X=T+1=0?a.charCodeAt(T-1):0;if(P===32&&$!==32&&$!==9)continue}if(i&&(!x||x.startOffset>T||x.endOffset<=T))continue;const W=e.visibleRangeForPosition(new Y(t,T+1));W&&(r?(A=Math.max(A,W.left),P===9?y+=this._renderArrow(f,_,W.left):y+='')):P===9?y+='
').concat(w?String.fromCharCode(65515):String.fromCharCode(8594),"
"):y+='
').concat(String.fromCharCode(C),"
"))}return r?(A=Math.round(A+_),'')+y+""):y}_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},C=[l,c,d,u,h,f,g,p,_,v].map(w=>"".concat((a+w.x).toFixed(2)," ").concat((r+w.y).toFixed(2))).join(" L ");return'')}render(e,t){if(!this._renderResult)return"";const i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}}class I${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 Cke=globalThis&&globalThis.__decorate||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},wke=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let vO=class extends _S{constructor(e,t,i,s,o,r,a){super(),this._instantiationService=a,this._shouldRecomputeGlyphMarginLanes=!1,this._selections=[new Je(1,1,1,1)],this._renderAnimationFrame=null;const l=new ILe(t,s,o,e);this._context=new mke(t,i,s),this._context.addEventHandler(this),this._viewParts=[],this._textAreaHandler=this._instantiationService.createInstance(pO,this._context,l,this._createTextAreaHandlerHelper()),this._viewParts.push(this._textAreaHandler),this._linesContent=ci(document.createElement("div")),this._linesContent.setClassName("lines-content monaco-editor-background"),this._linesContent.setPosition("absolute"),this.domNode=ci(document.createElement("div")),this.domNode.setClassName(this._getEditorClassName()),this.domNode.setAttribute("role","code"),this._overflowGuardContainer=ci(document.createElement("div")),Dd.write(this._overflowGuardContainer,3),this._overflowGuardContainer.setClassName("overflow-guard"),this._scrollbar=new FLe(this._context,this._linesContent,this.domNode,this._overflowGuardContainer),this._viewParts.push(this._scrollbar),this._viewLines=new Dx(this._context,this._linesContent),this._viewZones=new fke(this._context),this._viewParts.push(this._viewZones);const c=new ske(this._context);this._viewParts.push(c);const d=new lke(this._context);this._viewParts.push(d);const u=new xLe(this._context);this._viewParts.push(u),u.addDynamicOverlay(new RLe(this._context)),u.addDynamicOverlay(new _n(this._context)),u.addDynamicOverlay(new WLe(this._context)),u.addDynamicOverlay(new OLe(this._context)),u.addDynamicOverlay(new bke(this._context));const h=new NLe(this._context);this._viewParts.push(h),h.addDynamicOverlay(new PLe(this._context)),h.addDynamicOverlay(new ZLe(this._context)),h.addDynamicOverlay(new YLe(this._context)),h.addDynamicOverlay(new yS(this._context)),this._glyphMarginWidgets=new jLe(this._context),this._viewParts.push(this._glyphMarginWidgets);const f=new dm(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 ALe(this._context,this.domNode),this._viewParts.push(this._contentWidgets),this._viewCursors=new $w(this._context),this._viewParts.push(this._viewCursors),this._overlayWidgets=new ike(this._context),this._viewParts.push(this._overlayWidgets);const g=new ake(this._context);this._viewParts.push(g);const p=new vke(this._context);this._viewParts.push(p);const _=new tke(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 DSe(this._context,l,this._createPointerHandlerHelper()))}_flushAccumulatedAndRenderNow(){this._shouldRecomputeGlyphMarginLanes&&(this._shouldRecomputeGlyphMarginLanes=!1,this._context.configuration.setGlyphMarginDecorationLaneCount(this._computeGlyphMarginLaneCount())),nf.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:$v.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)=>I.compareRangesUsingStarts(o.range,r.range));let i=null,s=null;for(const o of t)if(o.lane===$v.Left&&(!i||I.compareRangesUsingEnds(i,o.range)<0)&&(i=o.range),o.lane===$v.Right&&(!s||I.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 nSe(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 Y(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)+" "+gO(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=vE(this._onRenderScheduled.bind(this),100))}_onRenderScheduled(){this._renderAnimationFrame=null,this._flushAccumulatedAndRenderNow()}_renderNow(){yke(()=>this._actualRender())}_getViewPartsToRender(){const e=[];let t=0;for(const i of this._viewParts)i.shouldRender()&&(e[t++]=i);return e}_actualRender(){if(!O8(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 _ke(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 Zye(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 Y(s.lineNumber,s.column));return o?o.left:-1}getTargetAtClientPoint(e,t){const i=this._pointerHandler.getTargetAtClientPoint(e,t);return i?Lx.convertViewToModelMouseTarget(i,this._context.viewModel.coordinatesConverter):null}createOverviewRuler(e){return new rke(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()}};vO=Cke([wke(6,_t)],vO);function yke(n){try{return n()}catch(e){Dt(e)}}class LJ{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 Xf(n){let e=0,t=0,i=0,s=0;for(let o=0,r=n.length;o=jr&&(t=t-n%jr),t}function Eke(n,e){return n.reduce((t,i)=>on(t,e(i)),No)}function kJ(n,e){return n===e}function Uw(n,e){const t=n,i=e;if(i-t<=0)return No;const o=Math.floor(t/jr),r=Math.floor(i/jr),a=i-r*jr;if(o===r){const l=t-o*jr;return kn(0,a-l)}else return kn(r-o,a)}function Yv(n,e){return n=e}function gv(n){return kn(n.lineNumber-1,n.column-1)}function Kp(n,e){const t=n,i=Math.floor(t/jr),s=t-i*jr,o=e,r=Math.floor(o/jr),a=o-r*jr;return new I(i+1,s+1,r+1,a+1)}function Ike(n){const e=Sd(n);return kn(e.length-1,e[e.length-1].length)}class Tu{static fromModelContentChanges(e){return e.map(i=>{const s=I.lift(i.range);return new Tu(gv(s.getStartPosition()),gv(s.getEndPosition()),Ike(i.text))}).reverse()}constructor(e,t,i){this.startOffset=e,this.endOffset=t,this.newLength=i}toString(){return"[".concat(ka(this.startOffset),"...").concat(ka(this.endOffset),") -> ").concat(ka(this.newLength))}}class Tke{constructor(e){this.nextEditIdx=0,this.deltaOldToNewLineCount=0,this.deltaOldToNewColumnCount=0,this.deltaLineIdxInOld=-1,this.edits=e.map(t=>f9.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:Uw(e,i)}translateOldToCur(e){return e.lineCount===this.deltaLineIdxInOld?kn(e.lineCount+this.deltaOldToNewLineCount,e.columnCount+this.deltaOldToNewColumnCount):kn(e.lineCount+this.deltaOldToNewLineCount,e.columnCount)}translateCurToOld(e){const t=ka(e);return t.lineCount-this.deltaOldToNewLineCount===this.deltaLineIdxInOld?kn(t.lineCount-this.deltaOldToNewLineCount,t.columnCount-this.deltaOldToNewColumnCount):kn(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=kke(e,t,this.lineIdx,this.lineCharOffset);return new jh(s,0,-1,$n.getEmpty(),new bp(s))}}class Pke{constructor(e,t){this.text=e,this._offset=No,this.idx=0;const i=t.getRegExpStr(),s=i?new RegExp(i+"|\n","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 jh(kn(0,g),0,-1,$n.getEmpty(),new bp(kn(0,g))));const h=[];for(let g=0;g<60;g++)h.push(new jh(kn(1,g),0,-1,$n.getEmpty(),new bp(kn(1,g))));if(s)for(s.lastIndex=0;(r=s.exec(e))!==null;){const g=r.index,p=r[0];if(p==="\n")a++,l=g+1;else{if(c!==g){let _;if(d===a){const v=g-c;if(vOke(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 Oke(n){let e=Xr(n);return/^[\w ]+/.test(n)&&(e="\\b".concat(e)),/[\w ]+$/.test(n)&&(e="".concat(e,"\\b")),e}class IJ{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=m9.createFromLanguage(this.getLanguageConfiguration(e),this.denseKeyProvider),this.languageIdToBracketTokens.set(e,t)),t}}function Fke(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())N$(i,s)<=N$(s,r)?(i=xM(i,s),s=r):s=xM(s,r);return xM(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 N$(n,e){return Math.abs(n.listHeight-e.listHeight)}function xM(n,e){return n.listHeight===e.listHeight?Ed.create23(n,e,null,!1):n.listHeight>e.listHeight?Bke(n,e):Wke(e,n)}function Bke(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=Ed.create23(r.unappendChild(),s,null,!1):(r.appendChildOfSameHeight(s),s=void 0):r.handleChildrenChanged()}return s?Ed.create23(n,s,null,!1):n}function Wke(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=Ed.create23(s,r.unprependChild(),null,!1):(r.prependChildOfSameHeight(s),s=void 0):r.handleChildrenChanged()}return s?Ed.create23(s,n,null,!1):n}class Vke{constructor(e){this.lastOffset=No,this.nextNodes=[e],this.offsets=[No],this.idxs=[]}readLongestNodeAt(e,t){if(Yv(e,this.lastOffset))throw new Error("Invalid offset");for(this.lastOffset=e;;){const i=u1(this.nextNodes);if(!i)return;const s=u1(this.offsets);if(Yv(e,s))return;if(Yv(s,e))if(on(s,i.length)<=e)this.nextNodeAfterCurrent();else{const o=NM(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=NM(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=u1(this.offsets),t=u1(this.nextNodes);if(this.nextNodes.pop(),this.offsets.pop(),this.idxs.length===0)break;const i=u1(this.nextNodes),s=NM(i,this.idxs[this.idxs.length-1]);if(s!==-1){this.nextNodes.push(i.getChild(s)),this.offsets.push(on(e,t.length)),this.idxs[this.idxs.length-1]=s;break}else this.idxs.pop()}}}function NM(n,e=-1){for(;;){if(e++,e>=n.childrenLength)return-1;if(n.getChild(e))return e}}function u1(n){return n.length>0?n[n.length-1]:void 0}function bO(n,e,t,i){return new Hke(n,e,t,i).parseDocument()}class Hke{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 Vke(i):void 0,this.positionMapper=new Tke(t)}parseDocument(){this._itemsConstructed=0,this._itemsFromCache=0;let e=this.parseList($n.getEmpty(),0);return e||(e=Ed.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?Fke(i):TJ(i,this.createImmutableLists)}tryReadChildFromCache(e){if(this.oldNodeReader){const t=this.positionMapper.getDistanceToNextChange(this.tokenizer.offset);if(t===null||!VE(t)){const i=this.oldNodeReader.readLongestNodeAt(this.positionMapper.getOffsetBeforeChange(this.tokenizer.offset),s=>t!==null&&!Yv(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 Mke(i.bracketIds,i.length);case 0:return i.astNode;case 1:{if(t>300)return new bp(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(),jw.create(i.astNode,o,r.astNode)):jw.create(i.astNode,o,null)}default:throw new Error("unexpected")}}}function zE(n,e){if(n.length===0)return e;if(e.length===0)return n;const t=new Ku(A$(n)),i=A$(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&&!VE(c);){const[u,h]=s.splitAt(c);d.push(u),c=Uw(u.lengthAfter,c),s=h!=null?h:t.dequeue()}return VE(c)||d.push(new sf(!1,c,c)),d}const r=[];function a(c,d,u){if(r.length>0&&kJ(r[r.length-1].endOffset,c)){const h=r[r.length-1];r[r.length-1]=new Tu(h.startOffset,d,on(h.newLength,u))}else r.push({startOffset:c,endOffset:d,newLength:u})}let l=No;for(const c of i){const d=o(c.lengthBefore);if(c.modified){const u=Eke(d,f=>f.lengthBefore),h=on(l,u);a(l,h,c.lengthAfter),l=h}else for(const u of d){const h=l;l=on(l,u.lengthBefore),u.modified&&a(h,l,u.lengthAfter)}}return r}class sf{constructor(e,t,i){this.modified=e,this.lengthBefore=t,this.lengthAfter=i}splitAt(e){const t=Uw(e,this.lengthAfter);return kJ(t,No)?[this,void 0]:this.modified?[new sf(this.modified,this.lengthBefore,e),new sf(this.modified,No,t)]:[new sf(this.modified,e,e),new sf(this.modified,t,t)]}toString(){return"".concat(this.modified?"M":"U",":").concat(ka(this.lengthBefore)," -> ").concat(ka(this.lengthAfter))}}function A$(n){const e=[];let t=No;for(const i of n){const s=Uw(t,i.startOffset);VE(s)||e.push(new sf(!1,s,s));const o=Uw(i.startOffset,i.endOffset);e.push(new sf(!0,o,i.newLength)),t=i.endOffset}return e}class $ke extends te{didLanguageChange(e){return this.brackets.didLanguageChange(e)}constructor(e,t){if(super(),this.textModel=e,this.getLanguageConfiguration=t,this.didChangeEmitter=new j,this.denseKeyProvider=new DJ,this.brackets=new IJ(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 Pke(this.textModel.getValue(),i);this.initialAstWithoutTokens=bO(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 Tu(kn(i.fromLineNumber-1,0),kn(i.toLineNumber,0),kn(i.toLineNumber-i.fromLineNumber+1,0)));this.handleEdits(t,!0),this.initialAstWithoutTokens||this.didChangeEmitter.fire()}handleContentChanged(e){const t=Tu.fromModelContentChanges(e.changes);this.handleEdits(t,!1)}handleEdits(e,t){const i=zE(this.queuedTextEdits,e);this.queuedTextEdits=i,this.initialAstWithoutTokens&&!t&&(this.queuedTextEditsForInitialAstWithoutTokens=zE(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 EJ(this.textModel,this.brackets);return bO(o,e,s,i)}getBracketsInRange(e,t){this.flushQueue();const i=kn(e.startLineNumber-1,e.startColumn-1),s=kn(e.endLineNumber-1,e.endColumn-1);return new fd(o=>{const r=this.initialAstWithoutTokens||this.astWithTokens;CO(r,No,r.length,i,s,o,0,0,new Map,t)})}getBracketPairsInRange(e,t){this.flushQueue();const i=gv(e.getStartPosition()),s=gv(e.getEndPosition());return new fd(o=>{const r=this.initialAstWithoutTokens||this.astWithTokens,a=new zke(o,t,this.textModel);wO(r,No,r.length,i,s,a,0,new Map)})}getFirstBracketAfter(e){this.flushQueue();const t=this.initialAstWithoutTokens||this.astWithTokens;return NJ(t,No,t.length,gv(e))}getFirstBracketBefore(e){this.flushQueue();const t=this.initialAstWithoutTokens||this.astWithTokens;return xJ(t,No,t.length,gv(e))}}function xJ(n,e,t,i){if(n.kind===4||n.kind===2){const s=[];for(const o of n.children)t=on(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(Yv(r,i)){const l=xJ(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=Kp(e,t);return{bracketInfo:n.bracketInfo,range:s}}}return null}function NJ(n,e,t,i){if(n.kind===4||n.kind===2){for(const s of n.children){if(t=on(e,s.length),Yv(i,t)){const o=NJ(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=Kp(e,t);return{bracketInfo:n.bracketInfo,range:s}}}return null}function CO(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=on(e,n.openingBracket.length);let h=-1;if(o.includeMinIndentation&&(h=n.computeMinIndentation(e,o.textModel)),c=o.push(new Lke(Kp(e,t),Kp(e,u),n.closingBracket?Kp(on(u,((l=n.child)===null||l===void 0?void 0:l.length)||No),t):void 0,r,d,n,h)),e=u,c&&n.child){const f=n.child;if(t=on(e,f.length),Zv(e,s)&&K1(t,i)&&(c=wO(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=on(d,u.length),Zv(h,s)&&Zv(i,d)&&(c=wO(u,h,d,i,s,o,r,a),!c))return!1}}return c}class Uke extends te{get canBuildAST(){return this.textModel.getValueLength()<=5e6}constructor(e,t){super(),this.textModel=e,this.languageConfigurationService=t,this.bracketPairsTree=this._register(new Ts),this.onDidChangeEmitter=new j,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 be;this.bracketPairsTree.value=jke(e.add(new $ke(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))||fd.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))||fd.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))||fd.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(I.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?RL(this._findMatchingBracketUp(l,s,AM(i))):null}}matchBracket(e,t){if(this.canBuildAST){const i=this.getBracketPairsInRange(I.fromPositions(e,e)).filter(s=>s.closingBracketRange!==void 0&&(s.openingBracketRange.containsPosition(e)||s.closingBracketRange.containsPosition(e))).findLastMaxBy(Sa(s=>s.openingBracketRange.containsPosition(e)?s.openingBracketRange:s.closingBracketRange,I.compareRangesUsingStarts));return i?[i.openingBracketRange,i.closingBracketRange]:null}else{const i=AM(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(Nc(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(Nc(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&&!Nc(s.getStandardTokenType(r))){let{searchStartOffset:l,searchEndOffset:c}=this._establishBracketSearchOffsets(e,s,a,r),d=null;for(;;){const u=Ga.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 uu)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&&!Nc(s.getStandardTokenType(l))){const{searchStartOffset:d,searchEndOffset:u}=this._establishBracketSearchOffsets(e,s,c,l),h=Ga.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 uu?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 uu?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 uu.INSTANCE;const f=Ga.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&&!Nc(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 uu.INSTANCE;const g=Ga.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=Ga.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&&!Nc(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=Ga.findPrevBracketInRange(o.reversedRegex,a,d,h,f);if(v)return this._toFoundBracket(r,v)}g=_}if(r&&o&&g&&h!==f){const p=Ga.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=AM(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 uu.INSTANCE;const b=Ga.findNextBracketInRange(f.forwardRegex,g,p,_,v);if(!b)break;const C=p.substring(b.startColumn-1,b.endColumn-1).toLowerCase(),w=f.textIsBracket[C];if(w&&(w.isOpen(C)?a[w.index]++:w.isClose(C)&&a[w.index]--,a[w.index]===-1))return this._matchFoundBracket(b,w,!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,C=0;if(f===i.lineNumber){v=g.findTokenIndexAtOffset(i.column-1),b=i.column-1,C=i.column-1;const y=g.getLanguageId(v);u!==y&&(u=y,h=this.languageConfigurationService.getLanguageConfiguration(u).brackets,l(u,h))}let w=!0;for(;ve==null?void 0:e.dispose()}}function AM(n){if(typeof n>"u")return()=>!0;{const e=Date.now();return()=>Date.now()-e<=n}}class uu{constructor(){this._searchCanceledBrand=void 0}}uu.INSTANCE=new uu;function RL(n){return n instanceof uu?null:n}class Kke extends te{constructor(e){super(),this.textModel=e,this.colorProvider=new AJ,this.onDidChangeEmitter=new j,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".concat(r.range.toString(),"-").concat(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 I(1,1,this.textModel.getLineCount(),1),e,t):[]}}class AJ{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-".concat(e%30)}}bl((n,e)=>{const t=[aJ,lJ,cJ,dJ,uJ,hJ],i=new AJ;e.addRule(".monaco-editor .".concat(i.unexpectedClosingBracketClassName," { color: ").concat(n.getColor(GSe),"; }"));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 .".concat(i.getInlineClassNameOfLevel(o)," { color: ").concat(r,"; }"))}});function PL(n){return n.replace(/\n/g,"\\n").replace(/\r/g,"\\r")}class Ps{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@".concat(this.oldPosition,' "').concat(PL(this.newText),'")'):this.newText.length===0?"(delete@".concat(this.oldPosition,' "').concat(PL(this.oldText),'")'):"(replace@".concat(this.oldPosition,' "').concat(PL(this.oldText),'" with "').concat(PL(this.newText),'")')}static _writeStringSize(e){return 4+2*e.length}static _writeString(e,t,i){const s=t.length;Fl(e,s,i),i+=4;for(let o=0;on.length)return!1;if(t){if(!k8(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 RJ(n){return n>=65&&n<=90||n>=97&&n<=122}function Yke(n,e=zs){return e?RJ(n.charCodeAt(0))&&n.charCodeAt(1)===58:!1}function Ac(n){return uE(n,!0)}class Zke{constructor(e){this._ignorePathCasing=e}compare(e,t,i=!1){return e===t?0:_w(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===Nt.file)return yO(Ac(e),Ac(t),this._ignorePathCasing(e))&&e.query===t.query&&(i||e.fragment===t.fragment);if(P$(e.authority,t.authority))return yO(e.path,t.path,this._ignorePathCasing(e),"/")&&e.query===t.query&&(i||e.fragment===t.fragment)}return!1}joinPath(e,...t){return ct.joinPath(e,...t)}basenameOrAuthority(e){return Ra(e)||e.authority}basename(e){return zn.basename(e.path)}extname(e){return zn.extname(e.path)}dirname(e){if(e.path.length===0)return e;let t;return e.scheme===Nt.file?t=ct.file(mX(Ac(e))).path:(t=zn.dirname(e.path),e.authority&&t.length&&t.charCodeAt(0)!==47&&(console.error('dirname("'.concat(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===Nt.file?t=ct.file(pX(Ac(e))).path:t=zn.normalize(e.path),e.with({path:t})}relativePath(e,t){if(e.scheme!==t.scheme||!P$(e.authority,t.authority))return;if(e.scheme===Nt.file){const o=sve(Ac(e),Ac(t));return zs?MJ(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);oM$(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=sc){return O$(e,t)?e.with({path:e.path.substr(0,e.path.length-1)}):e}addTrailingPathSeparator(e,t=sc){let i=!1;if(e.scheme===Nt.file){const s=Ac(e);i=s!==void 0&&s.length===M$(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&&!O$(e,t)?e.with({path:e.path+"/"}):e}}const zi=new Zke(()=>!1),_9=zi.isEqual.bind(zi);zi.isEqualOrParent.bind(zi);zi.getComparisonKey.bind(zi);const Xke=zi.basenameOrAuthority.bind(zi),Ra=zi.basename.bind(zi),Qke=zi.extname.bind(zi),Ex=zi.dirname.bind(zi),Jke=zi.joinPath.bind(zi),eDe=zi.normalizePath.bind(zi),tDe=zi.relativePath.bind(zi),R$=zi.resolvePath.bind(zi);zi.isAbsolutePath.bind(zi);const P$=zi.isEqualAuthority.bind(zi),O$=zi.hasTrailingPathSeparator.bind(zi);zi.removeTrailingPathSeparator.bind(zi);zi.addTrailingPathSeparator.bind(zi);var Qf;(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})(Qf||(Qf={}));function D_(n){return n.toString()}class as{static create(e,t){const i=e.getAlternativeVersionId(),s=SO(e);return new as(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=qke(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(Fl(e,t?t.length:0,i),i+=4,t)for(const s of t)Fl(e,s.selectionStartLineNumber,i),i+=4,Fl(e,s.selectionStartColumn,i),i+=4,Fl(e,s.positionLineNumber,i),i+=4,Fl(e,s.positionColumn,i),i+=4;return i}static _readSelections(e,t,i){const s=Ol(e,t);t+=4;for(let o=0;ot.toString()).join(", ")}matchesResource(e){return(ct.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 as}append(e,t,i,s,o){this._data instanceof as&&this._data.append(e,t,i,s,o)}close(){this._data instanceof as&&(this._data=this._data.serialize())}open(){this._data instanceof as||(this._data=as.deserialize(this._data))}undo(){if(ct.isUri(this.model))throw new Error("Invalid SingleModelEditStackElement");this._data instanceof as&&(this._data=this._data.serialize());const e=as.deserialize(this._data);this.model._applyUndo(e.changes,e.beforeEOL,e.beforeVersionId,e.beforeCursorState)}redo(){if(ct.isUri(this.model))throw new Error("Invalid SingleModelEditStackElement");this._data instanceof as&&(this._data=this._data.serialize());const e=as.deserialize(this._data);this.model._applyRedo(e.changes,e.afterEOL,e.afterVersionId,e.afterCursorState)}heapSize(){return this._data instanceof as&&(this._data=this._data.serialize()),this._data.byteLength+168}}class iDe{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=D_(s.resource);this._editStackElementsMap.set(o,s)}this._delegate=null}prepareUndoRedo(){if(this._delegate)return this._delegate.prepareUndoRedo(this)}matchesResource(e){const t=D_(e);return this._editStackElementsMap.has(t)}setModel(e){const t=D_(ct.isUri(e)?e:e.uri);this._editStackElementsMap.has(t)&&this._editStackElementsMap.get(t).setModel(e)}canAppend(e){if(!this._isOpen)return!1;const t=D_(e.uri);return this._editStackElementsMap.has(t)?this._editStackElementsMap.get(t).canAppend(e):!1}append(e,t,i,s,o){const r=D_(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=D_(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("".concat(Ra(t.resource),": ").concat(t));return"{".concat(e.join(", "),"}")}}function SO(n){return n.getEOL()==="\n"?0:1}function hu(n){return n?n instanceof PJ||n instanceof iDe:!1}class v9{constructor(e,t){this._model=e,this._undoRedoService=t}pushStackElement(){const e=this._undoRedoService.getLastElement(this._model.uri);hu(e)&&e.close()}popStackElement(){const e=this._undoRedoService.getLastElement(this._model.uri);hu(e)&&e.open()}clear(){this._undoRedoService.removeElements(this._model.uri)}_getOrCreateEditStackElement(e,t){const i=this._undoRedoService.getLastElement(this._model.uri);if(hu(i)&&i.canAppend(this._model))return i;const s=new PJ(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,[],SO(this._model),this._model.getAlternativeVersionId(),null)}pushEditOperation(e,t,i,s){const o=this._getOrCreateEditStackElement(e,s),r=this._model.applyEdits(t,!0),a=v9._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),SO(this._model),this._model.getAlternativeVersionId(),a),a}static _computeCursorState(e,t){try{return e?e(t):null}catch(i){return Dt(i),null}}}class nDe{constructor(){this.spacesDiff=0,this.looksLikeAlignment=!1}}function sDe(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++:w>1&&o++,sDe(r,a,_,C,u),u.looksLikeAlignment&&!(t&&e===u.spacesDiff)))continue;const L=u.spacesDiff;L<=c&&d[L]++,r=_,a=C}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 jo(n){return(n.metadata&1)>>>0}function Bi(n,e){n.metadata=n.metadata&254|e<<0}function Hs(n){return(n.metadata&2)>>>1===1}function Ri(n,e){n.metadata=n.metadata&253|(e?1:0)<<1}function OJ(n){return(n.metadata&4)>>>2===1}function B$(n,e){n.metadata=n.metadata&251|(e?1:0)<<2}function FJ(n){return(n.metadata&64)>>>6===1}function W$(n,e){n.metadata=n.metadata&191|(e?1:0)<<6}function oDe(n){return(n.metadata&24)>>>3}function V$(n,e){n.metadata=n.metadata&231|e<<3}function rDe(n){return(n.metadata&32)>>>5===1}function H$(n,e){n.metadata=n.metadata&223|(e?1:0)<<5}class BJ{constructor(e,t,i){this.metadata=0,this.parent=this,this.left=this,this.right=this,Bi(this,1),this.start=t,this.end=i,this.delta=0,this.maxEnd=i,this.id=e,this.ownerId=0,this.options=null,B$(this,!1),W$(this,!1),V$(this,1),H$(this,!1),this.cachedVersionId=0,this.cachedAbsoluteStart=t,this.cachedAbsoluteEnd=i,this.range=null,Ri(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;B$(this,t==="squiggly-error"||t==="squiggly-warning"||t==="squiggly-info"),W$(this,this.options.glyphMarginClassName!==null),V$(this,this.options.stickiness),H$(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 Mt=new BJ(null,0,0);Mt.parent=Mt;Mt.left=Mt;Mt.right=Mt;Bi(Mt,0);class MM{constructor(){this.root=Mt,this.requestNormalizeDelta=!1}intervalSearch(e,t,i,s,o,r){return this.root===Mt?[]:gDe(this,e,t,i,s,o,r)}search(e,t,i,s){return this.root===Mt?[]:fDe(this,e,t,i,s)}collectNodesFromOwner(e){return uDe(this,e)}collectNodesPostOrder(){return hDe(this)}insert(e){$$(this,e),this._normalizeDeltaIfNecessary()}delete(e){z$(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=cDe(this,e,e+t);for(let r=0,a=o.length;rt||i===1?!1:i===2?!0:e}function lDe(n,e,t,i,s){const o=oDe(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&&rDe(n)&&(n.start=e,h=!0,n.end=e,g=!0);{const _=s?1:l>0?2:0;!h&&E_(u,r,e,_)&&(h=!0),!g&&E_(f,a,e,_)&&(g=!0)}if(d>0&&!s){const _=l>c?2:0;!h&&E_(u,r,e+d,_)&&(h=!0),!g&&E_(f,a,e+d,_)&&(g=!0)}{const _=s?1:0;!h&&E_(u,r,t,_)&&(n.start=e+c,h=!0),!g&&E_(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 cDe(n,e,t){let i=n.root,s=0,o=0,r=0,a=0;const l=[];let c=0;for(;i!==Mt;){if(Hs(i)){Ri(i.left,!1),Ri(i.right,!1),i===i.parent.right&&(s-=i.parent.delta),i=i.parent;continue}if(!Hs(i.left)){if(o=s+i.maxEnd,ot){Ri(i,!0);continue}if(a=s+i.end,a>=e&&(i.setCachedOffsets(r,a,0),l[c++]=i),Ri(i,!0),i.right!==Mt&&!Hs(i.right)){s+=i.delta,i=i.right;continue}}return Ri(n.root,!1),l}function dDe(n,e,t,i){let s=n.root,o=0,r=0,a=0;const l=i-(t-e);for(;s!==Mt;){if(Hs(s)){Ri(s.left,!1),Ri(s.right,!1),s===s.parent.right&&(o-=s.parent.delta),Jf(s),s=s.parent;continue}if(!Hs(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),Ri(s,!0);continue}if(Ri(s,!0),s.right!==Mt&&!Hs(s.right)){o+=s.delta,s=s.right;continue}}Ri(n.root,!1)}function uDe(n,e){let t=n.root;const i=[];let s=0;for(;t!==Mt;){if(Hs(t)){Ri(t.left,!1),Ri(t.right,!1),t=t.parent;continue}if(t.left!==Mt&&!Hs(t.left)){t=t.left;continue}if(t.ownerId===e&&(i[s++]=t),Ri(t,!0),t.right!==Mt&&!Hs(t.right)){t=t.right;continue}}return Ri(n.root,!1),i}function hDe(n){let e=n.root;const t=[];let i=0;for(;e!==Mt;){if(Hs(e)){Ri(e.left,!1),Ri(e.right,!1),e=e.parent;continue}if(e.left!==Mt&&!Hs(e.left)){e=e.left;continue}if(e.right!==Mt&&!Hs(e.right)){e=e.right;continue}t[i++]=e,Ri(e,!0)}return Ri(n.root,!1),t}function fDe(n,e,t,i,s){let o=n.root,r=0,a=0,l=0;const c=[];let d=0;for(;o!==Mt;){if(Hs(o)){Ri(o.left,!1),Ri(o.right,!1),o===o.parent.right&&(r-=o.parent.delta),o=o.parent;continue}if(o.left!==Mt&&!Hs(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&&OJ(o)&&(u=!1),s&&!FJ(o)&&(u=!1),u&&(c[d++]=o),Ri(o,!0),o.right!==Mt&&!Hs(o.right)){r+=o.delta,o=o.right;continue}}return Ri(n.root,!1),c}function gDe(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!==Mt;){if(Hs(a)){Ri(a.left,!1),Ri(a.right,!1),a===a.parent.right&&(l-=a.parent.delta),a=a.parent;continue}if(!Hs(a.left)){if(c=l+a.maxEnd,ct){Ri(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&&OJ(a)&&(g=!1),r&&!FJ(a)&&(g=!1),g&&(h[f++]=a)}if(Ri(a,!0),a.right!==Mt&&!Hs(a.right)){l+=a.delta,a=a.right;continue}}return Ri(n.root,!1),h}function $$(n,e){if(n.root===Mt)return e.parent=Mt,e.left=Mt,e.right=Mt,Bi(e,0),n.root=e,n.root;pDe(n,e),Nh(e.parent);let t=e;for(;t!==n.root&&jo(t.parent)===1;)if(t.parent===t.parent.parent.left){const i=t.parent.parent.right;jo(i)===1?(Bi(t.parent,0),Bi(i,0),Bi(t.parent.parent,1),t=t.parent.parent):(t===t.parent.right&&(t=t.parent,kC(n,t)),Bi(t.parent,0),Bi(t.parent.parent,1),DC(n,t.parent.parent))}else{const i=t.parent.parent.left;jo(i)===1?(Bi(t.parent,0),Bi(i,0),Bi(t.parent.parent,1),t=t.parent.parent):(t===t.parent.left&&(t=t.parent,DC(n,t)),Bi(t.parent,0),Bi(t.parent.parent,1),kC(n,t.parent.parent))}return Bi(n.root,0),e}function pDe(n,e){let t=0,i=n.root;const s=e.start,o=e.end;for(;;)if(_De(s,o,i.start+t,i.end+t)<0)if(i.left===Mt){e.start-=t,e.end-=t,e.maxEnd-=t,i.left=e;break}else i=i.left;else if(i.right===Mt){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=Mt,e.right=Mt,Bi(e,1)}function z$(n,e){let t,i;if(e.left===Mt?(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===Mt?(t=e.left,i=e):(i=mDe(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,Bi(t,0),e.detach(),RM(),Jf(t),n.root.parent=Mt;return}const s=jo(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,Bi(i,jo(e)),e===n.root?n.root=i:e===e.parent.left?e.parent.left=i:e.parent.right=i,i.left!==Mt&&(i.left.parent=i),i.right!==Mt&&(i.right.parent=i)),e.detach(),s){Nh(t.parent),i!==e&&(Nh(i),Nh(i.parent)),RM();return}Nh(t),Nh(t.parent),i!==e&&(Nh(i),Nh(i.parent));let o;for(;t!==n.root&&jo(t)===0;)t===t.parent.left?(o=t.parent.right,jo(o)===1&&(Bi(o,0),Bi(t.parent,1),kC(n,t.parent),o=t.parent.right),jo(o.left)===0&&jo(o.right)===0?(Bi(o,1),t=t.parent):(jo(o.right)===0&&(Bi(o.left,0),Bi(o,1),DC(n,o),o=t.parent.right),Bi(o,jo(t.parent)),Bi(t.parent,0),Bi(o.right,0),kC(n,t.parent),t=n.root)):(o=t.parent.left,jo(o)===1&&(Bi(o,0),Bi(t.parent,1),DC(n,t.parent),o=t.parent.left),jo(o.left)===0&&jo(o.right)===0?(Bi(o,1),t=t.parent):(jo(o.left)===0&&(Bi(o.right,0),Bi(o,1),kC(n,o),o=t.parent.left),Bi(o,jo(t.parent)),Bi(t.parent,0),Bi(o.left,0),DC(n,t.parent),t=n.root));Bi(t,0),RM()}function mDe(n){for(;n.left!==Mt;)n=n.left;return n}function RM(){Mt.parent=Mt,Mt.delta=0,Mt.start=0,Mt.end=0}function kC(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!==Mt&&(t.left.parent=e),t.parent=e.parent,e.parent===Mt?n.root=t:e===e.parent.left?e.parent.left=t:e.parent.right=t,t.left=e,e.parent=t,Jf(e),Jf(t)}function DC(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!==Mt&&(t.right.parent=e),t.parent=e.parent,e.parent===Mt?n.root=t:e===e.parent.right?e.parent.right=t:e.parent.left=t,t.right=e,e.parent=t,Jf(e),Jf(t)}function WJ(n){let e=n.end;if(n.left!==Mt){const t=n.left.maxEnd;t>e&&(e=t)}if(n.right!==Mt){const t=n.right.maxEnd+n.delta;t>e&&(e=t)}return e}function Jf(n){n.maxEnd=WJ(n)}function Nh(n){for(;n!==Mt;){const e=WJ(n);if(n.maxEnd===e)return;n.maxEnd=e,n=n.parent}}function _De(n,e,t,i){return n===t?e-i:n-t}class LO{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!==St)return b9(this.right);let e=this;for(;e.parent!==St&&e.parent.left!==e;)e=e.parent;return e.parent===St?St:e.parent}prev(){if(this.left!==St)return VJ(this.left);let e=this;for(;e.parent!==St&&e.parent.right!==e;)e=e.parent;return e.parent===St?St:e.parent}detach(){this.parent=null,this.left=null,this.right=null}}const St=new LO(null,0);St.parent=St;St.left=St;St.right=St;St.color=0;function b9(n){for(;n.left!==St;)n=n.left;return n}function VJ(n){for(;n.right!==St;)n=n.right;return n}function C9(n){return n===St?0:n.size_left+n.piece.length+C9(n.right)}function w9(n){return n===St?0:n.lf_left+n.piece.lineFeedCnt+w9(n.right)}function PM(){St.parent=St}function EC(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!==St&&(t.left.parent=e),t.parent=e.parent,e.parent===St?n.root=t:e.parent.left===e?e.parent.left=t:e.parent.right=t,t.left=e,e.parent=t}function IC(n,e){const t=e.left;e.left=t.right,t.right!==St&&(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===St?n.root=t:e===e.parent.right?e.parent.right=t:e.parent.left=t,t.right=e,e.parent=t}function OL(n,e){let t,i;if(e.left===St?(i=e,t=i.right):e.right===St?(i=e,t=i.left):(i=b9(e.right),t=i.right),i===n.root){n.root=t,t.color=0,e.detach(),PM(),n.root.parent=St;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,q1(n,t)):(i.parent===e?t.parent=i:t.parent=i.parent,q1(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!==St&&(i.left.parent=i),i.right!==St&&(i.right.parent=i),i.size_left=e.size_left,i.lf_left=e.lf_left,q1(n,i)),e.detach(),t.parent.left===t){const r=C9(t),a=w9(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,iu(n,t.parent,l,c)}}if(q1(n,t.parent),s){PM();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,EC(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,IC(n,o),o=t.parent.right),o.color=t.parent.color,t.parent.color=0,o.right.color=0,EC(n,t.parent),t=n.root)):(o=t.parent.left,o.color===1&&(o.color=0,t.parent.color=1,IC(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,EC(n,o),o=t.parent.left),o.color=t.parent.color,t.parent.color=0,o.left.color=0,IC(n,t.parent),t=n.root));t.color=0,PM()}function U$(n,e){for(q1(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,EC(n,e)),e.parent.color=0,e.parent.parent.color=1,IC(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,IC(n,e)),e.parent.color=0,e.parent.parent.color=1,EC(n,e.parent.parent))}n.root.color=0}function iu(n,e,t,i){for(;e!==n.root&&e!==St;)e.parent.left===e&&(e.parent.size_left+=t,e.parent.lf_left+=i),e=e.parent}function q1(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=C9(e.left)-e.size_left,i=w9(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 Kd=65535;function HJ(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 vDe{constructor(e,t,i,s,o){this.lineStarts=e,this.cr=t,this.lf=i,this.crlf=s,this.isBasicASCII=o}}function ou(n,e=!0){const t=[0];let i=1;for(let s=0,o=n.length;s126)&&(r=!1)}const a=new vDe(HJ(n),i,s,o,r);return n.length=0,a}class rr{constructor(e,t,i,s,o){this.bufferIndex=e,this.start=t,this.end=i,this.lineFeedCnt=s,this.length=o}}class Cp{constructor(e,t){this.buffer=e,this.lineStarts=t}}class CDe{constructor(e,t){this._pieces=[],this._tree=e,this._BOM=t,this._index=0,e.root!==St&&e.iterate(e.root,i=>(i!==St&&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 wDe{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 yDe{constructor(e,t,i){this.create(e,t,i)}create(e,t,i){this._buffers=[new Cp("",[0])],this._lastChangeBufferPos={line:0,column:0},this.root=St,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=ou(e[o].buffer));const a=new rr(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 wDe(1),this._lastVisitedLine={lineNumber:0,value:""},this.computeBufferMetadata()}normalizeEOL(e){const t=Kd,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 Cp(l,ou(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 CDe(this,e)}getOffsetAt(e,t){let i=0,s=this.root;for(;s!==St;)if(s.left!==St&&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!==St;)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 Y(i+1,a+1)}return new Y(i+1,o.remainder+1)}else if(e-=t.size_left+t.piece.length,i+=t.lf_left+t.piece.lineFeedCnt,t.right===St){const o=this.getOffsetAt(i+1,1),r=s-e-o;return new Y(i+1,r+1)}else t=t.right;return new Y(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!==St;){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===St)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;fw+g,t.reset(0)):(b=h.buffer,C=w=>w,t.reset(g));do if(_=t.next(b),_){if(C(_.index)>=p)return d;this.positionInBuffer(e,C(_.index)-f,v);const w=this.getLineFeedCnt(e.piece.bufferIndex,o,v),y=v.line===o.line?v.column-o.column+s:v.column+1,L=y+_[0].length;if(u[d++]=gp(new I(i+w,y,i+w,L),_,l),C(_.index)+_[0].length>=p||d>=c)return d}while(_);return d}findMatchesLineByLine(e,t,i,s){const o=[];let r=0;const a=new sv(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),C=v[d.line+p],w=h===e.startLineNumber?e.startColumn:1;if(r=this.findMatchesInNode(f,a,h,w,d,this.positionInBuffer(f,C-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||V8(d,i,g,p,f))&&(a[r++]=new Lw(new I(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++]=gp(new I(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!==St){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 rr(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 rr(u.bufferIndex,p,u.end,this.getLineFeedCnt(u.bufferIndex,p,u.end),u.length-1),t+="\n"}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+="\n");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;tKd){const d=[];for(;e.length>Kd;){const h=e.charCodeAt(Kd-1);let f;h===13||h>=55296&&h<=56319?(f=e.substring(0,Kd-1),e=e.substring(Kd-1)):(f=e.substring(0,Kd),e=e.substring(Kd));const g=ou(f);d.push(new rr(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 Cp(f,g))}const u=ou(e);return d.push(new rr(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 Cp(e,u)),d}let t=this._buffers[0].buffer.length;const i=ou(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!==St;){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!==St;)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 rr(i.bufferIndex,i.start,r,l,u),iu(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 rr(i.bufferIndex,r,i.end,a,u),iu(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 rr(s.bufferIndex,s.start,c,d,u),iu(this,e,u-a,d-l);const h=new rr(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+="\n");const i=this.shouldCheckCRLF()&&this.startWithLF(t)&&this.endWithCR(e),s=this._buffers[0].buffer.length;this._buffers[0].buffer+=t;const o=ou(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!==St;)if(i.left!==St&&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!==St;){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==="\n")}startWithLF(e){if(typeof e=="string")return e.charCodeAt(0)===10;if(e===St||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===St||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 rr(e.piece.bufferIndex,e.piece.start,o,a,r),iu(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 rr(t.piece.bufferIndex,l,t.piece.end,d,c),iu(this,t,-1,-1),t.piece.length===0&&i.push(t);const u=this.createNewPieces("\r\n");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,C=this.getLineContent(v);C.length===0||C===b||bo(C)!==-1||g.push(v)}}return this._onDidChangeContent.fire(),new T1e(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 I(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]=Xf(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(Xv._sortOpsDescending);const t=[];for(let i=0;i0){const h=l.eolCount+1;h===1?u=new I(c,d,c,d+l.firstLineLength):u=new I(c,d,c+h-1,l.lastLineLength+1)}else u=new I(c,d,c,d);i=u.endLineNumber,s=u.endColumn,t.push(u),o=l}return t}static _sortOpsAscending(e,t){const i=I.compareRangesUsingEnds(e.range,t.range);return i===0?e.sortIndex-t.sortIndex:i}static _sortOpsDescending(e,t){const i=I.compareRangesUsingEnds(e.range,t.range);return i===0?t.sortIndex-e.sortIndex:-i}}class SDe{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?"\n":"\r\n":i>t/2?"\r\n":"\n"}create(e){const t=this._getEOL(e),i=this._chunks;if(this._normalizeEOL&&(t==="\r\n"&&(this._cr>0||this._lf>0)||t==="\n"&&(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=bDe(this._tmpLineStarts,e);this.chunks.push(new Cp(e,t.lineStarts)),this.cr+=t.cr,this.lf+=t.lf,this.crlf+=t.crlf,t.isBasicASCII||(this.isBasicASCII=!1,this.containsRTL||(this.containsRTL=Cb(e)),this.containsUnusualLineTerminators||(this.containsUnusualLineTerminators=IX(e)))}finish(e=!0){return this._finish(),new SDe(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=ou(e.buffer);e.lineStarts=t,this._previousChar===13&&this.cr++}}}class LDe{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=kDe(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 DDe(e,[t]))}finalize(){return this._tokens}}class EDe{constructor(e,t){this.tokenizationSupport=t,this.initialState=this.tokenizationSupport.getInitialState(),this.store=new DO(e)}getStartState(e){return this.store.getStartState(e,this.initialState)}getFirstInvalidLine(){return this.store.getFirstInvalidLine(this.initialState)}}class IDe extends EDe{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=h1(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=h1(this._languageIdCodec,s,this.tokenizationSupport,r,!0,i),l=new ts(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=h1(this._languageIdCodec,c,this.tokenizationSupport,l,!0,r);return new ts(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 xDe{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 Bt(e+1,i.endExclusive):i.endExclusive===e+1?this._ranges[t]=new Bt(i.start,e):this._ranges.splice(t,1,new Bt(i.start,e),new Bt(e+1,i.endExclusive))}}addRange(e){Bt.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 h1(n,e,t,i,s,o){let r=null;if(t)try{r=t.tokenizeEncoded(i,s,o.clone())}catch(a){Dt(a)}return r||(r=px(n.encodeLanguageId(e),o)),ts.convertToEndOffset(r.tokens,i.length),r}class NDe{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,yu(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 Ht(e,t))}}const ru=new Uint32Array(0).buffer;class Oc{static deleteBeginning(e,t){return e===null||e===ru?e:Oc.delete(e,0,t)}static deleteEnding(e,t){if(e===null||e===ru)return e;const i=bu(e),s=i[i.length-2];return Oc.delete(e,t,s)}static delete(e,t,i){if(e===null||e===ru||t===i)return e;const s=bu(e),o=s.length>>>1;if(t===0&&s[s.length-2]===i)return ru;const r=ts.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===ru)return e;if(e===ru)return t;if(e===null)return e;if(t===null)return null;const i=bu(e),s=bu(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=ts.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=Fs.getLanguageId(s[1])!==e),!o)return ru}if(!s||s.length===0){const o=new Uint32Array(2);return o[0]=t,o[1]=j$(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]=Oc.delete(this._lineTokens[t],e.startColumn-1,e.endColumn-1);return}this._lineTokens[t]=Oc.deleteEnding(this._lineTokens[t],e.startColumn-1);const i=e.endLineNumber-1;let s=null;i=this._len)){if(t===0){this._lineTokens[s]=Oc.insert(this._lineTokens[s],e.column-1,i);return}this._lineTokens[s]=Oc.deleteEnding(this._lineTokens[s],e.column-1),this._lineTokens[s]=Oc.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 y9{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=$T(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=y9._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 UE extends CJ{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 y9(this._languageService.languageIdCodec),this._onDidChangeLanguage=this._register(new j),this.onDidChangeLanguage=this._onDidChangeLanguage.event,this._onDidChangeLanguageConfiguration=this._register(new j),this.onDidChangeLanguageConfiguration=this._onDidChangeLanguageConfiguration.event,this._onDidChangeTokens=this._register(new j),this.onDidChangeTokens=this._onDidChangeTokens.event,this.grammarTokens=this._register(new ADe(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]=Xf(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 Rn("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]=UE._findLanguageBoundaries(s,o),l=fw(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]=UE._findLanguageBoundaries(s,o-1),u=fw(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 MDe(()=>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 DO(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=nn.get(this.getLanguageId());if(!r)return[null,null];let a;try{a=r.getInitialState()}catch(l){return Dt(l),[null,null]}return[r,a]},[s,o]=i();if(s&&o?this._tokenizer=new IDe(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 NDe(this._tokenizer,r),this._defaultBackgroundTokenizer.handleChanges()),s!=null&&s.backgroundTokenizerShouldOnlyVerifyTokens&&s.createBackgroundTokenizer?(this._debugBackgroundTokens=new qw(this._languageIdCodec),this._debugBackgroundStates=new DO(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]=Xf(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=Ht.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 kO,{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 kO;(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 Y(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 MDe extends te{get lineRanges(){return this._lineRanges}constructor(e){super(),this._refreshTokens=e,this.runner=this._register(new Si(()=>this.update(),50)),this._computedLineRanges=[],this._lineRanges=[]}update(){yn(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 RDe{constructor(){this.changeType=1}}class fc{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 fc(i.ownerId,i.range.startLineNumber,i.range.startColumn,i.options.before,0)),i.options.after&&i.options.after.content.length>0&&t.push(new fc(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 K${constructor(e,t,i){this.changeType=2,this.lineNumber=e,this.detail=t,this.injectedText=i}}class PDe{constructor(e,t){this.changeType=3,this.fromLineNumber=e,this.toLineNumber=t}}class ODe{constructor(e,t,i,s){this.changeType=4,this.injectedTexts=s,this.fromLineNumber=e,this.toLineNumber=t,this.detail=i}}class FDe{constructor(){this.changeType=5}}class Qv{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},OM=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},np;function WDe(n){const e=new $J;return e.acceptChunk(n),e.finish()}function VDe(n){const e=new $J;let t;for(;typeof(t=n.read())=="string";)e.acceptChunk(t);return e.finish()}function q$(n,e){let t;return typeof n=="string"?t=WDe(n):E1e(n)?t=VDe(n):t=n,t.create(e)}let FL=0;const HDe=999,$De=1e4;class zDe{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 f1=()=>{throw new Error("Invalid change accessor")};let Id=np=class extends te{static resolveOptions(e,t){if(t.detectIndentation){const i=F$(e,t.tabSize,t.insertSpaces);return new cD({tabSize:i.tabSize,indentSize:"tabSize",insertSpaces:i.insertSpaces,trimAutoWhitespace:t.trimAutoWhitespace,defaultEOL:t.defaultEOL,bracketPairColorizationOptions:t.bracketPairColorizationOptions})}return new cD(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 rl(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 j),this.onWillDispose=this._onWillDispose.event,this._onDidChangeDecorations=this._register(new GDe(f=>this.handleBeforeFireDecorationsChangedEvent(f))),this.onDidChangeDecorations=this._onDidChangeDecorations.event,this._onDidChangeOptions=this._register(new j),this.onDidChangeOptions=this._onDidChangeOptions.event,this._onDidChangeAttached=this._register(new j),this.onDidChangeAttached=this._onDidChangeAttached.event,this._onDidChangeInjectedText=this._register(new j),this._eventEmitter=this._register(new YDe),this._languageSelectionListener=this._register(new Ts),this._deltaDecorationCallCnt=0,this._attachedViews=new ZDe,FL++,this.id="$model"+FL,this.isForSimpleWidget=i.isForSimpleWidget,typeof s>"u"||s===null?this._associatedResource=ct.parse("inmemory://model/"+FL):this._associatedResource=s,this._attachedEditorCount=0;const{textBuffer:l,disposable:c}=q$(e,i.defaultEOL);this._buffer=l,this._bufferDisposable=c,this._options=np.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 Uke(this,this._languageConfigurationService)),this._guidesTextModelPart=this._register(new BLe(this,this._languageConfigurationService)),this._decorationProvider=this._register(new Kke(this)),this._tokenizationTextModelPart=new UE(this._languageService,this._languageConfigurationService,this,this._bracketPairs,d,this._attachedViews);const u=this._buffer.getLineCount(),h=this._buffer.getValueLengthInRange(new I(1,1,u,this._buffer.getLineLength(u)+1),0);i.largeFileOptimizations?(this._isTooLargeForTokenization=h>np.LARGE_FILE_SIZE_THRESHOLD||u>np.LARGE_FILE_LINE_COUNT_THRESHOLD,this._isTooLargeForHeapOperation=h>np.LARGE_FILE_HEAP_OPERATION_THRESHOLD):(this._isTooLargeForTokenization=!1,this._isTooLargeForHeapOperation=!1),this._isTooLargeForSyncing=h>np._MODEL_SYNC_LIMIT,this._versionId=1,this._alternativeVersionId=1,this._initialUndoRedoSnapshot=null,this._isDisposed=!1,this.__isDisposing=!1,this._instanceId=TX(FL),this._lastDecorationId=0,this._decorations=Object.create(null),this._decorationsTree=new G$,this._commandManager=new v9(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 Xv([],"","\n",!1,!1,!0,!0);e.dispose(),this._buffer=e,this._bufferDisposable=te.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 qp(e,t)))}setValue(e){if(this._assertNotDisposed(),e==null)throw La();const{textBuffer:t,disposable:i}=q$(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 G$,this._commandManager.clear(),this._trimAutoWhitespaceLines=null,this._emitContentChangedEvent(new Qv([new RDe],this._versionId,!1,!1),this._createContentChanged2(new I(1,1,o,r),0,s,this.getValue(),!1,!1,!0,!1))}setEOL(e){this._assertNotDisposed();const t=e===1?"\r\n":"\n";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 Qv([new FDe],this._versionId,!1,!1),this._createContentChanged2(new I(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>=$De?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 cD({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=F$(this._buffer,t,e);this.updateOptions({insertSpaces:i.insertSpaces,tabSize:i.tabSize,indentSize:i.tabSize})}normalizeIndentation(e){return this._assertNotDisposed(),OE(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(EX.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 Rn("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 zDe(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 Rn("Illegal value for lineNumber");return this._buffer.getLineContent(e)}getLineLength(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new Rn("Illegal value for lineNumber");return this._buffer.getLineLength(e)}getLinesContent(){if(this._assertNotDisposed(),this.isTooLargeForHeapOperation())throw new Rn("Operation would exceed heap memory limits");return this._buffer.getLinesContent()}getEOL(){return this._assertNotDisposed(),this._buffer.getEOL()}getEndOfLineSequence(){return this._assertNotDisposed(),this._buffer.getEOL()==="\n"?0:1}getLineMinColumn(e){return this._assertNotDisposed(),1}getLineMaxColumn(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new Rn("Illegal value for lineNumber");return this._buffer.getLineLength(e)+1}getLineFirstNonWhitespaceColumn(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new Rn("Illegal value for lineNumber");return this._buffer.getLineFirstNonWhitespaceColumn(e)}getLineLastNonWhitespaceColumn(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new Rn("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 I&&!(e instanceof Je)?e:new I(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(es(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 Y(1,1);if(s>r)return new Y(r,this.getLineMaxColumn(r));if(o<=1)return new Y(s,1);const a=this.getLineMaxColumn(s);if(o>=a)return new Y(s,a);if(i===1){const l=this._buffer.getLineCharCode(s,o-2);if(es(l))return new Y(s,o-1)}return new Y(s,o)}validatePosition(e){return this._assertNotDisposed(),e instanceof Y&&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=es(a),d=es(l);return!c&&!d}return!0}validateRange(e){if(this._assertNotDisposed(),e instanceof I&&!(e instanceof Je)&&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=es(c),h=es(d);return!u&&!h?new I(o,r,a,l):o===a&&r===l?new I(o,r-1,a,l-1):u&&h?new I(o,r-1,a,l+1):u?new I(o,r-1,a,l):new I(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 I(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=HDe){this._assertNotDisposed();let l=null;t!==null&&(Array.isArray(t)||(t=[t]),t.every(u=>I.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)=>I.areIntersecting(u,h)?u.plusRange(h):(c.push(u),h)));let d;if(!i&&e.indexOf("\n")<0){const h=new ip(e,i,s,o).parseSearchRequest();if(!h)return[];d=f=>this.findMatchesLineByLine(f,h,r,a)}else d=u=>yL.findMatches(this,new ip(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("\n")<0){const c=new ip(e,i,s,o).parseSearchRequest();if(!c)return null;const d=this.getLineCount();let u=new I(a.lineNumber,a.column,d,this.getLineMaxColumn(d)),h=this.findMatchesLineByLine(u,c,r,1);return yL.findNextMatch(this,new ip(e,i,s,o),a,r),h.length>0||(u=new I(1,1,a.lineNumber,this.getLineMaxColumn(a.lineNumber)),h=this.findMatchesLineByLine(u,c,r,1),h.length>0)?h[0]:null}return yL.findNextMatch(this,new ip(e,i,s,o),a,r)}findPreviousMatch(e,t,i,s,o,r){this._assertNotDisposed();const a=this.validatePosition(t);return yL.findPreviousMatch(this,new ip(e,i,s,o),a,r)}pushStackElement(){this._commandManager.pushStackElement()}popStackElement(){this._commandManager.popStackElement()}pushEOL(e){if((this.getEOL()==="\n"?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 mM?e:new mM(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)==="\n")&&!(c===g.startLineNumber&&g.startColumn===1&&g.isEmpty()&&p&&p.length>0&&p.charAt(p.length-1)==="\n")){u=!1;break}}if(u){const h=new I(c,1,c,d);t.push(new mM(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 I(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 I(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;D--){const x=f+D,A=C+D;k.takeFromEndWhile(P=>P.lineNumber>A);const T=k.takeFromEndWhile(P=>P.lineNumber===A);a.push(new K$(x,this.getLineContent(A),T))}if(vJ.lineNumberJ.lineNumber===X)}a.push(new ODe(x+1,f+_,W,P))}l+=b}this._emitContentChangedEvent(new Qv(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 K$(s,this.getLineContent(s),this._getInjectedTextInLine(s)));this._onDidChangeInjectedText.fire(new zJ(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,Z$(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){Dt(o)}return i.addDecoration=f1,i.changeDecoration=f1,i.changeDecorationOptions=f1,i.removeDecoration=f1,i.deltaDecorations=f1,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."),Dt(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:Y$[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(Y$[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 I(a,1,l,c),u=this._getDecorationsInRange(d,i,s,o);return W2(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 W2(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 fc.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 UDe(this.getLineContent(e))+1}};Id._MODEL_SYNC_LIMIT=50*1024*1024;Id.LARGE_FILE_SIZE_THRESHOLD=20*1024*1024;Id.LARGE_FILE_LINE_COUNT_THRESHOLD=300*1e3;Id.LARGE_FILE_HEAP_OPERATION_THRESHOLD=256*1024*1024;Id.DEFAULT_CREATION_OPTIONS={isForSimpleWidget:!1,tabSize:Qs.tabSize,indentSize:Qs.indentSize,insertSpaces:Qs.insertSpaces,detectIndentation:!1,defaultEOL:1,trimAutoWhitespace:Qs.trimAutoWhitespace,largeFileOptimizations:Qs.largeFileOptimizations,bracketPairColorizationOptions:Qs.bracketPairColorizationOptions};Id=np=BDe([OM(4,Ix),OM(5,qi),OM(6,Ni)],Id);function UDe(n){let e=0;for(const t of n)if(t===" "||t===" ")e++;else break;return e}function FM(n){return!!(n.options.overviewRuler&&n.options.overviewRuler.color)}function BM(n){return!!n.options.after||!!n.options.before}class G${constructor(){this._decorationsTree0=new MM,this._decorationsTree1=new MM,this._injectedTextDecorationsTree=new MM}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){BM(e)?this._injectedTextDecorationsTree.insert(e):FM(e)?this._decorationsTree1.insert(e):this._decorationsTree0.insert(e)}delete(e){BM(e)?this._injectedTextDecorationsTree.delete(e):FM(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){BM(e)?this._injectedTextDecorationsTree.resolveNode(e,t):FM(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 qd(n){return n.replace(/[^a-z0-9\-_]/gi," ")}class jJ{constructor(e){this.color=e.color||"",this.darkColor=e.darkColor||""}}class jDe extends jJ{constructor(e){super(e),this._resolvedColor=null,this.position=typeof e.position=="number"?e.position:Qr.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 KDe{constructor(e){var t;this.position=(t=e==null?void 0:e.position)!==null&&t!==void 0?t:$v.Left}}class qDe extends jJ{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"?ee.fromHex(e):t.getColor(e.id)}}class eg{static from(e){return e instanceof eg?e:new eg(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 kt{static register(e){return new kt(e)}static createDynamic(e){return new kt(e)}constructor(e){var t,i,s,o,r,a;this.description=e.description,this.blockClassName=e.blockClassName?qd(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?qd(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 jDe(e.overviewRuler):null,this.minimap=e.minimap?new qDe(e.minimap):null,this.glyphMargin=e.glyphMarginClassName?new KDe(e.glyphMargin):null,this.glyphMarginClassName=e.glyphMarginClassName?qd(e.glyphMarginClassName):null,this.linesDecorationsClassName=e.linesDecorationsClassName?qd(e.linesDecorationsClassName):null,this.firstLineDecorationClassName=e.firstLineDecorationClassName?qd(e.firstLineDecorationClassName):null,this.marginClassName=e.marginClassName?qd(e.marginClassName):null,this.inlineClassName=e.inlineClassName?qd(e.inlineClassName):null,this.inlineClassNameAffectsLetterSpacing=e.inlineClassNameAffectsLetterSpacing||!1,this.beforeContentClassName=e.beforeContentClassName?qd(e.beforeContentClassName):null,this.afterContentClassName=e.afterContentClassName?qd(e.afterContentClassName):null,this.after=e.after?eg.from(e.after):null,this.before=e.before?eg.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}}kt.EMPTY=kt.register({description:"empty"});const Y$=[kt.register({description:"tracked-range-always-grows-when-typing-at-edges",stickiness:0}),kt.register({description:"tracked-range-never-grows-when-typing-at-edges",stickiness:1}),kt.register({description:"tracked-range-grows-only-when-typing-before",stickiness:2}),kt.register({description:"tracked-range-grows-only-when-typing-after",stickiness:3})];function Z$(n){return n instanceof kt?n:kt.createDynamic(n)}class GDe extends te{constructor(e){super(),this.handleBeforeFire=e,this._actual=this._register(new j),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 YDe extends te{constructor(){super(),this._fastEmitter=this._register(new j),this.fastEvent=this._fastEmitter.event,this._slowEmitter=this._register(new j),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 ZDe{constructor(){this._onDidChangeVisibleRanges=new j,this.onDidChangeVisibleRanges=this._onDidChangeVisibleRanges.event,this._views=new Set}attachView(){const e=new XDe(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 XDe{constructor(e){this.handleStateChange=e}setVisibleLines(e,t){const i=e.map(s=>new Ht(s.startLineNumber,s.endLineNumber+1));this.handleStateChange({visibleLineRanges:i,stabilized:t})}}class jE{constructor(e){this._selTrackedRange=null,this._trackSelection=!0,this._setState(e,new Cs(new I(1,1,1,1),0,0,new Y(1,1),0),new Cs(new I(1,1,1,1),0,0,new Y(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 Qt(this.modelState,this.viewState)}readSelectionFromMarkers(e){const t=e.model._getTrackedRange(this._selTrackedRange);return this.modelState.selection.isEmpty()&&!t.isEmpty()?Je.fromRange(t.collapseToEnd(),this.modelState.selection.getDirection()):Je.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 Cs(I.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=jE._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 Cs(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 Cs(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 Cs(s,t.selectionStartKind,t.selectionStartLeftoverVisibleColumns,o,t.leftoverVisibleColumns)}else{const s=e.coordinatesConverter.convertModelPositionToViewPosition(new Y(t.selectionStart.startLineNumber,t.selectionStart.startColumn)),o=e.coordinatesConverter.convertModelPositionToViewPosition(new Y(t.selectionStart.endLineNumber,t.selectionStart.endColumn)),r=new I(s.lineNumber,s.column,o.lineNumber,o.column),a=e.coordinatesConverter.convertModelPositionToViewPosition(t.position);i=new Cs(r,t.selectionStartKind,t.selectionStartLeftoverVisibleColumns,a,t.leftoverVisibleColumns)}this.modelState=t,this.viewState=i,this._updateTrackedRange(e)}}class X${constructor(e){this.context=e,this.cursors=[new jE(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 W1e(this.cursors,Sa(e=>e.viewState.position,Y.compare)).viewState.position}getBottomMostViewPosition(){return B1e(this.cursors,Sa(e=>e.viewState.position,Y.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(Qt.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,I.compareRangesUsingStarts));for(let i=0;iu&&p.index--;e.splice(u,1),t.splice(d,1),this._removeSecondaryCursor(u-1),i--}}}}class Q${constructor(e,t,i,s){this._cursorContextBrand=void 0,this.model=e,this.viewModel=t,this.coordinatesConverter=i,this.cursorConfig=s}}class QDe{constructor(){this.type=0}}class JDe{constructor(){this.type=1}}class eEe{constructor(e){this.type=2,this._source=e}hasChanged(e){return this._source.hasChanged(e)}}class tEe{constructor(e,t,i){this.selections=e,this.modelSelections=t,this.reason=i,this.type=3}}class I_{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 BL{constructor(){this.type=5}}class iEe{constructor(e){this.type=6,this.isFocused=e}}class nEe{constructor(){this.type=7}}class WL{constructor(){this.type=8}}class KJ{constructor(e,t){this.fromLineNumber=e,this.count=t,this.type=9}}class EO{constructor(e,t){this.type=10,this.fromLineNumber=e,this.toLineNumber=t}}class IO{constructor(e,t){this.type=11,this.fromLineNumber=e,this.toLineNumber=t}}class vD{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 sEe{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 oEe{constructor(e){this.theme=e,this.type=14}}class rEe{constructor(e){this.type=15,this.ranges=e}}class aEe{constructor(){this.type=16}}let lEe=class{constructor(){this.type=17}};class cEe extends te{constructor(){super(),this._onEvent=this._register(new j),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 dEe{constructor(){this.viewEvents=[],this.outgoingEvents=[]}emitViewEvent(e){this.viewEvents.push(e)}emitOutgoingEvent(e){this.outgoingEvents.push(e)}}class S9{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 S9(this._oldContentWidth,this._oldContentHeight,e.contentWidth,e.contentHeight)}}class L9{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 L9(this.oldHasFocus,e.hasFocus)}}class k9{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 k9(this._oldScrollWidth,this._oldScrollLeft,this._oldScrollHeight,this._oldScrollTop,e.scrollWidth,e.scrollLeft,e.scrollHeight,e.scrollTop)}}class uEe{constructor(){this.kind=3}isNoOp(){return!1}attemptToMerge(e){return e.kind!==this.kind?null:this}}class hEe{constructor(){this.kind=4}isNoOp(){return!1}attemptToMerge(e){return e.kind!==this.kind?null:this}}class KE{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=TC.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=I.fromPositions(a[0],a[0]),e.emitViewEvent(new vD(t,i,l,c,s,o,r))}saveState(){const e=[],t=this._cursors.getSelections();for(let i=0,s=t.length;i0){const o=Qt.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,Qt.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,Qt.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=TC.from(this._model,this);if(r.equals(s))return!1;const a=this._cursors.getSelections(),l=this._cursors.getViewSelections();if(e.emitViewEvent(new tEe(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 KE(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=TC.from(this._model,this);this._cursors.stopTrackingSelections(),this._isHandling=!0;try{this._cursors.ensureValidState(),e()}catch(r){Dt(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 J$.getAllAutoClosedCharacters(this._autoClosedActions)}startComposition(e){this._compositionState=new xC(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(Qi.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 Je(c.lineNumber,c.column+o,c.lineNumber,c.column+o)});this.setSelections(e,r,a,0)}return}this._executeEdit(()=>{this._executeEditOperation(Qi.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(Qi.paste(this.context.cursorConfig,this._model,this.getSelections(),t,i,s||[]))},e,o,4)}cut(e,t){this._executeEdit(()=>{this._executeEditOperation(um.cut(this.context.cursorConfig,this._model,this.getSelections()))},e,t)}executeCommand(e,t,i){this._executeEdit(()=>{this._cursors.killSecondaryCursors(),this._executeEditOperation(new Uo(0,[t],{shouldPushStackElementBefore:!1,shouldPushStackElementAfter:!1}))},e,i)}executeCommands(e,t,i){this._executeEdit(()=>{this._executeEditOperation(new Uo(0,t,{shouldPushStackElementBefore:!1,shouldPushStackElementAfter:!1}))},e,i)}}class TC{static from(e,t){return new TC(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 wEe{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 Je(_.startLineNumber,_.startColumn,_.endLineNumber,_.endColumn):new Je(_.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{I.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=Je.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 Dt(u),{operations:[],hadTrackedEditOperation:!1}}return{operations:s,hadTrackedEditOperation:a}}static _getLoserCursorMap(e){e=e.slice(0),e.sort((i,s)=>-I.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 yEe{constructor(e,t,i){this.text=e,this.startSelection=t,this.endSelection=i}}class xC{static _capture(e,t){const i=[];for(const s of t){if(s.startLineNumber!==s.endLineNumber)return null;i.push(new yEe(e.getLineContent(s.startLineNumber),s.startColumn-1,s.endColumn-1))}return i}constructor(e,t){this._original=xC._capture(e,t)}deduceOutcome(e,t){if(!this._original)return null;const i=xC._capture(e,t);if(!i||this._original.length!==i.length)return null;const s=[];for(let o=0,r=this._original.length;oEb,tokenizeEncoded:(n,e,t)=>px(0,t)};function LEe(n,e,t){return SEe(this,void 0,void 0,function*(){if(!t)return tz(e,n.languageIdCodec,ez);const i=yield nn.getOrCreate(t);return tz(e,n.languageIdCodec,i||ez)})}function kEe(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+='').concat(g,""),f>s||l>=s)break}return a+="
",a}function tz(n,e,t){let i='
';const s=Sd(n);let o=t.getInitialState();for(let r=0,a=s.length;r0&&(i+="
");const c=t.tokenizeEncoded(l,!0,o);ts.convertToEndOffset(c.tokens,l.length);const u=new ts(c.tokens,l,e).inflate();let h=0;for(let f=0,g=u.getCount();f').concat(gE(l.substring(h,_)),""),h=_}o=c.endState}return i+="
",i}class DEe{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 EEe{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 qJ=class TO{constructor(e,t,i,s){this._instanceId=TX(++TO.INSTANCE_COUNT),this._pendingChanges=new DEe,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 EEe(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=TO.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 y=s;y<=r;y++){if(v===-1){const L=u,S=u+i;(L<=_&&__)&&(v=y)}for(u+=i,p[y-s]=h,h+=i;d===y;)h+=c,u+=c,a++,a>=l?d=r+1:(d=this.getAfterLineNumberForWhitespaceIndex(a)|0,c=this.getHeightForWhitespaceIndex(a)|0);if(u>=t){r=y;break}}v===-1&&(v=r);const b=this.getVerticalOffsetForLineNumber(r)|0;let C=s,w=r;return Ct&&w--,{bigNumbersDelta:g,startLineNumber:s,endLineNumber:r,relativeVerticalOffset:p,centeredLineNumber:v,completelyVisibleStartLineNumber:C,completelyVisibleEndLineNumber:w}}getVerticalOffsetForWhitespaceIndex(e){this._checkPendingChanges(),e=e|0;const t=this.getAfterLineNumberForWhitespaceIndex(e);let i;t>=1?i=this._lineHeight*t:i=0;let 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}};qJ.INSTANCE_COUNT=0;const IEe=125;class G1{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 TEe extends te{constructor(e,t){super(),this._onDidContentSizeChange=this._register(new j),this.onDidContentSizeChange=this._onDidContentSizeChange.event,this._dimensions=new G1(0,0,0,0),this._scrollable=this._register(new vS({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 S9(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 xEe extends te{constructor(e,t,i){super(),this._configuration=e;const s=this._configuration.options,o=s.get(143),r=s.get(83);this._linesLayout=new qJ(t,s.get(66),r.top,r.bottom),this._maxLineWidth=0,this._overlayWidgetsMinWidth=0,this._scrollable=this._register(new TEe(0,i)),this._configureSmoothScrollDuration(),this._scrollable.setScrollDimensions(new G1(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)?IEe: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 G1(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 G1(t,e.contentWidth,i,this._getContentHeight(t,i,s)))}getCurrentViewport(){const e=this._scrollable.getScrollDimensions(),t=this._scrollable.getCurrentScrollPosition();return new GH(t.scrollTop,t.scrollLeft,e.width,e.height)}getFutureViewport(){const e=this._scrollable.getScrollDimensions(),t=this._scrollable.getFutureScrollPosition();return new GH(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 G1(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 NEe{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 Y(s.startLineNumber,1),0,!1,!0),l=this._coordinatesConverter.convertModelPositionToViewPosition(new Y(s.endLineNumber,this.model.getLineMaxColumn(s.endLineNumber)),1);r=new I(a.lineNumber,a.column,l.lineNumber,l.column)}else r=this._coordinatesConverter.convertModelRangeToViewRange(s,1);i=new PQ(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 I(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,aE(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 I9(n,e){return GJ(n,e.range,t=>t===2)}function GJ(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 WM(n,e){return n===null?e?qE.INSTANCE:GE.INSTANCE:new AEe(n,e)}class AEe{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 fc(0,0,c+1,this._projectionData.injectionOptions[d],0));r=fc.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=iz(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,k=S+Math.max(w-v,0),D=S+Math.min(y-v,b-v);k!==D&&_.push(new BCe(k,D,L.inlineClassName,L.inlineClassNameAffectsLetterSpacing))}}if(y<=b)f+=C,g++;else break}}}let h;c?h=e.tokenization.getLineTokens(t).withInserted(c.map((f,g)=>({offset:f,text:d[g].content,tokenMetadata:ts.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=iz(s.wrappedTextIndentLength)+c);const d=this._projectionData.getMinOutputOffset(i)+1,u=c.length+1,h=i+1=VM.length)for(let e=1;e<=n;e++)VM[e]=MEe(e);return VM[n]}function MEe(n){return new Array(n+1).join(" ")}class REe{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 OEe(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 Ku(fc.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(I.compareRangesUsingStarts);let u=1,h=0,f=-1,g=f+1=u&&_<=h,b=WM(l[p],!v);c[p]=b.getViewLineCount(),this.modelLineProjections[p]=b}this._validModelVersionId=this.model.getVersionId(),this.projectedModelLineLineCounts=new v1e(c)}getHiddenAreas(){return this.hiddenAreasDecorationIds.map(e=>this.model.getDecorationRange(e))}setHiddenAreas(e){const t=e.map(h=>this.model.validateRange(h)),i=PEe(t),s=this.hiddenAreasDecorationIds.map(h=>this.model.getDecorationRange(h)).sort(I.compareRangesUsingStarts);if(i.length===s.length){let h=!1;for(let f=0;f({range:h,options:kt.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 nz(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 Y(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 Y(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 Ap(f.visibleColumn,g,f.className,new yC(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 C=0;b>1&&p.getViewLineMinColumn(this.model,g+1,v)===1&&(C=_===0?1:2),r.push(b),a.push(C),d===null&&(d=new Y(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 Y(o+1,d)).equals(i)?new Y(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 I(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 Y(i.modelLineNumber,s))}convertViewRangeToModelRange(e){const t=this.convertViewPositionToModelPosition(e.startLineNumber,e.startColumn),i=this.convertViewPositionToModelPosition(e.endLineNumber,e.endColumn);return new I(t.lineNumber,t.column,i.lineNumber,i.column)}convertModelPositionToViewPosition(e,t,i=2,s=!1,o=!1){const r=this.model.validatePosition(new Y(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 Y(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 I.fromPositions(i)}else{const i=this.convertModelPositionToViewPosition(e.startLineNumber,e.startColumn,1),s=this.convertModelPositionToViewPosition(e.endLineNumber,e.endColumn,0);return new I(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 I(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 Y(p+1,p===c?r.column:1));else if(u!==null){const v=this.model.getLineMaxColumn(p);l=l.concat(this.model.getDecorationsInRange(new I(u.lineNumber,u.column,p,v),t,i,s)),u=null}u!==null&&(l=l.concat(this.model.getDecorationsInRange(new I(u.lineNumber,u.column,a.lineNumber,a.column),t,i,s)),u=null),l.sort((p,_)=>{const v=I.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 PEe(n){if(n.length===0)return[];const e=n.slice();e.sort(I.compareRangesUsingStarts);const t=[];let i=e[0].startLineNumber,s=e[0].endLineNumber;for(let o=1,r=e.length;os+1?(t.push(new I(i,1,s,1)),i=a.startLineNumber,s=a.endLineNumber):a.endLineNumber>s&&(s=a.endLineNumber)}return t.push(new I(i,1,s,1)),t}class nz{constructor(e,t){this.modelLineNumber=e,this.modelLineWrappedLineIdx=t}}class sz{constructor(e,t){this.modelRange=e,this.viewLines=t}}class OEe{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 FEe{constructor(e){this.model=e}dispose(){}createCoordinatesConverter(){return new BEe(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 EO(t,i)}onModelLinesInserted(e,t,i,s){return new IO(t,i)}onModelLineChanged(e,t,i){return[!1,new KJ(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 WEe=class extends te{constructor(e,t,i,s,o,r,a,l,c){if(super(),this.languageConfigurationService=a,this._themeService=l,this._attachedView=c,this.hiddenAreasModel=new HEe,this.previousHiddenAreas=[],this._editorId=e,this._configuration=t,this.model=i,this._eventDispatcher=new cEe,this.onEvent=this._eventDispatcher.onEvent,this.cursorConfig=new L_(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._updateConfigurationViewLineCount=this._register(new Si(()=>this._updateConfigurationViewLineCountNow(),0)),this._hasFocus=!1,this._viewportStart=T9.create(this.model),this.model.isTooLargeForTokenization())this._lines=new FEe(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 REe(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 CEe(i,this,this.coordinatesConverter,this.cursorConfig)),this.viewLayout=this._register(new xEe(this._configuration,this.getLineCount(),r)),this._register(this.viewLayout.onDidScroll(d=>{d.scrollTopChanged&&this._handleVisibleLinesChanged(),d.scrollTopChanged&&this._viewportStart.invalidate(),this._eventDispatcher.emitSingleViewEvent(new sEe(d)),this._eventDispatcher.emitOutgoingEvent(new k9(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 NEe(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(SS.getInstance().onDidChange(()=>{this._eventDispatcher.emitSingleViewEvent(new aEe)})),this._register(this._themeService.onDidColorThemeChange(d=>{this._invalidateDecorationsColorCache(),this._eventDispatcher.emitSingleViewEvent(new oEe(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 I(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 iEe(e)),this._eventDispatcher.emitOutgoingEvent(new L9(!e,e))}onCompositionStart(){this._eventDispatcher.emitSingleViewEvent(new QDe)}onCompositionEnd(){this._eventDispatcher.emitSingleViewEvent(new JDe)}_captureStableViewport(){if(this._viewportStart.isValid&&this.viewLayout.getCurrentScrollTop()>0){const e=new Y(this._viewportStart.viewLineNumber,this.getLineMinColumn(this._viewportStart.viewLineNumber)),t=this.coordinatesConverter.convertViewPositionToModelPosition(e);return new rz(t,this._viewportStart.startLineDelta)}return new rz(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 BL),e.emitViewEvent(new WL),e.emitViewEvent(new I_(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 I_(null))),e.emitViewEvent(new eEe(t)),this.viewLayout.onConfigurationChanged(t),i.recoverViewportStart(this.coordinatesConverter,this.viewLayout),L_.shouldRecreate(t)&&(this.cursorConfig=new L_(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 qp?e.rawContentChangedEvent.changes:e.changes,a=e instanceof qp?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 Ku(c);for(const u of r)switch(u.changeType){case 1:{this._lines.onModelFlushed(),i.emitViewEvent(new BL),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 WL),i.emitViewEvent(new I_(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 qp&&i.emitOutgoingEvent(new _Ee(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 nEe),this.cursorConfig=new L_(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._cursor.updateConfiguration(this.cursorConfig),this._eventDispatcher.emitOutgoingEvent(new mEe(e))})),this._register(this.model.onDidChangeLanguage(e=>{this.cursorConfig=new L_(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._cursor.updateConfiguration(this.cursorConfig),this._eventDispatcher.emitOutgoingEvent(new pEe(e))})),this._register(this.model.onDidChangeOptions(e=>{if(this._lines.setTabSize(this.model.getOptions().tabSize)){try{const t=this._eventDispatcher.beginEmitViewEvents();t.emitViewEvent(new BL),t.emitViewEvent(new WL),t.emitViewEvent(new I_(null)),this._cursor.onLineMappingChanged(t),this._decorations.onLineMappingChanged(),this.viewLayout.onFlushed(this.getLineCount())}finally{this._eventDispatcher.endEmitViewEvents()}this._updateConfigurationViewLineCount.schedule()}this.cursorConfig=new L_(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._cursor.updateConfiguration(this.cursorConfig),this._eventDispatcher.emitOutgoingEvent(new vEe(e))})),this._register(this.model.onDidChangeDecorations(e=>{this._decorations.onModelDecorationsChanged(),this._eventDispatcher.emitSingleViewEvent(new I_(e)),this._eventDispatcher.emitOutgoingEvent(new gEe(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 BL),r.emitViewEvent(new WL),r.emitViewEvent(new I_(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 hEe)}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 I(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=bo(this.getLineContent(e));return t===-1?0:t+1}getLineLastNonWhitespaceColumn(e){const t=oc(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 Jr(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 FCe(this.getTabSize(),s)}getAllOverviewRulerDecorations(e){const t=this.model.getOverviewRulerDecorations(this._editorId,aE(this._configuration.options)),i=new VEe;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\n":this.model.getEOL();e=e.slice(0),e.sort(I.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===Yr||e.length!==1)return null;let s=e[0];if(s.isEmpty()){if(!t)return null;const d=s.startLineNumber;s=new I(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===wr.fontFamily;let c;return l?c=wr.fontFamily:(c=o.fontFamily,c=c.replace(/"/g,"'"),/[,']/.test(c)||/[+ ]/.test(c)&&(c="'".concat(c,"'")),c="".concat(c,", ").concat(wr.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+=kEe(u,d.inflate(),t,h,f,a,zs)}return l}_getColorMap(){const e=nn.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 fEe);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 I(t.lineNumber,t.column,t.lineNumber,t.column);this._withViewEventsCollector(s=>s.emitViewEvent(new vD(e,!1,i,null,0,!0,0)))}revealBottomMostCursor(e){const t=this._cursor.getBottomMostViewPosition(),i=new I(t.lineNumber,t.column,t.lineNumber,t.column);this._withViewEventsCollector(s=>s.emitViewEvent(new vD(e,!1,i,null,0,!0,0)))}revealRange(e,t,i,s,o){this._withViewEventsCollector(r=>r.emitViewEvent(new vD(e,!1,i,null,s,t,o)))}changeWhitespace(e){this.viewLayout.changeWhitespace(e)&&(this._eventDispatcher.emitSingleViewEvent(new lEe),this._eventDispatcher.emitOutgoingEvent(new uEe))}_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 T9{static create(e){const t=e._setTrackedRange(null,new I(1,1,1,1),1);return new T9(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 Y(t,e.getLineMinColumn(t))),s=e.model._setTrackedRange(this._modelTrackedRange,new I(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 VEe{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 Tw(e,t,[o,i,s]);this._asMap[e]=a,this.asArray.push(a)}}}class HEe{constructor(){this.hiddenAreas=new Map,this.shouldRecompute=!1,this.ranges=[]}setHiddenAreas(e,t){const i=this.hiddenAreas.get(e);i&&oz(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)=>$Ee(t,i),[]);return oz(this.ranges,e)?this.ranges:(this.ranges=e,this.ranges)}}function $Ee(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 VL(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 VL(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&&az(this.injectionOptions[i.injectedTextIndex].cursorStops))return i.offsetInInputWithInjections+i.length;{let s=i.offsetInInputWithInjections;if(lz(this.injectionOptions[i.injectedTextIndex].cursorStops))return s;let o=i.injectedTextIndex-1;for(;o>=0&&this.injectionOffsets[o]===this.injectionOffsets[i.injectedTextIndex]&&!(az(this.injectionOptions[o].cursorStops)||(s-=this.injectionOptions[o].content.length,lz(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}tx()}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 az(n){return n==null?!0:n===Jl.Right||n===Jl.Both}function lz(n){return n==null?!0:n===Jl.Left||n===Jl.Both}class VL{constructor(e,t){this.outputLineIndex=e,this.outputOffset=t}toString(){return"".concat(this.outputLineIndex,":").concat(this.outputOffset)}toPosition(e){return new Y(e+this.outputLineIndex,this.outputOffset+1)}}class x9{static create(e){return new x9(e.get(132),e.get(131))}constructor(e,t){this.classifier=new UEe(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 xO=[],NO=[];function jEe(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=YJ(t,i,s,o,r),f=s-h,g=xO,p=NO;let _=0,v=0,b=0,C=s;const w=d.length;let y=0;if(y>=0){let L=Math.abs(u[y]-C);for(;y+1=L)break;L=S,y++}}for(;yL&&(L=v,S=b);let k=0,D=0,x=0,A=0;if(S<=C){let P=S,W=L===0?0:t.charCodeAt(L-1),$=L===0?0:n.get(W),X=!0;for(let J=L;Jv&&AO(W,$,le,de,c)&&(k=Q,D=P),P+=_e,P>C){Q>v?(x=Q,A=P-_e):(x=J+1,A=P),P-D>f&&(k=0),X=!1;break}W=le,$=de}if(X){_>0&&(g[_]=d[d.length-1],p[_]=u[d.length-1],_++);break}}if(k===0){let P=S,W=t.charCodeAt(L),$=n.get(W),X=!1;for(let J=L-1;J>=v;J--){const Q=J+1,le=t.charCodeAt(J);if(le===9){X=!0;break}let de,_e;if(rm(le)?(J--,de=0,_e=2):(de=n.get(le),_e=zf(le)?o:1),P<=C){if(x===0&&(x=Q,A=P),P<=C-f)break;if(AO(le,de,W,$,c)){k=Q,D=P;break}}P-=_e,W=le,$=de}if(k!==0){const J=f-(A-D);if(J<=i){const Q=t.charCodeAt(x);let le;es(Q)?le=2:le=AC(Q,A,i,o),J-le<0&&(k=0)}}if(X){y--;continue}}if(k===0&&(k=x,D=A),k<=v){const P=t.charCodeAt(v);es(P)?(k=v+2,D=b+2):(k=v+1,D=b+AC(P,b,i,o))}for(v=k,g[_]=k,b=D,p[_]=D,_++,C=D+f;y<0||y=T)break;T=P,y++}}return _===0?null:(g.length=_,p.length=_,xO=e.breakOffsets,NO=e.breakOffsetsVisibleColumn,e.breakOffsets=g,e.breakOffsetsVisibleColumn=p,e.wrappedTextIndentLength=h,e)}function KEe(n,e,t,i,s,o,r,a){const l=fc.applyInjectedText(e,t);let c,d;if(t&&t.length>0?(c=t.map(D=>D.options),d=t.map(D=>D.column-1)):(c=null,d=null),s===-1)return c?new NC(d,c,[l.length],[],0):null;const u=l.length;if(u<=1)return c?new NC(d,c,[l.length],[],0):null;const h=a==="keepAll",f=YJ(l,i,s,o,r),g=s-f,p=[],_=[];let v=0,b=0,C=0,w=s,y=l.charCodeAt(0),L=n.get(y),S=AC(y,0,i,o),k=1;es(y)&&(S+=1,y=l.charCodeAt(1),L=n.get(y),k++);for(let D=k;Dw&&((b===0||S-C>g)&&(b=x,C=S-P),p[v]=b,_[v]=C,v++,w=C+g,b=0),y=A,L=T}return v===0&&(!t||t.length===0)?null:(p[v]=u,_[v]=S,new NC(d,c,p,_,f))}function AC(n,e,t,i){return n===9?t-e%t:zf(n)||n<32?i:1}function cz(n,e){return e-n%e}function AO(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 YJ(n,e,t,i,s){let o=0;if(s!==0){const r=bo(n);if(r!==-1){for(let l=0;lt&&(o=0)}}return o}const HM=sh("domLineBreaksComputer",{createHTML:n=>n});class N9{static create(){return new N9}constructor(){}createLineBreaksComputer(e,t,i,s,o){const r=[],a=[];return{addRequest:(l,c,d)=>{r.push(l),a.push(c)},finalize:()=>qEe(r,e,t,i,s,o,a)}}}function qEe(n,e,t,i,s,o,r){var a;function l(D){const x=r[D];if(x){const A=fc.applyInjectedText(n[D],x),T=x.map(W=>W.options),P=x.map(W=>W.column-1);return new NC(P,T,[A.length],[],0)}else return null}if(i===-1){const D=[];for(let x=0,A=n.length;xc?(A=0,T=0):P=c-X}const W=x.substr(A),$=GEe(W,T,t,P,g,h);p[D]=A,_[D]=T,v[D]=W,b[D]=$[0],C[D]=$[1]}const w=g.build(),y=(a=HM==null?void 0:HM.createHTML(w))!==null&&a!==void 0?a:w;f.innerHTML=y,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(),S=Array.prototype.slice.call(f.children,0),k=[];for(let D=0;Dle.options),J=Q.map(le=>le.column-1)):(X=null,J=null),k[D]=new NC(J,X,A,$,P)}return document.body.removeChild(f),k}function GEe(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 YEe(n,e,t,i){if(t.length<=1)return null;const s=Array.prototype.slice.call(e.children,0),o=[];try{MO(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 MO(n,e,t,i,s,o,r,a){if(i===o||(s=s||$M(n,e,t[i],t[i+1]),r=r||$M(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=$M(n,e,t[l],t[l+1]);MO(n,e,t,i,s,l,c,a),MO(n,e,t,l,c,o,r,a)}function $M(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 ZEe extends te{constructor(){super(),this._editor=null,this._instantiationService=null,this._instances=this._register(new v8),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)){Dt(new Error("Cannot have two contributions with the same id ".concat(s.id)));continue}this._pending.set(s.id,s)}this._instantiateSome(0),this._register(yu(()=>{this._instantiateSome(1)})),this._register(yu(()=>{this._instantiateSome(2)})),this._register(yu(()=>{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(yu(()=>{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 '".concat(t.id,"' should be eager instantiated because it uses saveViewState / restoreViewState."))}catch(i){Dt(i)}}}}var XEe=globalThis&&globalThis.__decorate||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},Gd=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},QEe=globalThis&&globalThis.__awaiter||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())})},sp;let JEe=0,eIe=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(){fi(this.listenersToRemove),this.model.onBeforeDetached(this.attachedView),this.hasRealView&&this.view.dispose(),this.viewModel.dispose()}},Ob=sp=class extends te{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=U_e(),this._contributions=this._register(new ZEe),this._onDidDispose=this._register(new j),this.onDidDispose=this._onDidDispose.event,this._onDidChangeModelContent=this._register(new j({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelContent=this._onDidChangeModelContent.event,this._onDidChangeModelLanguage=this._register(new j({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelLanguage=this._onDidChangeModelLanguage.event,this._onDidChangeModelLanguageConfiguration=this._register(new j({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelLanguageConfiguration=this._onDidChangeModelLanguageConfiguration.event,this._onDidChangeModelOptions=this._register(new j({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelOptions=this._onDidChangeModelOptions.event,this._onDidChangeModelDecorations=this._register(new j({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelDecorations=this._onDidChangeModelDecorations.event,this._onDidChangeModelTokens=this._register(new j({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelTokens=this._onDidChangeModelTokens.event,this._onDidChangeConfiguration=this._register(new j({deliveryQueue:this._deliveryQueue})),this.onDidChangeConfiguration=this._onDidChangeConfiguration.event,this._onDidChangeModel=this._register(new j({deliveryQueue:this._deliveryQueue})),this.onDidChangeModel=this._onDidChangeModel.event,this._onDidChangeCursorPosition=this._register(new j({deliveryQueue:this._deliveryQueue})),this.onDidChangeCursorPosition=this._onDidChangeCursorPosition.event,this._onDidChangeCursorSelection=this._register(new j({deliveryQueue:this._deliveryQueue})),this.onDidChangeCursorSelection=this._onDidChangeCursorSelection.event,this._onDidAttemptReadOnlyEdit=this._register(new lo(this._contributions,this._deliveryQueue)),this.onDidAttemptReadOnlyEdit=this._onDidAttemptReadOnlyEdit.event,this._onDidLayoutChange=this._register(new j({deliveryQueue:this._deliveryQueue})),this.onDidLayoutChange=this._onDidLayoutChange.event,this._editorTextFocus=this._register(new dz({deliveryQueue:this._deliveryQueue})),this.onDidFocusEditorText=this._editorTextFocus.onDidChangeToTrue,this.onDidBlurEditorText=this._editorTextFocus.onDidChangeToFalse,this._editorWidgetFocus=this._register(new dz({deliveryQueue:this._deliveryQueue})),this.onDidFocusEditorWidget=this._editorWidgetFocus.onDidChangeToTrue,this.onDidBlurEditorWidget=this._editorWidgetFocus.onDidChangeToFalse,this._onWillType=this._register(new lo(this._contributions,this._deliveryQueue)),this.onWillType=this._onWillType.event,this._onDidType=this._register(new lo(this._contributions,this._deliveryQueue)),this.onDidType=this._onDidType.event,this._onDidCompositionStart=this._register(new lo(this._contributions,this._deliveryQueue)),this.onDidCompositionStart=this._onDidCompositionStart.event,this._onDidCompositionEnd=this._register(new lo(this._contributions,this._deliveryQueue)),this.onDidCompositionEnd=this._onDidCompositionEnd.event,this._onDidPaste=this._register(new lo(this._contributions,this._deliveryQueue)),this.onDidPaste=this._onDidPaste.event,this._onMouseUp=this._register(new lo(this._contributions,this._deliveryQueue)),this.onMouseUp=this._onMouseUp.event,this._onMouseDown=this._register(new lo(this._contributions,this._deliveryQueue)),this.onMouseDown=this._onMouseDown.event,this._onMouseDrag=this._register(new lo(this._contributions,this._deliveryQueue)),this.onMouseDrag=this._onMouseDrag.event,this._onMouseDrop=this._register(new lo(this._contributions,this._deliveryQueue)),this.onMouseDrop=this._onMouseDrop.event,this._onMouseDropCanceled=this._register(new lo(this._contributions,this._deliveryQueue)),this.onMouseDropCanceled=this._onMouseDropCanceled.event,this._onDropIntoEditor=this._register(new lo(this._contributions,this._deliveryQueue)),this.onDropIntoEditor=this._onDropIntoEditor.event,this._onContextMenu=this._register(new lo(this._contributions,this._deliveryQueue)),this.onContextMenu=this._onContextMenu.event,this._onMouseMove=this._register(new lo(this._contributions,this._deliveryQueue)),this.onMouseMove=this._onMouseMove.event,this._onMouseLeave=this._register(new lo(this._contributions,this._deliveryQueue)),this.onMouseLeave=this._onMouseLeave.event,this._onMouseWheel=this._register(new lo(this._contributions,this._deliveryQueue)),this.onMouseWheel=this._onMouseWheel.event,this._onKeyUp=this._register(new lo(this._contributions,this._deliveryQueue)),this.onKeyUp=this._onKeyUp.event,this._onKeyDown=this._register(new lo(this._contributions,this._deliveryQueue)),this.onKeyDown=this._onKeyDown.event,this._onDidContentSizeChange=this._register(new j({deliveryQueue:this._deliveryQueue})),this.onDidContentSizeChange=this._onDidContentSizeChange.event,this._onDidScrollChange=this._register(new j({deliveryQueue:this._deliveryQueue})),this.onDidScrollChange=this._onDidScrollChange.event,this._onDidChangeViewZones=this._register(new j({deliveryQueue:this._deliveryQueue})),this.onDidChangeViewZones=this._onDidChangeViewZones.event,this._onDidChangeHiddenAreas=this._register(new j({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=++JEe,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 C=b.get(143);this._onDidLayoutChange.fire(C)}})),this._contextKeyService=this._register(a.createScoped(this._domElement)),this._notificationService=c,this._codeEditorService=o,this._commandService=r,this._themeService=l,this._register(new tIe(this,this._contextKeyService)),this._register(new iIe(this,this._contextKeyService,h)),this._instantiationService=s.createChild(new Tx([bt,this._contextKeyService])),this._modelData=null,this._focusTracker=new nIe(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=Wv.getEditorContributions(),this._contributions.initialize(this,p,this._instantiationService);for(const v of Wv.getEditorActions()){if(this._actions.has(v.id)){Dt(new Error("Cannot have two actions with the same id ".concat(v.id)));continue}const b=new LJ(v.id,v.label,v.alias,(f=v.precondition)!==null&&f!==void 0?f:void 0,()=>this._instantiationService.invokeFunction(C=>Promise.resolve(v.runEditorCommand(C,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 c0e(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=>QEe(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 aO(e,t,this._domElement,i)}getId(){return this.getEditorType()+":"+this._id}getEditorType(){return fS.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?oi.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==="\n"?i=1:e&&e.lineEnding&&e.lineEnding==="\r\n"&&(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?sp._getVerticalOffsetForPosition(this._modelData,e,1,t):-1}getTopForPosition(e,t){return this._modelData?sp._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?sp._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=>I.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 Zn.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(!Y.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(!I.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 I(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(!Y.isIPosition(e))throw new Error("Invalid arguments");this._sendRevealRange(new I(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=Je.isISelection(e),s=I.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 Je(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 I(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(!I.isIRange(e))throw new Error("Invalid arguments");this._sendRevealRange(I.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,Dt);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 I(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=Wv.getEditorCommand(t);return s?(i=i||{},i.source=e,this._instantiationService.invokeFunction(o=>{Promise.resolve(s.runEditorCommand(o,this,i)).then(void 0,Dt)}),!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 sIe(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,aE(this._configuration.options)):null}getDecorationsInRange(e){return this._modelData?this._modelData.model.getDecorationsInRange(e,this._id,aE(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=sp._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){Vs(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 WEe(this._id,this._configuration,e,N9.create(),x9.create(this._configuration.options),a=>xa(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(xx.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 Lx(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 vO(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 I(e.lineNumber,e.column,e.lineNumber,e.column),options:sp.dropIntoEditorDecorationOptions}];this._dropIntoEditorDecorations.set(t),this.revealPosition(e,1)}removeDropIndicator(){this._dropIntoEditorDecorations.clear()}setContextValue(e,t){this._contextKeyService.createKey(e,t)}};Ob.dropIntoEditorDecorationOptions=kt.register({description:"workbench-dnd-target",className:"dnd-target"});Ob=sp=XEe([Gd(3,_t),Gd(4,ai),Gd(5,gn),Gd(6,bt),Gd(7,os),Gd(8,Nn),Gd(9,oh),Gd(10,Ni),Gd(11,Ze)],Ob);class dz extends te{constructor(e){super(),this._emitterOptions=e,this._onDidChangeToTrue=this._register(new j(this._emitterOptions)),this.onDidChangeToTrue=this._onDidChangeToTrue.event,this._onDidChangeToFalse=this._register(new j(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 lo extends j{constructor(e,t){super({deliveryQueue:t}),this._contributions=e}fire(e){this._contributions.onBeforeInteractionEvent(),super.fire(e)}}class tIe extends te{constructor(e,t){super(),this._editor=e,t.createKey("editorId",e.getId()),this._editorSimpleInput=O.editorSimpleInput.bindTo(t),this._editorFocus=O.focus.bindTo(t),this._textInputFocus=O.textInputFocus.bindTo(t),this._editorTextFocus=O.editorTextFocus.bindTo(t),this._tabMovesFocus=O.tabMovesFocus.bindTo(t),this._editorReadonly=O.readOnly.bindTo(t),this._inDiffEditor=O.inDiffEditor.bindTo(t),this._editorColumnSelection=O.columnSelection.bindTo(t),this._hasMultipleSelections=O.hasMultipleSelections.bindTo(t),this._hasNonEmptySelection=O.hasNonEmptySelection.bindTo(t),this._canUndo=O.canUndo.bindTo(t),this._canRedo=O.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(Ib.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(Ib.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 iIe extends te{constructor(e,t,i){super(),this._editor=e,this._contextKeyService=t,this._languageFeaturesService=i,this._langId=O.languageId.bindTo(t),this._hasCompletionItemProvider=O.hasCompletionItemProvider.bindTo(t),this._hasCodeActionsProvider=O.hasCodeActionsProvider.bindTo(t),this._hasCodeLensProvider=O.hasCodeLensProvider.bindTo(t),this._hasDefinitionProvider=O.hasDefinitionProvider.bindTo(t),this._hasDeclarationProvider=O.hasDeclarationProvider.bindTo(t),this._hasImplementationProvider=O.hasImplementationProvider.bindTo(t),this._hasTypeDefinitionProvider=O.hasTypeDefinitionProvider.bindTo(t),this._hasHoverProvider=O.hasHoverProvider.bindTo(t),this._hasDocumentHighlightProvider=O.hasDocumentHighlightProvider.bindTo(t),this._hasDocumentSymbolProvider=O.hasDocumentSymbolProvider.bindTo(t),this._hasReferenceProvider=O.hasReferenceProvider.bindTo(t),this._hasRenameProvider=O.hasRenameProvider.bindTo(t),this._hasSignatureHelpProvider=O.hasSignatureHelpProvider.bindTo(t),this._hasInlayHintsProvider=O.hasInlayHintsProvider.bindTo(t),this._hasDocumentFormattingProvider=O.hasDocumentFormattingProvider.bindTo(t),this._hasDocumentSelectionFormattingProvider=O.hasDocumentSelectionFormattingProvider.bindTo(t),this._hasMultipleDocumentFormattingProvider=O.hasMultipleDocumentFormattingProvider.bindTo(t),this._hasMultipleDocumentSelectionFormattingProvider=O.hasMultipleDocumentSelectionFormattingProvider.bindTo(t),this._isInWalkThrough=O.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===Nt.walkThroughSnippet)})}}class nIe extends te{constructor(e){super(),this._onChange=this._register(new j),this.onChange=this._onChange.event,this._hasFocus=!1,this._domFocusTracker=this._register(Ld(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 sIe{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 oIe=encodeURIComponent("");function zM(n){return oIe+encodeURIComponent(n.toString())+rIe}const aIe=encodeURIComponent('');function cIe(n){return aIe+encodeURIComponent(n.toString())+lIe}bl((n,e)=>{const t=n.getColor(od);t&&e.addRule('.monaco-editor .squiggly-error { background: url("data:image/svg+xml,'.concat(zM(t),'") repeat-x bottom left; }'));const i=n.getColor(Ur);i&&e.addRule('.monaco-editor .squiggly-warning { background: url("data:image/svg+xml,'.concat(zM(i),'") repeat-x bottom left; }'));const s=n.getColor(Xo);s&&e.addRule('.monaco-editor .squiggly-info { background: url("data:image/svg+xml,'.concat(zM(s),'") repeat-x bottom left; }'));const o=n.getColor(Awe);o&&e.addRule('.monaco-editor .squiggly-hint { background: url("data:image/svg+xml,'.concat(cIe(o),'") no-repeat bottom left; }'));const r=n.getColor(USe);r&&e.addRule(".monaco-editor.showUnused .squiggly-inline-unnecessary { opacity: ".concat(r.rgba.a,"; }"))});var dIe=globalThis&&globalThis.__decorate||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},uIe=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},hIe=globalThis&&globalThis.__awaiter||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 RO=class extends te{constructor(e){super(),this._themeService=e,this._onWillCreateCodeEditor=this._register(new j),this._onCodeEditorAdd=this._register(new j),this.onCodeEditorAdd=this._onCodeEditorAdd.event,this._onCodeEditorRemove=this._register(new j),this.onCodeEditorRemove=this._onCodeEditorRemove.event,this._onWillCreateDiffEditor=this._register(new j),this._onDiffEditorAdd=this._register(new j),this.onDiffEditorAdd=this._onDiffEditorAdd.event,this._onDiffEditorRemove=this._register(new j),this.onDiffEditorRemove=this._onDiffEditorRemove.event,this._decorationOptionProviders=new Map,this._codeEditorOpenHandlers=new To,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 hIe(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 vt(t)}};RO=dIe([uIe(0,os)],RO);var fIe=globalThis&&globalThis.__decorate||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},uz=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},gIe=globalThis&&globalThis.__awaiter||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 YE=class extends RO{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)=>gIe(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===Nt.http||o===Nt.https)return tQ(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}};YE=fIe([uz(0,bt),uz(1,os)],YE);Gt(ai,YE,0);const x0=Wt("layoutService");var ZJ=globalThis&&globalThis.__decorate||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},XJ=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let ZE=class{get dimension(){return this._dimension||(this._dimension=L0(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=We.None,this.offset={top:0,quickPickTop:0}}};ZE=ZJ([XJ(0,ai)],ZE);let PO=class extends ZE{get hasContainer(){return!1}get container(){return this._container}constructor(e,t){super(t),this._container=e}};PO=ZJ([XJ(1,ai)],PO);Gt(x0,ZE,1);const LS=Wt("dialogService");var pIe=globalThis&&globalThis.__decorate||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},hz=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},HL=globalThis&&globalThis.__awaiter||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 $L(n){return n.scheme===Nt.file?n.fsPath:n.path}let QJ=0;class zL{constructor(e,t,i,s,o,r,a){this.id=++QJ,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:".concat(this.id,"] [group:").concat(this.groupId,"] [").concat(this.isValid?" VALID":"INVALID","] ").concat(this.actual.constructor.name," - ").concat(this.actual)}}class fz{constructor(e,t){this.resourceLabel=e,this.reason=t}}class gz{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("\n")}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 mIe{constructor(e,t,i,s,o,r,a){this.id=++QJ,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 gz),this.removedResources.has(t)||this.removedResources.set(t,new fz(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 gz),this.invalidatedResources.has(t)||this.invalidatedResources.set(t,new fz(e,0)))}toString(){return"[id:".concat(this.id,"] [group:").concat(this.groupId,"] [").concat(this.invalidatedResources?"INVALID":" VALID","] ").concat(this.actual.constructor.name," - ").concat(this.actual)}}class JJ{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("* ".concat(this.strResource,":"));for(let t=0;t=0;t--)e.push(" * [REDO] ".concat(this._future[t]));return e.join("\n")}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 UJ(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 UM{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 Yc){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){Dt(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 HL(this,void 0,void 0,function*(){if(typeof e.actual.prepareUndoRedo>"u")return te.None;const t=e.actual.prepareUndoRedo();return typeof t>"u"?te.None:t})}_invokeResourcePrepare(e,t){if(e.actual.type!==1||typeof e.actual.prepareUndoRedo>"u")return t(te.None);const i=e.actual.prepareUndoRedo();return i?_8(i)?t(i):i.then(s=>t(s)):t(te.None)}_getAffectedEditStacks(e){const t=[];for(const i of e.strResources)t.push(this._editStacks.get(i)||eee);return new UM(t)}_tryToSplitAndUndo(e,t,i,s){if(t.canSplit())return this._splitPastWorkspaceElement(t,i),this._notificationService.warn(s),new UL(this._undo(e,0,!0));for(const o of t.strResources)this.removeElements(o);return this._notificationService.warn(s),new UL}_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 HL(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:bn.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 UM([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 Yc){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 HL(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 HL(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 UM([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.groupOrderM9(n,t))}function vIe(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 bIe=globalThis&&globalThis.__decorate||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},mz=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};const Va=Wt("ILanguageFeatureDebounceService");var XE;(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})(XE||(XE={}));class CIe{constructor(e){this._default=e}get(e){return this._default}update(e,t){return this._default}default(){return this._default}}class wIe{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 Dg(50,.7)}_key(e){return e.id+this._registry.all(e).reduce((t,i)=>fx(XE.of(i),t),0)}get(e){const t=this._key(e),i=this._cache.get(t);return i?fr(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 _Ie(6),this._cache.set(i,s));const o=fr(s.update(t),this._min,this._max);return M9(e.uri,"output")||this._logService.trace("[DEBOUNCE: ".concat(this._name,"] for ").concat(e.uri.toString()," is ").concat(o,"ms")),o}_overall(){const e=new tee;for(const[,t]of this._cache)e.update(t.value);return e.value}default(){const e=this._overall()|0||this._default;return fr(e,this._min,this._max)}}let FO=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="".concat(XE.of(e),",").concat(a).concat(c?","+c:"");let u=this._data.get(d);return u||(this._isDev?u=new wIe(this._logService,t,e,this._overallAverage()|0||a*1.5,a,l):(this._logService.debug("[DEBOUNCE: ".concat(t,"] is disabled in developed mode")),u=new CIe(a*1.5)),this._data.set(d,u)),u}_overallAverage(){const e=new tee;for(const t of this._data.values())e.update(t.default());return e.value}};FO=bIe([mz(0,aa),mz(1,A9)],FO);Gt(Va,FO,1);class MC{static create(e,t){return new MC(e,new QE(t))}get startLineNumber(){return this._startLineNumber}get endLineNumber(){return this._endLineNumber}constructor(e,t){this._startLineNumber=e,this._tokens=t,this._endLineNumber=this._startLineNumber+this._tokens.getMaxDeltaLine()}toString(){return this._tokens.toString(this._startLineNumber)}_updateEndLineNumber(){this._endLineNumber=this._startLineNumber+this._tokens.getMaxDeltaLine()}isEmpty(){return this._tokens.isEmpty()}getLineTokens(e){return this._startLineNumber<=e&&e<=this._endLineNumber?this._tokens.getLineTokens(e-this._startLineNumber):null}getRange(){const e=this._tokens.getRange();return e&&new I(this._startLineNumber+e.startLineNumber,e.startColumn,this._startLineNumber+e.endLineNumber,e.endColumn)}removeTokens(e){const t=e.startLineNumber-this._startLineNumber,i=e.endLineNumber-this._startLineNumber;this._startLineNumber+=this._tokens.removeTokens(t,e.startColumn-1,i,e.endColumn-1),this._updateEndLineNumber()}split(e){const t=e.startLineNumber-this._startLineNumber,i=e.endLineNumber-this._startLineNumber,[s,o,r]=this._tokens.split(t,e.startColumn-1,i,e.endColumn-1);return[new MC(this._startLineNumber,s),new MC(this._startLineNumber+r,o)]}applyEdit(e,t){const[i,s,o]=Xf(t);this.acceptEdit(e,i,s,o,t.length>0?t.charCodeAt(0):0)}acceptEdit(e,t,i,s,o){this._acceptDeleteRange(e),this._acceptInsertText(new Y(e.startLineNumber,e.startColumn),t,i,s,o),this._updateEndLineNumber()}_acceptDeleteRange(e){if(e.startLineNumber===e.endLineNumber&&e.startColumn===e.endColumn)return;const t=e.startLineNumber-this._startLineNumber,i=e.endLineNumber-this._startLineNumber;if(i<0){const o=i-t;this._startLineNumber-=o;return}const s=this._tokens.getMaxDeltaLine();if(!(t>=s+1)){if(t<0&&i>=s+1){this._startLineNumber=0,this._tokens.clear();return}if(t<0){const o=-t;this._startLineNumber-=o,this._tokens.acceptDeleteRange(e.startColumn-1,0,0,i,e.endColumn-1)}else this._tokens.acceptDeleteRange(0,t,e.startColumn-1,i,e.endColumn-1)}}_acceptInsertText(e,t,i,s,o){if(t===0&&i===0)return;const r=e.lineNumber-this._startLineNumber;if(r<0){this._startLineNumber+=t;return}const a=this._tokens.getMaxDeltaLine();r>=a+1||this._tokens.acceptInsertText(r,e.column-1,t,i,s,o)}}class QE{constructor(e){this._tokens=e,this._tokenCount=e.length/4}toString(e){const t=[];for(let i=0;ie)i=s-1;else{let r=s;for(;r>t&&this._getDeltaLine(r-1)===e;)r--;let a=s;for(;ae||h===e&&g>=t)&&(he||g===e&&_>=t){if(go?p-=o-i:p=i;else if(f===t&&g===i)if(f===s&&p>o)p-=o-i;else{d=!0;continue}else if(fo)f=t,g=i,p=g+(p-o);else{d=!0;continue}else if(f>s){if(l===0&&!d){c=a;break}f-=l}else if(f===s&&g>=o)e&&f===0&&(g+=e,p+=e),f-=l,g-=o-i,p-=o-i;else throw new Error("Not possible!");const v=4*c;r[v]=f,r[v+1]=g,r[v+2]=p,r[v+3]=_,c++}this._tokenCount=c}acceptInsertText(e,t,i,s,o,r){const a=i===0&&s===1&&(r>=48&&r<=57||r>=65&&r<=90||r>=97&&r<=122),l=this._tokens,c=this._tokenCount;for(let d=0;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},jM=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let BO=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 fu}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()===Os.Trace&&this._logService.trace("SemanticTokensProviderStyling [CACHED] ".concat(e," / ").concat(t,": foreground ").concat(Fs.getForeground(r),", fontStyle ").concat(Fs.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()===Os.Trace&&(this._logService.trace("SemanticTokensProviderStyling: unknown token modifier index: ".concat(t.toString(2)," for legend: ").concat(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()===Os.Trace&&this._logService.trace("SemanticTokensProviderStyling: unknown token type index: ".concat(e," for legend: ").concat(JSON.stringify(this._legend.tokenTypes))),r=2147483647,a="not-in-legend";this._hashTable.add(e,t,s,r),this._logService.getLevel()===Os.Trace&&this._logService.trace("SemanticTokensProviderStyling ".concat(e," (").concat(a,") / ").concat(t," (").concat(l.join(" "),"): foreground ").concat(Fs.getForeground(r),", fontStyle ").concat(Fs.getFontStyle(r).toString(2)))}return r}warnOverlappingSemanticTokens(e,t){this._hasWarnedOverlappingTokens||(this._hasWarnedOverlappingTokens=!0,console.warn("Overlapping semantic tokens detected at lineNumber ".concat(e,", column ").concat(t)))}warnInvalidLengthSemanticTokens(e,t){this._hasWarnedInvalidLengthTokens||(this._hasWarnedInvalidLengthTokens=!0,console.warn("Semantic token with invalid length detected at lineNumber ".concat(e,", column ").concat(t)))}warnInvalidEditStart(e,t,i,s,o){this._hasWarnedInvalidEditStart||(this._hasWarnedInvalidEditStart=!0,console.warn("Invalid semantic tokens edit detected (previousResultId: ".concat(e,", resultId: ").concat(t,") at edit #").concat(i,": The provided start offset ").concat(s," is outside the previous data (length ").concat(o,").")))}};BO=yIe([jM(1,os),jM(2,qi),jM(3,aa)],BO);function iee(n,e,t){const i=n.data,s=n.data.length/5|0,o=Math.max(Math.ceil(s/1024),400),r=[];let a=0,l=1,c=0;for(;ad&&i[5*b]===0;)b--;if(b-1===d){let C=u;for(;C+1L)e.warnOverlappingSemanticTokens(y,L+1);else{const A=e.getMetadata(D,x,t);A!==2147483647&&(g===0&&(g=y),h[f]=y-g,h[f+1]=L,h[f+2]=k,h[f+3]=A,f+=4,p=y,_=k)}l=y,c=L,a++}f!==h.length&&(h=h.subarray(0,f));const v=MC.create(g,h);r.push(v)}return r}class SIe{constructor(e,t,i,s){this.tokenTypeIndex=e,this.tokenModifierSet=t,this.languageId=i,this.metadata=s,this.next=null}}class fu{constructor(){this._elementsCount=0,this._currentLengthIndex=0,this._currentLength=fu._SIZES[this._currentLengthIndex],this._growCount=Math.round(this._currentLengthIndex+1=this._growCount){const o=this._elements;this._currentLengthIndex++,this._currentLength=fu._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},KM=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let WO=class extends te{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 BO(e.getLegend(),this._themeService,this._languageService,this._logService)),this._caches.get(e)}};WO=LIe([KM(0,os),KM(1,aa),KM(2,qi)],WO);Gt(Nx,WO,1);var vz=globalThis&&globalThis.__awaiter||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 jL="**",bz="/",bD="[/\\\\]",CD="[^/\\\\]",kIe=/\//g;function Cz(n,e){switch(n){case 0:return"";case 1:return"".concat(CD,"*?");default:return"(?:".concat(bD,"|").concat(CD,"+").concat(bD).concat(e?"|".concat(bD).concat(CD,"+"):"",")*?")}}function wz(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 nee(n){if(!n)return"";let e="";const t=wz(n,bz);if(t.every(i=>i===jL))e=".*";else{let i=!1;t.forEach((s,o)=>{if(s===jL){if(i)return;e+=Cz(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===bz?u="":u=Xr(d),c+=u;continue}switch(d){case"{":r=!0;continue;case"[":l=!0;continue;case"}":{const u=wz(a,","),h="(?:".concat(u.map(f=>nee(f)).join("|"),")");e+=h,r=!1,a="";break}case"]":{e+="["+c+"]",l=!1,c="";break}case"?":e+=CD;continue;case"*":e+=Cz(1);continue;default:e+=Xr(d)}}oR9(a,e)).filter(a=>a!==md),n),i=t.length;if(!i)return md;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 kz(n,e,t){const i=sc===zn.sep,s=i?n:n.replace(kIe,sc),o=sc+s,r=zn.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 PIe(n){try{const e=new RegExp("^".concat(nee(n),"$"));return function(t){return e.lastIndex=0,typeof t=="string"&&e.test(t)?n:null}}catch{return md}}function OIe(n,e,t){return!n||typeof e!="string"?!1:see(n)(e,void 0,t)}function see(n,e={}){if(!n)return Sz;if(typeof n=="string"||FIe(n)){const t=R9(n,e);if(t===md)return Sz;const i=function(s,o){return!!t(s,o)};return t.allBasenames&&(i.allBasenames=t.allBasenames),t.allPaths&&(i.allPaths=t.allPaths),i}return BIe(n,e)}function FIe(n){const e=n;return e?typeof e.base=="string"&&typeof e.pattern=="string":!1}function BIe(n,e){const t=oee(Object.getOwnPropertyNames(n).map(a=>WIe(a,n[a],e)).filter(a=>a!==md)),i=t.length;if(!i)return md;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;fvz(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;hvz(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 WIe(n,e,t){if(e===!1)return md;const i=R9(n,t);if(i===md)return md;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 jP(u)?u.then(h=>h?n:null):u?n:null};return o.requiresSiblings=!0,o}}return i}function oee(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 ree(n,e,t,i,s,o){if(Array.isArray(n)){let r=0;for(const a of n){const l=ree(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:pX(a.base)}),h===e.fsPath||OIe(h,e.fsPath))u=10;else return 0}return u}else return 0}}function aee(n){return typeof n=="string"?!1:Array.isArray(n)?n.every(aee):!!n.exclusive}class Dz{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 dn{constructor(e){this._notebookInfoResolver=e,this._clock=0,this._entries=[],this._onDidChange=new j,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),vt(()=>{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 Dz(e.uri,e.getLanguageId(),s.uri,s.type):new Dz(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=ree(r.selector,o.uri,o.languageId,x1e(e),o.notebookUri,o.notebookType),aee(r.selector)&&r._score>0){for(const a of this._entries)a._score=0;r._score=1e3;break}this._entries.sort(dn._compareByScoreAndTime)}}static _compareByScoreAndTime(e,t){return e._scoret._score?-1:Y1(e.selector)&&!Y1(t.selector)?1:!Y1(e.selector)&&Y1(t.selector)?-1:e._timet._time?-1:0}}function Y1(n){return typeof n=="string"?!1:Array.isArray(n)?n.some(Y1):!!n.isBuiltin}class VIe{constructor(){this.referenceProvider=new dn(this._score.bind(this)),this.renameProvider=new dn(this._score.bind(this)),this.codeActionProvider=new dn(this._score.bind(this)),this.definitionProvider=new dn(this._score.bind(this)),this.typeDefinitionProvider=new dn(this._score.bind(this)),this.declarationProvider=new dn(this._score.bind(this)),this.implementationProvider=new dn(this._score.bind(this)),this.documentSymbolProvider=new dn(this._score.bind(this)),this.inlayHintsProvider=new dn(this._score.bind(this)),this.colorProvider=new dn(this._score.bind(this)),this.codeLensProvider=new dn(this._score.bind(this)),this.documentFormattingEditProvider=new dn(this._score.bind(this)),this.documentRangeFormattingEditProvider=new dn(this._score.bind(this)),this.onTypeFormattingEditProvider=new dn(this._score.bind(this)),this.signatureHelpProvider=new dn(this._score.bind(this)),this.hoverProvider=new dn(this._score.bind(this)),this.documentHighlightProvider=new dn(this._score.bind(this)),this.selectionRangeProvider=new dn(this._score.bind(this)),this.foldingRangeProvider=new dn(this._score.bind(this)),this.linkProvider=new dn(this._score.bind(this)),this.inlineCompletionsProvider=new dn(this._score.bind(this)),this.completionProvider=new dn(this._score.bind(this)),this.linkedEditingRangeProvider=new dn(this._score.bind(this)),this.documentRangeSemanticTokensProvider=new dn(this._score.bind(this)),this.documentSemanticTokensProvider=new dn(this._score.bind(this)),this.documentOnDropEditProvider=new dn(this._score.bind(this)),this.documentPasteEditProvider=new dn(this._score.bind(this))}_score(e){var t;return(t=this._notebookTypeResolver)===null||t===void 0?void 0:t.call(this,e)}}Gt(Ze,VIe,1);const kS=Wt("IWorkspaceEditService");class P9{constructor(e){this.metadata=e}static convert(e){return e.edits.map(t=>{if(Ou.is(t))return Ou.lift(t);if(Jv.is(t))return Jv.lift(t);throw new Error("Unsupported edit")})}}class Ou extends P9{static is(e){return e instanceof Ou?!0:Io(e)&&ct.isUri(e.resource)&&Io(e.textEdit)}static lift(e){return e instanceof Ou?e:new Ou(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 Jv extends P9{static is(e){return e instanceof Jv?!0:Io(e)&&(!!e.newResource||!!e.oldResource)}static lift(e){return e instanceof Jv?e:new Jv(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 co={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},Ax=Object.freeze({id:"editor",order:5,type:"object",title:m("editorConfigurationTitle","Editor"),scope:5}),JE=Object.assign(Object.assign({},Ax),{properties:{"editor.tabSize":{type:"number",default:Qs.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:Qs.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:Qs.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:Qs.trimAutoWhitespace,description:m("trimAutoWhitespace","Remove trailing auto inserted whitespace.")},"editor.largeFileOptimizations":{type:"boolean",default:Qs.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:co.maxComputationTime,description:m("maxComputationTime","Timeout in milliseconds after which diff computation is cancelled. Use 0 for no timeout.")},"diffEditor.maxFileSize":{type:"number",default:co.maxFileSize,description:m("maxFileSize","Maximum file size in MB for which to compute diffs. Use 0 for no limit.")},"diffEditor.renderSideBySide":{type:"boolean",default:co.renderSideBySide,description:m("sideBySide","Controls whether the diff editor shows the diff side by side or inline.")},"diffEditor.renderSideBySideInlineBreakpoint":{type:"number",default:co.renderSideBySideInlineBreakpoint,description:m("renderSideBySideInlineBreakpoint","If the diff editor width is smaller than this value, the inline view is used.")},"diffEditor.useInlineViewWhenSpaceIsLimited":{type:"boolean",default:co.useInlineViewWhenSpaceIsLimited,description:m("useInlineViewWhenSpaceIsLimited","If enabled and the editor width is too small, the inline view is used.")},"diffEditor.renderMarginRevertIcon":{type:"boolean",default:co.renderMarginRevertIcon,description:m("renderMarginRevertIcon","When enabled, the diff editor shows arrows in its glyph margin to revert changes.")},"diffEditor.ignoreTrimWhitespace":{type:"boolean",default:co.ignoreTrimWhitespace,description:m("ignoreTrimWhitespace","When enabled, the diff editor ignores changes in leading or trailing whitespace.")},"diffEditor.renderIndicators":{type:"boolean",default:co.renderIndicators,description:m("renderIndicators","Controls whether the diff editor shows +/- indicators for added/removed changes.")},"diffEditor.codeLens":{type:"boolean",default:co.diffCodeLens,description:m("codeLens","Controls whether the editor shows CodeLens.")},"diffEditor.wordWrap":{type:"string",enum:["off","on","inherit"],default:co.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:co.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:co.hideUnchangedRegions.enabled,markdownDescription:m("hideUnchangedRegions.enabled","Controls whether the diff editor shows unchanged regions.")},"diffEditor.hideUnchangedRegions.revealLineCount":{type:"integer",default:co.hideUnchangedRegions.revealLineCount,markdownDescription:m("hideUnchangedRegions.revealLineCount","Controls how many lines are used for unchanged regions."),minimum:1},"diffEditor.hideUnchangedRegions.minimumLineCount":{type:"integer",default:co.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:co.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:co.experimental.showMoves,markdownDescription:m("showMoves","Controls whether the diff editor should show detected code moves.")},"diffEditor.experimental.showEmptyDecorations":{type:"boolean",default:co.experimental.showEmptyDecorations,description:m("showEmptyDecorations","Controls whether the diff editor shows empty decorations to see where characters got inserted or deleted.")}}});function HIe(n){return typeof n.type<"u"||typeof n.anyOf<"u"}for(const n of ev){const e=n.schema;if(typeof e<"u")if(HIe(e))JE.properties["editor.".concat(n.name)]=e;else for(const t in e)Object.hasOwnProperty.call(e,t)&&(JE.properties[t]=e[t])}let KL=null;function lee(){return KL===null&&(KL=Object.create(null),Object.keys(JE.properties).forEach(n=>{KL[n]=!0})),KL}function $Ie(n){return lee()["editor.".concat(n)]||!1}function zIe(n){return lee()["diffEditor.".concat(n)]||!1}const UIe=en.as(wc.Configuration);UIe.registerConfiguration(JE);class Yi{static insert(e,t){return{range:new I(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 GM(n){return Object.isFrozen(n)?n:xme(n)}class Ys{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 Ys)return i;const s=new jIe("");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?gH(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?gH(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=du(this.contents),o=du(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=>yn(u.identifiers,c.identifiers));d?(this.mergeContents(d.contents,c.contents),d.keys.push(...c.keys),d.keys=Vf(d.keys)):o.push(du(c))}for(const c of l.keys)r.indexOf(c)===-1&&r.push(c)}return new Ys(s,r,o,a.every(l=>l instanceof Ys)?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 Vf([...Object.keys(this.contents),...Object.keys(t)])){let o=this.contents[s];const r=t[s];r&&(typeof o=="object"&&typeof r=="object"?(o=du(o),this.mergeContents(o,r)):o=r),i[s]=o}return new Ys(i,this.keys,this.overrides)}mergeContents(e,t){for(const i of Object.keys(t)){if(i in e&&Io(e[i])&&Io(t[i])){this.mergeContents(e[i],t[i]);continue}e[i]=du(t[i])}}getContentsForOverrideIdentifer(e){let t=null,i=null;const s=o=>{o&&(i?this.mergeContents(i,o):i=du(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),K0e(this.contents,e),qf.test(e)&&this.overrides.splice(this.overrides.findIndex(i=>yn(i.identifiers,yE(e))),1))}updateValue(e,t,i){mQ(this.contents,e,t,s=>console.error(s)),i=i||this.keys.indexOf(e)===-1,i&&this.keys.push(e),qf.test(e)&&this.overrides.push({identifiers:yE(e),keys:Object.keys(this.contents[e]),contents:GP(this.contents[e],s=>console.error(s))})}}class jIe{constructor(e){this._name=e,this._raw=null,this._configurationModel=null,this._restrictedConfigurations=[]}get configurationModel(){return this._configurationModel||new Ys}parseRaw(e,t){this._raw=e;const{contents:i,keys:s,overrides:o,restricted:r,hasExcludedProperties:a}=this.doParseRaw(e,t);this._configurationModel=new Ys(i,s,o,a?[e]:void 0),this._restrictedConfigurations=r||[]}doParseRaw(e,t){const i=en.as(wc.Configuration).getConfigurationProperties(),s=this.filter(e,i,!0,t);e=s.raw;const o=GP(e,l=>console.error("Conflict in settings file ".concat(this._name,": ").concat(l))),r=Object.keys(e),a=this.toOverrides(e,l=>console.error("Conflict in settings file ".concat(this._name,": ").concat(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(qf.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(qf.test(s)){const o={};for(const r in e[s])o[r]=e[s][r];i.push({identifiers:yE(s),keys:Object.keys(o),contents:GP(o,t)})}return i}}class KIe{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 GM(s.value)},get override(){return GM(s.override)},get merged(){return GM(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 Mx{constructor(e,t,i,s,o=new Ys,r=new Ys,a=new Js,l=new Ys,c=new Js){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 Js,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 Ys,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 KIe(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(ct.revive(c[0]),this.parseConfigurationModel(c[1])),l),new Js);return new Mx(t,i,s,o,new Ys,r,a,new Ys,new Js)}static parseConfigurationModel(e){return new Ys(e.contents,e.keys,e.overrides)}}class qIe{constructor(e,t,i,s){this.change=e,this.previous=t,this.currentConfiguraiton=i,this.currentWorkspace=s,this._marker="\n",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=Mx.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!Gr(l,c)}return!0}}const eI={kind:0},GIe={kind:1};function YIe(n,e,t){return{kind:2,commandId:n,commandArgs:e,isBubble:t}}class RC{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=RC.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 ".concat(s));const o=this._map.get(s[0]);if(o===void 0)return this._log("\\ No keybinding entries."),eI;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(RC._contextMatchesRules(e,s.when))return s}return null}static _contextMatchesRules(e,t){return t?t.evaluate(e):!0}}function Ez(n){return n?"".concat(n.serialize()):"no when condition"}function Iz(n){return n.extensionId?n.isBuiltinExtension?"built-in extension ".concat(n.extensionId):"user extension ".concat(n.extensionId):n.isDefault?"built-in":"user"}const ZIe=/^(cursor|delete|undo|redo|tab|editor\.action\.clipboard)/;class XIe extends te{get onDidUpdateKeybindings(){return this._onDidUpdateKeybindings?this._onDidUpdateKeybindings.event:We.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 j),this._currentChords=[],this._currentChordChecker=new uS,this._currentChordStatusMessage=null,this._ignoreSingleModifiers=pv.EMPTY,this._currentSingleModifier=null,this._currentSingleModifierClearTimeout=new _l,this._logging=!1}dispose(){super.dispose()}_log(e){this._logging&&this._logService.info("[KeybindingService]: ".concat(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"),eI;const[s]=i.getDispatchChords();if(s===null)return this._log("\\ Keyboard event cannot be dispatched"),eI;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 m8("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(),CC.enabled&&CC.disable()}_leaveChordMode(){this._currentChordStatusMessage&&(this._currentChordStatusMessage.dispose(),this._currentChordStatusMessage=null),this._currentChordChecker.cancel(),this._currentChords=[],CC.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 ".concat(s," due to it being pressed together with other keys.")),this._ignoreSingleModifiers=pv.EMPTY,this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,!1):(this._ignoreSingleModifiers=pv.EMPTY,this._currentSingleModifier===null?(this._log("+ Storing single modifier for possible chord ".concat(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 ".concat(s," ").concat(s)),this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,this._doDispatch(i,t,!0)):(this._log("+ Clearing single modifier due to modifier mismatch: ".concat(this._currentSingleModifier," ").concat(s)),this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,!1));const[o]=i.getChords();return this._ignoreSingleModifiers=new pv(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 "'.concat(u,", ").concat(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 ".concat(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 "'.concat(u,", ").concat(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 ".concat(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)),ZIe.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 pv{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}}}pv.EMPTY=new pv(null);class Tz{constructor(e,t,i,s,o,r,a){this._resolvedKeybindingItemBrand=void 0,this.resolvedKeybinding=e,this.chords=e?VO(e.getDispatchChords()):[],e&&this.chords.length===0&&(this.chords=VO(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 VO(n){const e=[];for(let t=0,i=n.length;tthis._getLabel(e))}getAriaLabel(){return QIe.toLabel(this._os,this._chords,e=>this._getAriaLabel(e))}getElectronAccelerator(){return this._chords.length>1||this._chords[0].isDuplicateModifierCase()?null:JIe.toLabel(this._os,this._chords,e=>this._getElectronAccelerator(e))}getUserSettingsLabel(){return eTe.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 obe(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 Yw extends iTe{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 pu.toString(e)}_getLabel(e){return e.isDuplicateModifierCase()?"":this._keyCodeToUILabel(e.keyCode)}_getAriaLabel(e){return e.isDuplicateModifierCase()?"":pu.toString(e.keyCode)}_getElectronAccelerator(e){return pu.toElectronAccelerator(e.keyCode)}_getUserSettingsLabel(e){if(e.isDuplicateModifierCase())return"";const t=pu.toUserSettingsUS(e.keyCode);return t&&t.toLowerCase()}_getChordDispatch(e){return Yw.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+=pu.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=y8[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 Gu)return e;const t=this._scanCodeToKeyCode(e.scanCode);return t===0?null:new Gu(e.ctrlKey,e.shiftKey,e.altKey,e.metaKey,t)}static resolveKeybinding(e,t){const i=VO(e.chords.map(s=>this._toKeyCodeChord(s)));return i.length>0?[new Yw(i,t)]:[]}}const Fb=Wt("labelService"),cee=Wt("progressService");class Fu{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)})}}Fu.None=Object.freeze({report(){}});const Tg=Wt("editorProgressService");class nTe{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 eb(new rTe(e,t))}static forStrings(){return new eb(new nTe)}static forConfigKeys(){return new eb(new sTe)}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 qL,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 qL,s.left.segment=i.value()),o.push([-1,s]),s=s.left;else if(a<0)s.right||(s.right=new qL,s.right.segment=i.value()),o.push([1,s]),s=s.right;else if(i.hasNext())i.next(),s.mid||(s.mid=new qL,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 hm=Wt("contextService");function HO(n){const e=n;return typeof(e==null?void 0:e.id)=="string"&&ct.isUri(e.uri)}function aTe(n){const e=n;return typeof(e==null?void 0:e.id)=="string"&&!HO(n)&&!uTe(n)}const lTe={id:"ext-dev"},cTe={id:"empty-window"};function dTe(n,e){if(typeof n=="string"||typeof n>"u")return typeof n=="string"?{id:bf(n)}:e?lTe:cTe;const t=n;return t.configuration?{id:t.id,configPath:t.configuration}:t.folders.length===1?{id:t.id,uri:t.folders[0].uri}:{id:t.id}}function uTe(n){const e=n;return typeof(e==null?void 0:e.id)=="string"&&ct.isUri(e.configPath)}class hTe{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 $O="code-workspace";m("codeWorkspace","Code Workspace");const dee="4064f6ec-cb38-4ad0-af64-ee6467e63c82";function fTe(n){return n.id===dee}var zO;(function(n){n.inspectTokensAction=m("inspectTokens","Developer: Inspect Tokens")})(zO||(zO={}));var tI;(function(n){n.gotoLineActionLabel=m("gotoLineActionLabel","Go to Line/Column...")})(tI||(tI={}));var UO;(function(n){n.helpQuickAccessActionLabel=m("helpQuickAccess","Show all Quick Access Providers")})(UO||(UO={}));var iI;(function(n){n.quickCommandActionLabel=m("quickCommandActionLabel","Command Palette"),n.quickCommandHelp=m("quickCommandActionHelp","Show And Run Commands")})(iI||(iI={}));var Zw;(function(n){n.quickOutlineActionLabel=m("quickOutlineActionLabel","Go to Symbol..."),n.quickOutlineByCategoryActionLabel=m("quickOutlineByCategoryActionLabel","Go to Symbol by Category...")})(Zw||(Zw={}));var nI;(function(n){n.editorViewAccessibleLabel=m("editorViewAccessibleLabel","Editor content"),n.accessibilityHelpMessage=m("accessibilityHelpMessage","Press Alt+F1 for Accessibility Options.")})(nI||(nI={}));var jO;(function(n){n.toggleHighContrast=m("toggleHighContrast","Toggle High Contrast Theme")})(jO||(jO={}));var KO;(function(n){n.bulkEditServiceSummary=m("bulkEditServiceSummary","Made {0} edits in {1} files")})(KO||(KO={}));const uee=Wt("workspaceTrustManagementService"),rh=Wt("contextViewService"),Cl=Wt("contextMenuService");var js;(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})(js||(js={}));function gTe(n){const e=n;return!!e&&typeof e.x=="number"&&typeof e.y=="number"}var of;(function(n){n[n.AVOID=0]="AVOID",n[n.ALIGN=1]="ALIGN"})(of||(of={}));function mv(n,e,t){const i=t.mode===of.ALIGN?t.offset:t.offset+t.size,s=t.mode===of.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 Bb extends te{constructor(e,t){super(),this.container=null,this.delegate=null,this.toDisposeOnClean=te.None,this.toDisposeOnSetContainer=te.None,this.shadowRoot=null,this.shadowRootHostElement=null,this.view=ye(".context-view"),this.useFixedPosition=!1,this.useShadowDOM=!1,Lo(this.view),this.setContainer(e,t),this._register(vt(()=>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=ye(".shadow-root-host"),this.container.appendChild(this.shadowRootHostElement),this.shadowRoot=this.shadowRootHostElement.attachShadow({mode:"open"});const o=document.createElement("style");o.textContent=pTe,this.shadowRoot.appendChild(o),this.shadowRoot.appendChild(this.view),this.shadowRoot.appendChild(ye("slot"))}else this.container.appendChild(this.view);const s=new be;Bb.BUBBLE_UP_EVENTS.forEach(o=>{s.add(In(this.container,o,r=>{this.onDOMEvent(r,!1)}))}),Bb.BUBBLE_DOWN_EVENTS.forEach(o=>{s.add(In(this.container,o,r=>{this.onDOMEvent(r,!0)},!0))}),this.toDisposeOnSetContainer=s}}show(e){var t,i;this.isVisible()&&this.hide(),Ds(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",mr(this.view),this.toDisposeOnClean=e.render(this.view)||te.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&&!(uc&&P8.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(F8(e)){const u=Un(e),h=Xbe(e);t={top:u.top*h,left:u.left*h,width:u.width*h,height:u.height*h}}else gTe(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=Ko(this.view),s=Ep(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:of.ALIGN};l=mv(window.innerHeight,s,u)+window.pageYOffset,js.intersects({start:l,end:l+s},{start:u.offset,end:u.offset+u.size})&&(h.mode=of.AVOID),c=mv(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:of.ALIGN};c=mv(window.innerWidth,i,u),js.intersects({start:c,end:c+i},{start:u.offset,end:u.offset+u.size})&&(h.mode=of.AVOID),l=mv(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=Un(this.container);this.view.style.top="".concat(l-(this.useFixedPosition?Un(this.view).top:d.top),"px"),this.view.style.left="".concat(c-(this.useFixedPosition?Un(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(),Lo(this.view)}isVisible(){return!!this.delegate}onDOMEvent(e,t){this.delegate&&(this.delegate.onDOMEvent?this.delegate.onDOMEvent(e,document.activeElement):t&&!Ws(e.target,this.container)&&this.hide())}dispose(){this.hide(),super.dispose()}}Bb.BUBBLE_UP_EVENTS=["click","keydown","focus","blur"];Bb.BUBBLE_DOWN_EVENTS=["click"];const pTe='\n :host {\n all: initial; /* 1st rule so subsequent properties are reset. */\n }\n\n .codicon[class*=\'codicon-\'] {\n font: normal normal normal 16px/1 codicon;\n display: inline-block;\n text-decoration: none;\n text-rendering: auto;\n text-align: center;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n user-select: none;\n -webkit-user-select: none;\n -ms-user-select: none;\n }\n\n :host {\n font-family: -apple-system, BlinkMacSystemFont, "Segoe WPC", "Segoe UI", "HelveticaNeue-Light", system-ui, "Ubuntu", "Droid Sans", sans-serif;\n }\n\n :host-context(.mac) { font-family: -apple-system, BlinkMacSystemFont, sans-serif; }\n :host-context(.mac:lang(zh-Hans)) { font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", sans-serif; }\n :host-context(.mac:lang(zh-Hant)) { font-family: -apple-system, BlinkMacSystemFont, "PingFang TC", sans-serif; }\n :host-context(.mac:lang(ja)) { font-family: -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic Pro", sans-serif; }\n :host-context(.mac:lang(ko)) { font-family: -apple-system, BlinkMacSystemFont, "Nanum Gothic", "Apple SD Gothic Neo", "AppleGothic", sans-serif; }\n\n :host-context(.windows) { font-family: "Segoe WPC", "Segoe UI", sans-serif; }\n :host-context(.windows:lang(zh-Hans)) { font-family: "Segoe WPC", "Segoe UI", "Microsoft YaHei", sans-serif; }\n :host-context(.windows:lang(zh-Hant)) { font-family: "Segoe WPC", "Segoe UI", "Microsoft Jhenghei", sans-serif; }\n :host-context(.windows:lang(ja)) { font-family: "Segoe WPC", "Segoe UI", "Yu Gothic UI", "Meiryo UI", sans-serif; }\n :host-context(.windows:lang(ko)) { font-family: "Segoe WPC", "Segoe UI", "Malgun Gothic", "Dotom", sans-serif; }\n\n :host-context(.linux) { font-family: system-ui, "Ubuntu", "Droid Sans", sans-serif; }\n :host-context(.linux:lang(zh-Hans)) { font-family: system-ui, "Ubuntu", "Droid Sans", "Source Han Sans SC", "Source Han Sans CN", "Source Han Sans", sans-serif; }\n :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; }\n :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; }\n :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; }\n';var mTe=globalThis&&globalThis.__decorate||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=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let qO=class extends te{constructor(e){super(),this.layoutService=e,this.currentViewDisposable=te.None,this.container=e.hasContainer?e.container:null,this.contextView=this._register(new Bb(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=vt(()=>{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)}};qO=mTe([_Te(0,x0)],qO);let Wb=[],F9=[],hee=[];function GL(n,e=!1){vTe(n,!1,e)}function vTe(n,e,t){const i=bTe(n,e);Wb.push(i),i.userConfigured?hee.push(i):F9.push(i),t&&!i.userConfigured&&Wb.forEach(s=>{s.mime===i.mime||s.userConfigured||(i.extension&&s.extension===i.extension&&console.warn("Overwriting extension <<".concat(i.extension,">> to now point to mime <<").concat(i.mime,">>")),i.filename&&s.filename===i.filename&&console.warn("Overwriting filename <<".concat(i.filename,">> to now point to mime <<").concat(i.mime,">>")),i.filepattern&&s.filepattern===i.filepattern&&console.warn("Overwriting filepattern <<".concat(i.filepattern,">> to now point to mime <<").concat(i.mime,">>")),i.firstline&&s.firstline===i.firstline&&console.warn("Overwriting firstline <<".concat(i.firstline,">> to now point to mime <<").concat(i.mime,">>")))})}function bTe(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?see(n.filepattern.toLowerCase()):void 0,filepatternOnPath:n.filepattern?n.filepattern.indexOf(zn.sep)>=0:!1}}function CTe(){Wb=Wb.filter(n=>n.userConfigured),F9=[]}function wTe(n,e){return yTe(n,e).map(t=>t.id)}function yTe(n,e){let t;if(n)switch(n.scheme){case Nt.file:t=n.fsPath;break;case Nt.data:{t=Qf.parseMetaData(n).get(Qf.META_DATA_LABEL);break}case Nt.vscodeNotebookCell:t=void 0;break;default:t=n.path}if(!t)return[{id:"unknown",mime:wn.unknown}];t=t.toLowerCase();const i=bf(t),s=xz(t,i,hee);if(s)return[s,{id:Yr,mime:wn.text}];const o=xz(t,i,F9);if(o)return[o,{id:Yr,mime:wn.text}];if(e){const r=STe(e);if(r)return[r,{id:Yr,mime:wn.text}]}return[{id:"unknown",mime:wn.unknown}]}function xz(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 STe(n){if(x8(n)&&(n=n.substr(1)),n.length>0)for(let e=Wb.length-1;e>=0;e--){const t=Wb[e];if(!t.firstline)continue;const i=n.match(t.firstline);if(i&&i.length>0)return t}}const YL=Object.prototype.hasOwnProperty,Nz="vs.editor.nullLanguage";class LTe{constructor(){this._languageIdToLanguage=[],this._languageToLanguageId=new Map,this._register(Nz,0),this._register(Yr,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]||Nz}}class Xw extends te{constructor(e=!0,t=!1){super(),this._onDidChange=this._register(new j),this.onDidChange=this._onDidChange.event,Xw.instanceCount++,this._warnOnOverwrite=t,this.languageIdCodec=new LTe,this._dynamicLanguages=[],this._languages={},this._mimeTypesMap={},this._nameMap={},this._lowercaseNameMap={},e&&(this._initializeFromRegistry(),this._register(kb.onDidChangeLanguages(i=>{this._initializeFromRegistry()})))}dispose(){Xw.instanceCount--,super.dispose()}_initializeFromRegistry(){this._languages={},this._mimeTypesMap={},this._nameMap={},this._lowercaseNameMap={},CTe();const e=[].concat(kb.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})}),en.as(wc.Configuration).registerOverrideIdentifiers(this.getRegisteredLanguageIds()),this._onDidChange.fire()}_registerLanguage(e){const t=e.id;let i;YL.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-".concat(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)GL({id:i,mime:s,extension:a},this._warnOnOverwrite)}if(Array.isArray(t.filenames))for(const a of t.filenames)GL({id:i,mime:s,filename:a},this._warnOnOverwrite),e.filenames.push(a);if(Array.isArray(t.filenamePatterns))for(const a of t.filenamePatterns)GL({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);kve(l)||GL({id:i,mime:s,firstline:l},this._warnOnOverwrite)}catch(l){console.warn("[".concat(t.id,"]: Invalid regular expression `").concat(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?YL.call(this._languages,e):!1}getRegisteredLanguageIds(){return Object.keys(this._languages)}getLanguageIdByLanguageName(e){const t=e.toLowerCase();return YL.call(this._lowercaseNameMap,t)?this._lowercaseNameMap[t]:null}getLanguageIdByMimeType(e){return e&&YL.call(this._mimeTypesMap,e)?this._mimeTypesMap[e]:null}guessLanguageIdByFilepathOrFirstLine(e,t){return!e&&!t?[]:wTe(e,t)}}Xw.instanceCount=0;class Qw extends te{constructor(e=!1){super(),this._onDidRequestBasicLanguageFeatures=this._register(new j),this.onDidRequestBasicLanguageFeatures=this._onDidRequestBasicLanguageFeatures.event,this._onDidRequestRichLanguageFeatures=this._register(new j),this.onDidRequestRichLanguageFeatures=this._onDidRequestRichLanguageFeatures.event,this._onDidChange=this._register(new j({leakWarningThreshold:200})),this.onDidChange=this._onDidChange.event,this._requestedBasicLanguages=new Set,this._requestedRichLanguages=new Set,Qw.instanceCount++,this._registry=this._register(new Xw(!0,e)),this.languageIdCodec=this._registry.languageIdCodec,this._register(this._registry.onDidChange(()=>this._onDidChange.fire()))}dispose(){Qw.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 jZ(i,null)}createById(e){return new Az(this.onDidChange,()=>this._createAndGetLanguageIdentifier(e))}createByFilepathOrFirstLine(e,t){return new Az(this.onDidChange,()=>{const i=this.guessLanguageIdByFilepathOrFirstLine(e,t);return this._createAndGetLanguageIdentifier(i)})}_createAndGetLanguageIdentifier(e){return(!e||!this.isRegisteredLanguageId(e))&&(e=Yr),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),nn.getOrCreate(e),this._onDidRequestRichLanguageFeatures.fire(e))}}Qw.instanceCount=0;class Az{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 j({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 Jw={RESOURCES:"ResourceURLs",DOWNLOAD_URL:"DownloadURL",FILES:"Files",TEXT:wn.text,INTERNAL_URI_LIST:"application/vnd.code.uri-list"};function B9(...n){return function(e,t){for(let i=0,s=n.length;i0?[{start:0,end:e.length}]:[]:null}function gee(n,e){const t=e.toLowerCase().indexOf(n.toLowerCase());return t===-1?null:[{start:t,end:t+n.length}]}function pee(n,e){return GO(n.toLowerCase(),e.toLowerCase(),0,0)}function GO(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=GO(n,e,t+1,i+1))?H9({start:i,end:i+1},s):null}return GO(n,e,t,i+1)}function W9(n){return 97<=n&&n<=122}function Px(n){return 65<=n&&n<=90}function V9(n){return 48<=n&&n<=57}function mee(n){return n===32||n===9||n===10||n===13}const _ee=new Set;"()[]{}<>`'\"-/;:,.?!".split("").forEach(n=>_ee.add(n.charCodeAt(0)));function sI(n){return mee(n)||_ee.has(n)}function kTe(n,e){return n===e||sI(n)&&sI(e)}function vee(n){return W9(n)||Px(n)||V9(n)}function H9(n,e){return e.length===0?e=[n]:n.end===e[0].start?e[0].start=n.start:e.unshift(n),e}function bee(n,e){for(let t=e;t0&&!vee(n.charCodeAt(t-1)))return t}return n.length}function YO(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=YO(n,e,t+1,i+1);!s&&(o=bee(e,o)).6}function ITe(n){const{upperPercent:e,lowerPercent:t,alphaPercent:i,numericPercent:s}=n;return t>.2&&e<.8&&i>.6&&s<.2}function TTe(n){let e=0,t=0,i=0,s=0;for(let o=0;o60)return null;const t=DTe(e);if(!ITe(t)){if(!ETe(t))return null;e=e.toLowerCase()}let i=null,s=0;for(n=n.toLowerCase();s0&&sI(n.charCodeAt(t-1)))return t;return n.length}const NTe=B9(ey,Cee,gee),ATe=B9(ey,Cee,pee),Mz=new Dg(1e4);function Rz(n,e,t=!1){if(typeof n!="string"||typeof e!="string")return null;let i=Mz.get(n);i||(i=new RegExp(Sve(n),"i"),Mz.set(n,i));const s=i.exec(e);return s?[{start:s.index,end:s.index+s[0].length}]:t?ATe(n,e):NTe(n,e)}function MTe(n,e){const t=fm(n,n.toLowerCase(),0,e,e.toLowerCase(),0,{firstMatchCanBeWeak:!0,boostFullMatch:!0});return t?DS(t):null}function RTe(n,e,t,i,s,o){const r=Math.min(13,n.length);for(;t"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 rf=128;function $9(){const n=[],e=[];for(let t=0;t<=rf;t++)e[t]=0;for(let t=0;t<=rf;t++)n.push(e.slice(0));return n}function yee(n){const e=[];for(let t=0;t<=n;t++)e[t]=0;return e}const See=yee(2*rf),XO=yee(2*rf),Yd=$9(),qg=$9(),ZL=$9();function XL(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!!T8(t)}}function Pz(n,e){if(e<0||e>=n.length)return!1;switch(n.charCodeAt(e)){case 32:case 9:return!0;default:return!1}}function wD(n,e,t){return e[n]!==t[n]}function PTe(n,e,t,i,s,o,r=!1){for(;erf?rf:n.length,l=i.length>rf?rf:i.length;if(t>=a||o>=l||a-t>l-o||!PTe(e,t,a,s,o,l,!0))return;OTe(a,l,t,o,e,s);let c=1,d=1,u=t,h=o;const f=[!1];for(c=1,u=t;ub,D=k?qg[c][d-1]+(Yd[c][d-1]>0?-5:0):0,x=h>b+1&&Yd[c][d-1]>0,A=x?qg[c][d-2]+(Yd[c][d-2]>0?-5:0):0;if(x&&(!k||A>=D)&&(!L||A>=S))qg[c][d]=A,ZL[c][d]=3,Yd[c][d]=0;else if(k&&(!L||D>=S))qg[c][d]=D,ZL[c][d]=2,Yd[c][d]=0;else if(L)qg[c][d]=S,ZL[c][d]=1,Yd[c][d]=Yd[c-1][d-1]+1;else throw new Error("not possible")}}if(!f[0]&&!r.firstMatchCanBeWeak)return;c--,d--;const g=[qg[c][d],o];let p=0,_=0;for(;c>=1;){let b=d;do{const C=ZL[c][b];if(C===3)b=b-2;else if(C===2)b=b-1;else break}while(b>=1);p>1&&e[t+c-1]===s[o+d-1]&&!wD(b+o-1,i,s)&&p+1>Yd[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 OTe(n,e,t,i,s,o){let r=n-1,a=e-1;for(;r>=t&&a>=i;)s[r]===o[a]&&(XO[r]=a,r--),a--}function FTe(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:wD(r,s,o)&&(r===0||!wD(r-1,s,o))?(u=n[t]===s[r]?7:5,h=!0):XL(o,r)&&(r===0||!XL(o,r-1))?u=5:(XL(o,r-1)||Pz(o,r-1))&&(u=5,h=!0),u>1&&t===i&&(d[0]=!0),h||(h=wD(r,s,o)||XL(o,r-1)||Pz(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}function BTe(n,e,t,i,s,o,r){return WTe(n,e,t,i,s,o,!0,r)}function WTe(n,e,t,i,s,o,r,a){let l=fm(n,e,t,i,s,o,a);if(l&&!r)return l;if(n.length>=3){const c=Math.min(7,n.length-1);for(let d=t+1;dl[0])&&(l=h))}}}return l}function VTe(n,e){if(e+1>=n.length)return;const t=n[e],i=n[e+1];if(t!==i)return n.slice(0,e)+i+t+n.slice(e+2)}const HTe="$(",z9=new RegExp("\\$\\(".concat(dt.iconNameExpression,"(?:").concat(dt.iconModifierExpression,")?\\)"),"g"),$Te=new RegExp("(\\\\)?".concat(z9.source),"g");function zTe(n){return n.replace($Te,(e,t)=>t?e:"\\".concat(e))}const UTe=new RegExp("\\\\".concat(z9.source),"g");function jTe(n){return n.replace(UTe,e=>"\\".concat(e))}const KTe=new RegExp("(\\s)?(\\\\)?".concat(z9.source,"(\\s)?"),"g");function U9(n){return n.indexOf(HTe)===-1?n:n.replace(KTe,(e,t,i,s)=>i?e:t||s||"")}function qTe(n){return n?n.replace(/\$\((.*?)\)/g,(e,t)=>" ".concat(t," ")).trim():""}const YM=new RegExp("\\$\\(".concat(dt.iconNameCharacter,"+\\)"),"g");function Z1(n){YM.lastIndex=0;let e="";const t=[];let i=0;for(;;){const s=YM.lastIndex,o=YM.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?"\\\n":"\n\n"),this}appendMarkdown(e){return this.value+=e,this}appendCodeblock(e,t){return this.value+="\n```",this.value+=e,this.value+="\n",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+=' "'.concat(this._escape(this._escape(i,'"'),")"),'"')),this.value+=")",this}_escape(e,t){const i=new RegExp(Xr(t),"g");return e.replace(i,(s,o)=>e.charAt(o-1)!=="\\"?"\\".concat(s):s)}}function Vb(n){return Lf(n)?!n.value:Array.isArray(n)?n.every(Vb):!0}function Lf(n){return n instanceof Bs?!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 GTe(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&&_9(ct.from(n.baseUri),ct.from(e.baseUri)))}function YTe(n){return n.replace(/[\\`*_{}[\]()#+\-!~]/g,"\\$&")}function QL(n){return n.replace(/"/g,""")}function XM(n){return n&&n.replace(/\\([\\`*_{}[\]()#+\-.!~])/g,"$1")}function ZTe(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="'.concat(a,'"')),c&&e.push('height="'.concat(r,'"'))}return{href:n,dimensions:e}}var QO=globalThis&&globalThis.__awaiter||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 XTe(n,e){Mo(e)?n.title=U9(e):e!=null&&e.markdownNotSupportedFallback?n.title=e.markdownNotSupportedFallback:n.removeAttribute("title")}class QTe{constructor(e,t,i){this.hoverDelegate=e,this.target=t,this.fadeInAnimation=i}update(e,t,i){var s;return QO(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||Mo(e)||e instanceof HTMLElement)o=e;else if(!hw(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 Tn;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?Lf(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 Lee(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 _l(()=>QO(this,void 0,void 0,function*(){(!o||o.isDisposed)&&(o=new QTe(n,f||e,u>0),yield o.update(t,h,i))}),u),l=()=>{if(s)return;const u=new be,h=p=>r(!1,p.fromElement===e);u.add(ce(e,Pe.MOUSE_LEAVE,h,!0));const f=()=>r(!0,!0);u.add(ce(e,Pe.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(ce(e,Pe.MOUSE_MOVE,p,!0))}u.add(a(n.delay,!1,g)),s=u},c=ce(e,Pe.MOUSE_OVER,l,!0);return{show:u=>{r(!1,!0),a(0,u)},hide:()=>{r(!0,!0)},update:(u,h)=>QO(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 JTe(n,e={}){const t=j9(e);return t.textContent=n,t}function exe(n,e={}){const t=j9(e);return kee(t,ixe(n,!!e.renderCodeSegments),e.actionHandler,e.renderCodeSegments),t}function j9(n){const e=n.inline?"span":"div",t=document.createElement(e);return n.className&&(t.className=n.className),t}class txe{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 kee(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(In(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=>{kee(s,o,t,i)})}function ixe(n,e){const t={type:1,children:[]};let i=0,s=t;const o=[],r=new txe(n);for(;!r.eos();){let a=r.next();const l=a==="\\"&&JO(r.peek(),e)!==0;if(l&&(a=r.next()),!l&&nxe(a,e)&&a===r.peek()){r.advance(),s.type===2&&(s=o.pop());const c=JO(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==="\n")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 nxe(n,e){return JO(n,e)!==0}function JO(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 sxe=new RegExp("(\\\\)?\\$\\((".concat(dt.iconNameExpression,"(?:").concat(dt.iconModifierExpression,")?)\\)"),"g");function kf(n){const e=new Array;let t,i=0,s=0;for(;(t=sxe.exec(n))!==null;){s=t.index||0,iK.length)&&(V=K.length);for(var G=0,N=new Array(V);G=K.length?{done:!0}:{done:!1,value:K[N++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn 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(K){e.defaults=K}var c=/[&<>"']/,d=/[&<>"']/g,u=/[<>"']|&(?!#?\w+;)/,h=/[<>"']|&(?!#?\w+;)/g,f={"&":"&","<":"<",">":">",'"':""","'":"'"},g=function(V){return f[V]};function p(K,V){if(V){if(c.test(K))return K.replace(d,g)}else if(u.test(K))return K.replace(h,g);return K}var _=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function v(K){return K.replace(_,function(V,G){return G=G.toLowerCase(),G==="colon"?":":G.charAt(0)==="#"?G.charAt(1)==="x"?String.fromCharCode(parseInt(G.substring(2),16)):String.fromCharCode(+G.substring(1)):""})}var b=/(^|[^\[])\^/g;function C(K,V){K=typeof K=="string"?K:K.source,V=V||"";var G={replace:function(R,U){return U=U.source||U,U=U.replace(b,"$1"),K=K.replace(R,U),G},getRegex:function(){return new RegExp(K,V)}};return G}var w=/[^\w:]/g,y=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function L(K,V,G){if(K){var N;try{N=decodeURIComponent(v(G)).replace(w,"").toLowerCase()}catch{return null}if(N.indexOf("javascript:")===0||N.indexOf("vbscript:")===0||N.indexOf("data:")===0)return null}V&&!y.test(G)&&(G=A(V,G));try{G=encodeURI(G).replace(/%25/g,"%")}catch{return null}return G}var S={},k=/^[^:]+:\/*[^/]*$/,D=/^([^:]+:)[\s\S]*$/,x=/^([^:]+:\/*[^/]*)[\s\S]*$/;function A(K,V){S[" "+K]||(k.test(K)?S[" "+K]=K+"/":S[" "+K]=$(K,"/",!0)),K=S[" "+K];var G=K.indexOf(":")===-1;return V.substring(0,2)==="//"?G?V:K.replace(D,"$1")+V:V.charAt(0)==="/"?G?V:K.replace(x,"$1")+V:K+V}var T={exec:function(){}};function P(K){for(var V=1,G,N;V=0&&he[qe]==="\\";)Le=!Le;return Le?"|":" |"}),N=G.split(/ \|/),R=0;if(N[0].trim()||N.shift(),N.length>0&&!N[N.length-1].trim()&&N.pop(),N.length>V)N.splice(V);else for(;N.length1;)V&1&&(G+=K),V>>=1,K+=K;return G+K}function le(K,V,G,N){var R=V.href,U=V.title?p(V.title):null,H=K[1].replace(/\\([\[\]])/g,"$1");if(K[0].charAt(0)!=="!"){N.state.inLink=!0;var he={type:"link",raw:G,href:R,title:U,text:H,tokens:N.inlineTokens(H)};return N.state.inLink=!1,he}return{type:"image",raw:G,href:R,title:U,text:p(H)}}function de(K,V){var G=K.match(/^(\s+)(?:```)/);if(G===null)return V;var N=G[1];return V.split("\n").map(function(R){var U=R.match(/^\s+/);if(U===null)return R;var H=U[0];return H.length>=N.length?R.slice(N.length):R}).join("\n")}var _e=function(){function K(G){this.options=G||e.defaults}var V=K.prototype;return V.space=function(N){var R=this.rules.block.newline.exec(N);if(R&&R[0].length>0)return{type:"space",raw:R[0]}},V.code=function(N){var R=this.rules.block.code.exec(N);if(R){var U=R[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:R[0],codeBlockStyle:"indented",text:this.options.pedantic?U:$(U,"\n")}}},V.fences=function(N){var R=this.rules.block.fences.exec(N);if(R){var U=R[0],H=de(U,R[3]||"");return{type:"code",raw:U,lang:R[2]?R[2].trim():R[2],text:H}}},V.heading=function(N){var R=this.rules.block.heading.exec(N);if(R){var U=R[2].trim();if(/#$/.test(U)){var H=$(U,"#");(this.options.pedantic||!H||/ $/.test(H))&&(U=H.trim())}return{type:"heading",raw:R[0],depth:R[1].length,text:U,tokens:this.lexer.inline(U)}}},V.hr=function(N){var R=this.rules.block.hr.exec(N);if(R)return{type:"hr",raw:R[0]}},V.blockquote=function(N){var R=this.rules.block.blockquote.exec(N);if(R){var U=R[0].replace(/^ *>[ \t]?/gm,"");return{type:"blockquote",raw:R[0],tokens:this.lexer.blockTokens(U,[]),text:U}}},V.list=function(N){var R=this.rules.block.list.exec(N);if(R){var U,H,he,Le,qe,ot,yt,Et,gi,_i,ft,Ci,Xi=R[1].trim(),za=Xi.length>1,ui={type:"list",raw:"",ordered:za,start:za?+Xi.slice(0,-1):"",loose:!1,items:[]};Xi=za?"\\d{1,9}\\"+Xi.slice(-1):"\\"+Xi,this.options.pedantic&&(Xi=za?Xi:"[*+-]");for(var Gn=new RegExp("^( {0,3}"+Xi+")((?:[ ][^\\n]*)?(?:\\n|$))");N&&(Ci=!1,!(!(R=Gn.exec(N))||this.rules.block.hr.test(N)));){if(U=R[0],N=N.substring(U.length),Et=R[2].split("\n",1)[0],gi=N.split("\n",1)[0],this.options.pedantic?(Le=2,ft=Et.trimLeft()):(Le=R[2].search(/[^ ]/),Le=Le>4?1:Le,ft=Et.slice(Le),Le+=R[1].length),ot=!1,!Et&&/^ *$/.test(gi)&&(U+=gi+"\n",N=N.substring(gi.length+1),Ci=!0),!Ci)for(var Bg=new RegExp("^ {0,"+Math.min(3,Le-1)+"}(?:[*+-]|\\d{1,9}[.)])((?: [^\\n]*)?(?:\\n|$))"),Wg=new RegExp("^ {0,"+Math.min(3,Le-1)+"}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)"),Dl=new RegExp("^ {0,"+Math.min(3,Le-1)+"}(?:```|~~~)"),uh=new RegExp("^ {0,"+Math.min(3,Le-1)+"}#");N&&(_i=N.split("\n",1)[0],Et=_i,this.options.pedantic&&(Et=Et.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),!(Dl.test(Et)||uh.test(Et)||Bg.test(Et)||Wg.test(N)));){if(Et.search(/[^ ]/)>=Le||!Et.trim())ft+="\n"+Et.slice(Le);else if(!ot)ft+="\n"+Et;else break;!ot&&!Et.trim()&&(ot=!0),U+=_i+"\n",N=N.substring(_i.length+1)}ui.loose||(yt?ui.loose=!0:/\n *\n *$/.test(U)&&(yt=!0)),this.options.gfm&&(H=/^\[[ xX]\] /.exec(ft),H&&(he=H[0]!=="[ ] ",ft=ft.replace(/^\[[ xX]\] +/,""))),ui.items.push({type:"list_item",raw:U,task:!!H,checked:he,loose:!1,text:ft}),ui.raw+=U}ui.items[ui.items.length-1].raw=U.trimRight(),ui.items[ui.items.length-1].text=ft.trimRight(),ui.raw=ui.raw.trimRight();var Vg=ui.items.length;for(qe=0;qe1)return!0}return!1});!ui.loose&&Hg.length&&p_&&(ui.loose=!0,ui.items[qe].loose=!0)}return ui}},V.html=function(N){var R=this.rules.block.html.exec(N);if(R){var U={type:"html",raw:R[0],pre:!this.options.sanitizer&&(R[1]==="pre"||R[1]==="script"||R[1]==="style"),text:R[0]};if(this.options.sanitize){var H=this.options.sanitizer?this.options.sanitizer(R[0]):p(R[0]);U.type="paragraph",U.text=H,U.tokens=this.lexer.inline(H)}return U}},V.def=function(N){var R=this.rules.block.def.exec(N);if(R){R[3]&&(R[3]=R[3].substring(1,R[3].length-1));var U=R[1].toLowerCase().replace(/\s+/g," ");return{type:"def",tag:U,raw:R[0],href:R[2],title:R[3]}}},V.table=function(N){var R=this.rules.block.table.exec(N);if(R){var U={type:"table",header:W(R[1]).map(function(yt){return{text:yt}}),align:R[2].replace(/^ *|\| *$/g,"").split(/ *\| */),rows:R[3]&&R[3].trim()?R[3].replace(/\n[ \t]*$/,"").split("\n"):[]};if(U.header.length===U.align.length){U.raw=R[0];var H=U.align.length,he,Le,qe,ot;for(he=0;he/i.test(R[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(R[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(R[0])&&(this.lexer.state.inRawBlock=!1),{type:this.options.sanitize?"text":"html",raw:R[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(R[0]):p(R[0]):R[0]}},V.link=function(N){var R=this.rules.inline.link.exec(N);if(R){var U=R[2].trim();if(!this.options.pedantic&&/^$/.test(U))return;var H=$(U.slice(0,-1),"\\");if((U.length-H.length)%2===0)return}else{var he=X(R[2],"()");if(he>-1){var Le=R[0].indexOf("!")===0?5:4,qe=Le+R[1].length+he;R[2]=R[2].substring(0,he),R[0]=R[0].substring(0,qe).trim(),R[3]=""}}var ot=R[2],yt="";if(this.options.pedantic){var Et=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(ot);Et&&(ot=Et[1],yt=Et[3])}else yt=R[3]?R[3].slice(1,-1):"";return ot=ot.trim(),/^$/.test(U)?ot=ot.slice(1):ot=ot.slice(1,-1)),le(R,{href:ot&&ot.replace(this.rules.inline._escapes,"$1"),title:yt&&yt.replace(this.rules.inline._escapes,"$1")},R[0],this.lexer)}},V.reflink=function(N,R){var U;if((U=this.rules.inline.reflink.exec(N))||(U=this.rules.inline.nolink.exec(N))){var H=(U[2]||U[1]).replace(/\s+/g," ");if(H=R[H.toLowerCase()],!H||!H.href){var he=U[0].charAt(0);return{type:"text",raw:he,text:he}}return le(U,H,U[0],this.lexer)}},V.emStrong=function(N,R,U){U===void 0&&(U="");var H=this.rules.inline.emStrong.lDelim.exec(N);if(H&&!(H[3]&&U.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 he=H[1]||H[2]||"";if(!he||he&&(U===""||this.rules.inline.punctuation.exec(U))){var Le=H[0].length-1,qe,ot,yt=Le,Et=0,gi=H[0][0]==="*"?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(gi.lastIndex=0,R=R.slice(-1*N.length+Le);(H=gi.exec(R))!=null;)if(qe=H[1]||H[2]||H[3]||H[4]||H[5]||H[6],!!qe){if(ot=qe.length,H[3]||H[4]){yt+=ot;continue}else if((H[5]||H[6])&&Le%3&&!((Le+ot)%3)){Et+=ot;continue}if(yt-=ot,!(yt>0)){if(ot=Math.min(ot,ot+yt+Et),Math.min(Le,ot)%2){var _i=N.slice(1,Le+H.index+ot);return{type:"em",raw:N.slice(0,Le+H.index+ot+1),text:_i,tokens:this.lexer.inlineTokens(_i)}}var ft=N.slice(2,Le+H.index+ot-1);return{type:"strong",raw:N.slice(0,Le+H.index+ot+1),text:ft,tokens:this.lexer.inlineTokens(ft)}}}}}},V.codespan=function(N){var R=this.rules.inline.code.exec(N);if(R){var U=R[2].replace(/\n/g," "),H=/[^ ]/.test(U),he=/^ /.test(U)&&/ $/.test(U);return H&&he&&(U=U.substring(1,U.length-1)),U=p(U,!0),{type:"codespan",raw:R[0],text:U}}},V.br=function(N){var R=this.rules.inline.br.exec(N);if(R)return{type:"br",raw:R[0]}},V.del=function(N){var R=this.rules.inline.del.exec(N);if(R)return{type:"del",raw:R[0],text:R[2],tokens:this.lexer.inlineTokens(R[2])}},V.autolink=function(N,R){var U=this.rules.inline.autolink.exec(N);if(U){var H,he;return U[2]==="@"?(H=p(this.options.mangle?R(U[1]):U[1]),he="mailto:"+H):(H=p(U[1]),he=H),{type:"link",raw:U[0],text:H,href:he,tokens:[{type:"text",raw:H,text:H}]}}},V.url=function(N,R){var U;if(U=this.rules.inline.url.exec(N)){var H,he;if(U[2]==="@")H=p(this.options.mangle?R(U[0]):U[0]),he="mailto:"+H;else{var Le;do Le=U[0],U[0]=this.rules.inline._backpedal.exec(U[0])[0];while(Le!==U[0]);H=p(U[0]),U[1]==="www."?he="http://"+H:he=H}return{type:"link",raw:U[0],text:H,href:he,tokens:[{type:"text",raw:H,text:H}]}}},V.inlineText=function(N,R){var U=this.rules.inline.text.exec(N);if(U){var H;return this.lexer.state.inRawBlock?H=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(U[0]):p(U[0]):U[0]:H=p(this.options.smartypants?R(U[0]):U[0]),{type:"text",raw:U[0],text:H}}},K}(),ie={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:T,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,text:/^[^\n]+/};ie._label=/(?!\s*\])(?:\\.|[^\[\]\\])+/,ie._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,ie.def=C(ie.def).replace("label",ie._label).replace("title",ie._title).getRegex(),ie.bullet=/(?:[*+-]|\d{1,9}[.)])/,ie.listItemStart=C(/^( *)(bull) */).replace("bull",ie.bullet).getRegex(),ie.list=C(ie.list).replace(/bull/g,ie.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+ie.def.source+")").getRegex(),ie._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",ie._comment=/|$)/,ie.html=C(ie.html,"i").replace("comment",ie._comment).replace("tag",ie._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),ie.paragraph=C(ie._paragraph).replace("hr",ie.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",ie._tag).getRegex(),ie.blockquote=C(ie.blockquote).replace("paragraph",ie.paragraph).getRegex(),ie.normal=P({},ie),ie.gfm=P({},ie.normal,{table:"^ *([^\\n ].*\\|.*)\\n {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)(?:\\| *)?(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"}),ie.gfm.table=C(ie.gfm.table).replace("hr",ie.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",ie._tag).getRegex(),ie.gfm.paragraph=C(ie._paragraph).replace("hr",ie.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("table",ie.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",ie._tag).getRegex(),ie.pedantic=P({},ie.normal,{html:C("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",ie._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:T,paragraph:C(ie.normal._paragraph).replace("hr",ie.hr).replace("heading"," *#{1,6} *[^\n]").replace("lheading",ie.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var ne={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:T,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:T,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\?@\\[\\]`^{|}~",ne.punctuation=C(ne.punctuation).replace(/punctuation/g,ne._punctuation).getRegex(),ne.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g,ne.escapedEmSt=/\\\*|\\_/g,ne._comment=C(ie._comment).replace("(?:-->|$)","-->").getRegex(),ne.emStrong.lDelim=C(ne.emStrong.lDelim).replace(/punct/g,ne._punctuation).getRegex(),ne.emStrong.rDelimAst=C(ne.emStrong.rDelimAst,"g").replace(/punct/g,ne._punctuation).getRegex(),ne.emStrong.rDelimUnd=C(ne.emStrong.rDelimUnd,"g").replace(/punct/g,ne._punctuation).getRegex(),ne._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,ne._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,ne._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])?)+(?![-_])/,ne.autolink=C(ne.autolink).replace("scheme",ne._scheme).replace("email",ne._email).getRegex(),ne._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,ne.tag=C(ne.tag).replace("comment",ne._comment).replace("attribute",ne._attribute).getRegex(),ne._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,ne._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/,ne._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,ne.link=C(ne.link).replace("label",ne._label).replace("href",ne._href).replace("title",ne._title).getRegex(),ne.reflink=C(ne.reflink).replace("label",ne._label).replace("ref",ie._label).getRegex(),ne.nolink=C(ne.nolink).replace("ref",ie._label).getRegex(),ne.reflinkSearch=C(ne.reflinkSearch,"g").replace("reflink",ne.reflink).replace("nolink",ne.nolink).getRegex(),ne.normal=P({},ne),ne.pedantic=P({},ne.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:C(/^!?\[(label)\]\((.*?)\)/).replace("label",ne._label).getRegex(),reflink:C(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",ne._label).getRegex()}),ne.gfm=P({},ne.normal,{escape:C(ne.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&&(N="x"+N.toString(16)),V+="&#"+N+";";return V}var Ee=function(){function K(G){this.tokens=[],this.tokens.links=Object.create(null),this.options=G||e.defaults,this.options.tokenizer=this.options.tokenizer||new _e,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 N={block:ie.normal,inline:ne.normal};this.options.pedantic?(N.block=ie.pedantic,N.inline=ne.pedantic):this.options.gfm&&(N.block=ie.gfm,this.options.breaks?N.inline=ne.breaks:N.inline=ne.gfm),this.tokenizer.rules=N}K.lex=function(N,R){var U=new K(R);return U.lex(N)},K.lexInline=function(N,R){var U=new K(R);return U.inlineTokens(N)};var V=K.prototype;return V.lex=function(N){N=N.replace(/\r\n|\r/g,"\n"),this.blockTokens(N,this.tokens);for(var R;R=this.inlineQueue.shift();)this.inlineTokens(R.src,R.tokens);return this.tokens},V.blockTokens=function(N,R){var U=this;R===void 0&&(R=[]),this.options.pedantic?N=N.replace(/\t/g," ").replace(/^ +$/gm,""):N=N.replace(/^( *)(\t+)/gm,function(yt,Et,gi){return Et+" ".repeat(gi.length)});for(var H,he,Le,qe;N;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(function(yt){return(H=yt.call({lexer:U},N,R))?(N=N.substring(H.raw.length),R.push(H),!0):!1}))){if(H=this.tokenizer.space(N)){N=N.substring(H.raw.length),H.raw.length===1&&R.length>0?R[R.length-1].raw+="\n":R.push(H);continue}if(H=this.tokenizer.code(N)){N=N.substring(H.raw.length),he=R[R.length-1],he&&(he.type==="paragraph"||he.type==="text")?(he.raw+="\n"+H.raw,he.text+="\n"+H.text,this.inlineQueue[this.inlineQueue.length-1].src=he.text):R.push(H);continue}if(H=this.tokenizer.fences(N)){N=N.substring(H.raw.length),R.push(H);continue}if(H=this.tokenizer.heading(N)){N=N.substring(H.raw.length),R.push(H);continue}if(H=this.tokenizer.hr(N)){N=N.substring(H.raw.length),R.push(H);continue}if(H=this.tokenizer.blockquote(N)){N=N.substring(H.raw.length),R.push(H);continue}if(H=this.tokenizer.list(N)){N=N.substring(H.raw.length),R.push(H);continue}if(H=this.tokenizer.html(N)){N=N.substring(H.raw.length),R.push(H);continue}if(H=this.tokenizer.def(N)){N=N.substring(H.raw.length),he=R[R.length-1],he&&(he.type==="paragraph"||he.type==="text")?(he.raw+="\n"+H.raw,he.text+="\n"+H.raw,this.inlineQueue[this.inlineQueue.length-1].src=he.text):this.tokens.links[H.tag]||(this.tokens.links[H.tag]={href:H.href,title:H.title});continue}if(H=this.tokenizer.table(N)){N=N.substring(H.raw.length),R.push(H);continue}if(H=this.tokenizer.lheading(N)){N=N.substring(H.raw.length),R.push(H);continue}if(Le=N,this.options.extensions&&this.options.extensions.startBlock&&function(){var yt=1/0,Et=N.slice(1),gi=void 0;U.options.extensions.startBlock.forEach(function(_i){gi=_i.call({lexer:this},Et),typeof gi=="number"&&gi>=0&&(yt=Math.min(yt,gi))}),yt<1/0&&yt>=0&&(Le=N.substring(0,yt+1))}(),this.state.top&&(H=this.tokenizer.paragraph(Le))){he=R[R.length-1],qe&&he.type==="paragraph"?(he.raw+="\n"+H.raw,he.text+="\n"+H.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=he.text):R.push(H),qe=Le.length!==N.length,N=N.substring(H.raw.length);continue}if(H=this.tokenizer.text(N)){N=N.substring(H.raw.length),he=R[R.length-1],he&&he.type==="text"?(he.raw+="\n"+H.raw,he.text+="\n"+H.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=he.text):R.push(H);continue}if(N){var ot="Infinite loop on byte: "+N.charCodeAt(0);if(this.options.silent){console.error(ot);break}else throw new Error(ot)}}return this.state.top=!0,R},V.inline=function(N,R){return R===void 0&&(R=[]),this.inlineQueue.push({src:N,tokens:R}),R},V.inlineTokens=function(N,R){var U=this;R===void 0&&(R=[]);var H,he,Le,qe=N,ot,yt,Et;if(this.tokens.links){var gi=Object.keys(this.tokens.links);if(gi.length>0)for(;(ot=this.tokenizer.rules.inline.reflinkSearch.exec(qe))!=null;)gi.includes(ot[0].slice(ot[0].lastIndexOf("[")+1,-1))&&(qe=qe.slice(0,ot.index)+"["+Q("a",ot[0].length-2)+"]"+qe.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(ot=this.tokenizer.rules.inline.blockSkip.exec(qe))!=null;)qe=qe.slice(0,ot.index)+"["+Q("a",ot[0].length-2)+"]"+qe.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(ot=this.tokenizer.rules.inline.escapedEmSt.exec(qe))!=null;)qe=qe.slice(0,ot.index)+"++"+qe.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex);for(;N;)if(yt||(Et=""),yt=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(function(ft){return(H=ft.call({lexer:U},N,R))?(N=N.substring(H.raw.length),R.push(H),!0):!1}))){if(H=this.tokenizer.escape(N)){N=N.substring(H.raw.length),R.push(H);continue}if(H=this.tokenizer.tag(N)){N=N.substring(H.raw.length),he=R[R.length-1],he&&H.type==="text"&&he.type==="text"?(he.raw+=H.raw,he.text+=H.text):R.push(H);continue}if(H=this.tokenizer.link(N)){N=N.substring(H.raw.length),R.push(H);continue}if(H=this.tokenizer.reflink(N,this.tokens.links)){N=N.substring(H.raw.length),he=R[R.length-1],he&&H.type==="text"&&he.type==="text"?(he.raw+=H.raw,he.text+=H.text):R.push(H);continue}if(H=this.tokenizer.emStrong(N,qe,Et)){N=N.substring(H.raw.length),R.push(H);continue}if(H=this.tokenizer.codespan(N)){N=N.substring(H.raw.length),R.push(H);continue}if(H=this.tokenizer.br(N)){N=N.substring(H.raw.length),R.push(H);continue}if(H=this.tokenizer.del(N)){N=N.substring(H.raw.length),R.push(H);continue}if(H=this.tokenizer.autolink(N,pe)){N=N.substring(H.raw.length),R.push(H);continue}if(!this.state.inLink&&(H=this.tokenizer.url(N,pe))){N=N.substring(H.raw.length),R.push(H);continue}if(Le=N,this.options.extensions&&this.options.extensions.startInline&&function(){var ft=1/0,Ci=N.slice(1),Xi=void 0;U.options.extensions.startInline.forEach(function(za){Xi=za.call({lexer:this},Ci),typeof Xi=="number"&&Xi>=0&&(ft=Math.min(ft,Xi))}),ft<1/0&&ft>=0&&(Le=N.substring(0,ft+1))}(),H=this.tokenizer.inlineText(Le,Ye)){N=N.substring(H.raw.length),H.raw.slice(-1)!=="_"&&(Et=H.raw.slice(-1)),yt=!0,he=R[R.length-1],he&&he.type==="text"?(he.raw+=H.raw,he.text+=H.text):R.push(H);continue}if(N){var _i="Infinite loop on byte: "+N.charCodeAt(0);if(this.options.silent){console.error(_i);break}else throw new Error(_i)}}return R},i(K,null,[{key:"rules",get:function(){return{block:ie,inline:ne}}}]),K}(),ze=function(){function K(G){this.options=G||e.defaults}var V=K.prototype;return V.code=function(N,R,U){var H=(R||"").match(/\S*/)[0];if(this.options.highlight){var he=this.options.highlight(N,H);he!=null&&he!==N&&(U=!0,N=he)}return N=N.replace(/\n$/,"")+"\n",H?'
'+(U?N:p(N,!0))+"
\n":"
"+(U?N:p(N,!0))+"
\n"},V.blockquote=function(N){return"
\n"+N+"
\n"},V.html=function(N){return N},V.heading=function(N,R,U,H){if(this.options.headerIds){var he=this.options.headerPrefix+H.slug(U);return"'+N+"\n"}return""+N+"\n"},V.hr=function(){return this.options.xhtml?"
\n":"
\n"},V.list=function(N,R,U){var H=R?"ol":"ul",he=R&&U!==1?' start="'+U+'"':"";return"<"+H+he+">\n"+N+"\n"},V.listitem=function(N){return"
  • "+N+"
  • \n"},V.checkbox=function(N){return" "},V.paragraph=function(N){return"

    "+N+"

    \n"},V.table=function(N,R){return R&&(R=""+R+""),"\n\n"+N+"\n"+R+"
    \n"},V.tablerow=function(N){return"\n"+N+"\n"},V.tablecell=function(N,R){var U=R.header?"th":"td",H=R.align?"<"+U+' align="'+R.align+'">':"<"+U+">";return H+N+("\n")},V.strong=function(N){return""+N+""},V.em=function(N){return""+N+""},V.codespan=function(N){return""+N+""},V.br=function(){return this.options.xhtml?"
    ":"
    "},V.del=function(N){return""+N+""},V.link=function(N,R,U){if(N=L(this.options.sanitize,this.options.baseUrl,N),N===null)return U;var H='",H},V.image=function(N,R,U){if(N=L(this.options.sanitize,this.options.baseUrl,N),N===null)return U;var H=''+U+'":">",H},V.text=function(N){return N},K}(),It=function(){function K(){}var V=K.prototype;return V.strong=function(N){return N},V.em=function(N){return N},V.codespan=function(N){return N},V.del=function(N){return N},V.html=function(N){return N},V.text=function(N){return N},V.link=function(N,R,U){return""+U},V.image=function(N,R,U){return""+U},V.br=function(){return""},K}(),Ke=function(){function K(){this.seen={}}var V=K.prototype;return V.serialize=function(N){return N.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")},V.getNextSafeSlug=function(N,R){var U=N,H=0;if(this.seen.hasOwnProperty(U)){H=this.seen[N];do H++,U=N+"-"+H;while(this.seen.hasOwnProperty(U))}return R||(this.seen[N]=H,this.seen[U]=0),U},V.slug=function(N,R){R===void 0&&(R={});var U=this.serialize(N);return this.getNextSafeSlug(U,R.dryrun)},K}(),Xe=function(){function K(G){this.options=G||e.defaults,this.options.renderer=this.options.renderer||new ze,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new It,this.slugger=new Ke}K.parse=function(N,R){var U=new K(R);return U.parse(N)},K.parseInline=function(N,R){var U=new K(R);return U.parseInline(N)};var V=K.prototype;return V.parse=function(N,R){R===void 0&&(R=!0);var U="",H,he,Le,qe,ot,yt,Et,gi,_i,ft,Ci,Xi,za,ui,Gn,Bg,Wg,Dl,uh,Vg=N.length;for(H=0;H0&&Gn.tokens[0].type==="paragraph"?(Gn.tokens[0].text=Dl+" "+Gn.tokens[0].text,Gn.tokens[0].tokens&&Gn.tokens[0].tokens.length>0&&Gn.tokens[0].tokens[0].type==="text"&&(Gn.tokens[0].tokens[0].text=Dl+" "+Gn.tokens[0].tokens[0].text)):Gn.tokens.unshift({type:"text",text:Dl}):ui+=Dl),ui+=this.parse(Gn.tokens,za),_i+=this.renderer.listitem(ui,Wg,Bg);U+=this.renderer.list(_i,Ci,Xi);continue}case"html":{U+=this.renderer.html(ft.text);continue}case"paragraph":{U+=this.renderer.paragraph(this.parseInline(ft.tokens));continue}case"text":{for(_i=ft.tokens?this.parseInline(ft.tokens):ft.text;H+1"u"||K===null)throw new Error("marked(): input parameter is undefined or null");if(typeof K!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(K)+", string expected");if(typeof V=="function"&&(G=V,V=null),V=P({},je.defaults,V||{}),J(V),G){var N=V.highlight,R;try{R=Ee.lex(K,V)}catch(qe){return G(qe)}var U=function(ot){var yt;if(!ot)try{V.walkTokens&&je.walkTokens(R,V.walkTokens),yt=Xe.parse(R,V)}catch(Et){ot=Et}return V.highlight=N,ot?G(ot):G(null,yt)};if(!N||N.length<3||(delete V.highlight,!R.length))return U();var H=0;je.walkTokens(R,function(qe){qe.type==="code"&&(H++,setTimeout(function(){N(qe.text,qe.lang,function(ot,yt){if(ot)return U(ot);yt!=null&&yt!==qe.text&&(qe.text=yt,qe.escaped=!0),H--,H===0&&U()})},0))}),H===0&&U();return}function he(qe){if(qe.message+="\nPlease report this to https://github.com/markedjs/marked.",V.silent)return"

    An error occurred:

    "+p(qe.message+"",!0)+"
    ";throw qe}try{var Le=Ee.lex(K,V);if(V.walkTokens){if(V.async)return Promise.all(je.walkTokens(Le,V.walkTokens)).then(function(){return Xe.parse(Le,V)}).catch(he);je.walkTokens(Le,V.walkTokens)}return Xe.parse(Le,V)}catch(qe){he(qe)}}je.options=je.setOptions=function(K){return P(je.defaults,K),l(je.defaults),je},je.getDefaults=a,je.defaults=e.defaults,je.use=function(){for(var K=arguments.length,V=new Array(K),G=0;G"u"||K===null)throw new Error("marked.parseInline(): input parameter is undefined or null");if(typeof K!="string")throw new Error("marked.parseInline(): input parameter is of type "+Object.prototype.toString.call(K)+", string expected");V=P({},je.defaults,V||{}),J(V);try{var G=Ee.lexInline(K,V);return V.walkTokens&&je.walkTokens(G,V.walkTokens),Xe.parseInline(G,V)}catch(N){if(N.message+="\nPlease report this to https://github.com/markedjs/marked.",V.silent)return"

    An error occurred:

    "+p(N.message+"",!0)+"
    ";throw N}},je.Parser=Xe,je.parser=Xe.parse,je.Renderer=ze,je.TextRenderer=It,je.Lexer=Ee,je.lexer=Ee.lex,je.Tokenizer=_e,je.Slugger=Ke,je.parse=je;var Z=je.options,z=je.setOptions,ae=je.use,we=je.walkTokens,Ne=je.parseInline,Ce=je,Be=Xe.parse,Ae=Ee.lex;e.Lexer=Ee,e.Parser=Xe,e.Renderer=ze,e.Slugger=Ke,e.TextRenderer=It,e.Tokenizer=_e,e.getDefaults=a,e.lexer=Ae,e.marked=je,e.options=Z,e.parse=Ce,e.parseInline=Ne,e.parser=Be,e.setOptions=z,e.use=ae,e.walkTokens=we,Object.defineProperty(e,"__esModule",{value:!0})})})();Fo.Lexer||exports.Lexer;Fo.Parser||exports.Parser;Fo.Renderer||exports.Renderer;Fo.Slugger||exports.Slugger;Fo.TextRenderer||exports.TextRenderer;Fo.Tokenizer||exports.Tokenizer;Fo.getDefaults||exports.getDefaults;Fo.lexer||exports.lexer;var Zc=Fo.marked||exports.marked;Fo.options||exports.options;Fo.parse||exports.parse;Fo.parseInline||exports.parseInline;Fo.parser||exports.parser;Fo.setOptions||exports.setOptions;Fo.use||exports.use;Fo.walkTokens||exports.walkTokens;function oxe(n){return JSON.stringify(n,rxe)}function i4(n){let e=JSON.parse(n);return e=n4(e),e}function rxe(n,e){return e instanceof RegExp?{$mid:2,source:e.source,flags:e.flags}:e}function n4(n,e=0){if(!n||e>200)return n;if(typeof n=="object"){switch(n.$mid){case 1:return ct.revive(n);case 2:return new RegExp(n.source,n.flags);case 17:return new Date(n.source)}if(n instanceof cx||n instanceof Uint8Array)return n;if(Array.isArray(n))for(let t=0;t{let i=[],s=[];return n&&({href:n,dimensions:i}=ZTe(n),s.push('src="'.concat(QL(n),'"'))),t&&s.push('alt="'.concat(QL(t),'"')),e&&s.push('title="'.concat(QL(e),'"')),i.length&&(s=s.concat(i)),""},paragraph:n=>"

    ".concat(n,"

    "),link:(n,e,t)=>typeof n!="string"?"":(n===t&&(t=XM(t)),e=typeof e=="string"?QL(XM(e)):"",n=XM(n),n=n.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'"),'
    ').concat(t,""))});function Fx(n,e={},t={}){var i,s;const o=new be;let r=!1;const a=j9(e),l=function(v){let b;try{b=i4(decodeURIComponent(v))}catch{}return b?(b=ZZ(b,C=>{if(n.uris&&n.uris[C])return ct.revive(n.uris[C])}),encodeURIComponent(JSON.stringify(b))):v},c=function(v,b){const C=n.uris&&n.uris[v];let w=ct.revive(C);return b?v.startsWith(Nt.data+":")?v:(w||(w=ct.parse(v)),GX.uriToBrowserUri(w).toString(!0)):!w||ct.parse(v).toString()===w.toString()?v:(w.query&&(w=w.with({query:l(w.query)})),w.toString())},d=new Zc.Renderer;d.image=QM.image,d.link=QM.link,d.paragraph=QM.paragraph;const u=[],h=[];if(e.codeBlockRendererSync?d.code=(v,b)=>{const C=t4.nextId(),w=e.codeBlockRendererSync(Oz(b),v);return h.push([C,w]),'
    ').concat(gE(v),"
    ")}:e.codeBlockRenderer&&(d.code=(v,b)=>{const C=t4.nextId(),w=e.codeBlockRenderer(Oz(b),v);return u.push(w.then(y=>[C,y])),'
    ').concat(gE(v),"
    ")}),e.actionHandler){const v=function(w){let y=w.target;if(!(y.tagName!=="A"&&(y=y.parentElement,!y||y.tagName!=="A")))try{let L=y.dataset.href;L&&(n.baseUri&&(L=JM(ct.from(n.baseUri),L)),e.actionHandler.callback(L,w))}catch(L){Dt(L)}finally{w.preventDefault()}},b=e.actionHandler.disposables.add(new Vt(a,"click")),C=e.actionHandler.disposables.add(new Vt(a,"auxclick"));e.actionHandler.disposables.add(We.any(b.event,C.event)(w=>{const y=new ba(w);!y.leftButton&&!y.middleButton||v(y)})),e.actionHandler.disposables.add(ce(a,"keydown",w=>{const y=new Oi(w);!y.equals(10)&&!y.equals(3)||v(y)}))}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="".concat(f.substr(0,1e5),"…")),n.supportThemeIcons&&(f=jTe(f));let g;if(e.fillInIncompleteTokens){const v=Object.assign(Object.assign({},Zc.defaults),t),b=Zc.lexer(f,v),C=gxe(b);g=Zc.parser(C,v)}else g=Zc.parse(f,t);n.supportThemeIcons&&(g=kf(g).map(b=>typeof b=="string"?b:b.outerHTML).join(""));const _=new DOMParser().parseFromString(s4(n,g),"text/html");if(_.body.querySelectorAll("img").forEach(v=>{const b=v.getAttribute("src");if(b){let C=b;try{n.baseUri&&(C=JM(ct.from(n.baseUri),C))}catch{}v.src=c(C,!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 C=c(b,!1);n.baseUri&&(C=JM(ct.from(n.baseUri),b)),v.dataset.href=C}}),a.innerHTML=s4(n,_.body.innerHTML),u.length>0)Promise.all(u).then(v=>{var b,C;if(r)return;const w=new Map(v),y=a.querySelectorAll("div[data-code]");for(const L of y){const S=w.get((b=L.dataset.code)!==null&&b!==void 0?b:"");S&&Es(L,S)}(C=e.asyncRenderCallback)===null||C===void 0||C.call(e)});else if(h.length>0){const v=new Map(h),b=a.querySelectorAll("div[data-code]");for(const C of b){const w=v.get((s=C.dataset.code)!==null&&s!==void 0?s:"");w&&Es(C,w)}}if(e.asyncRenderCallback)for(const v of a.getElementsByTagName("img")){const b=o.add(ce(v,"load",()=>{b.dispose(),e.asyncRenderCallback()}))}return{element:a,dispose:()=>{r=!0,o.dispose()}}}function Oz(n){if(!n)return"";const e=n.split(/[\s+|:|,|\{|\?]/,1);return e.length?e[0]:n}function JM(n,e){return/^\w[\w\d+.-]*:/.test(e)?e:n.path.endsWith("/")?R$(n,e).toString():R$(Ex(n),e).toString()}function s4(n,e){const{config:t,allowedSchemes:i}=lxe(n);jX("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=a0e(i);try{return UX(e,Object.assign(Object.assign({},t),{RETURN_TRUSTED_TYPE:!0}))}finally{KX("uponSanitizeAttribute"),s.dispose()}}const axe=["align","autoplay","alt","class","controls","data-code","data-href","height","href","loop","muted","playsinline","poster","src","style","target","title","width","start"];function lxe(n){const e=[Nt.http,Nt.https,Nt.mailto,Nt.data,Nt.file,Nt.vscodeFileResource,Nt.vscodeRemote,Nt.vscodeRemoteResource];return n.isTrusted&&e.push(Nt.command),{config:{ALLOWED_TAGS:[...l0e],ALLOWED_ATTR:axe,ALLOW_UNKNOWN_PROTOCOLS:!0},allowedSchemes:e}}function cxe(n){return typeof n=="string"?n:dxe(n)}function dxe(n){var e;let t=(e=n.value)!==null&&e!==void 0?e:"";t.length>1e5&&(t="".concat(t.substr(0,1e5),"…"));const i=Zc.parse(t,{renderer:hxe.value}).replace(/&(#\d+|[a-zA-Z]+);/g,s=>{var o;return(o=uxe.get(s))!==null&&o!==void 0?o:s});return s4({isTrusted:!1},i).toString()}const uxe=new Map([[""",'"'],[" "," "],["&","&"],["'","'"],["<","<"],[">",">"]]),hxe=new kg(()=>{const n=new Zc.Renderer;return n.code=e=>e,n.blockquote=e=>e,n.html=e=>"",n.heading=(e,t,i)=>e+"\n",n.hr=()=>"",n.list=(e,t)=>e,n.listitem=e=>e+"\n",n.paragraph=e=>e+"\n",n.table=(e,t)=>e+t+"\n",n.tablerow=e=>e,n.tablecell=(e,t)=>e+" ",n.strong=e=>e,n.em=e=>e,n.codespan=e=>e,n.br=()=>"\n",n.del=e=>e,n.image=(e,t,i)=>"",n.text=e=>e,n.link=(e,t,i)=>i,n});function q9(n){let e="";return n.forEach(t=>{e+=t.raw}),e}function fxe(n){for(const e of n.tokens)if(e.type==="text"){const t=e.raw.split("\n"),i=t[t.length-1];if(i.includes("`"))return mxe(n);if(i.includes("**"))return wxe(n);if(i.match(/\*\w/))return _xe(n);if(i.match(/(^|\s)__\w/))return yxe(n);if(i.match(/(^|\s)_\w/))return vxe(n);if(i.match(/(^|\s)\[.*\]\(\w*/))return bxe(n);if(i.match(/(^|\s)\[\w/))return Cxe(n)}}function gxe(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("\n"):e,r=!!o.match(/\|\s*$/),a=o+(r?"":"|")+"\n|".concat(" --- |".repeat(i));return Zc.lexer(a)}}class Lxe{constructor(e){this.spliceables=e}splice(e,t,i){this.spliceables.forEach(s=>s.splice(e,t,i))}}class T_ extends Error{constructor(e,t){super("ListError [".concat(e,"] ").concat(t))}}function Fz(n,e){const t=[];for(const i of e){if(n.start>=i.range.end)continue;if(n.ende.concat(t),[]))}class Bz{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!=null?e:0,this._size=this._paddingTop}splice(e,t,i=[]){const s=i.length-t,o=Fz({start:0,end:e},this.groups),r=Fz({start:e+t,end:Number.POSITIVE_INFINITY},this.groups).map(l=>({range:o4(l.range,s),size:l.size})),a=i.map((l,c)=>({range:{start:e+c,end:e+c+1},size:l.size}));this.groups=Dxe(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 ".concat(e));return t}}var ah=globalThis&&globalThis.__decorate||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 Gg={CurrentDragAndDropData:void 0},Ic={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 ES{constructor(e){this.elements=e}update(){}getData(){return this.elements}}class Txe{constructor(e){this.elements=e}update(){}getData(){return this.elements}}class xxe{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 Ha{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:oM(this.domNode)}),this.rowsContainer.style.width="".concat(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=Ic){var o,r,a,l,c,d,u,h,f,g,p,_,v;if(this.virtualDelegate=t,this.domId="list_id_".concat(++Ha.InstanceCount),this.renderers=new Map,this.renderWidth=0,this._scrollHeight=0,this.scrollableElementUpdateDisposable=null,this.scrollableElementWidthDelayer=new pl(50),this.splicing=!1,this.dragOverAnimationStopDisposable=te.None,this.dragOverMouseY=0,this.canDrop=!1,this.currentDragFeedbackDisposable=te.None,this.onDragLeaveTimeout=te.None,this.disposables=new be,this._onDidChangeContentHeight=new j,this._onDidChangeContentWidth=new j,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 Bz((o=s.paddingTop)!==null&&o!==void 0?o:0);for(const C of i)this.renderers.set(C.templateId,C);this.cache=this.disposables.add(new Ixe(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:Ic.horizontalScrolling,this.domNode.classList.toggle("horizontal-scrolling",this._horizontalScrolling),this.paddingBottom=typeof s.paddingBottom>"u"?0:s.paddingBottom,this.accessibilityProvider=new Axe(s.accessibilityProvider),this.rowsContainer=document.createElement("div"),this.rowsContainer.className="monaco-list-rows",((a=s.transformOptimization)!==null&&a!==void 0?a:Ic.transformOptimization)&&(this.rowsContainer.style.transform="translate3d(0px, 0px, 0px)",this.rowsContainer.style.overflow="hidden",this.rowsContainer.style.contain="strict"),this.disposables.add(Ii.addTarget(this.rowsContainer)),this.scrollable=this.disposables.add(new vS({forceIntegerValues:!0,smoothScrollDuration:(l=s.smoothScrolling)!==null&&l!==void 0&&l?125:0,scheduleAtNextAnimationFrame:C=>xa(C)})),this.scrollableElement=this.disposables.add(new c9(this.rowsContainer,{alwaysConsumeMouseWheel:(c=s.alwaysConsumeMouseWheel)!==null&&c!==void 0?c:Ic.alwaysConsumeMouseWheel,horizontal:1,vertical:(d=s.verticalScrollMode)!==null&&d!==void 0?d:Ic.verticalScrollMode,useShadows:(u=s.useShadows)!==null&&u!==void 0?u:Ic.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(ce(this.rowsContainer,Ti.Change,C=>this.onTouchChange(C))),this.disposables.add(ce(this.scrollableElement.getDomNode(),"scroll",C=>C.target.scrollTop=0)),this.disposables.add(ce(this.domNode,"dragover",C=>this.onDragOver(this.toDragEvent(C)))),this.disposables.add(ce(this.domNode,"drop",C=>this.onDrop(this.toDragEvent(C)))),this.disposables.add(ce(this.domNode,"dragleave",C=>this.onDragLeave(this.toDragEvent(C)))),this.disposables.add(ce(this.domNode,"dragend",C=>this.onDragEnd(C))),this.setRowLineHeight=(h=s.setRowLineHeight)!==null&&h!==void 0?h:Ic.setRowLineHeight,this.setRowHeight=(f=s.setRowHeight)!==null&&f!==void 0?f:Ic.setRowHeight,this.supportDynamicHeights=(g=s.supportDynamicHeights)!==null&&g!==void 0?g:Ic.supportDynamicHeights,this.dnd=(p=s.dnd)!==null&&p!==void 0?p:this.disposables.add(Ic.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!=null?t:{}),{scrollByPage:e.scrollByPage})),e.mouseWheelScrollSensitivity!==void 0&&(t=Object.assign(Object.assign({},t!=null?t:{}),{mouseWheelScrollSensitivity:e.mouseWheelScrollSensitivity})),e.fastScrollSensitivity!==void 0&&(t=Object.assign(Object.assign({},t!=null?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=js.intersect(s,o),a=new Map;for(let L=r.end-1;L>=r.start;L--){const S=this.items[L];if(S.dragStartDisposable.dispose(),S.checkedDisposable.dispose(),S.row){let k=a.get(S.templateId);k||(k=[],a.set(S.templateId,k));const D=this.renderers.get(S.templateId);D&&D.disposeElement&&D.disposeElement(S.element,L,S.row.templateData,S.size),k.push(S.row)}S.row=null}const l={start:e+t,end:this.items.length},c=js.intersect(l,s),d=js.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:te.None,checkedDisposable:te.None}));let h;e===0&&t>=this.items.length?(this.rangeMap=new Bz(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=o4(c,f),_=js.intersect(g,p);for(let L=_.start;L<_.end;L++)this.updateItemInDOM(this.items[L],L);const v=js.relativeComplement(p,g);for(const L of v)for(let S=L.start;So4(L,f)),w=[{start:e,end:e+i.length},...b].map(L=>js.intersect(g,L)),y=this.getNextToLastElement(w);for(const L of w)for(let S=L.start;SL.element)}eventuallyUpdateScrollDimensions(){this._scrollHeight=this.contentHeight,this.rowsContainer.style.height="".concat(this._scrollHeight,"px"),this.scrollableElementUpdateDisposable||(this.scrollableElementUpdateDisposable=xa(()=>{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 ".concat(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=ce(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=oM(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="".concat(this.elementTop(t),"px"),this.setRowHeight&&(e.row.domNode.style.height="".concat(e.size,"px")),this.setRowLineHeight&&(e.row.domNode.style.lineHeight="".concat(e.size,"px")),e.row.domNode.setAttribute("data-index","".concat(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 We.map(this.disposables.add(new Vt(this.domNode,"click")).event,e=>this.toMouseEvent(e),this.disposables)}get onMouseDblClick(){return We.map(this.disposables.add(new Vt(this.domNode,"dblclick")).event,e=>this.toMouseEvent(e),this.disposables)}get onMouseMiddleClick(){return We.filter(We.map(this.disposables.add(new Vt(this.domNode,"auxclick")).event,e=>this.toMouseEvent(e),this.disposables),e=>e.browserEvent.button===1,this.disposables)}get onMouseDown(){return We.map(this.disposables.add(new Vt(this.domNode,"mousedown")).event,e=>this.toMouseEvent(e),this.disposables)}get onMouseOver(){return We.map(this.disposables.add(new Vt(this.domNode,"mouseover")).event,e=>this.toMouseEvent(e),this.disposables)}get onMouseOut(){return We.map(this.disposables.add(new Vt(this.domNode,"mouseout")).event,e=>this.toMouseEvent(e),this.disposables)}get onContextMenu(){return We.any(We.map(this.disposables.add(new Vt(this.domNode,"contextmenu")).event,e=>this.toMouseEvent(e),this.disposables),We.map(this.disposables.add(new Vt(this.domNode,Ti.Contextmenu)).event,e=>this.toGestureEvent(e),this.disposables))}get onTouchStart(){return We.map(this.disposables.add(new Vt(this.domNode,"touchstart")).event,e=>this.toTouchEvent(e),this.disposables)}get onTap(){return We.map(this.disposables.add(new Vt(this.rowsContainer,Ti.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(Jw.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=ye(".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 ES(r),Gg.CurrentDragAndDropData=new Txe(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(),Gg.CurrentDragAndDropData&&Gg.CurrentDragAndDropData.getData()==="vscode-ui"||(this.setupDragAndDropScrollTopAnimation(e.browserEvent),!e.browserEvent.dataTransfer))return!1;if(!this.currentDragData)if(Gg.CurrentDragAndDropData)this.currentDragData=Gg.CurrentDragAndDropData;else{if(!e.browserEvent.dataTransfer.types)return!1;this.currentDragData=new xxe}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=Vf(s).filter(o=>o>=-1&&oo-r),s=s[0]===-1?[-1]:s,Nxe(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=vt(()=>{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=vt(()=>{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=Kf(()=>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,Gg.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,Gg.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=te.None}setupDragAndDropScrollTopAnimation(e){if(!this.dragOverAnimationDisposable){const t=ZX(this.domNode).top;this.dragOverAnimationDisposable=r0e(this.animateDragAndDropScrollTop.bind(this,t))}this.dragOverAnimationStopDisposable.dispose(),this.dragOverAnimationStopDisposable=Kf(()=>{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},Wz=globalThis&&globalThis.__awaiter||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 Mxe{constructor(e){this.trait=e,this.renderedElements=[]}get templateId(){return"template:".concat(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 oI=class{get name(){return this._trait}get renderer(){return new Mxe(this)}constructor(e){this._trait=e,this.length=0,this.indexes=[],this.sortedIndexes=[],this._onChange=new j,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(Hz),t)}_set(e,t,i){const s=this.indexes,o=this.sortedIndexes;this.indexes=e,this.sortedIndexes=t;const r=r4(o,e);return this.renderer.renderIndexes(r),this._onChange.fire({indexes:e,browserEvent:i}),s}get(){return this.indexes}contains(e){return cw(this.sortedIndexes,e,Hz)>=0}dispose(){fi(this._onChange)}};Jm([xn],oI.prototype,"renderer",null);class Rxe extends oI{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 eR{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 Df(n){return n.tagName==="INPUT"||n.tagName==="TEXTAREA"}function _v(n){return n.classList.contains("monaco-editor")?!0:n.classList.contains("monaco-list")||!n.parentElement?!1:_v(n.parentElement)}function Dee(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:Dee(n.parentElement)}class Eee{get onKeyDown(){return We.chain(this.disposables.add(new Vt(this.view.domNode,"keydown")).event,e=>e.filter(t=>!Df(t.target)).map(t=>new Oi(t)))}constructor(e,t,i){this.list=e,this.view=t,this.disposables=new be,this.multipleSelectionDisposables=new be,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&&(Kt?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(yo(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()}}Jm([xn],Eee.prototype,"onKeyDown",null);var Xc;(function(n){n[n.Automatic=0]="Automatic",n[n.Trigger=1]="Trigger"})(Xc||(Xc={}));var vv;(function(n){n[n.Idle=0]="Idle",n[n.Typing=1]="Typing"})(vv||(vv={}));const Pxe=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 Oxe{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=vv.Idle,this.mode=Xc.Automatic,this.triggered=!1,this.previouslyFocused=-1,this.enabledDisposables=new be,this.disposables=new be,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:Xc.Automatic}enable(){if(this.enabled)return;let e=!1;const t=We.chain(this.enabledDisposables.add(new Vt(this.view.domNode,"keydown")).event,o=>o.filter(r=>!Df(r.target)).filter(()=>this.mode===Xc.Automatic||this.triggered).map(r=>new Oi(r)).filter(r=>e||this.keyboardNavigationEventFilter(r)).filter(r=>this.delegate.mightProducePrintableCharacter(r)).forEach(r=>xt.stop(r,!0)).map(r=>r.browserEvent.key)),i=We.debounce(t,()=>null,800,void 0,void 0,void 0,this.enabledDisposables);We.reduce(We.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&&to(i)}this.previouslyFocused=-1}onInput(e){if(!e){this.state=vv.Idle,this.triggered=!1;return}const t=this.list.getFocus(),i=t.length>0?t[0]:0,s=this.state===vv.Idle?1:0;this.state=vv.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"||ey(e,l)){this.previouslyFocused=i,this.list.setFocus([r]),this.list.reveal(r);return}}}dispose(){this.disable(),this.enabledDisposables.dispose(),this.disposables.dispose()}}class Fxe{constructor(e,t){this.list=e,this.view=t,this.disposables=new be;const i=We.chain(this.disposables.add(new Vt(t.domNode,"keydown")).event,o=>o.filter(r=>!Df(r.target)).map(r=>new Oi(r)));We.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 Iee(n){return Kt?n.browserEvent.metaKey:n.browserEvent.ctrlKey}function Tee(n){return n.browserEvent.shiftKey}function Bxe(n){return n instanceof MouseEvent&&n.button===2}const Vz={isSelectionSingleChangeEvent:Iee,isSelectionRangeChangeEvent:Tee};class xee{constructor(e){this.list=e,this.disposables=new be,this._onPointer=new j,this.onPointer=this._onPointer.event,e.options.multipleSelectionSupport!==!1&&(this.multipleSelectionController=this.list.options.multipleSelectionController||Vz),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(Ii.addTarget(e.getHTMLElement()))),We.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||Vz))}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){_v(e.browserEvent.target)||document.activeElement!==e.browserEvent.target&&this.list.domFocus()}onContextMenu(e){if(Df(e.browserEvent.target)||_v(e.browserEvent.target))return;const t=typeof e.index>"u"?[]:[e.index];this.list.setFocus(t,e.browserEvent)}onViewPointer(e){if(!this.mouseSupport||Df(e.browserEvent.target)||_v(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),Bxe(e.browserEvent)||this.list.setSelection([t],e.browserEvent),this._onPointer.fire(e)}onDoubleClick(e){if(Df(e.browserEvent.target)||_v(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!=null?d:t,this.list.setAnchor(i)}const s=Math.min(i,t),o=Math.max(i,t),r=yo(s,o+1),a=this.list.getSelection(),l=Hxe(r4(a,[i]),i);if(l.length===0)return;const c=r4(r,$xe(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 Nee{constructor(e,t){this.styleElement=e,this.selectorSuffix=t}style(e){var t,i;const s=this.selectorSuffix&&".".concat(this.selectorSuffix),o=[];e.listBackground&&o.push(".monaco-list".concat(s," .monaco-list-rows { background: ").concat(e.listBackground,"; }")),e.listFocusBackground&&(o.push(".monaco-list".concat(s,":focus .monaco-list-row.focused { background-color: ").concat(e.listFocusBackground,"; }")),o.push(".monaco-list".concat(s,":focus .monaco-list-row.focused:hover { background-color: ").concat(e.listFocusBackground,"; }"))),e.listFocusForeground&&o.push(".monaco-list".concat(s,":focus .monaco-list-row.focused { color: ").concat(e.listFocusForeground,"; }")),e.listActiveSelectionBackground&&(o.push(".monaco-list".concat(s,":focus .monaco-list-row.selected { background-color: ").concat(e.listActiveSelectionBackground,"; }")),o.push(".monaco-list".concat(s,":focus .monaco-list-row.selected:hover { background-color: ").concat(e.listActiveSelectionBackground,"; }"))),e.listActiveSelectionForeground&&o.push(".monaco-list".concat(s,":focus .monaco-list-row.selected { color: ").concat(e.listActiveSelectionForeground,"; }")),e.listActiveSelectionIconForeground&&o.push(".monaco-list".concat(s,":focus .monaco-list-row.selected .codicon { color: ").concat(e.listActiveSelectionIconForeground,"; }")),e.listFocusAndSelectionBackground&&o.push("\n .monaco-drag-image,\n .monaco-list".concat(s,":focus .monaco-list-row.selected.focused { background-color: ").concat(e.listFocusAndSelectionBackground,"; }\n ")),e.listFocusAndSelectionForeground&&o.push("\n .monaco-drag-image,\n .monaco-list".concat(s,":focus .monaco-list-row.selected.focused { color: ").concat(e.listFocusAndSelectionForeground,"; }\n ")),e.listInactiveFocusForeground&&(o.push(".monaco-list".concat(s," .monaco-list-row.focused { color: ").concat(e.listInactiveFocusForeground,"; }")),o.push(".monaco-list".concat(s," .monaco-list-row.focused:hover { color: ").concat(e.listInactiveFocusForeground,"; }"))),e.listInactiveSelectionIconForeground&&o.push(".monaco-list".concat(s," .monaco-list-row.focused .codicon { color: ").concat(e.listInactiveSelectionIconForeground,"; }")),e.listInactiveFocusBackground&&(o.push(".monaco-list".concat(s," .monaco-list-row.focused { background-color: ").concat(e.listInactiveFocusBackground,"; }")),o.push(".monaco-list".concat(s," .monaco-list-row.focused:hover { background-color: ").concat(e.listInactiveFocusBackground,"; }"))),e.listInactiveSelectionBackground&&(o.push(".monaco-list".concat(s," .monaco-list-row.selected { background-color: ").concat(e.listInactiveSelectionBackground,"; }")),o.push(".monaco-list".concat(s," .monaco-list-row.selected:hover { background-color: ").concat(e.listInactiveSelectionBackground,"; }"))),e.listInactiveSelectionForeground&&o.push(".monaco-list".concat(s," .monaco-list-row.selected { color: ").concat(e.listInactiveSelectionForeground,"; }")),e.listHoverBackground&&o.push(".monaco-list".concat(s,":not(.drop-target):not(.dragging) .monaco-list-row:hover:not(.selected):not(.focused) { background-color: ").concat(e.listHoverBackground,"; }")),e.listHoverForeground&&o.push(".monaco-list".concat(s,":not(.drop-target):not(.dragging) .monaco-list-row:hover:not(.selected):not(.focused) { color: ").concat(e.listHoverForeground,"; }"));const r=zp(e.listFocusAndSelectionOutline,zp(e.listSelectionOutline,(t=e.listFocusOutline)!==null&&t!==void 0?t:""));r&&o.push(".monaco-list".concat(s,":focus .monaco-list-row.focused.selected { outline: 1px solid ").concat(r,"; outline-offset: -1px;}")),e.listFocusOutline&&o.push("\n .monaco-drag-image,\n .monaco-list".concat(s,":focus .monaco-list-row.focused { outline: 1px solid ").concat(e.listFocusOutline,"; outline-offset: -1px; }\n .monaco-workbench.context-menu-visible .monaco-list").concat(s,".last-focused .monaco-list-row.focused { outline: 1px solid ").concat(e.listFocusOutline,"; outline-offset: -1px; }\n "));const a=zp(e.listSelectionOutline,(i=e.listInactiveFocusOutline)!==null&&i!==void 0?i:"");a&&o.push(".monaco-list".concat(s," .monaco-list-row.focused.selected { outline: 1px dotted ").concat(a,"; outline-offset: -1px; }")),e.listSelectionOutline&&o.push(".monaco-list".concat(s," .monaco-list-row.selected { outline: 1px dotted ").concat(e.listSelectionOutline,"; outline-offset: -1px; }")),e.listInactiveFocusOutline&&o.push(".monaco-list".concat(s," .monaco-list-row.focused { outline: 1px dotted ").concat(e.listInactiveFocusOutline,"; outline-offset: -1px; }")),e.listHoverOutline&&o.push(".monaco-list".concat(s," .monaco-list-row:hover { outline: 1px dashed ").concat(e.listHoverOutline,"; outline-offset: -1px; }")),e.listDropBackground&&o.push("\n .monaco-list".concat(s,".drop-target,\n .monaco-list").concat(s," .monaco-list-rows.drop-target,\n .monaco-list").concat(s," .monaco-list-row.drop-target { background-color: ").concat(e.listDropBackground," !important; color: inherit !important; }\n ")),e.tableColumnsBorder&&o.push("\n .monaco-table > .monaco-split-view2,\n .monaco-table > .monaco-split-view2 .monaco-sash.vertical::before,\n .monaco-workbench:not(.reduce-motion) .monaco-table:hover > .monaco-split-view2,\n .monaco-workbench:not(.reduce-motion) .monaco-table:hover > .monaco-split-view2 .monaco-sash.vertical::before {\n border-color: ".concat(e.tableColumnsBorder,";\n }\n\n .monaco-workbench:not(.reduce-motion) .monaco-table > .monaco-split-view2,\n .monaco-workbench:not(.reduce-motion) .monaco-table > .monaco-split-view2 .monaco-sash.vertical::before {\n border-color: transparent;\n }\n ")),e.tableOddRowsBackgroundColor&&o.push("\n .monaco-table .monaco-list-row[data-parity=odd]:not(.focused):not(.selected):not(:hover) .monaco-table-tr,\n .monaco-table .monaco-list:not(:focus) .monaco-list-row[data-parity=odd].focused:not(.selected):not(:hover) .monaco-table-tr,\n .monaco-table .monaco-list:not(.focused) .monaco-list-row[data-parity=odd].focused:not(.selected):not(:hover) .monaco-table-tr {\n background-color: ".concat(e.tableOddRowsBackgroundColor,";\n }\n ")),this.styleElement.textContent=o.join("\n")}}const Wxe={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:ee.fromHex("#a9a9a9").transparent(.4).toString(),tableColumnsBorder:ee.fromHex("#cccccc").transparent(.2).toString(),tableOddRowsBackgroundColor:ee.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},Vxe={keyboardSupport:!0,mouseSupport:!0,multipleSelectionSupport:!0,dnd:{getDragURI(){return null},onDragStart(){},onDragOver(){return!1},drop(){},dispose(){}}};function Hxe(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 zxe{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 Uxe{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","".concat(o)):i.removeAttribute("aria-level")}disposeTemplate(e){}}class jxe{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 wl{get onDidChangeFocus(){return We.map(this.eventBufferer.wrapEvent(this.focus.onChange),e=>this.toListEvent(e),this.disposables)}get onDidChangeSelection(){return We.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=We.chain(this.disposables.add(new Vt(this.view.domNode,"keydown")).event,o=>o.map(r=>new Oi(r)).filter(r=>e=r.keyCode===58||r.shiftKey&&r.keyCode===68).map(r=>xt.stop(r,!0)).filter(()=>!1)),i=We.chain(this.disposables.add(new Vt(this.view.domNode,"keyup")).event,o=>o.forEach(()=>e=!1).map(r=>new Oi(r)).filter(r=>r.keyCode===58||r.shiftKey&&r.keyCode===68).map(r=>xt.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=We.chain(this.view.onContextMenu,o=>o.filter(r=>!e).map(({element:r,index:a,browserEvent:l})=>({element:r,index:a,anchor:new ba(l),browserEvent:l})));return We.any(t,i,s)}get onKeyDown(){return this.disposables.add(new Vt(this.view.domNode,"keydown")).event}get onDidFocus(){return We.signal(this.disposables.add(new Vt(this.view.domNode,"focus",!0)).event)}constructor(e,t,i,s,o=Vxe){var r,a,l,c;this.user=e,this._options=o,this.focus=new oI("focused"),this.anchor=new oI("anchor"),this.eventBufferer=new C8,this._ariaLabel="",this.disposables=new be,this._onDidDispose=new j,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 Rxe(d!=="listbox");const u=[this.focus.renderer,this.selection.renderer];this.accessibilityProvider=o.accessibilityProvider,this.accessibilityProvider&&(u.push(new Uxe(this.accessibilityProvider)),(l=(a=this.accessibilityProvider).onDidChangeActiveDescendant)===null||l===void 0||l.call(a,this.onDidChangeActiveDescendant,this,this.disposables)),s=s.map(f=>new zxe(f.templateId,[...u,f]));const h=Object.assign(Object.assign({},o),{dnd:o.dnd&&new jxe(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=Na(this.view.domNode);this.styleController=new Nee(f,this.view.domId)}if(this.spliceable=new Lxe([new eR(this.focus,this.view,o.identityProvider),new eR(this.selection,this.view,o.identityProvider),new eR(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 Fxe(this,this.view)),(typeof o.keyboardSupport!="boolean"||o.keyboardSupport)&&(this.keyboardController=new Eee(this,this.view,o),this.disposables.add(this.keyboardController)),o.keyboardNavigationLabelProvider){const f=o.keyboardNavigationDelegate||Pxe;this.typeNavigationController=new Oxe(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 Ha(e,t,i,s)}createMouseController(e){return new xee(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 T_(this.user,"Invalid start index: ".concat(e));if(t<0)throw new T_(this.user,"Invalid delete count: ".concat(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 T_(this.user,"Invalid index ".concat(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 T_(this.user,"Invalid index ".concat(e));this.anchor.set([e])}getAnchor(){return jZ(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 T_(this.user,"Invalid index ".concat(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 Wz(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 jf(0),yield this.focusNextPage(e,t))}})}focusPreviousPage(e,t){return Wz(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 jf(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 T_(this.user,"Invalid index ".concat(e));const i=this.view.getScrollTop(),s=this.view.elementTop(e),o=this.view.elementHeight(e);if(Hf(t)){const r=o-this.view.renderHeight;this.view.setScrollTop(r*fr(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()}}Jm([xn],wl.prototype,"onDidChangeFocus",null);Jm([xn],wl.prototype,"onDidChangeSelection",null);Jm([xn],wl.prototype,"onContextMenu",null);Jm([xn],wl.prototype,"onKeyDown",null);Jm([xn],wl.prototype,"onDidFocus",null);const Mp=ye,Aee="selectOption.entry.template";class Kxe{get templateId(){return Aee}renderTemplate(e){const t=Object.create(null);return t.root=e,t.text=ge(e,Mp(".option-text")),t.detail=ge(e,Mp(".option-detail")),t.decoratorRight=ge(e,Mp(".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 Qc extends te{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=Qc.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 j,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 Aee}constructSelectDropDown(e){this.contextViewProvider=e,this.selectDropDownContainer=ye(".monaco-select-box-dropdown-container"),this.selectDropDownContainer.classList.add("monaco-select-box-dropdown-padding"),this.selectionDetailsPane=ge(this.selectDropDownContainer,Mp(".select-box-details-pane"));const t=ge(this.selectDropDownContainer,Mp(".select-box-dropdown-container-width-control")),i=ge(t,Mp(".width-control-div"));this.widthControlElement=document.createElement("span"),this.widthControlElement.className="option-text-width-control",ge(i,this.widthControlElement),this._dropDownPosition=0,this.styleElement=Na(this.selectDropDownContainer),this.selectDropDownContainer.setAttribute("draggable","true"),this._register(ce(this.selectDropDownContainer,Pe.DRAG_START,s=>{xt.stop(s,!0)}))}registerListeners(){this._register(In(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(ce(this.selectElement,Pe.CLICK,t=>{xt.stop(t),this._isVisible?this.hideSelectDropDown(!0):this.showSelectDropDown()})),this._register(ce(this.selectElement,Pe.MOUSE_DOWN,t=>{xt.stop(t)}));let e;this._register(ce(this.selectElement,"touchstart",t=>{e=this._isVisible})),this._register(ce(this.selectElement,"touchend",t=>{xt.stop(t),e?this.hideSelectDropDown(!0):this.showSelectDropDown()})),this._register(ce(this.selectElement,Pe.KEY_DOWN,t=>{const i=new Oi(t);let s=!1;Kt?(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(),xt.stop(t,!0))}))}get onDidSelect(){return this._onDidSelect.event}setOptions(e,t){yn(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: ".concat(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: ".concat(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: ".concat(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 ".concat(this.styles.selectBorder," } ")),e.push(".monaco-select-box-dropdown-container > .select-box-details-pane.border-top { border-top: 1px solid ".concat(this.styles.selectBorder," } ")),e.push(".monaco-select-box-dropdown-container > .select-box-details-pane.border-bottom { border-bottom: 1px solid ".concat(this.styles.selectBorder," } "))):this.styles.selectListBorder&&(e.push(".monaco-select-box-dropdown-container > .select-box-details-pane.border-top { border-top: 1px solid ".concat(this.styles.selectListBorder," } ")),e.push(".monaco-select-box-dropdown-container > .select-box-details-pane.border-bottom { border-bottom: 1px solid ".concat(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: ".concat(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: ".concat(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 ".concat(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 ".concat(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("\n")}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=zp(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=Un(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-Qc.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=Ko(e)}return t}createSelectList(e){if(this.selectList)return;this.selectDropDownListContainer=ge(e,Mp(".select-box-dropdown-list-container")),this.listRenderer=new Kxe,this.selectList=new wl("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+=". ".concat(s.detail)),s.decoratorRight&&(o+=". ".concat(s.decoratorRight)),s.description&&(o+=". ".concat(s.description)),o},getWidgetAriaLabel:()=>m({key:"selectBox",comment:["Behave like native select dropdown element."]},"Select Box"),getRole:()=>Kt?"":"option",getWidgetRole:()=>"listbox"}}),this.selectBoxOptions.ariaLabel&&(this.selectList.ariaLabel=this.selectBoxOptions.ariaLabel);const t=this._register(new Vt(this.selectDropDownListContainer,"keydown")),i=We.chain(t.event,s=>s.filter(()=>this.selectList.length>0).map(o=>new Oi(o)));this._register(We.chain(i,s=>s.filter(o=>o.keyCode===3))(this.onEnter,this)),this._register(We.chain(i,s=>s.filter(o=>o.keyCode===2))(this.onEnter,this)),this._register(We.chain(i,s=>s.filter(o=>o.keyCode===9))(this.onEscape,this)),this._register(We.chain(i,s=>s.filter(o=>o.keyCode===16))(this.onUpArrow,this)),this._register(We.chain(i,s=>s.filter(o=>o.keyCode===18))(this.onDownArrow,this)),this._register(We.chain(i,s=>s.filter(o=>o.keyCode===12))(this.onPageDown,this)),this._register(We.chain(i,s=>s.filter(o=>o.keyCode===11))(this.onPageUp,this)),this._register(We.chain(i,s=>s.filter(o=>o.keyCode===14))(this.onHome,this)),this._register(We.chain(i,s=>s.filter(o=>o.keyCode===13))(this.onEnd,this)),this._register(We.chain(i,s=>s.filter(o=>o.keyCode>=21&&o.keyCode<=56||o.keyCode>=85&&o.keyCode<=113))(this.onCharacter,this)),this._register(ce(this.selectList.getHTMLElement(),Pe.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(ce(this.selectDropDownContainer,Pe.FOCUS_OUT,s=>{!this._isVisible||Ws(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;xt.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&&(xt.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){xt.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){xt.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){xt.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=pu.toString(e.keyCode);let i=-1;for(let s=0;s{this._register(ce(this.selectElement,e,t=>{this.selectElement.focus()}))}),this._register(In(this.selectElement,"click",e=>{xt.stop(e,!0)})),this._register(In(this.selectElement,"change",e=>{this.selectElement.title=e.target.value,this._onDidSelect.fire({index:e.target.selectedIndex,selected:e.target.value})})),this._register(In(this.selectElement,"keydown",e=>{let t=!1;Kt?(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||!yn(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 yb)),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(Ii.addTarget(e));const i=this.options&&this.options.draggable;i&&(e.draggable=!0,Ta&&this._register(ce(e,Pe.DRAG_START,s=>{var o;return(o=s.dataTransfer)===null||o===void 0?void 0:o.setData(Jw.TEXT,this._action.label)}))),this._register(ce(t,Ti.Tap,s=>this.onClick(s,!0))),this._register(ce(t,Pe.MOUSE_DOWN,s=>{i||xt.stop(s,!0),this._action.enabled&&s.button===0&&t.classList.add("active")})),Kt&&this._register(ce(t,Pe.CONTEXT_MENU,s=>{s.button===0&&s.ctrlKey===!0&&this.onClick(s)})),this._register(ce(t,Pe.CLICK,s=>{xt.stop(s,!0),this.options&&this.options.isMenu||this.onClick(s)})),this._register(ce(t,Pe.DBLCLICK,s=>{xt.stop(s,!0)})),[Pe.MOUSE_UP,Pe.MOUSE_OUT].forEach(s=>{this._register(ce(t,s,o=>{xt.stop(o),t.classList.remove("active")}))})}onClick(e,t=!1){var i;xt.stop(e,!0);const s=Fr(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=Lee(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 Hb extends Ul{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=ge(this.element,ye("a.action-label"))),this.label&&this.label.setAttribute("role",this.getDefaultAriaRole()),this.options.label&&this.options.keybinding&&this.element&&(ge(this.element,ye("span.keybinding")).textContent=this.options.keybinding),this.updateClass(),this.updateLabel(),this.updateTooltip(),this.updateEnabled(),this.updateChecked()}getDefaultAriaRole(){return this._action.id===hs.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!=null?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 Yxe extends Ul{constructor(e,t,i,s,o,r,a){super(e,t),this.selectBox=new Gxe(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 Zxe extends yb{constructor(e,t){super(),this._onDidChangeVisibility=this._register(new j),this.onDidChangeVisibility=this._onDidChangeVisibility.event,this._element=ge(e,ye(".monaco-dropdown")),this._label=ge(this._element,ye(".dropdown-label"));let i=t.labelRenderer;i||(i=o=>(o.textContent=t.label||"",null));for(const o of[Pe.CLICK,Pe.MOUSE_DOWN,Ti.Tap])this._register(ce(this.element,o,r=>xt.stop(r,!0)));for(const o of[Pe.MOUSE_DOWN,Ti.Tap])this._register(ce(this._label,o,r=>{r instanceof MouseEvent&&(r.detail>1||r.button!==0)||(this.visible?this.hide():this.show())}));this._register(ce(this._label,Pe.KEY_UP,o=>{const r=new Oi(o);(r.equals(3)||r.equals(10))&&(xt.stop(o,!0),this.visible?this.hide():this.show())}));const s=i(this._label);s&&this._register(s),this._register(Ii.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 Xxe extends Zxe{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 rI extends Ul{constructor(e,t,i,s=Object.create(null)){super(null,e,s),this.actionItem=null,this._onDidChangeVisibility=this._register(new j),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=ge(o,ye("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 Xxe(e,s)),this._register(this.dropdownMenu.onDidChangeVisibility(o=>{var r;(r=this.element)===null||r===void 0||r.setAttribute("aria-expanded","".concat(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!=null?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 Qxe(n){return n?n.condition!==void 0:!1}var X1=globalThis&&globalThis.__awaiter||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())})},tb;(function(n){n[n.STORAGE_DOES_NOT_EXIST=0]="STORAGE_DOES_NOT_EXIST",n[n.STORAGE_IN_MEMORY=1]="STORAGE_IN_MEMORY"})(tb||(tb={}));var bv;(function(n){n[n.None=0]="None",n[n.Initialized=1]="Initialized",n[n.Closed=2]="Closed"})(bv||(bv={}));class ib extends te{constructor(e,t=Object.create(null)){super(),this.database=e,this.options=t,this._onDidChangeStorage=this._register(new nm),this.onDidChangeStorage=this._onDidChangeStorage.event,this.state=bv.None,this.cache=new Map,this.flushDelayer=this._register(new lQ(ib.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===bv.Closed)return;let i=!1;Fr(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 Fr(i)?t:i}getBoolean(e,t){const i=this.get(e);return Fr(i)?t:i==="true"}getNumber(e,t){const i=this.get(e);return Fr(i)?t:parseInt(i,10)}set(e,t,i=!1){return X1(this,void 0,void 0,function*(){if(this.state===bv.Closed)return;if(Fr(t))return this.delete(e,i);const s=Io(t)||Array.isArray(t)?oxe(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 X1(this,void 0,void 0,function*(){if(!(this.state===bv.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 X1(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 X1(this,void 0,void 0,function*(){return this.options.hint===tb.STORAGE_IN_MEMORY?this.flushPending():this.flushDelayer.trigger(()=>this.flushPending(),e)})}}ib.DEFAULT_FLUSH_DELAY=100;class tR{constructor(){this.onDidChangeItemsExternal=We.None,this.items=new Map}updateItems(e){var t,i;return X1(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 yD="__$__targetStorageMarker",yl=Wt("storageService");var aI;(function(n){n[n.NONE=0]="NONE",n[n.SHUTDOWN=1]="SHUTDOWN"})(aI||(aI={}));function Jxe(n){const e=n.get(yD);if(e)try{return JSON.parse(e)}catch{}return Object.create(null)}class Bx extends te{constructor(e={flushInterval:Bx.DEFAULT_FLUSH_INTERVAL}){super(),this.options=e,this._onDidChangeValue=this._register(new nm),this._onDidChangeTarget=this._register(new nm),this._onWillSaveState=this._register(new j),this.onWillSaveState=this._onWillSaveState.event,this._workspaceKeyTargets=void 0,this._profileKeyTargets=void 0,this._applicationKeyTargets=void 0}onDidChangeValue(e,t,i){return We.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===yD){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(Fr(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(yD,JSON.stringify(a),s)):typeof a[e]=="number"&&(delete a[e],(r=this.getStorage(t))===null||r===void 0||r.set(yD,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?Jxe(t):Object.create(null)}}Bx.DEFAULT_FLUSH_INTERVAL=60*1e3;class eNe extends Bx{constructor(){super(),this.applicationStorage=this._register(new ib(new tR,{hint:tb.STORAGE_IN_MEMORY})),this.profileStorage=this._register(new ib(new tR,{hint:tb.STORAGE_IN_MEMORY})),this.workspaceStorage=this._register(new ib(new tR,{hint:tb.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 tNe(n,e){const t=Object.assign({},e);for(const i in n){const s=n[i];t[i]=s!==void 0?He(s):void 0}return t}const iNe={keybindingLabelBackground:He(Fwe),keybindingLabelForeground:He(Bwe),keybindingLabelBorder:He(Wwe),keybindingLabelBottomBorder:He(Vwe),keybindingLabelShadow:He(nd)},nNe={buttonForeground:He(B1),buttonSeparator:He(Swe),buttonBackground:He(W1),buttonHoverBackground:He(Lwe),buttonSecondaryForeground:He(Dwe),buttonSecondaryBackground:He(lO),buttonSecondaryHoverBackground:He(Ewe),buttonBorder:He(kwe)},sNe={progressBarBackground:He(xwe)},lI={inputActiveOptionBorder:He(e9),inputActiveOptionForeground:He(t9),inputActiveOptionBackground:He(Ip)};He(bye),He(wye),He(Cye);He(un),He(rd),He(nd),He($t),He(Fye),He(Bye),He(Wye),He(hwe);const cI={inputBackground:He(VQ),inputForeground:He(HQ),inputBorder:He($Q),inputValidationInfoBorder:He(pwe),inputValidationInfoBackground:He(fwe),inputValidationInfoForeground:He(gwe),inputValidationWarningBorder:He(vwe),inputValidationWarningBackground:He(mwe),inputValidationWarningForeground:He(_we),inputValidationErrorBorder:He(wwe),inputValidationErrorBackground:He(bwe),inputValidationErrorForeground:He(Cwe)},oNe={listFilterWidgetBackground:He(hye),listFilterWidgetOutline:He(fye),listFilterWidgetNoMatchesOutline:He(gye),listFilterWidgetShadow:He(pye),inputBoxStyles:cI,toggleStyles:lI},Mee={badgeBackground:He(fD),badgeForeground:He(Iwe),badgeBorder:He($t)};He(xye),He(Tye),He(i$),He(i$),He(Nye);const e_={listBackground:void 0,listInactiveFocusForeground:void 0,listFocusBackground:He(iye),listFocusForeground:He(nye),listFocusOutline:He(sye),listActiveSelectionBackground:He(Eu),listActiveSelectionForeground:He(cd),listActiveSelectionIconForeground:He(z1),listFocusAndSelectionOutline:He(oye),listFocusAndSelectionBackground:He(Eu),listFocusAndSelectionForeground:He(cd),listInactiveSelectionBackground:He(rye),listInactiveSelectionIconForeground:He(lye),listInactiveSelectionForeground:He(aye),listInactiveFocusBackground:He(cye),listInactiveFocusOutline:He(dye),listHoverBackground:He(jQ),listHoverForeground:He(KQ),listDropBackground:He(uye),listSelectionOutline:He($i),listHoverOutline:He($i),treeIndentGuidesStroke:He(U1),treeInactiveIndentGuidesStroke:He(mye),tableColumnsBorder:He(_ye),tableOddRowsBackgroundColor:He(vye)};function N0(n){return tNe(n,e_)}const rNe={selectBackground:He(sd),selectListBackground:He(ywe),selectForeground:He(Lu),decoratorRightForeground:He(zQ),selectBorder:He(rv),focusBorder:He(zr),listFocusBackground:He(xp),listInactiveSelectionIconForeground:He(av),listFocusForeground:He(Tp),listFocusOutline:cwe($i,ee.transparent.toString()),listHoverBackground:He(jQ),listHoverForeground:He(KQ),listHoverOutline:He($i),selectListBorder:He(ad),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},aNe={shadowColor:He(nd),borderColor:He(yye),foregroundColor:He(Sye),backgroundColor:He(Lye),selectionForegroundColor:He(kye),selectionBackgroundColor:He(Dye),selectionBorderColor:He(Eye),separatorColor:He(Iye),scrollbarShadow:He(Twe),scrollbarSliderBackground:He(V1),scrollbarSliderHoverBackground:He(H1),scrollbarSliderActiveBackground:He($1)};var Wx=globalThis&&globalThis.__decorate||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},Yo=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},Ree=globalThis&&globalThis.__awaiter||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 lNe(n,e,t,i){const s=n.getActions(e),o=wu.getInstance(),r=o.keyStatus.altKey||(zs||Co)&&o.keyStatus.shiftKey;Oee(s,t,r,i?a=>a===i:a=>a==="navigation")}function Pee(n,e,t,i,s,o){const r=n.getActions(e);Oee(r,t,!1,typeof i=="string"?l=>l===i:i,s,o)}function Oee(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 hs)):(u=a,u.length>0&&u.push(new hs));for(let h of d){t&&(h=h instanceof fl&&h.alt?h.alt:h);const f=u.push(h);h instanceof Sb&&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 gm=class extends Hb{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 Ts),this._altKey=wu.getInstance()}get _menuItemAction(){return this._action}get _commandAction(){return this._wantsAltCommand&&this._menuItemAction.alt||this._menuItemAction}onClick(e){return Ree(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(ce(e,"mouseleave",s=>{t=!1,i()})),this._register(ce(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}\n[{1}] {2}",o,O9.modifierLabels[$r].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&&Qxe(e.toggled)&&e.toggled.icon?e.toggled.icon:e.icon;if(s)if(dt.isThemeIcon(s)){const o=dt.asClassNameArray(s);i.classList.add(...o),this._itemClassDispose.value=vt(()=>{i.classList.remove(...o)})}else{const o=Nb(this._themeService.getColorTheme().type)?Uf(s.dark):Uf(s.light),r=ye("span");r.style.webkitMask=r.style.mask="".concat(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=rl(vt(()=>{i.classList.remove("icon"),Es(i)}),this._themeService.onDidColorThemeChange(()=>{this.updateClass()}))}}};gm=Wx([Yo(2,Di),Yo(3,Nn),Yo(4,bt),Yo(5,os),Yo(6,Cl),Yo(7,oh)],gm);let a4=class extends rI{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:dt.isThemeIcon(e.item.icon)?dt.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),bi(this.element),e.classList.add("menu-entry");const t=this._action,{icon:i}=t.item;if(i&&!dt.isThemeIcon(i)){this.element.classList.add("icon");const s=()=>{this.element&&(this.element.style.backgroundImage=Nb(this._themeService.getColorTheme().type)?Uf(i.dark):Uf(i.light))};s(),this._register(this._themeService.onDidColorThemeChange(()=>{s()}))}}};a4=Wx([Yo(2,Di),Yo(3,Cl),Yo(4,os)],a4);let l4=class extends Ul{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="".concat(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(gm,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 yb});this._dropdown=new rI(e,e.actions,this._contextMenuService,g),this._dropdown.actionRunner.onDidRun(p=>{p.action instanceof fl&&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(gm,e,{keybinding:this._getDefaultActionKeybindingLabel(e)}),this._defaultAction.actionRunner=new class extends yb{runAction(i,s){return Ree(this,void 0,void 0,function*(){yield i.run(void 0)})}},this._container&&this._defaultAction.render(JX(this._container,ye(".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="(".concat(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=ye(".action-container");this._defaultAction.render(ge(this._container,t)),this._register(ce(t,Pe.KEY_DOWN,s=>{const o=new Oi(s);o.equals(17)&&(this._defaultAction.element.tabIndex=-1,this._dropdown.focus(),o.stopPropagation())}));const i=ye(".dropdown-action-container");this._dropdown.render(ge(this._container,i)),this._register(ce(i,Pe.KEY_DOWN,s=>{var o;const r=new Oi(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()}};l4=Wx([Yo(2,Di),Yo(3,Nn),Yo(4,Cl),Yo(5,Vd),Yo(6,_t),Yo(7,yl)],l4);let c4=class extends Yxe{constructor(e,t){super(null,e,e.actions.map(i=>({text:i.id===hs.ID?"─────────":i.label,isDisabled:!i.enabled})),0,t,rNe,{ariaLabel:e.tooltip,optionsAsChildren:!0}),this.select(Math.max(0,e.actions.findIndex(i=>i.checked)))}render(e){super.render(e),e.style.borderColor=He(rv)}runAction(e,t){const i=this.action.actions[t];i&&this.actionRunner.run(i)}};c4=Wx([Yo(1,rh)],c4);function cNe(n,e,t){return e instanceof fl?n.createInstance(gm,e,t):e instanceof ww?e.item.isSelection?n.createInstance(c4,e):e.item.rememberDefaultAction?n.createInstance(l4,e,Object.assign(Object.assign({},t),{persistLastActionId:!0})):n.createInstance(a4,e,t):void 0}var dNe=globalThis&&globalThis.__awaiter||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 Pa extends te{constructor(e,t={}){var i,s,o,r,a,l;super(),this._actionRunnerDisposables=this._register(new be),this.viewItemDisposables=this._register(new v8),this.triggerKeyDown=!1,this.focusable=!0,this._onDidBlur=this._register(new j),this.onDidBlur=this._onDidBlur.event,this._onDidCancel=this._register(new j({onWillAddFirstListener:()=>this.cancelHasListener=!0})),this.onDidCancel=this._onDidCancel.event,this.cancelHasListener=!1,this._onDidRun=this._register(new j),this.onDidRun=this._onDidRun.event,this._onWillRun=this._register(new j),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 yb,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(ce(this.domNode,Pe.KEY_DOWN,u=>{const h=new Oi(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 Ul&&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(ce(this.domNode,Pe.KEY_UP,u=>{const h=new Oi(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(Ld(this.domNode)),this._register(this.focusTracker.onDidBlur(()=>{(al()===this.domNode||!Ws(al(),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 Ul&&i.isEnabled());t instanceof Ul&&t.setFocusable(!0)}else this.viewItems.forEach(t=>{t instanceof Ul&&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 Hb(this.context,o,l)),this.options.allowContextMenu||this.viewItemDisposables.set(a,ce(r,Pe.CONTEXT_MENU,c=>{xt.stop(c,!0)})),a.actionRunner=this._actionRunner,a.setActionContext(this.context),a.render(r),this.focusable&&a instanceof Ul&&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=fi(this.viewItems),this.viewItemDisposables.clearAndDisposeAll(),Ds(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===hs.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===hs.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;hw(o.focus)||(r=!1),this.options.focusOnlyEnabledItems&&hw(o.isEnabled)&&!o.isEnabled()&&(r=!1),o.action.id===hs.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 Ul){const i=t._context===null||t._context===void 0?e:t._context;this.run(t._action,i)}}run(e,t){return dNe(this,void 0,void 0,function*(){yield this._actionRunner.run(e,t)})}dispose(){this._context=void 0,this.viewItems=fi(this.viewItems),this.getContainer().remove(),super.dispose()}}const d4=/\(&([^\s&])\)|(^|[^&])&([^\s&])/,iR=/(&)?(&)([^\s&])/g;var dI;(function(n){n[n.Right=0]="Right",n[n.Left=1]="Left"})(dI||(dI={}));class nb extends Pa{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,...Kt||Co?[10]:[]],keyDown:!0}}),this.menuStyles=s,this.menuElement=o,this.actionsList.tabIndex=0,this.menuDisposables=this._register(new be),this.initializeOrUpdateStyleSheet(e,s),this._register(Ii.addTarget(o)),ce(o,Pe.KEY_DOWN,l=>{new Oi(l).equals(2)&&l.preventDefault()}),i.enableMnemonics&&this.menuDisposables.add(ce(o,Pe.KEY_DOWN,l=>{const c=l.key.toLocaleLowerCase();if(this.mnemonics.has(c)){xt.stop(l,!0);const d=this.mnemonics.get(c);if(d.length===1&&(d[0]instanceof $z&&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)}}})),Co&&this._register(ce(o,Pe.KEY_DOWN,l=>{const c=new Oi(l);c.equals(14)||c.equals(11)?(this.focusedItem=this.viewItems.length-1,this.focusNext(),xt.stop(l,!0)):(c.equals(13)||c.equals(12))&&(this.focusedItem=0,this.focusPrevious(),xt.stop(l,!0))})),this._register(ce(this.domNode,Pe.MOUSE_OUT,l=>{const c=l.relatedTarget;Ws(c,this.domNode)||(this.focusedItem=void 0,this.updateFocus(),l.stopPropagation())})),this._register(ce(this.actionsList,Pe.MOUSE_OVER,l=>{let c=l.target;if(!(!c||!Ws(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(Ii.addTarget(this.actionsList)),this._register(ce(this.actionsList,Ti.Tap,l=>{let c=l.initialTarget;if(!(!c||!Ws(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 bS(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(ce(o,Ti.Change,l=>{xt.stop(l,!0);const c=this.scrollableElement.getScrollPosition().scrollTop;this.scrollableElement.setScrollPosition({scrollTop:c-l.translationY})})),this._register(ce(a,Pe.MOUSE_UP,l=>{l.preventDefault()})),o.style.maxHeight="".concat(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: ".concat(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 zz)).forEach((l,c,d)=>{l.updatePositionInSet(c+1,d.length)})}initializeOrUpdateStyleSheet(e,t){this.styleSheet||(bE(e)?this.styleSheet=Na(e):(nb.globalStyleSheet||(nb.globalStyleSheet=Na()),this.styleSheet=nb.globalStyleSheet)),this.styleSheet.textContent=hNe(t,bE(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 ".concat(t.borderColor):"",l="5px",c=t.shadowColor?"0 2px 8px ".concat(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(ce(this.element,Pe.MOUSE_UP,o=>{if(xt.stop(o,!0),Ta){if(new ba(o).rightButton)return;this.onClick(o)}else setTimeout(()=>{this.onClick(o)},0)})),this._register(ce(this.element,Pe.CONTEXT_MENU,o=>{xt.stop(o,!0)})))},100),this._register(this.runOnceToEnableMouseUp)}render(e){super.render(e),this.element&&(this.container=e,this.item=ge(this.element,ye("a.action-menu-item")),this._action.id===hs.ID?this.item.setAttribute("role","presentation"):(this.item.setAttribute("role","menuitem"),this.mnemonic&&this.item.setAttribute("aria-keyshortcuts","".concat(this.mnemonic))),this.check=ge(this.item,ye("span.menu-item-check"+dt.asCSSSelector(Me.menuSelection))),this.check.setAttribute("role","none"),this.label=ge(this.item,ye("span.action-label")),this.options.label&&this.options.keybinding&&(ge(this.item,ye("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","".concat(e)),this.item.setAttribute("aria-setsize","".concat(t)))}updateLabel(){var e;if(this.label&&this.options.label){Ds(this.label);let t=U9(this.action.label);if(t){const i=uNe(t);this.options.enableMnemonics||(t=i),this.label.setAttribute("aria-label",i.replace(/&&/g,"&"));const s=d4.exec(t);if(s){t=gE(t),iR.lastIndex=0;let o=iR.exec(t);for(;o&&o[1];)o=iR.exec(t);const r=a=>a.replace(/&&/g,"&");o?this.label.append(aS(r(t.substr(0,o.index))," "),ye("u",{"aria-hidden":"true"},o[3]),LX(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 ".concat(this.menuStyle.selectionBorderColor):"",o=e&&this.menuStyle.selectionBorderColor?"-1px":"";this.item&&(this.item.style.color=t!=null?t:"",this.item.style.backgroundColor=i!=null?i:"",this.item.style.outline=s,this.item.style.outlineOffset=o),this.check&&(this.check.style.color=t!=null?t:"")}}class $z extends Fee{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 be),this.mouseOver=!1,this.expandDirection=s&&s.expandDirection!==void 0?s.expandDirection:dI.Right,this.showScheduler=new Si(()=>{this.mouseOver&&(this.cleanupExistingSubmenu(!1),this.createSubmenu(!1))},250),this.hideScheduler=new Si(()=>{this.element&&!Ws(al(),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=ge(this.item,ye("span.submenu-indicator"+dt.asCSSSelector(Me.menuSubmenu))),this.submenuIndicator.setAttribute("aria-hidden","true")),this._register(ce(this.element,Pe.KEY_UP,t=>{const i=new Oi(t);(i.equals(17)||i.equals(3))&&(xt.stop(t,!0),this.createSubmenu(!0))})),this._register(ce(this.element,Pe.KEY_DOWN,t=>{const i=new Oi(t);al()===this.item&&(i.equals(17)||i.equals(3))&&xt.stop(t,!0)})),this._register(ce(this.element,Pe.MOUSE_OVER,t=>{this.mouseOver||(this.mouseOver=!0,this.showScheduler.schedule())})),this._register(ce(this.element,Pe.MOUSE_LEAVE,t=>{this.mouseOver=!1})),this._register(ce(this.element,Pe.FOCUS_OUT,t=>{this.element&&!Ws(al(),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){xt.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=mv(e.width,t.width,{position:s===dI.Right?0:1,offset:i.left,size:i.width}),o.left>=i.left&&o.left{new Oi(c).equals(15)&&(xt.stop(c,!0),this.parentData.parent.focus(),this.cleanupExistingSubmenu(!0))})),this.submenuDisposables.add(ce(this.submenuContainer,Pe.KEY_DOWN,c=>{new Oi(c).equals(15)&&xt.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!=null?t:"")}dispose(){super.dispose(),this.hideScheduler.dispose(),this.mysubmenu&&(this.mysubmenu.dispose(),this.mysubmenu=null),this.submenuContainer&&(this.submenuContainer=void 0)}}class zz extends Hb{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?"".concat(this.menuStyles.separatorColor):"")}}function uNe(n){const e=d4,t=e.exec(n);if(!t)return n;const i=!t[1];return n.replace(e,i?"$2$3":"").trim()}function Uz(n){const e=CX()[n.id];return".codicon-".concat(n.id,":before { content: '\\").concat(e.toString(16),"'; }")}function hNe(n,e){let t="\n.monaco-menu {\n font-size: 13px;\n border-radius: 5px;\n min-width: 160px;\n}\n\n".concat(Uz(Me.menuSelection),"\n").concat(Uz(Me.menuSubmenu),"\n\n.monaco-menu .monaco-action-bar {\n text-align: right;\n overflow: hidden;\n white-space: nowrap;\n}\n\n.monaco-menu .monaco-action-bar .actions-container {\n display: flex;\n margin: 0 auto;\n padding: 0;\n width: 100%;\n justify-content: flex-end;\n}\n\n.monaco-menu .monaco-action-bar.vertical .actions-container {\n display: inline-block;\n}\n\n.monaco-menu .monaco-action-bar.reverse .actions-container {\n flex-direction: row-reverse;\n}\n\n.monaco-menu .monaco-action-bar .action-item {\n cursor: pointer;\n display: inline-block;\n transition: transform 50ms ease;\n position: relative; /* DO NOT REMOVE - this is the key to preventing the ghosting icon bug in Chrome 42 */\n}\n\n.monaco-menu .monaco-action-bar .action-item.disabled {\n cursor: default;\n}\n\n.monaco-menu .monaco-action-bar.animated .action-item.active {\n transform: scale(1.272019649, 1.272019649); /* 1.272019649 = √φ */\n}\n\n.monaco-menu .monaco-action-bar .action-item .icon,\n.monaco-menu .monaco-action-bar .action-item .codicon {\n display: inline-block;\n}\n\n.monaco-menu .monaco-action-bar .action-item .codicon {\n display: flex;\n align-items: center;\n}\n\n.monaco-menu .monaco-action-bar .action-label {\n font-size: 11px;\n margin-right: 4px;\n}\n\n.monaco-menu .monaco-action-bar .action-item.disabled .action-label,\n.monaco-menu .monaco-action-bar .action-item.disabled .action-label:hover {\n color: var(--vscode-disabledForeground);\n}\n\n/* Vertical actions */\n\n.monaco-menu .monaco-action-bar.vertical {\n text-align: left;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-item {\n display: block;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-label.separator {\n display: block;\n border-bottom: 1px solid var(--vscode-menu-separatorBackground);\n padding-top: 1px;\n padding: 30px;\n}\n\n.monaco-menu .secondary-actions .monaco-action-bar .action-label {\n margin-left: 6px;\n}\n\n/* Action Items */\n.monaco-menu .monaco-action-bar .action-item.select-container {\n overflow: hidden; /* somehow the dropdown overflows its container, we prevent it here to not push */\n flex: 1;\n max-width: 170px;\n min-width: 60px;\n display: flex;\n align-items: center;\n justify-content: center;\n margin-right: 10px;\n}\n\n.monaco-menu .monaco-action-bar.vertical {\n margin-left: 0;\n overflow: visible;\n}\n\n.monaco-menu .monaco-action-bar.vertical .actions-container {\n display: block;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-item {\n padding: 0;\n transform: none;\n display: flex;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-item.active {\n transform: none;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-menu-item {\n flex: 1 1 auto;\n display: flex;\n height: 2em;\n align-items: center;\n position: relative;\n margin: 0 4px;\n border-radius: 4px;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-menu-item:hover .keybinding,\n.monaco-menu .monaco-action-bar.vertical .action-menu-item:focus .keybinding {\n opacity: unset;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-label {\n flex: 1 1 auto;\n text-decoration: none;\n padding: 0 1em;\n background: none;\n font-size: 12px;\n line-height: 1;\n}\n\n.monaco-menu .monaco-action-bar.vertical .keybinding,\n.monaco-menu .monaco-action-bar.vertical .submenu-indicator {\n display: inline-block;\n flex: 2 1 auto;\n padding: 0 1em;\n text-align: right;\n font-size: 12px;\n line-height: 1;\n}\n\n.monaco-menu .monaco-action-bar.vertical .submenu-indicator {\n height: 100%;\n}\n\n.monaco-menu .monaco-action-bar.vertical .submenu-indicator.codicon {\n font-size: 16px !important;\n display: flex;\n align-items: center;\n}\n\n.monaco-menu .monaco-action-bar.vertical .submenu-indicator.codicon::before {\n margin-left: auto;\n margin-right: -20px;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-item.disabled .keybinding,\n.monaco-menu .monaco-action-bar.vertical .action-item.disabled .submenu-indicator {\n opacity: 0.4;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-label:not(.separator) {\n display: inline-block;\n box-sizing: border-box;\n margin: 0;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-item {\n position: static;\n overflow: visible;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-item .monaco-submenu {\n position: absolute;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-label.separator {\n width: 100%;\n height: 0px !important;\n opacity: 1;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-label.separator.text {\n padding: 0.7em 1em 0.1em 1em;\n font-weight: bold;\n opacity: 1;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-label:hover {\n color: inherit;\n}\n\n.monaco-menu .monaco-action-bar.vertical .menu-item-check {\n position: absolute;\n visibility: hidden;\n width: 1em;\n height: 100%;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-menu-item.checked .menu-item-check {\n visibility: visible;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\n/* Context Menu */\n\n.context-view.monaco-menu-container {\n outline: 0;\n border: none;\n animation: fadeIn 0.083s linear;\n -webkit-app-region: no-drag;\n}\n\n.context-view.monaco-menu-container :focus,\n.context-view.monaco-menu-container .monaco-action-bar.vertical:focus,\n.context-view.monaco-menu-container .monaco-action-bar.vertical :focus {\n outline: 0;\n}\n\n.hc-black .context-view.monaco-menu-container,\n.hc-light .context-view.monaco-menu-container,\n:host-context(.hc-black) .context-view.monaco-menu-container,\n:host-context(.hc-light) .context-view.monaco-menu-container {\n box-shadow: none;\n}\n\n.hc-black .monaco-menu .monaco-action-bar.vertical .action-item.focused,\n.hc-light .monaco-menu .monaco-action-bar.vertical .action-item.focused,\n:host-context(.hc-black) .monaco-menu .monaco-action-bar.vertical .action-item.focused,\n:host-context(.hc-light) .monaco-menu .monaco-action-bar.vertical .action-item.focused {\n background: none;\n}\n\n/* Vertical Action Bar Styles */\n\n.monaco-menu .monaco-action-bar.vertical {\n padding: 4px 0;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-menu-item {\n height: 2em;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-label:not(.separator),\n.monaco-menu .monaco-action-bar.vertical .keybinding {\n font-size: inherit;\n padding: 0 2em;\n}\n\n.monaco-menu .monaco-action-bar.vertical .menu-item-check {\n font-size: inherit;\n width: 2em;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-label.separator {\n font-size: inherit;\n margin: 5px 0 !important;\n padding: 0;\n border-radius: 0;\n}\n\n.linux .monaco-menu .monaco-action-bar.vertical .action-label.separator,\n:host-context(.linux) .monaco-menu .monaco-action-bar.vertical .action-label.separator {\n margin-left: 0;\n margin-right: 0;\n}\n\n.monaco-menu .monaco-action-bar.vertical .submenu-indicator {\n font-size: 60%;\n padding: 0 1.8em;\n}\n\n.linux .monaco-menu .monaco-action-bar.vertical .submenu-indicator,\n:host-context(.linux) .monaco-menu .monaco-action-bar.vertical .submenu-indicator {\n height: 100%;\n mask-size: 10px 10px;\n -webkit-mask-size: 10px 10px;\n}\n\n.monaco-menu .action-item {\n cursor: default;\n}");if(e){t+="\n /* Arrows */\n .monaco-scrollable-element > .scrollbar > .scra {\n cursor: pointer;\n font-size: 11px !important;\n }\n\n .monaco-scrollable-element > .visible {\n opacity: 1;\n\n /* Background rule added for IE9 - to allow clicks on dom node */\n background:rgba(0,0,0,0);\n\n transition: opacity 100ms linear;\n }\n .monaco-scrollable-element > .invisible {\n opacity: 0;\n pointer-events: none;\n }\n .monaco-scrollable-element > .invisible.fade {\n transition: opacity 800ms linear;\n }\n\n /* Scrollable Content Inset Shadow */\n .monaco-scrollable-element > .shadow {\n position: absolute;\n display: none;\n }\n .monaco-scrollable-element > .shadow.top {\n display: block;\n top: 0;\n left: 3px;\n height: 3px;\n width: 100%;\n }\n .monaco-scrollable-element > .shadow.left {\n display: block;\n top: 3px;\n left: 0;\n height: 100%;\n width: 3px;\n }\n .monaco-scrollable-element > .shadow.top-left-corner {\n display: block;\n top: 0;\n left: 0;\n height: 3px;\n width: 3px;\n }\n ";const i=n.scrollbarShadow;i&&(t+="\n .monaco-scrollable-element > .shadow.top {\n box-shadow: ".concat(i," 0 6px 6px -6px inset;\n }\n\n .monaco-scrollable-element > .shadow.left {\n box-shadow: ").concat(i," 6px 0 6px -6px inset;\n }\n\n .monaco-scrollable-element > .shadow.top.left {\n box-shadow: ").concat(i," 6px 6px 6px -6px inset;\n }\n "));const s=n.scrollbarSliderBackground;s&&(t+="\n .monaco-scrollable-element > .scrollbar > .slider {\n background: ".concat(s,";\n }\n "));const o=n.scrollbarSliderHoverBackground;o&&(t+="\n .monaco-scrollable-element > .scrollbar > .slider:hover {\n background: ".concat(o,";\n }\n "));const r=n.scrollbarSliderActiveBackground;r&&(t+="\n .monaco-scrollable-element > .scrollbar > .slider.active {\n background: ".concat(r,";\n }\n "))}return t}class fNe{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=F8(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(ye(".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=ce(this.block,Pe.MOUSE_DOWN,d=>d.stopPropagation()));const l=new be,c=e.actionRunner||new yb;return c.onWillRun(d=>this.onActionRun(d,!e.skipTelemetry),this,l),c.onDidRun(this.onDidActionRun,this,l),i=new nb(o,t,{actionViewItemProvider:e.getActionViewItem,context:e.getActionsContext?e.getActionsContext():null,actionRunner:c,getKeyBinding:e.getKeyBinding?e.getKeyBinding:d=>this.keybindingService.lookupKeybinding(d.id)},aNe),i.onDidCancel(()=>this.contextViewService.hideContextView(!0),null,l),i.onDidBlur(()=>this.contextViewService.hideContextView(!0),null,l),l.add(ce(window,Pe.BLUR,()=>this.contextViewService.hideContextView(!0))),l.add(ce(window,Pe.MOUSE_DOWN,d=>{if(d.defaultPrevented)return;const u=new ba(d);let h=u.target;if(!u.rightButton){for(;h;){if(h===o)return;h=h.parentElement}this.contextViewService.hideContextView(!0)}})),rl(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&&(al()===this.lastContainer||Ws(al(),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&&!bc(e.error)&&this.notificationService.error(e.error)}}var gNe=globalThis&&globalThis.__decorate||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},x_=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let u4=class extends te{get contextMenuHandler(){return this._contextMenuHandler||(this._contextMenuHandler=new fNe(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 j),this._onDidHideContextMenu=this._store.add(new j)}configure(e){this.contextMenuHandler.configure(e)}showContextMenu(e){e=h4.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()}})),wu.getInstance().resetKeyStatus(),this._onDidShowContextMenu.fire()}};u4=gNe([x_(0,ra),x_(1,Nn),x_(2,rh),x_(3,Di),x_(4,Vd),x_(5,bt)],u4);var h4;(function(n){function e(i){return i&&i.menuId instanceof M}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!=null?l:o);lNe(d,a,c),d.dispose()}return i.getActions?hs.join(i.getActions(),c):c}})}n.transform=t})(h4||(h4={}));var uI;(function(n){n[n.API=0]="API",n[n.USER=1]="USER"})(uI||(uI={}));var G9=globalThis&&globalThis.__decorate||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},hI=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},wp=globalThis&&globalThis.__awaiter||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 f4=class{constructor(e){this._commandService=e}open(e,t){return wp(this,void 0,void 0,function*(){if(!M9(e,Nt.command))return!1;if(!(t!=null&&t.allowCommands)||(typeof e=="string"&&(e=ct.parse(e)),Array.isArray(t.allowCommands)&&!t.allowCommands.includes(e.path)))return!0;let i=[];try{i=i4(decodeURIComponent(e.query))}catch{try{i=i4(e.query)}catch{}}return Array.isArray(i)||(i=[i]),yield this._commandService.executeCommand(e.path,...i),!0})}};f4=G9([hI(0,gn)],f4);let g4=class{constructor(e){this._editorService=e}open(e,t){return wp(this,void 0,void 0,function*(){typeof e=="string"&&(e=ct.parse(e));const{selection:i,uri:s}=vIe(e);return e=s,e.scheme===Nt.file&&(e=eDe(e)),yield this._editorService.openCodeEditor({resource:e,options:Object.assign({selection:i,source:t!=null&&t.fromUserGesture?uI.USER:uI.API},t==null?void 0:t.editorOptions)},this._editorService.getFocusedCodeEditor(),t==null?void 0:t.openToSide),!0})}};g4=G9([hI(0,ai)],g4);let p4=class{constructor(e,t){this._openers=new To,this._validators=new To,this._resolvers=new To,this._resolvedUriTargets=new Js(i=>i.with({path:null,fragment:null,query:null}).toString()),this._externalOpeners=new To,this._defaultExternalOpener={openExternal:i=>wp(this,void 0,void 0,function*(){return pz(i,Nt.http,Nt.https)?tQ(i):window.location.href=i,!0})},this._openers.push({open:(i,s)=>wp(this,void 0,void 0,function*(){return s!=null&&s.openExternal||pz(i,Nt.mailto,Nt.http,Nt.https,Nt.vsls)?(yield this._doOpenExternal(i,s),!0):!1})}),this._openers.push(new f4(t)),this._openers.push(new g4(e))}registerOpener(e){return{dispose:this._openers.unshift(e)}}open(e,t){var i;return wp(this,void 0,void 0,function*(){const s=typeof e=="string"?ct.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 wp(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 wp(this,void 0,void 0,function*(){const i=typeof e=="string"?ct.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},Ft.None))return!0}return this._defaultExternalOpener.openExternal(o,{sourceUri:i},Ft.None)})}dispose(){this._validators.clear()}};p4=G9([hI(0,ai),hI(1,gn)],p4);const Sl=Wt("editorWorkerService");var rn;(function(n){n[n.Hint=1]="Hint",n[n.Info=2]="Info",n[n.Warning=4]="Warning",n[n.Error=8]="Error"})(rn||(rn={}));(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 bn.Error:return n.Error;case bn.Warning:return n.Warning;case bn.Info:return n.Info;case bn.Ignore:return n.Hint}}n.fromSeverity=s;function o(r){switch(r){case n.Error:return bn.Error;case n.Warning:return bn.Warning;case n.Info:return bn.Info;case n.Hint:return bn.Ignore}}n.toSeverity=o})(rn||(rn={}));var fI;(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(rn.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})(fI||(fI={}));const zd=Wt("markerService");function pNe(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 mNe(n,e){const t=new Set;for(const i of e)n.has(i)&&t.add(i);return t}var _Ne=globalThis&&globalThis.__decorate||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},jz=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let m4=class extends te{constructor(e,t){super(),this._markerService=t,this._onDidChangeMarker=this._register(new j),this._markerDecorations=new Js,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 vNe(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===Nt.inMemory||e.uri.scheme===Nt.internal||e.uri.scheme===Nt.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)}};m4=_Ne([jz(0,Zi),jz(1,zd)],m4);class vNe extends te{constructor(e){super(),this.model=e,this._map=new eCe,this._register(vt(()=>{this.model.deltaDecorations([...this._map.values()],[]),this._map.clear()}))}update(e){const{added:t,removed:i}=pNe(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 I(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 bNe=globalThis&&globalThis.__decorate||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},g1=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},q_;function Yg(n){return n.toString()}class CNe{constructor(e,t,i){this.model=e,this._modelEventListeners=new be,this.model=e,this._modelEventListeners.add(e.onWillDispose(()=>t(e))),this._modelEventListeners.add(e.onDidChangeLanguage(s=>i(e,s)))}dispose(){this._modelEventListeners.dispose()}}const wNe=Co||Kt?1:2;class yNe{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 gI=q_=class extends te{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 j),this.onModelAdded=this._onModelAdded.event,this._onModelRemoved=this._register(new j),this.onModelRemoved=this._onModelRemoved.event,this._onModelModeChanged=this._register(new j),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=Qs.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=Qs.insertSpaces;e.editor&&typeof e.editor.insertSpaces<"u"&&(r=e.editor.insertSpaces==="false"?!1:!!e.editor.insertSpaces);let a=wNe;const l=e.eol;l==="\r\n"?a=2:l==="\n"&&(a=1);let c=Qs.trimAutoWhitespace;e.editor&&typeof e.editor.trimAutoWhitespace<"u"&&(c=e.editor.trimAutoWhitespace==="false"?!1:!!e.editor.trimAutoWhitespace);let d=Qs.detectIndentation;e.editor&&typeof e.editor.detectIndentation<"u"&&(d=e.editor.detectIndentation==="false"?!1:!!e.editor.detectIndentation);let u=Qs.largeFileOptimizations;e.editor&&typeof e.editor.largeFileOptimizations<"u"&&(u=e.editor.largeFileOptimizations==="false"?!1:!!e.editor.largeFileOptimizations);let h=Qs.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:$r===3||$r===2?"\n":"\r\n"}_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=q_._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 Id(e,t,o,i,this._undoRedoService,this._languageService,this._languageConfigurationService);if(i&&this._disposedModels.has(Yg(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)hu(f)&&f.matchesResource(i)&&f.setModel(r);for(const f of d.future)hu(f)&&f.matchesResource(i)&&f.setModel(r);this._undoRedoService.setElementsValidFlag(i,!0,f=>hu(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=Yg(r.uri);if(this._models[a])throw new Error("ModelService: Cannot add model because it already exists!");const l=new CNe(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,Yr,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)hu(d)&&d.matchesResource(e.uri)&&(o=!0,r+=d.heapSize(e.uri),d.setModel(e.uri));for(const d of c.future)hu(d)&&d.matchesResource(e.uri)&&(o=!0,r+=d.heapSize(e.uri),d.setModel(e.uri))}}const a=q_.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=>hu(c)&&c.matchesResource(e.uri)),this._insertDisposedModel(new yNe(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);q_._setModelOptionsForModel(e,r,o),this._onModelModeChanged.fire({model:e,oldLanguageId:i})}_getSHA1Computer(){return new Vx}};gI.MAX_MEMORY_FOR_CLOSED_FILES_UNDO_STACK=20*1024*1024;gI=q_=bNe([g1(0,zt),g1(1,NQ),g1(2,Ix),g1(3,qi),g1(4,Ni)],gI);class Vx{canComputeSHA1(e){return e.getValueLength()<=Vx.MAX_MODEL_SIZE}computeSHA1(e){const t=new gx,i=e.createSnapshot();let s;for(;s=i.read();)t.update(s);return t.digest()}}Vx.MAX_MODEL_SIZE=10*1024*1024;class SNe{get templateId(){return this.renderer.templateId}constructor(e,t){this.renderer=e,this.modelProvider=t}renderTemplate(e){return{data:this.renderer.renderTemplate(e),disposable:te.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 Tn,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 LNe{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 kNe(n,e){return Object.assign(Object.assign({},e),{accessibilityProvider:e.accessibilityProvider&&new LNe(n,e.accessibilityProvider)})}class DNe{constructor(e,t,i,s,o={}){const r=()=>this.model,a=s.map(l=>new SNe(l,r));this.list=new wl(e,t,i,a,kNe(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 We.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 We.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 We.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,yo(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 A0=globalThis&&globalThis.__decorate||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 ENe=!1;var pI;(function(n){n.North="north",n.South="south",n.East="east",n.West="west"})(pI||(pI={}));let INe=4;const TNe=new j;let xNe=300;const NNe=new j;class Y9{constructor(){this.disposables=new be}get onPointerMove(){return this.disposables.add(new Vt(window,"mousemove")).event}get onPointerUp(){return this.disposables.add(new Vt(window,"mouseup")).event}dispose(){this.disposables.dispose()}}A0([xn],Y9.prototype,"onPointerMove",null);A0([xn],Y9.prototype,"onPointerUp",null);class Z9{get onPointerMove(){return this.disposables.add(new Vt(this.el,Ti.Change)).event}get onPointerUp(){return this.disposables.add(new Vt(this.el,Ti.End)).event}constructor(e){this.el=e,this.disposables=new be}dispose(){this.disposables.dispose()}}A0([xn],Z9.prototype,"onPointerMove",null);A0([xn],Z9.prototype,"onPointerUp",null);class mI{get onPointerMove(){return this.factory.onPointerMove}get onPointerUp(){return this.factory.onPointerUp}constructor(e){this.factory=e}dispose(){}}A0([xn],mI.prototype,"onPointerMove",null);A0([xn],mI.prototype,"onPointerUp",null);const Kz="pointer-events-disabled";class qs extends te{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=ge(this.el,ye(".orthogonal-drag-handle.start")),this.orthogonalStartDragHandleDisposables.add(vt(()=>this._orthogonalStartDragHandle.remove())),this.orthogonalStartDragHandleDisposables.add(new Vt(this._orthogonalStartDragHandle,"mouseenter")).event(()=>qs.onMouseEnter(e),void 0,this.orthogonalStartDragHandleDisposables),this.orthogonalStartDragHandleDisposables.add(new Vt(this._orthogonalStartDragHandle,"mouseleave")).event(()=>qs.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=ge(this.el,ye(".orthogonal-drag-handle.end")),this.orthogonalEndDragHandleDisposables.add(vt(()=>this._orthogonalEndDragHandle.remove())),this.orthogonalEndDragHandleDisposables.add(new Vt(this._orthogonalEndDragHandle,"mouseenter")).event(()=>qs.onMouseEnter(e),void 0,this.orthogonalEndDragHandleDisposables),this.orthogonalEndDragHandleDisposables.add(new Vt(this._orthogonalEndDragHandle,"mouseleave")).event(()=>qs.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=xNe,this.hoverDelayer=this._register(new pl(this.hoverDelay)),this._state=3,this.onDidEnablementChange=this._register(new j),this._onDidStart=this._register(new j),this._onDidChange=this._register(new j),this._onDidReset=this._register(new j),this._onDidEnd=this._register(new j),this.orthogonalStartSashDisposables=this._register(new be),this.orthogonalStartDragHandleDisposables=this._register(new be),this.orthogonalEndSashDisposables=this._register(new be),this.orthogonalEndDragHandleDisposables=this._register(new be),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=ge(e,ye(".monaco-sash")),i.orthogonalEdge&&this.el.classList.add("orthogonal-edge-".concat(i.orthogonalEdge)),Kt&&this.el.classList.add("mac");const s=this._register(new Vt(this.el,"mousedown")).event;this._register(s(u=>this.onPointerStart(u,new Y9),this));const o=this._register(new Vt(this.el,"dblclick")).event;this._register(o(this.onPointerDoublePress,this));const r=this._register(new Vt(this.el,"mouseenter")).event;this._register(r(()=>qs.onMouseEnter(this)));const a=this._register(new Vt(this.el,"mouseleave")).event;this._register(a(()=>qs.onMouseLeave(this))),this._register(Ii.addTarget(this.el));const l=this._register(new Vt(this.el,Ti.Start)).event;this._register(l(u=>this.onPointerStart(u,new Z9(this.el)),this));const c=this._register(new Vt(this.el,Ti.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="".concat(this.size,"px"):this.el.style.height="".concat(this.size,"px")):(this.size=INe,this._register(TNe.event(u=>{this.size=u,this.layout()}))),this._register(NNe.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",ENe),this.layout()}onPointerStart(e,t){xt.stop(e);let i=!1;if(!e.__orthogonalSashEvent){const g=this.getOrthogonalSash(e);g&&(i=!0,e.__orthogonalSashEvent=!0,g.onPointerStart(e,new mI(t)))}if(this.linkedSash&&!e.__linkedSashEvent&&(e.__linkedSashEvent=!0,this.linkedSash.onPointerStart(e,new mI(t))),!this.state)return;const s=document.getElementsByTagName("iframe");for(const g of s)g.classList.add(Kz);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=Na(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=Kt?"row-resize":"ns-resize":this.state===1?g="e-resize":this.state===2?g="w-resize":g=Kt?"col-resize":"ew-resize",c.textContent="* { cursor: ".concat(g," !important; }")},u=new be;d(),i||this.onDidEnablementChange.event(d,null,u);const h=g=>{xt.stop(g,!1);const p={startX:o,currentX:g.pageX,startY:r,currentY:g.pageY,altKey:a};this._onDidChange.fire(p)},f=g=>{xt.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(Kz)};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&&qs.onMouseEnter(e.linkedSash,!0)}static onMouseLeave(e,t=!1){e.hoverDelayer.cancel(),e.el.classList.remove("hover"),!t&&e.linkedSash&&qs.onMouseLeave(e.linkedSash,!0)}clearSashHoverState(){qs.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 ANe={separatorBorder:ee.transparent};class Bee{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=fr(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 MNe extends Bee{layoutContainer(e){this.container.style.top="".concat(e,"px"),this.container.style.height="".concat(this.size,"px")}}class RNe extends Bee{layoutContainer(e){this.container.style.left="".concat(e,"px"),this.container.style.width="".concat(this.size,"px")}}var au;(function(n){n[n.Idle=0]="Idle",n[n.Busy=1]="Busy"})(au||(au={}));var _I;(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})(_I||(_I={}));class Wee extends te{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=au.Idle,this._onDidSashChange=this._register(new j),this._onDidSashReset=this._register(new j),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=ge(this.el,ye(".sash-container")),this.viewContainer=ye(".split-view-container"),this.scrollable=this._register(new vS({forceIntegerValues:!0,smoothScrollDuration:125,scheduleAtNextAnimationFrame:xa})),this.scrollableElement=this._register(new c9(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 Vt(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)})),ge(this.el,this.scrollableElement.getDomNode()),this.style(t.styles||ANe),t.descriptor&&(this.size=t.descriptor.size,t.descriptor.views.forEach((c,d)=>{const u=_r(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=rl(ce(document.body,"keydown",a=>r(this.sashDragState.current,a.altKey)),ce(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=yo(s,-1),p=yo(s+1,this.viewItems.length),_=g.reduce((k,D)=>k+(this.viewItems[D].minimumSize-c[D]),0),v=g.reduce((k,D)=>k+(this.viewItems[D].viewMaximumSize-c[D]),0),b=p.length===0?Number.POSITIVE_INFINITY:p.reduce((k,D)=>k+(c[D]-this.viewItems[D].minimumSize),0),C=p.length===0?Number.NEGATIVE_INFINITY:p.reduce((k,D)=>k+(c[D]-this.viewItems[D].viewMaximumSize),0),w=Math.max(_,C),y=Math.min(b,v),L=this.findFirstSnapIndex(g),S=this.findFirstSnapIndex(p);if(typeof L=="number"){const k=this.viewItems[L],D=Math.floor(k.viewMinimumSize/2);h={index:L,limitDelta:k.visible?w-D:w+D,size:k.size}}if(typeof S=="number"){const k=this.viewItems[S],D=Math.floor(k.viewMinimumSize/2);f={index:S,limitDelta:k.visible?y+D:y-D,size:k.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(C=>C.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=fr(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!==au.Idle)throw new Error("Cant modify splitview");if(this.state=au.Busy,e<0||e>=this.viewItems.length)return;const i=yo(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=fr(t,r.minimumSize,Math.min(r.maximumSize,this.size)),r.size=t,this.relayout(s,o),this.state=au.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=fr(i,a.minimumSize,a.maximumSize);const s=yo(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!==au.Idle)throw new Error("Cant modify splitview");this.state=au.Busy;const o=ye(".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=vt(()=>this.viewContainer.removeChild(o)),l=rl(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 MNe(o,e,c,l):new RNe(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 qs(this.sashContainer,{getHorizontalSashTop:k=>this.getSashPosition(k),getHorizontalSashWidth:this.getSashOrthogonalSize},Object.assign(Object.assign({},h),{orientation:1})):new qs(this.sashContainer,{getVerticalSashLeft:k=>this.getSashPosition(k),getVerticalSashHeight:this.getSashOrthogonalSize},Object.assign(Object.assign({},h),{orientation:0})),g=this.orientation===0?k=>({sash:f,start:k.startY,current:k.currentY,alt:k.altKey}):k=>({sash:f,start:k.startX,current:k.currentX,alt:k.altKey}),_=We.map(f.onDidStart,g)(this.onSashStart,this),b=We.map(f.onDidChange,g)(this.onSashChange,this),w=We.map(f.onDidEnd,()=>this.sashItems.findIndex(k=>k.sash===f))(this.onSashEnd,this),y=f.onDidReset(()=>{const k=this.sashItems.findIndex(P=>P.sash===f),D=yo(k,-1),x=yo(k+1,this.viewItems.length),A=this.findFirstSnapIndex(D),T=this.findFirstSnapIndex(x);typeof A=="number"&&!this.viewItems[A].visible||typeof T=="number"&&!this.viewItems[T].visible||this._onDidSashReset.fire(k)}),L=rl(_,b,w,y,f),S={sash:f,disposable:L};this.sashItems.splice(i-1,0,S)}o.appendChild(e.element);let u;typeof t!="number"&&t.type==="split"&&(u=[t.index]),s||this.relayout([i],u),this.state=au.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=yo(e,-1),u=yo(e+1,this.viewItems.length);if(o)for(const S of o)jA(d,S),jA(u,S);if(s)for(const S of s)fL(d,S),fL(u,S);const h=d.map(S=>this.viewItems[S]),f=d.map(S=>i[S]),g=u.map(S=>this.viewItems[S]),p=u.map(S=>i[S]),_=d.reduce((S,k)=>S+(this.viewItems[k].minimumSize-i[k]),0),v=d.reduce((S,k)=>S+(this.viewItems[k].maximumSize-i[k]),0),b=u.length===0?Number.POSITIVE_INFINITY:u.reduce((S,k)=>S+(i[k]-this.viewItems[k].minimumSize),0),C=u.length===0?Number.NEGATIVE_INFINITY:u.reduce((S,k)=>S+(i[k]-this.viewItems[k].maximumSize),0),w=Math.max(_,C,r),y=Math.min(b,v,a);let L=!1;if(l){const S=this.viewItems[l.index],k=t>=l.limitDelta;L=k!==S.visible,S.setVisible(k,l.size)}if(!L&&c){const S=this.viewItems[c.index],k=ta+l.size,0);let i=this.size-t;const s=yo(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)jA(s,a);for(const a of o)fL(s,a);typeof e=="number"&&fL(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(),fi(this.viewItems),this.viewItems=[],this.sashItems.forEach(t=>t.disposable.dispose()),this.sashItems=[],super.dispose()}}class IS{constructor(e,t,i){this.columns=e,this.getColumnSize=i,this.templateId=IS.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 ".concat(o.templateId," not found."));this.renderers.push(r)}}renderTemplate(e){const t=ge(e,ye(".monaco-table-tr")),i=[],s=[];for(let r=0;rnew ONe(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 Wee(this.domNode,{orientation:1,scrollbarVisibility:2,getSashOrthogonalSize:()=>this.cachedHeight,descriptor:l})),this.splitview.el.style.height="".concat(i.headerRowHeight,"px"),this.splitview.el.style.lineHeight="".concat(i.headerRowHeight,"px");const c=new IS(s,o,d=>this.splitview.getViewSize(d));this.list=this.disposables.add(new wl(e,this.domNode,PNe(i),[c],r)),We.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=Na(this.domNode),this.style(Wxe)}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.".concat(this.domId," > .monaco-split-view2 .monaco-sash.vertical::before {\n top: ").concat(this.virtualDelegate.headerRowHeight+1,"px;\n height: calc(100% - ").concat(this.virtualDelegate.headerRowHeight,"px);\n }")),this.styleElement.textContent=t.join("\n"),this.list.style(e)}getSelectedElements(){return this.list.getSelectedElements()}getSelection(){return this.list.getSelection()}getFocus(){return this.list.getFocus()}dispose(){this.disposables.dispose()}}Hx.InstanceCount=0;class M0 extends vl{constructor(e){super(),this._onChange=this._register(new j),this.onChange=this._onChange.event,this._onKeyDown=this._register(new j),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(...dt.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 FNe=m("caseDescription","Match Case"),BNe=m("wordsDescription","Match Whole Word"),WNe=m("regexDescription","Use Regular Expression");class Vee extends M0{constructor(e){super({icon:Me.caseSensitive,title:FNe+e.appendTitle,isChecked:e.isChecked,inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class Hee extends M0{constructor(e){super({icon:Me.wholeWord,title:BNe+e.appendTitle,isChecked:e.isChecked,inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class $ee extends M0{constructor(e){super({icon:Me.regex,title:WNe+e.appendTitle,isChecked:e.isChecked,inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class VNe{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 HNe{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 VNe(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 p1=ye;let $Ne=class extends vl{constructor(e,t,i){var s;super(),this.state="idle",this.maxHeight=Number.POSITIVE_INFINITY,this._onDidChange=this._register(new j),this.onDidChange=this._onDidChange.event,this._onDidHeightChange=this._register(new j),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=ge(e,p1(".monaco-inputbox.idle"));const o=this.options.flexibleHeight?"textarea":"input",r=ge(this.element,p1(".ibwrapper"));if(this.input=ge(r,p1(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=ge(r,p1("div.mirror")),this.mirror.innerText=" ",this.scrollableElement=new tJ(this.element,{vertical:1}),this.options.flexibleWidth&&(this.input.setAttribute("wrap","off"),this.mirror.style.whiteSpace="pre",this.mirror.style.wordWrap="initial"),ge(e,this.scrollableElement.getDomNode()),this._register(this.scrollableElement),this._register(this.scrollableElement.onScroll(c=>this.input.scrollTop=c.scrollTop));const a=this._register(new Vt(document,"selectionchange")),l=We.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 Pa(this.element)),this.actionbar.push(this.options.actions,{icon:!0,label:!1})),this.applyStyles()}onBlur(){this._hideMessage(),this.options.showPlaceholderOnFocus&&this.input.setAttribute("placeholder","")}onFocus(){this._showMessage(),this.options.showPlaceholderOnFocus&&this.input.setAttribute("placeholder",this.placeholder||"")}setPlaceHolder(e){this.placeholder=e,this.input.setAttribute("placeholder",e)}setTooltip(e){this.tooltip=e,this.input.title=e}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:Ep(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% - ".concat(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"&&Gr(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 ".concat(zp(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=Ko(this.element)+"px";this.contextViewProvider.showContextView({getAnchor:()=>this.element,anchorAlignment:1,render:s=>{var o,r;if(!this.message)return null;e=ge(s,p1(".monaco-inputbox-container")),t();const a={inline:!0,className:"monaco-inputbox-message"},l=this.message.formatContent?exe(this.message.content,a):JTe(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 ".concat(c.border):"",ge(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),to(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 ".concat(zp(a,"transparent"))}layout(){if(!this.mirror)return;const e=this.cachedContentHeight;this.cachedContentHeight=Ep(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 zee extends $Ne{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 ⇅ ".concat(s),r=" (⇅ ".concat(s,")");super(e,t,i),this._onDidFocus=this._register(new j),this.onDidFocus=this._onDidFocus.event,this._onDidBlur=this._register(new j),this.onDidBlur=this._onDidBlur.event,this.history=new HNe(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!=null?e:"",Yf(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,Yf(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 zNe=m("defaultLabel","input");class Uee extends vl{constructor(e,t,i){super(),this.fixFocusOnOptionClickEnabled=!0,this.imeSessionInProgress=!1,this.additionalTogglesDisposables=this._register(new Ts),this.additionalToggles=[],this._onDidOptionChange=this._register(new j),this.onDidOptionChange=this._onDidOptionChange.event,this._onKeyDown=this._register(new j),this.onKeyDown=this._onKeyDown.event,this._onMouseDown=this._register(new j),this.onMouseDown=this._onMouseDown.event,this._onInput=this._register(new j),this._onKeyUp=this._register(new j),this._onCaseSensitiveKeyDown=this._register(new j),this.onCaseSensitiveKeyDown=this._onCaseSensitiveKeyDown.event,this._onRegexKeyDown=this._register(new j),this.onRegexKeyDown=this._onRegexKeyDown.event,this._lastHighlightFindOptions=0,this.placeholder=i.placeholder||"",this.validation=i.validation,this.label=i.label||zNe,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 zee(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 $ee(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 Hee(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 Vee(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(),xt.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(ce(this.inputBox.inputElement,"compositionstart",u=>{this.imeSessionInProgress=!0})),this._register(ce(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 be;for(const t of e!=null?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 Pc;(function(n){n[n.Expanded=0]="Expanded",n[n.Collapsed=1]="Collapsed",n[n.PreserveOrExpanded=2]="PreserveOrExpanded",n[n.PreserveOrCollapsed=3]="PreserveOrCollapsed"})(Pc||(Pc={}));var Rp;(function(n){n[n.Unknown=0]="Unknown",n[n.Twistie=1]="Twistie",n[n.Element=2]="Element",n[n.Filter=3]="Filter"})(Rp||(Rp={}));class Wr extends Error{constructor(e,t){super("TreeError [".concat(e,"] ").concat(t))}}class X9{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 Q9(n){return typeof n=="object"&&"visibility"in n&&"data"in n}function ty(n){switch(n){case!0:return 1;case!1:return 0;default:return n}}function nR(n){return typeof n.collapsible=="boolean"}class UNe{constructor(e,t,i,s={}){this.user=e,this.list=t,this.rootRef=[],this.eventBufferer=new C8,this._onDidChangeCollapseState=new j,this.onDidChangeCollapseState=this.eventBufferer.wrapEvent(this._onDidChangeCollapseState.event),this._onDidChangeRenderNodeCount=new j,this.onDidChangeRenderNodeCount=this.eventBufferer.wrapEvent(this._onDidChangeRenderNodeCount.event),this._onDidSplice=new j,this.onDidSplice=this._onDidSplice.event,this.refilterDelayer=new pl(aQ),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=Pt.empty(),s={}){if(e.length===0)throw new Wr(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=Pt.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 Kc({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 C=0;Cb.originalStart-v.originalStart))f(g,p,g-(_.originalStart+_.originalLength)),g=_.originalStart,p=_.modifiedStart-d,this.spliceSimple([...h,g],_.originalLength,Pt.slice(c,p,p+_.modifiedLength),o);f(g,p,g)}spliceSimple(e,t,i=Pt.empty(),{onDidCreateNode:s,onDidDeleteNode:o,diffIdentityProvider:r}){const{parentNode:a,listIndex:l,revealed:c,visible:d}=this.getParentNodeWithListIndex(e),u=[],h=Pt.map(i,S=>this.createTreeNode(S,a,a.visible?1:0,c,u,s)),f=e[e.length-1],g=a.children.length>0;let p=0;for(let S=f;S>=0&&Sr.getId(S.element).toString())):a.lastDiffIds=a.children.map(S=>r.getId(S.element).toString()):a.lastDiffIds=void 0;let w=0;for(const S of C)S.visible&&w++;if(w!==0)for(let S=f+_.length;Sk+(D.visible?D.renderNodeCount:0),0);this._updateAncestorsRenderNodeCount(a,b-S),this.list.splice(l,S,u)}if(C.length>0&&o){const S=k=>{o(k),k.children.forEach(S)};C.forEach(S)}this._onDidSplice.fire({insertedNodes:_,deletedNodes:C});const y=a.children.length>0;g!==y&&this.setCollapsible(e.slice(0,-1),y);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 Wr(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&&!nR(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:(nR(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})),!nR(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||Pt.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):Q9(i)?(e.filterData=i.data,ty(i.visibility)):(e.filterData=void 0,ty(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 Wr(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 Wr(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 Wr(this.user,"Invalid tree location");for(let l=0;lt.element)),this.data=e}}function sR(n){return n instanceof ES?new jNe(n):n}class KNe{constructor(e,t){this.modelProvider=e,this.dnd=t,this.autoExpandDisposable=te.None,this.disposables=new be}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,sR(e),t)}onDragOver(e,t,i,s,o=!0){const r=this.dnd.onDragOver(sR(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=Kf(()=>{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:yo(d,d+u)})}drop(e,t,i,s){this.autoExpandDisposable.dispose(),this.autoExpandNode=void 0,this.dnd.drop(sR(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 qNe(n,e){return e&&Object.assign(Object.assign({},e),{identityProvider:e.identityProvider&&{getId(t){return e.identityProvider.getId(t.element)}},dnd:e.dnd&&new KNe(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 J9{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 iy;(function(n){n.None="none",n.OnHover="onHover",n.Always="always"})(iy||(iy={}));class GNe{get elements(){return this._elements}constructor(e,t=[]){this._elements=t,this.disposables=new be,this.onDidChange=We.forEach(e,i=>this._elements=i,this.disposables)}dispose(){this.disposables.dispose()}}class ny{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=ny.DefaultIndent,this.hideTwistiesOfChildlessElements=!1,this.shouldRenderIndentGuides=!1,this.activeIndentNodes=new Set,this.indentGuidesDisposable=te.None,this.disposables=new be,this.templateId=e.templateId,this.updateOptions(r),We.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=fr(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!==iy.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 be;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=ge(e,ye(".monaco-tl-row")),i=ge(t,ye(".monaco-tl-indent")),s=ge(t,ye(".monaco-tl-twistie")),o=ge(t,ye(".monaco-tl-contents")),r=this.renderer.renderTemplate(o);return{container:e,indent:i,twistie:s,indentGuidesDisposable:te.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=ny.DefaultIndent+(e.depth-1)*this.indent;t.twistie.style.paddingLeft="".concat(i,"px"),t.indent.style.width="".concat(i+this.indent-16,"px"),e.collapsible?t.container.setAttribute("aria-expanded",String(!e.collapsed)):t.container.removeAttribute("aria-expanded"),t.twistie.classList.remove(...dt.asClassNameArray(Me.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(...dt.asClassNameArray(Me.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(Ds(t.indent),t.indentGuidesDisposable.dispose(),!this.shouldRenderIndentGuides)return;const i=new be,s=this.modelProvider();for(;;){const o=s.getNodeLocation(e),r=s.getParentNodeLocation(o);if(!r)break;const a=s.getNode(r),l=ye(".indent-guide",{style:"width: ".concat(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(vt(()=>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(),fi(this.disposables)}}ny.DefaultIndent=8;class YNe{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 be,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:Q9(r)?i=ty(r.visibility):i=r,i===0)return!1}if(this._totalCount++,!this._pattern)return this._matchCount++,{data:lc.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:lc.Default,visibility:i};let l;if(this.tree.findMatchType===pm.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=fm(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===dd.Filter?typeof this.tree.options.defaultFindVisibility=="number"?this.tree.options.defaultFindVisibility:this.tree.options.defaultFindVisibility?this.tree.options.defaultFindVisibility(e):2:{data:lc.Default,visibility:i}}reset(){this._totalCount=0,this._matchCount=0}dispose(){fi(this.disposables)}}var dd;(function(n){n[n.Highlight=0]="Highlight",n[n.Filter=1]="Filter"})(dd||(dd={}));var pm;(function(n){n[n.Fuzzy=0]="Fuzzy",n[n.Contiguous=1]="Contiguous"})(pm||(pm={}));let ZNe=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 j,this.onDidChangeMode=this._onDidChangeMode.event,this._onDidChangeMatchType=new j,this.onDidChangeMatchType=this._onDidChangeMatchType.event,this._onDidChangePattern=new j,this._onDidChangeOpenState=new j,this.onDidChangeOpenState=this._onDidChangeOpenState.event,this.enabledDisposables=new be,this.disposables=new be,this._mode=(a=e.options.defaultFindMode)!==null&&a!==void 0?a:dd.Highlight,this._matchType=(l=e.options.defaultFindMatchType)!==null&&l!==void 0?l:pm.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===dd.Filter||this.filter.totalCount>0&&this.filter.matchCount<=1?!0:!lc.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 qz(n){let e=Rp.Unknown;return rM(n.browserEvent.target,"monaco-tl-twistie","monaco-tl-row")?e=Rp.Twistie:rM(n.browserEvent.target,"monaco-tl-contents","monaco-tl-row")?e=Rp.Element:rM(n.browserEvent.target,"monaco-tree-type-filter","monaco-list")&&(e=Rp.Filter),{browserEvent:n.browserEvent,element:n.element?n.element.element:null,target:e}}function SD(n,e){e(n),n.children.forEach(t=>SD(t,e))}class oR{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 j,this.onDidChange=this._onDidChange.event}set(e,t){!(t!=null&&t.__forceEvent)&&yn(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=>SD(d,c)),this.set([...l.values()]);return}const i=new Set,s=l=>i.add(this.identityProvider.getId(l.element).toString());t.forEach(l=>SD(l,s));const o=new Map,r=l=>o.set(this.identityProvider.getId(l.element).toString(),l);e.forEach(l=>SD(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 XNe extends xee{constructor(e,t){super(e),this.tree=t}onViewPointer(e){if(Dee(e.browserEvent.target)||Df(e.browserEvent.target)||_v(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 QNe extends wl{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 XNe(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(Vf([...super.getFocus(),...s])),o.length>0&&super.setSelection(Vf([...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 jee{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 We.filter(We.map(this.view.onMouseDblClick,qz),e=>e.target!==Rp.Filter)}get onPointer(){return We.map(this.view.onPointer,qz)}get onDidFocus(){return this.view.onDidFocus}get onDidChangeModel(){return We.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:dd.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:pm.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 C8,this.onDidChangeFindOpenState=We.None,this.disposables=new be,this._onWillRefilter=new j,this.onWillRefilter=this._onWillRefilter.event,this._onDidUpdateOptions=new j;const a=new J9(i),l=new BV,c=new BV,d=this.disposables.add(new GNe(c.event)),u=new z8;this.renderers=s.map(_=>new ny(_,()=>this.model,l.event,d,u,o));for(const _ of this.renderers)this.disposables.add(_);let h;o.keyboardNavigationLabelProvider&&(h=new YNe(this,o.keyboardNavigationLabelProvider,o.filter),o=Object.assign(Object.assign({},o),{filter:h}),this.disposables.add(h)),this.focus=new oR(()=>this.view.getFocusedElements()[0],o.identityProvider),this.selection=new oR(()=>this.view.getSelectedElements()[0],o.identityProvider),this.anchor=new oR(()=>this.view.getAnchorElement(),o.identityProvider),this.view=new QNe(e,t,a,this.renderers,this.focus,this.selection,this.anchor,Object.assign(Object.assign({},qNe(()=>this.model,o)),{tree:this})),this.model=this.createModel(e,this.view,o),l.input=this.model.onDidChangeCollapseState;const f=We.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 j),p=this.disposables.add(new pl(0));if(this.disposables.add(We.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 _=We.chain(this.view.onKeyDown,v=>v.filter(b=>!Df(b.target)).map(b=>new Oi(b)));We.chain(_,v=>v.filter(b=>b.keyCode===15))(this.onLeftArrow,this,this.disposables),We.chain(_,v=>v.filter(b=>b.keyCode===17))(this.onRightArrow,this,this.disposables),We.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 ZNe(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=We.None,this.onDidChangeFindMatchType=We.None;this.styleElement=Na(this.view.getHTMLElement()),this.getHTMLElement().classList.toggle("always",this._options.renderIndentGuides===iy.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===iy.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),Hf(t)&&((i=this.findController)===null||i===void 0||i.layout(t))}style(e){const t=".".concat(this.view.domId),i=[];e.treeIndentGuidesStroke&&(i.push(".monaco-list".concat(t,":hover .monaco-tl-indent > .indent-guide, .monaco-list").concat(t,".always .monaco-tl-indent > .indent-guide { border-color: ").concat(e.treeInactiveIndentGuidesStroke,"; }")),i.push(".monaco-list".concat(t," .monaco-tl-indent > .indent-guide.active { border-color: ").concat(e.treeIndentGuidesStroke,"; }"))),this.styleElement.textContent=i.join("\n"),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(){fi(this.disposables),this.view.dispose()}}class e7{constructor(e,t,i={}){this.user=e,this.rootRef=null,this.nodes=new Map,this.nodesByIdentity=new Map,this.model=new UNe(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=Pt.empty(),i={}){const s=this.getElementLocation(e);this._setChildren(s,this.preserveCollapseState(t),i)}_setChildren(e,t=Pt.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=Pt.empty()){return this.sorter&&(e=[...e].sort(this.sorter.compare.bind(this.sorter))),Pt.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===Pc.Collapsed||t.collapsed===Pc.PreserveOrCollapsed?r=!0:t.collapsed===Pc.Expanded||t.collapsed===Pc.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===Pc.PreserveOrCollapsed||t.collapsed===Pc.PreserveOrExpanded?o=i.collapsed:t.collapsed===Pc.Collapsed?o=!0:t.collapsed===Pc.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 Wr(this.user,"Tree element not found: ".concat(e));return t}getNodeLocation(e){return e.element}getParentNodeLocation(e){if(e===null)throw new Wr(this.user,"Invalid getParentNodeLocation call");const t=this.nodes.get(e);if(!t)throw new Wr(this.user,"Tree element not found: ".concat(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 Wr(this.user,"Tree element not found: ".concat(e));return this.model.getNodeLocation(t)}}function LD(n){const e=[n.element],t=n.incompressible||!1;return{element:{elements:e,incompressible:t},children:Pt.map(Pt.from(n.children),LD),collapsible:n.collapsible,collapsed:n.collapsed}}function kD(n){const e=[n.element],t=n.incompressible||!1;let i,s;for(;[s,i]=Pt.consume(Pt.from(n.children),2),!(s.length!==1||s[0].incompressible);)n=s[0],e.push(n.element);return{element:{elements:e,incompressible:t},children:Pt.map(Pt.concat(s,i),kD),collapsible:n.collapsible,collapsed:n.collapsed}}function _4(n,e=0){let t;return e_4(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 Gz(n){return _4(n,0)}function Kee(n,e,t){return n.element===e?Object.assign(Object.assign({},n),{children:t}):Object.assign(Object.assign({},n),{children:Pt.map(Pt.from(n.children),i=>Kee(i,e,t))})}const JNe=n=>({getId(e){return e.elements.map(t=>n.getId(t).toString()).join("\0")}});class eAe{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 e7(e,t,i),this.enabled=typeof i.compressionEnabled>"u"?!0:i.compressionEnabled,this.identityProvider=i.identityProvider}setChildren(e,t=Pt.empty(),i){const s=i.diffIdentityProvider&&JNe(i.diffIdentityProvider);if(e===null){const g=Pt.map(t,this.enabled?kD:LD);this._setChildren(null,g,{diffIdentityProvider:s,diffDepth:1/0});return}const o=this.nodes.get(e);if(!o)throw new Wr(this.user,"Unknown compressed tree node");const r=this.model.getNode(o),a=this.model.getParentNodeLocation(o),l=this.model.getNode(a),c=Gz(r),d=Kee(c,e,t),u=(this.enabled?kD:LD)(d),h=i.diffIdentityProvider?(g,p)=>i.diffIdentityProvider.getId(g)===i.diffIdentityProvider.getId(p):void 0;if(yn(u.element.elements,r.element.elements,h)){this._setChildren(o,u.children||Pt.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=Pt.map(i,Gz),o=Pt.map(s,e?kD:LD);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 Wr(this.user,"Tree element not found: ".concat(e));return t}}const tAe=n=>n[n.length-1];class t7{get element(){return this.node.element===null?null:this.unwrapper(this.node.element)}get children(){return this.node.children.map(e=>new t7(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 iAe(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 nAe(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 sAe{get onDidSplice(){return We.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 We.map(this.model.onDidChangeCollapseState,({node:e,deep:t})=>({node:this.nodeMapper.map(e),deep:t}))}get onDidChangeRenderNodeCount(){return We.map(this.model.onDidChangeRenderNodeCount,e=>this.nodeMapper.map(e))}constructor(e,t,i={}){this.rootRef=null,this.elementMapper=i.elementMapper||tAe;const s=o=>this.elementMapper(o.elements);this.nodeMapper=new X9(o=>new t7(s,o)),this.model=new eAe(e,iAe(this.nodeMapper,t),nAe(s,i))}setChildren(e,t=Pt.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 oAe=globalThis&&globalThis.__decorate||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 i7 extends jee{get onDidChangeCollapseState(){return this.model.onDidChangeCollapseState}constructor(e,t,i,s,o={}){super(e,t,i,s,o),this.user=e}setChildren(e,t=Pt.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 e7(e,t,i)}}class qee{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}}oAe([xn],qee.prototype,"compressedTreeNodeProvider",null);function rAe(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 Gee extends i7{constructor(e,t,i,s,o={}){const r=()=>this,a=s.map(l=>new qee(r,l));super(e,t,i,a,rAe(r,o))}setChildren(e,t=Pt.empty(),i){this.model.setChildren(e,t,i)}createModel(e,t,i){return new sAe(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 bh=globalThis&&globalThis.__awaiter||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 rR(n){return Object.assign(Object.assign({},n),{children:[],refreshPromise:void 0,stale:!0,slow:!1,collapsedByDefault:void 0})}function v4(n,e){return e.parent?e.parent===n?!0:v4(n,e.parent):!1}function aAe(n,e){return n===e||v4(n,e)||v4(e,n)}class n7{get element(){return this.node.element.element}get children(){return this.node.children.map(e=>new n7(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 lAe{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(...dt.asClassNameArray(Me.treeItemLoading)),!0):(t.classList.remove(...dt.asClassNameArray(Me.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 Yz(n){return{browserEvent:n.browserEvent,elements:n.elements.map(e=>e.element)}}function Zz(n){return{browserEvent:n.browserEvent,element:n.element&&n.element.element,target:n.target}}class cAe extends ES{constructor(e){super(e.elements.map(t=>t.element)),this.data=e}}function aR(n){return n instanceof ES?new cAe(n):n}class dAe{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,aR(e),t)}onDragOver(e,t,i,s,o=!0){return this.dnd.onDragOver(aR(e),t&&t.element,i,s)}drop(e,t,i,s){this.dnd.drop(aR(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 Yee(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 dAe(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 b4(n,e){e(n),n.children.forEach(t=>b4(t,e))}class Zee{get onDidScroll(){return this.tree.onDidScroll}get onDidChangeFocus(){return We.map(this.tree.onDidChangeFocus,Yz)}get onDidChangeSelection(){return We.map(this.tree.onDidChangeSelection,Yz)}get onMouseDblClick(){return We.map(this.tree.onMouseDblClick,Zz)}get onPointer(){return We.map(this.tree.onPointer,Zz)}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 j,this._onDidChangeNodeSlowState=new j,this.nodeMapper=new X9(a=>new n7(a)),this.disposables=new be,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=rR({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 J9(i),a=s.map(c=>new lAe(c,this.nodeMapper,this._onDidChangeNodeSlowState.event)),l=Yee(o)||{};return new i7(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 bh(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 bh(this,void 0,void 0,function*(){if(typeof this.root.element>"u")throw new Wr(this.user,"Tree input not set");this.root.refreshPromise&&(yield this.root.refreshPromise,yield We.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 bh(this,void 0,void 0,function*(){if(typeof this.root.element>"u")throw new Wr(this.user,"Tree input not set");this.root.refreshPromise&&(yield this.root.refreshPromise,yield We.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 We.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 We.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 Wr(this.user,"Data tree node not found: ".concat(e));return t}refreshAndRenderNode(e,t,i,s){return bh(this,void 0,void 0,function*(){yield this.refreshNode(e,t,i),this.render(e,i,s)})}refreshNode(e,t,i){return bh(this,void 0,void 0,function*(){let s;if(this.subTreeRefreshPromises.forEach((o,r)=>{!s&&aAe(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 bh(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 KP.settled(o.map(r=>this.doRefreshSubTree(r,t,i)))}finally{s()}})}doRefreshNode(e,t,i){return bh(this,void 0,void 0,function*(){e.hasChildren=!!this.dataSource.hasChildren(e.element);let s;if(!e.hasChildren)s=Promise.resolve(Pt.empty());else{const o=this.doGetChildren(e);if(AV(o))s=Promise.resolve(o);else{const r=jf(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),bc(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 AV(i)?this.processChildren(i):(t=Xn(()=>bh(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(Dt))}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=rR({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(_=>b4(_,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=rR({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())b4(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?Pt.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 s7{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 s7(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 uAe{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(...dt.asClassNameArray(Me.treeItemLoading)),!0):(t.classList.remove(...dt.asClassNameArray(Me.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=fi(this.disposables)}}function hAe(n){const e=n&&Yee(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 fAe extends Zee{constructor(e,t,i,s,o,r,a={}){super(e,t,i,o,r,a),this.compressionDelegate=s,this.compressibleNodeMapper=new X9(l=>new s7(l)),this.filter=a.filter}createTree(e,t,i,s,o){const r=new J9(i),a=s.map(c=>new uAe(c,this.nodeMapper,()=>this.compressibleNodeMapper,this._onDidChangeNodeSlowState.event)),l=hAe(o)||{};return new Gee(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=gAe(i);if(s===2)throw new Error("Recursive tree visibility not supported in async data compressed trees");return s===1})),super.processChildren(e)}}function gAe(n){return typeof n=="boolean"?n?1:0:Q9(n)?ty(n.visibility):ty(n)}class pAe extends jee{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 e7(e,t,i)}}new Ve("isMac",Kt,m("isMac","Whether the operating system is macOS"));new Ve("isLinux",Co,m("isLinux","Whether the operating system is Linux"));const $x=new Ve("isWindows",zs,m("isWindows","Whether the operating system is Windows")),Xee=new Ve("isWeb",yg,m("isWeb","Whether the platform is a web browser"));new Ve("isMacNative",Kt&&!yg,m("isMacNative","Whether the operating system is macOS on a non-browser platform"));new Ve("isIOS",uc,m("isIOS","Whether the operating system is iOS"));new Ve("isMobile",Wme,m("isMobile","Whether the platform is a mobile web browser"));new Ve("isDevelopment",!1,!0);new Ve("productQualityType","",m("productQualityType","Quality type of VS Code"));const Qee="inputFocus";new Ve(Qee,!1,m("inputFocus","Whether keyboard focus is inside an input box"));var lh=globalThis&&globalThis.__decorate||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},Fi=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};const $a=Wt("listService");class mAe{get lastFocusedList(){return this._lastFocusedWidget}constructor(){this.disposables=new be,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 Nee(Na(),"").style(e_)),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),rl(e.onDidFocus(()=>this.setLastFocusedList(e)),vt(()=>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 sy=new Ve("listScrollAtBoundary","none");fe.or(sy.isEqualTo("top"),sy.isEqualTo("both"));fe.or(sy.isEqualTo("bottom"),sy.isEqualTo("both"));const Jee=new Ve("listFocus",!0),zx=new Ve("listSupportsMultiselect",!0),ete=fe.and(Jee,fe.not(Qee)),o7=new Ve("listHasSelectionOrFocus",!1),r7=new Ve("listDoubleSelection",!1),a7=new Ve("listMultiSelection",!1),Ux=new Ve("listSelectionNavigation",!1),_Ae=new Ve("listSupportsFind",!0),l7=new Ve("treeElementCanCollapse",!1),vAe=new Ve("treeElementHasParent",!1),c7=new Ve("treeElementCanExpand",!1),bAe=new Ve("treeElementHasChild",!1),CAe=new Ve("treeFindOpen",!1),tte="listTypeNavigationMode",ite="listAutomaticKeyboardNavigation";function jx(n,e){const t=n.createScoped(e.getHTMLElement());return Jee.bindTo(t),t}function Kx(n,e){const t=sy.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 t_="workbench.list.multiSelectModifier",DD="workbench.list.openMode",Da="workbench.list.horizontalScrolling",d7="workbench.list.defaultFindMode",u7="workbench.list.typeNavigationMode",vI="workbench.list.keyboardNavigation",gc="workbench.list.scrollByPage",h7="workbench.list.defaultFindMatchType",oy="workbench.tree.indent",bI="workbench.tree.renderIndentGuides",pc="workbench.list.smoothScrolling",Td="workbench.list.mouseWheelScrollSensitivity",xd="workbench.list.fastScrollSensitivity",CI="workbench.tree.expandMode";function Nd(n){return n.getValue(t_)==="alt"}class wAe extends te{constructor(e){super(),this.configurationService=e,this.useAltAsMultipleSelectionModifier=Nd(e),this.registerListeners()}registerListeners(){this._register(this.configurationService.onDidChangeConfiguration(e=>{e.affectsConfiguration(t_)&&(this.useAltAsMultipleSelectionModifier=Nd(this.configurationService))}))}isSelectionSingleChangeEvent(e){return this.useAltAsMultipleSelectionModifier?e.browserEvent.altKey:Iee(e)}isSelectionRangeChangeEvent(e){return Tee(e)}}function qx(n,e){var t;const i=n.get(zt),s=n.get(Di),o=new be;return[Object.assign(Object.assign({},e),{keyboardNavigationDelegate:{mightProducePrintableCharacter(a){return s.mightProducePrintableCharacter(a)}},smoothScrolling:!!i.getValue(pc),mouseWheelScrollSensitivity:i.getValue(Td),fastScrollSensitivity:i.getValue(xd),multipleSelectionController:(t=e.multipleSelectionController)!==null&&t!==void 0?t:o.add(new wAe(i)),keyboardNavigationEventFilter:LAe(s),scrollByPage:!!i.getValue(gc)}),o]}let C4=class extends wl{constructor(e,t,i,s,o,r,a,l,c){const d=typeof o.horizontalScrolling<"u"?o.horizontalScrolling:!!l.getValue(Da),[u,h]=c.invokeFunction(qx,o);super(e,t,i,s,Object.assign(Object.assign({keyboardSupport:!1},u),{horizontalScrolling:d})),this.disposables.add(h),this.contextKeyService=jx(r,this),this.disposables.add(Kx(this.contextKeyService,this)),this.listSupportsMultiSelect=zx.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(o.multipleSelectionSupport!==!1),Ux.bindTo(this.contextKeyService).set(!!o.selectionNavigation),this.listHasSelectionOrFocus=o7.bindTo(this.contextKeyService),this.listDoubleSelection=r7.bindTo(this.contextKeyService),this.listMultiSelection=a7.bindTo(this.contextKeyService),this.horizontalScrolling=o.horizontalScrolling,this._useAltAsMultipleSelectionModifier=Nd(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(t_)&&(this._useAltAsMultipleSelectionModifier=Nd(l));let p={};if(g.affectsConfiguration(Da)&&this.horizontalScrolling===void 0){const _=!!l.getValue(Da);p=Object.assign(Object.assign({},p),{horizontalScrolling:_})}if(g.affectsConfiguration(gc)){const _=!!l.getValue(gc);p=Object.assign(Object.assign({},p),{scrollByPage:_})}if(g.affectsConfiguration(pc)){const _=!!l.getValue(pc);p=Object.assign(Object.assign({},p),{smoothScrolling:_})}if(g.affectsConfiguration(Td)){const _=l.getValue(Td);p=Object.assign(Object.assign({},p),{mouseWheelScrollSensitivity:_})}if(g.affectsConfiguration(xd)){const _=l.getValue(xd);p=Object.assign(Object.assign({},p),{fastScrollSensitivity:_})}Object.keys(p).length>0&&this.updateOptions(p)})),this.navigator=new nte(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?N0(e):e_)}};C4=lh([Fi(5,bt),Fi(6,$a),Fi(7,zt),Fi(8,_t)],C4);let Xz=class extends DNe{constructor(e,t,i,s,o,r,a,l,c){const d=typeof o.horizontalScrolling<"u"?o.horizontalScrolling:!!l.getValue(Da),[u,h]=c.invokeFunction(qx,o);super(e,t,i,s,Object.assign(Object.assign({keyboardSupport:!1},u),{horizontalScrolling:d})),this.disposables=new be,this.disposables.add(h),this.contextKeyService=jx(r,this),this.disposables.add(Kx(this.contextKeyService,this.widget)),this.horizontalScrolling=o.horizontalScrolling,this.listSupportsMultiSelect=zx.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(o.multipleSelectionSupport!==!1),Ux.bindTo(this.contextKeyService).set(!!o.selectionNavigation),this._useAltAsMultipleSelectionModifier=Nd(l),this.disposables.add(this.contextKeyService),this.disposables.add(a.register(this)),this.updateStyles(o.overrideStyles),this.disposables.add(l.onDidChangeConfiguration(g=>{g.affectsConfiguration(t_)&&(this._useAltAsMultipleSelectionModifier=Nd(l));let p={};if(g.affectsConfiguration(Da)&&this.horizontalScrolling===void 0){const _=!!l.getValue(Da);p=Object.assign(Object.assign({},p),{horizontalScrolling:_})}if(g.affectsConfiguration(gc)){const _=!!l.getValue(gc);p=Object.assign(Object.assign({},p),{scrollByPage:_})}if(g.affectsConfiguration(pc)){const _=!!l.getValue(pc);p=Object.assign(Object.assign({},p),{smoothScrolling:_})}if(g.affectsConfiguration(Td)){const _=l.getValue(Td);p=Object.assign(Object.assign({},p),{mouseWheelScrollSensitivity:_})}if(g.affectsConfiguration(xd)){const _=l.getValue(xd);p=Object.assign(Object.assign({},p),{fastScrollSensitivity:_})}Object.keys(p).length>0&&this.updateOptions(p)})),this.navigator=new nte(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?N0(e):e_)}dispose(){this.disposables.dispose(),super.dispose()}};Xz=lh([Fi(5,bt),Fi(6,$a),Fi(7,zt),Fi(8,_t)],Xz);let Qz=class extends Hx{constructor(e,t,i,s,o,r,a,l,c,d){const u=typeof r.horizontalScrolling<"u"?r.horizontalScrolling:!!c.getValue(Da),[h,f]=d.invokeFunction(qx,r);super(e,t,i,s,o,Object.assign(Object.assign({keyboardSupport:!1},h),{horizontalScrolling:u})),this.disposables.add(f),this.contextKeyService=jx(a,this),this.disposables.add(Kx(this.contextKeyService,this)),this.listSupportsMultiSelect=zx.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(r.multipleSelectionSupport!==!1),Ux.bindTo(this.contextKeyService).set(!!r.selectionNavigation),this.listHasSelectionOrFocus=o7.bindTo(this.contextKeyService),this.listDoubleSelection=r7.bindTo(this.contextKeyService),this.listMultiSelection=a7.bindTo(this.contextKeyService),this.horizontalScrolling=r.horizontalScrolling,this._useAltAsMultipleSelectionModifier=Nd(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(t_)&&(this._useAltAsMultipleSelectionModifier=Nd(c));let _={};if(p.affectsConfiguration(Da)&&this.horizontalScrolling===void 0){const v=!!c.getValue(Da);_=Object.assign(Object.assign({},_),{horizontalScrolling:v})}if(p.affectsConfiguration(gc)){const v=!!c.getValue(gc);_=Object.assign(Object.assign({},_),{scrollByPage:v})}if(p.affectsConfiguration(pc)){const v=!!c.getValue(pc);_=Object.assign(Object.assign({},_),{smoothScrolling:v})}if(p.affectsConfiguration(Td)){const v=c.getValue(Td);_=Object.assign(Object.assign({},_),{mouseWheelScrollSensitivity:v})}if(p.affectsConfiguration(xd)){const v=c.getValue(xd);_=Object.assign(Object.assign({},_),{fastScrollSensitivity:v})}Object.keys(_).length>0&&this.updateOptions(_)})),this.navigator=new yAe(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?N0(e):e_)}dispose(){this.disposables.dispose(),super.dispose()}};Qz=lh([Fi(6,bt),Fi(7,$a),Fi(8,zt),Fi(9,_t)],Qz);class f7 extends te{constructor(e,t){var i;super(),this.widget=e,this._onDidOpen=this._register(new j),this.onDidOpen=this._onDidOpen.event,this._register(We.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(DD))!=="doubleClick",this._register(t==null?void 0:t.configurationService.onDidChangeConfiguration(s=>{s.affectsConfiguration(DD)&&(this.openOnSingleClick=(t==null?void 0:t.configurationService.getValue(DD))!=="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 nte extends f7{constructor(e,t){super(e,t),this.widget=e}getSelectedElement(){return this.widget.getSelectedElements()[0]}}class yAe extends f7{constructor(e,t){super(e,t)}getSelectedElement(){return this.widget.getSelectedElements()[0]}}class SAe extends f7{constructor(e,t){super(e,t)}getSelectedElement(){var e;return(e=this.widget.getSelection()[0])!==null&&e!==void 0?e:void 0}}function LAe(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 Jz=class extends i7{constructor(e,t,i,s,o,r,a,l,c){const{options:d,getTypeNavigationMode:u,disposable:h}=r.invokeFunction(TS,o);super(e,t,i,s,d),this.disposables.add(h),this.internals=new mm(this,o,u,o.overrideStyles,a,l,c),this.disposables.add(this.internals)}updateOptions(e){super.updateOptions(e),this.internals.updateOptions(e)}};Jz=lh([Fi(5,_t),Fi(6,bt),Fi(7,$a),Fi(8,zt)],Jz);let eU=class extends Gee{constructor(e,t,i,s,o,r,a,l,c){const{options:d,getTypeNavigationMode:u,disposable:h}=r.invokeFunction(TS,o);super(e,t,i,s,d),this.disposables.add(h),this.internals=new mm(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)}};eU=lh([Fi(5,_t),Fi(6,bt),Fi(7,$a),Fi(8,zt)],eU);let tU=class extends pAe{constructor(e,t,i,s,o,r,a,l,c,d){const{options:u,getTypeNavigationMode:h,disposable:f}=a.invokeFunction(TS,r);super(e,t,i,s,o,u),this.disposables.add(f),this.internals=new mm(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)}};tU=lh([Fi(6,_t),Fi(7,bt),Fi(8,$a),Fi(9,zt)],tU);let w4=class extends Zee{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(TS,r);super(e,t,i,s,o,u),this.disposables.add(f),this.internals=new mm(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)}};w4=lh([Fi(6,_t),Fi(7,bt),Fi(8,$a),Fi(9,zt)],w4);let iU=class extends fAe{constructor(e,t,i,s,o,r,a,l,c,d,u){const{options:h,getTypeNavigationMode:f,disposable:g}=l.invokeFunction(TS,a);super(e,t,i,s,o,r,h),this.disposables.add(g),this.internals=new mm(this,a,f,a.overrideStyles,c,d,u),this.disposables.add(this.internals)}updateOptions(e){super.updateOptions(e),this.internals.updateOptions(e)}};iU=lh([Fi(7,_t),Fi(8,bt),Fi(9,$a),Fi(10,zt)],iU);function ste(n){const e=n.getValue(d7);if(e==="highlight")return dd.Highlight;if(e==="filter")return dd.Filter;const t=n.getValue(vI);if(t==="simple"||t==="highlight")return dd.Highlight;if(t==="filter")return dd.Filter}function ote(n){const e=n.getValue(h7);if(e==="fuzzy")return pm.Fuzzy;if(e==="contiguous")return pm.Contiguous}function TS(n,e){var t;const i=n.get(zt),s=n.get(rh),o=n.get(bt),r=n.get(_t),a=()=>{const f=o.getContextKeyValue(tte);if(f==="automatic")return Xc.Automatic;if(f==="trigger"||o.getContextKeyValue(ite)===!1)return Xc.Trigger;const p=i.getValue(u7);if(p==="automatic")return Xc.Automatic;if(p==="trigger")return Xc.Trigger},l=e.horizontalScrolling!==void 0?e.horizontalScrolling:!!i.getValue(Da),[c,d]=r.invokeFunction(qx,e),u=e.paddingBottom,h=e.renderIndentGuides!==void 0?e.renderIndentGuides:i.getValue(bI);return{getTypeNavigationMode:a,disposable:d,options:Object.assign(Object.assign({keyboardSupport:!1},c),{indent:typeof i.getValue(oy)=="number"?i.getValue(oy):void 0,renderIndentGuides:h,smoothScrolling:!!i.getValue(pc),defaultFindMode:ste(i),defaultFindMatchType:ote(i),horizontalScrolling:l,scrollByPage:!!i.getValue(gc),paddingBottom:u,hideTwistiesOfChildlessElements:e.hideTwistiesOfChildlessElements,expandOnlyOnTwistieClick:(t=e.expandOnlyOnTwistieClick)!==null&&t!==void 0?t:i.getValue(CI)==="doubleClick",contextViewProvider:s,findWidgetStyles:oNe})}}let mm=class{get onDidOpen(){return this.navigator.onDidOpen}constructor(e,t,i,s,o,r,a){var l;this.tree=e,this.disposables=[],this.contextKeyService=jx(o,e),this.disposables.push(Kx(this.contextKeyService,e)),this.listSupportsMultiSelect=zx.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(t.multipleSelectionSupport!==!1),Ux.bindTo(this.contextKeyService).set(!!t.selectionNavigation),this.listSupportFindWidget=_Ae.bindTo(this.contextKeyService),this.listSupportFindWidget.set((l=t.findWidgetEnabled)!==null&&l!==void 0?l:!0),this.hasSelectionOrFocus=o7.bindTo(this.contextKeyService),this.hasDoubleSelection=r7.bindTo(this.contextKeyService),this.hasMultiSelection=a7.bindTo(this.contextKeyService),this.treeElementCanCollapse=l7.bindTo(this.contextKeyService),this.treeElementHasParent=vAe.bindTo(this.contextKeyService),this.treeElementCanExpand=c7.bindTo(this.contextKeyService),this.treeElementHasChild=bAe.bindTo(this.contextKeyService),this.treeFindOpen=CAe.bindTo(this.contextKeyService),this._useAltAsMultipleSelectionModifier=Nd(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(tte),u.add(ite),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(t_)&&(this._useAltAsMultipleSelectionModifier=Nd(a)),h.affectsConfiguration(oy)){const g=a.getValue(oy);f=Object.assign(Object.assign({},f),{indent:g})}if(h.affectsConfiguration(bI)&&t.renderIndentGuides===void 0){const g=a.getValue(bI);f=Object.assign(Object.assign({},f),{renderIndentGuides:g})}if(h.affectsConfiguration(pc)){const g=!!a.getValue(pc);f=Object.assign(Object.assign({},f),{smoothScrolling:g})}if(h.affectsConfiguration(d7)||h.affectsConfiguration(vI)){const g=ste(a);f=Object.assign(Object.assign({},f),{defaultFindMode:g})}if(h.affectsConfiguration(u7)||h.affectsConfiguration(vI)){const g=i();f=Object.assign(Object.assign({},f),{typeNavigationMode:g})}if(h.affectsConfiguration(h7)){const g=ote(a);f=Object.assign(Object.assign({},f),{defaultFindMatchType:g})}if(h.affectsConfiguration(Da)&&t.horizontalScrolling===void 0){const g=!!a.getValue(Da);f=Object.assign(Object.assign({},f),{horizontalScrolling:g})}if(h.affectsConfiguration(gc)){const g=!!a.getValue(gc);f=Object.assign(Object.assign({},f),{scrollByPage:g})}if(h.affectsConfiguration(CI)&&t.expandOnlyOnTwistieClick===void 0&&(f=Object.assign(Object.assign({},f),{expandOnlyOnTwistieClick:a.getValue(CI)==="doubleClick"})),h.affectsConfiguration(Td)){const g=a.getValue(Td);f=Object.assign(Object.assign({},f),{mouseWheelScrollSensitivity:g})}if(h.affectsConfiguration(xd)){const g=a.getValue(xd);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 SAe(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?N0(e):e_)}dispose(){this.disposables=fi(this.disposables)}};mm=lh([Fi(4,bt),Fi(5,$a),Fi(6,zt)],mm);const kAe=en.as(wc.Configuration);kAe.registerConfiguration({id:"workbench",order:7,title:m("workbenchConfigurationTitle","Workbench"),type:"object",properties:{[t_]:{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.")},[DD]:{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.")},[Da]:{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.")},[gc]:{type:"boolean",default:!1,description:m("list.scrollByPage","Controls whether clicks in the scrollbar scroll page by page.")},[oy]:{type:"number",default:8,minimum:4,maximum:40,description:m("tree indent setting","Controls tree indentation in pixels.")},[bI]:{type:"string",enum:["none","onHover","always"],default:"onHover",description:m("render tree indent guides","Controls whether the tree should render indent guides.")},[pc]:{type:"boolean",default:!1,description:m("list smoothScrolling setting","Controls whether lists and trees have smooth scrolling.")},[Td]:{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.")},[xd]:{type:"number",default:5,markdownDescription:m("Fast Scroll Sensitivity","Scrolling speed multiplier when pressing `Alt`.")},[d7]:{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.")},[vI]:{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.")},[h7]:{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.")},[CI]:{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.")},[u7]:{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 y4;(function(n){n[n.PRESERVE=0]="PRESERVE",n[n.LAST=1]="LAST"})(y4||(y4={}));const i_={Quickaccess:"workbench.contributions.quickaccess"};class DAe{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),vt(()=>{this.providers.splice(this.providers.indexOf(e),1),this.defaultProvider===e&&(this.defaultProvider=void 0)})}getQuickAccessProviders(){return wd([this.defaultProvider,...this.providers])}getQuickAccessProvider(e){return e&&this.providers.find(i=>e.startsWith(i.prefix))||void 0||this.defaultProvider}}en.add(i_.Quickaccess,new DAe);const EAe={ctrlCmd:!1,alt:!1};var ry;(function(n){n[n.Blur=1]="Blur",n[n.Gesture=2]="Gesture",n[n.Other=3]="Other"})(ry||(ry={}));var Bl;(function(n){n[n.NONE=0]="NONE",n[n.FIRST=1]="FIRST",n[n.SECOND=2]="SECOND",n[n.LAST=3]="LAST"})(Bl||(Bl={}));const yc=Wt("quickInputService");var IAe=globalThis&&globalThis.__decorate||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},nU=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let S4=class extends te{constructor(e,t){super(),this.quickInputService=e,this.instantiationService=t,this.registry=en.as(i_.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="".concat(r.prefix).concat(g))}if(!f){const g=o==null?void 0:o.defaultFilterValue;g===y4.LAST?f=this.lastAcceptedPickerValues.get(r):typeof g=="string"&&(f="".concat(r.prefix).concat(g))}typeof f=="string"&&(e=f)}const c=new be,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:Bl.SECOND),d.contextKey=r==null?void 0:r.contextKey,d.filterValue=f=>f.substring(r?r.prefix.length:0);let u;t&&(u=new rx,c.add(We.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 Tn);if(o&&c.add(o.provide(d,h.token,i==null?void 0:i.providerOptions)),We.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 be,a=this.visibleQuickAccess={picker:e,descriptor:i,value:s};return r.add(vt(()=>{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]}};S4=IAe([nU(0,yc),nU(1,_t)],S4);ee.white.toString(),ee.white.toString();class L4 extends te{get onDidClick(){return this._onDidClick.event}constructor(e,t){super(),this._label="",this._onDidClick=this._register(new j),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(Ii.addTarget(this._element)),[Pe.CLICK,Ti.Tap].forEach(o=>{this._register(ce(this._element,o,r=>{if(!this.enabled){xt.stop(r);return}this._onDidClick.fire(r)}))}),this._register(ce(this._element,Pe.KEY_DOWN,o=>{const r=new Oi(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&&xt.stop(r,!0)})),this._register(ce(this._element,Pe.MOUSE_OVER,o=>{this._element.classList.contains("disabled")||this.updateBackground(!0)})),this._register(ce(this._element,Pe.MOUSE_OUT,o=>{this.updateBackground(!1)})),this.focusTracker=this._register(Ld(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 kf(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||Lf(this._label)&&Lf(e)&>e(this._label,e))return;this._element.classList.add("monaco-text-button");const i=this.options.supportShortLabel?this._labelElement:this._element;if(Lf(e)){const s=Fx(e,{inline:!0});s.dispose();const o=(t=s.element.querySelector("p"))===null||t===void 0?void 0:t.innerHTML;if(o){const r=UX(o,{ADD_TAGS:["b","i","u","code","span"],ALLOWED_ATTR:["class"],RETURN_TRUSTED_TYPE:!0});i.innerHTML=r}else Es(i)}else this.options.supportIcons?Es(i,...this.getContentElements(e)):i.textContent=e;typeof this.options.title=="string"?this._element.title=this.options.title:this.options.title&&(this._element.title=cxe(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 k4{constructor(e,t,i){this.options=t,this.styles=i,this.count=0,this.element=ge(e,ye(".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=sm(this.countFormat,this.count),this.element.title=sm(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 ".concat(this.styles.badgeBorder))}}const sU="done",oU="active",lR="infinite",cR="infinite-long-running",rU="discrete";class Gx extends te{constructor(e,t){super(),this.workedVal=0,this.showDelayedScheduler=this._register(new Si(()=>mr(this.element),0)),this.longRunningScheduler=this._register(new Si(()=>this.infiniteLongRunning(),Gx.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(oU,lR,cR,rU),this.workedVal=0,this.totalWork=void 0,this.longRunningScheduler.cancel()}stop(){return this.doDone(!1)}doDone(e){return this.element.classList.add(sU),this.element.classList.contains(lR)?(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(rU,sU,cR),this.element.classList.add(oU,lR),this.longRunningScheduler.schedule(),this}infiniteLongRunning(){this.element.classList.add(cR)}getContainer(){return this.element}}Gx.LONG_RUNNING_INFINITE_THRESHOLD=1e4;const TAe=ye;class xAe extends te{constructor(e,t,i){super(),this.parent=e,this.onKeyDown=o=>ce(this.findInput.inputBox.inputElement,Pe.KEY_DOWN,r=>{o(new Oi(r))}),this.onMouseDown=o=>ce(this.findInput.inputBox.inputElement,Pe.MOUSE_DOWN,r=>{o(new ba(r))}),this.onDidChange=o=>this.findInput.onDidChange(o),this.container=ge(this.parent,TAe(".quick-input-box")),this.findInput=this._register(new Uee(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===bn.Ignore?this.findInput.clearMessage():this.findInput.showMessage({type:e===bn.Info?1:e===bn.Warning?2:3,content:""})}stylesForType(e){return this.findInput.inputBox.stylesForType(e===bn.Info?1:e===bn.Warning?2:3)}setFocus(){this.findInput.focus()}layout(){this.findInput.inputBox.layout()}}class Ef{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=ge(e,ye("span.monaco-highlighted-label"))}get element(){return this.domNode}set(e,t=[],i="",s){e||(e=""),s&&(e=Ef.escapeNewLines(e,t)),!(this.didEverRender&&this.text===e&&this.title===i&&Gr(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\n"?-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 dR{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 wI extends te{constructor(e,t){super(),this.customHovers=new Map,this.creationOptions=t,this.domNode=this._register(new dR(ge(e,ye(".monaco-icon-label")))),this.labelContainer=ge(this.domNode.element,ye(".monaco-icon-label-container"));const i=ge(this.labelContainer,ye("span.monaco-icon-name-container"));t!=null&&t.supportHighlights||t!=null&&t.supportIcons?this.nameNode=new MAe(i,!!t.supportIcons):this.nameNode=new NAe(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 Ef?(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)?Ef.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)XTe(e,t);else{const s=Lee(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 dR(ge(this.labelContainer,ye("span.monaco-icon-description-container"))));!((e=this.creationOptions)===null||e===void 0)&&e.supportDescriptionHighlights?this.descriptionNode=new Ef(ge(t.element,ye("span.label-description")),{supportIcons:!!this.creationOptions.supportIcons}):this.descriptionNode=this._register(new dR(ge(t.element,ye("span.label-description"))))}return this.descriptionNode}}class NAe{constructor(e){this.container=e,this.label=void 0,this.singleLabel=void 0}setLabel(e,t){if(!(this.label===e&&Gr(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=ge(this.container,ye("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=>js.intersect(o,a)).filter(a=>!js.isEmpty(a)).map(({start:a,end:l})=>({start:a-i,end:l-i}));return i=o.end+e.length,r})}class MAe{constructor(e,t){this.container=e,this.supportIcons=t,this.label=void 0,this.singleLabel=void 0}setLabel(e,t){if(!(this.label===e&&Gr(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 Ef(ge(this.container,ye("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=AAe(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 PAe(n,e,t=!1){const i=n||"",s=e||"",o=aU.value.collator.compare(i,s);return aU.value.collatorIsNumeric&&o===0&&i!==s?is.length)return 1}return 0}var BAe=globalThis&&globalThis.__decorate||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 rte{constructor(e){this.nodes=e}toString(){return this.nodes.map(e=>typeof e=="string"?e:e.label).join("")}}BAe([xn],rte.prototype,"toString",null);const WAe=/\[([^\]]+)\]\(((?:https?:\/\/|command:|file:)[^\)\s]+)(?: (["'])(.+?)(\3))?\)/gi;function VAe(n){const e=[];let t=0,i;for(;i=WAe.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{t0e(f)&&xt.stop(f,!0),t.callback(o.href)},c=t.disposables.add(new Vt(a,Pe.CLICK)).event,d=t.disposables.add(new Vt(a,Pe.KEY_DOWN)).event,u=We.chain(d,f=>f.filter(g=>{const p=new Oi(g);return p.equals(10)||p.equals(3)}));t.disposables.add(Ii.addTarget(a));const h=t.disposables.add(new Vt(a,Ti.Tap)).event;We.any(c,h,u)(l,null,t.disposables),e.appendChild(a)}}var ate=globalThis&&globalThis.__decorate||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},lU=globalThis&&globalThis.__awaiter||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 Al=ye;class zAe{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?We.map(We.filter(this._onChecked.event,u=>u.listElement===this),u=>u.checked):We.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 kg(()=>{var u;const h=(u=e.label)!==null&&u!==void 0?u:"",f=Z1(h).text.trim(),g=e.ariaLabel||[h,this.saneDescription,this.saneDetail].map(p=>qTe(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 NS{constructor(e){this.themeService=e}get templateId(){return NS.ID}renderTemplate(e){const t=Object.create(null);t.toDisposeElement=[],t.toDisposeTemplate=[],t.entry=ge(e,Al(".quick-input-list-entry"));const i=ge(t.entry,Al("label.quick-input-list-label"));t.toDisposeTemplate.push(In(i,Pe.CLICK,c=>{t.checkbox.offsetParent||c.preventDefault()})),t.checkbox=ge(i,Al("input.quick-input-list-checkbox")),t.checkbox.type="checkbox",t.toDisposeTemplate.push(In(t.checkbox,Pe.CHANGE,c=>{t.element.checked=t.checkbox.checked}));const s=ge(i,Al(".quick-input-list-rows")),o=ge(s,Al(".quick-input-list-row")),r=ge(s,Al(".quick-input-list-row"));t.label=new wI(o,{supportHighlights:!0,supportDescriptionHighlights:!0,supportIcons:!0}),t.toDisposeTemplate.push(t.label),t.icon=JX(t.label.element,Al(".quick-input-list-icon"));const a=ge(o,Al(".quick-input-list-entry-keybinding"));t.keybinding=new xS(a,$r);const l=ge(r,Al(".quick-input-list-label-meta"));return t.detail=new wI(l,{supportHighlights:!0,supportIcons:!0}),t.toDisposeTemplate.push(t.detail),t.separator=ge(t.entry,Al(".quick-input-list-separator")),t.actionBar=new Pa(t.entry),t.actionBar.domNode.classList.add("quick-input-list-entry-action-bar"),t.toDisposeTemplate.push(t.actionBar),t}renderElement(e,t,i){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=Nb(this.themeService.getColorTheme().type)?e.item.iconPath.dark:(r=e.item.iconPath.light)!==null&&r!==void 0?r:e.item.iconPath.dark,p=ct.revive(g);i.icon.className="quick-input-list-icon",i.icon.style.backgroundImage=Uf(p)}else i.icon.style.backgroundImage="",i.icon.className=!((a=e.item)===null||a===void 0)&&a.iconClass?"quick-input-list-icon ".concat(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?D4(g.iconPath):void 0);return g.alwaysVisible&&(_=_?"".concat(_," always-visible"):"always-visible"),{id:"id-".concat(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=fi(i.toDisposeElement),i.actionBar.clear()}disposeTemplate(e){e.toDisposeElement=fi(e.toDisposeElement),e.toDisposeTemplate=fi(e.toDisposeTemplate)}}NS.ID="listelement";class UAe{getHeight(e){return e.item?e.saneDetail?44:22:24}getTemplateId(e){return NS.ID}}var cs;(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"})(cs||(cs={}));class g7{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 j,this.onChangedAllVisibleChecked=this._onChangedAllVisibleChecked.event,this._onChangedCheckedCount=new j,this.onChangedCheckedCount=this._onChangedCheckedCount.event,this._onChangedVisibleCount=new j,this.onChangedVisibleCount=this._onChangedVisibleCount.event,this._onChangedCheckedElements=new j,this.onChangedCheckedElements=this._onChangedCheckedElements.event,this._onButtonTriggered=new j,this.onButtonTriggered=this._onButtonTriggered.event,this._onSeparatorButtonTriggered=new j,this.onSeparatorButtonTriggered=this._onSeparatorButtonTriggered.event,this._onKeyDown=new j,this.onKeyDown=this._onKeyDown.event,this._onLeave=new j,this.onLeave=this._onLeave.event,this._listElementChecked=new j,this._fireCheckedEvents=!0,this.elementDisposables=[],this.disposables=[],this.id=t,this.container=ge(this.parent,Al(".quick-input-list"));const o=new UAe,r=new qAe;if(this.list=i.createList("QuickInput",this.container,o,[new NS(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 Oi(a);switch(l.keyCode){case 10:this.toggleCheckbox();break;case 31:(Kt?a.metaKey:a.ctrlKey)&&this.list.setFocus(yo(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(ce(this.container,Pe.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 lQ(i.hoverDelegate.delay);this.disposables.push(this.list.onMouseOver(l=>lU(this,void 0,void 0,function*(){var c;if(l.browserEvent.target instanceof HTMLAnchorElement){a.cancel();return}if(!(!(l.browserEvent.relatedTarget instanceof HTMLAnchorElement)&&Ws(l.browserEvent.relatedTarget,(c=l.element)===null||c===void 0?void 0:c.element)))try{yield a.trigger(()=>lU(this,void 0,void 0,function*(){l.element&&this.showHover(l.element)}))}catch(d){if(!bc(d))throw d}}))),this.disposables.push(this.list.onMouseOut(l=>{var c;Ws(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 We.map(this.list.onDidChangeFocus,e=>e.elements.map(t=>t.item))}get onDidChangeSelection(){return We.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=fi(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 zAe(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===cs.Second&&this.list.length<2&&(e=cs.First),e){case cs.First:this.list.scrollTop=0,this.list.focusFirst(void 0,i=>!!i.item);break;case cs.Second:this.list.scrollTop=0,this.list.focusNth(1,void 0,i=>!!i.item);break;case cs.Last:this.list.scrollTop=this.list.scrollHeight,this.list.focusLast(void 0,i=>!!i.item);break;case cs.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 cs.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 cs.NextPage:this.list.focusNextPage(void 0,i=>!!i.item);break;case cs.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?"".concat(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=ZM(e,Z1(o.saneLabel)))!==null&&r!==void 0?r:void 0:d=this.matchOnLabel&&(a=jAe(t,Z1(o.saneLabel)))!==null&&a!==void 0?a:void 0;const u=this.matchOnDescription&&(l=ZM(e,Z1(o.saneDescription||"")))!==null&&l!==void 0?l:void 0,h=this.matchOnDetail&&(c=ZM(e,Z1(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)=>KAe(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=fi(this.elementDisposables),this.disposables=fi(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 be;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)}}ate([xn],g7.prototype,"onDidChangeFocus",null);ate([xn],g7.prototype,"onDidChangeSelection",null);function jAe(n,e){const{text:t,iconOffsets:i}=e;if(!i||i.length===0)return cU(n,t);const s=aS(t," "),o=t.length-s.length,r=cU(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 cU(n,e){const t=e.toLowerCase().indexOf(n.toLowerCase());return t!==-1?[{start:t,end:t+n.length}]:null}function KAe(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:OAe(n.saneSortLabel,e.saneSortLabel,t)}class qAe{getWidgetAriaLabel(){return m("quickInput","Quick Input")}getAriaLabel(e){var t;return!((t=e.separator)===null||t===void 0)&&t.label?"".concat(e.saneAriaLabel,", ").concat(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 dU=globalThis&&globalThis.__awaiter||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 E4={iconClass:dt.asClassName(Me.quickInputBack),tooltip:m("quickInput.back","Back"),handle:-1};class AS extends te{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=AS.noPromptMessage,this._severity=bn.Ignore,this.onDidTriggerButtonEmitter=this._register(new j),this.onDidHideEmitter=this._register(new j),this.onDisposeEmitter=this._register(new j),this.visibleDisposables=this._register(new be),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&&!uc;this._ignoreFocusOut=e&&!uc,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!=null?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=ry.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?Es(this.ui.widget,this._widget):Es(this.ui.widget)),this.busy&&!this.busyDelay&&(this.busyDelay=new _l,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===E4);this.ui.leftActionBar.push(r.map((l,c)=>{const d=new Ro("id-".concat(c),"",l.iconClass||D4(l.iconPath),!0,()=>dU(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!==E4);this.ui.rightActionBar.push(a.map((l,c)=>{const d=new Ro("id-".concat(c),"",l.iconClass||D4(l.iconPath),!0,()=>dU(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 M0))!==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,Es(this.ui.message),$Ae(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?"".concat(this.title," (").concat(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!==bn.Ignore){const t=this.ui.inputBox.stylesForType(e);this.ui.message.style.color=t.foreground?"".concat(t.foreground):"",this.ui.message.style.backgroundColor=t.background?"".concat(t.background):"",this.ui.message.style.border=t.border?"1px solid ".concat(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()}}AS.noPromptMessage=m("inputModeEntry","Press 'Enter' to confirm your input or 'Escape' to cancel");class ay extends AS{constructor(){super(...arguments),this._value="",this.onDidChangeValueEmitter=this._register(new j),this.onWillAcceptEmitter=this._register(new j),this.onDidAcceptEmitter=this._register(new j),this.onDidCustomEmitter=this._register(new j),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=Bl.FIRST,this._activeItems=[],this.activeItemsUpdated=!1,this.activeItemsToConfirm=[],this.onDidChangeActiveEmitter=this._register(new j),this._selectedItems=[],this.selectedItemsUpdated=!1,this.selectedItemsToConfirm=[],this.onDidChangeSelectionEmitter=this._register(new j),this.onDidTriggerItemButtonEmitter=this._register(new j),this.onDidTriggerSeparatorButtonEmitter=this._register(new j),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?EAe: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(cs.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(cs.Next),this.canSelectMany&&this.ui.list.domFocus(),xt.stop(e,!0);break;case 16:this.ui.list.getFocusedElements().length?this.ui.list.focus(cs.Previous):this.ui.list.focus(cs.Last),this.canSelectMany&&this.ui.list.domFocus(),xt.stop(e,!0);break;case 12:this.ui.list.focus(cs.NextPage),this.canSelectMany&&this.ui.list.domFocus(),xt.stop(e,!0);break;case 11:this.ui.list.focus(cs.PreviousPage),this.canSelectMany&&this.ui.list.domFocus(),xt.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(cs.First),xt.stop(e,!0));break;case 13:(e.ctrlKey||e.metaKey)&&!e.shiftKey&&!e.altKey&&(this.ui.list.focus(cs.Last),xt.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&&yn(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&&yn(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&&yn(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 ce(this.ui.container,Pe.KEY_UP,e=>{if(this.canSelectMany||!this._quickNavigate)return;const t=new Oi(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||ay.DEFAULT_ARIA_LABEL,this.title&&(s+=" - ".concat(this.title))),this.ui.list.ariaLabel!==s&&(this.ui.list.ariaLabel=s!=null?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 Bl.NONE:this._itemActivation=Bl.FIRST;break;case Bl.SECOND:this.ui.list.focus(cs.Second),this._itemActivation=Bl.FIRST;break;case Bl.LAST:this.ui.list.focus(cs.Last),this._itemActivation=Bl.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(cs.First)),this.keepScrollPosition&&(this.scrollTop=e)}}ay.DEFAULT_ARIA_LABEL=m("quickInputBox.ariaLabel","Type to narrow down results.");class GAe extends AS{constructor(){super(...arguments),this._value="",this.valueSelectionUpdated=!0,this._password=!1,this.onDidValueChangeEmitter=this._register(new j),this.onDidAcceptEmitter=this._register(new j),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 ar=ye;class Yx extends te{constructor(e,t){super(),this.options=e,this.themeService=t,this.enabled=!0,this.onDidAcceptEmitter=this._register(new j),this.onDidCustomEmitter=this._register(new j),this.onDidTriggerButtonEmitter=this._register(new j),this.keyMods={ctrlCmd:!1,alt:!1},this.controller=null,this.onShowEmitter=this._register(new j),this.onShow=this.onShowEmitter.event,this.onHideEmitter=this._register(new j),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(ce(window,Pe.KEY_DOWN,e,!0)),this._register(ce(window,Pe.KEY_UP,e,!0)),this._register(ce(window,Pe.MOUSE_DOWN,e,!0))}getUI(){if(this.ui)return this.ui;const e=ge(this.parentElement,ar(".quick-input-widget.show-file-icons"));e.tabIndex=-1,e.style.display="none";const t=Na(e),i=ge(e,ar(".quick-input-titlebar")),s=this.options.hoverDelegate?{hoverDelegate:this.options.hoverDelegate}:void 0,o=this._register(new Pa(i,s));o.domNode.classList.add("quick-input-left-action-bar");const r=ge(i,ar(".quick-input-title")),a=this._register(new Pa(i,s));a.domNode.classList.add("quick-input-right-action-bar");const l=ge(e,ar(".quick-input-header")),c=ge(l,ar("input.quick-input-check-all"));c.type="checkbox",c.setAttribute("aria-label",m("quickInput.checkAll","Toggle all checkboxes")),this._register(In(c,Pe.CHANGE,P=>{const W=c.checked;A.setAllVisibleChecked(W)})),this._register(ce(c,Pe.CLICK,P=>{(P.x||P.y)&&f.setFocus()}));const d=ge(l,ar(".quick-input-description")),u=ge(l,ar(".quick-input-and-message")),h=ge(u,ar(".quick-input-filter")),f=this._register(new xAe(h,this.styles.inputBox,this.styles.toggle));f.setAttribute("aria-describedby","".concat(this.idPrefix,"message"));const g=ge(h,ar(".quick-input-visible-count"));g.setAttribute("aria-live","polite"),g.setAttribute("aria-atomic","true");const p=new k4(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),_=ge(h,ar(".quick-input-count"));_.setAttribute("aria-live","polite");const v=new k4(_,{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=ge(l,ar(".quick-input-action")),C=this._register(new L4(b,this.styles.button));C.label=m("ok","OK"),this._register(C.onDidClick(P=>{this.onDidAcceptEmitter.fire()}));const w=ge(l,ar(".quick-input-action")),y=this._register(new L4(w,this.styles.button));y.label=m("custom","Custom"),this._register(y.onDidClick(P=>{this.onDidCustomEmitter.fire()}));const L=ge(u,ar("#".concat(this.idPrefix,"message.quick-input-message"))),S=this._register(new Gx(e,this.styles.progressBar));S.getContainer().classList.add("quick-input-progress");const k=ge(e,ar(".quick-input-html-widget"));k.tabIndex=-1;const D=ge(e,ar(".quick-input-description")),x=this.idPrefix+"list",A=this._register(new g7(e,x,this.options,this.themeService));f.setAttribute("aria-controls",x),this._register(A.onDidChangeFocus(()=>{var P;f.setAttribute("aria-activedescendant",(P=A.getActiveDescendant())!==null&&P!==void 0?P:"")})),this._register(A.onChangedAllVisibleChecked(P=>{c.checked=P})),this._register(A.onChangedVisibleCount(P=>{p.setCount(P)})),this._register(A.onChangedCheckedCount(P=>{v.setCount(P)})),this._register(A.onLeave(()=>{setTimeout(()=>{f.setFocus(),this.controller instanceof ay&&this.controller.canSelectMany&&A.clearFocus()},0)}));const T=Ld(e);return this._register(T),this._register(ce(e,Pe.FOCUS,P=>{Ws(P.relatedTarget,e)||(this.previousFocusElement=P.relatedTarget instanceof HTMLElement?P.relatedTarget:void 0)},!0)),this._register(T.onDidBlur(()=>{!this.getUI().ignoreFocusOut&&!this.options.ignoreFocusOut()&&this.hide(ry.Blur),this.previousFocusElement=void 0})),this._register(ce(e,Pe.FOCUS,P=>{f.setFocus()})),this._register(In(e,Pe.KEY_DOWN,P=>{if(!Ws(P.target,k))switch(P.keyCode){case 3:xt.stop(P,!0),this.enabled&&this.onDidAcceptEmitter.fire();break;case 9:xt.stop(P,!0),this.hide(ry.Gesture);break;case 2:if(!P.altKey&&!P.ctrlKey&&!P.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(Ws(P.target,this.getUI().widget))break;W.push(".quick-input-html-widget")}const $=e.querySelectorAll(W.join(", "));P.shiftKey&&P.target===$[0]?(xt.stop(P,!0),A.clearFocus()):!P.shiftKey&&Ws(P.target,$[$.length-1])&&(xt.stop(P,!0),$[0].focus())}break;case 10:P.ctrlKey&&(xt.stop(P,!0),this.getUI().list.toggleHover());break}})),this.ui={container:e,styleSheet:t,leftActionBar:o,titleBar:i,title:r,description1:D,description2:d,widget:k,rightActionBar:a,checkAll:c,inputContainer:u,filterContainer:h,inputBox:f,visibleCountContainer:g,visibleCount:p,countContainer:_,count:v,okContainer:b,ok:C,message:L,customButtonContainer:w,customButton:y,list:A,progressBar:S,onDidAccept:this.onDidAcceptEmitter.event,onDidCustom:this.onDidCustomEmitter.event,onDidTriggerButton:this.onDidTriggerButtonEmitter.event,ignoreFocusOut:!1,keyMods:this.keyMods,show:P=>this.show(P),hide:()=>this.hide(),setVisibilities:P=>this.setVisibilities(P),setEnabled:P=>this.setEnabled(P),setContextKey:P=>this.options.setContextKey(P),linkOpenerDelegate:P=>this.options.linkOpenerDelegate(P)},this.updateStyles(),this.ui}pick(e,t={},i=Ft.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(()=>{fi(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 ay(e)}createInputBox(){const e=this.getUI();return new GAe(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="",Es(t.widget),t.rightActionBar.clear(),t.checkAll.checked=!1,t.inputBox.placeholder="",t.inputBox.password=!1,t.inputBox.showDecoration(bn.Ignore),t.visibleCount.setCount(0),t.count.setCount(0),Es(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();E4.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=!Ws(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="".concat(this.titleBarOffset,"px");const e=this.ui.container.style,t=Math.min(this.dimension.width*.62,Yx.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!=null?e:"",this.ui.container.style.backgroundColor=t!=null?t:"",this.ui.container.style.color=i!=null?i:"",this.ui.container.style.border=s?"1px solid ".concat(s):"",this.ui.container.style.boxShadow=o?"0 0 8px 2px ".concat(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: ".concat(this.styles.pickerGroup.pickerGroupBorder,"; }")),this.styles.pickerGroup.pickerGroupForeground&&r.push(".quick-input-list .quick-input-list-separator { color: ".concat(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: ".concat(this.styles.keybindingLabel.keybindingLabelBackground,";")),this.styles.keybindingLabel.keybindingLabelBorder&&r.push("border-color: ".concat(this.styles.keybindingLabel.keybindingLabelBorder,";")),this.styles.keybindingLabel.keybindingLabelBottomBorder&&r.push("border-bottom-color: ".concat(this.styles.keybindingLabel.keybindingLabelBottomBorder,";")),this.styles.keybindingLabel.keybindingLabelShadow&&r.push("box-shadow: inset 0 -1px 0 ".concat(this.styles.keybindingLabel.keybindingLabelShadow,";")),this.styles.keybindingLabel.keybindingLabelForeground&&r.push("color: ".concat(this.styles.keybindingLabel.keybindingLabelForeground,";")),r.push("}"));const a=r.join("\n");a!==this.ui.styleSheet.textContent&&(this.ui.styleSheet.textContent=a)}}isDisplayed(){return this.ui&&this.ui.container.style.display!=="none"}}Yx.MAX_WIDTH=600;var YAe=globalThis&&globalThis.__decorate||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=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let I4=class extends ISe{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(S4))),this._quickAccess}constructor(e,t,i,s){super(i),this.instantiationService=e,this.contextKeyService=t,this.layoutService=s,this._onShow=this._register(new j),this._onHide=this._register(new j),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(Ir).open(o,{allowCommands:!0,fromUserGesture:!0})})},returnFocus:()=>e.focus(),createList:(o,r,a,l,c)=>this.instantiationService.createInstance(C4,o,r,a,l,c),styles:this.computeStyles()},s=this._register(new Yx(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 Ve(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=Ft.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:He(e$),quickInputForeground:He(Rwe),quickInputTitleBackground:He(Pwe),widgetBorder:He(J8),widgetShadow:He(nd)},inputBox:cI,toggle:lI,countBadge:Mee,button:nNe,progressBar:sNe,keybindingLabel:iNe,list:N0({listBackground:e$,listFocusBackground:xp,listFocusForeground:Tp,listInactiveFocusForeground:Tp,listInactiveSelectionIconForeground:av,listInactiveFocusBackground:xp,listFocusOutline:$i,listInactiveFocusOutline:$i}),pickerGroup:{pickerGroupBorder:He(Owe),pickerGroupForeground:He(zQ)}}}};I4=YAe([ek(0,_t),ek(1,bt),ek(2,os),ek(3,x0)],I4);var lte=globalThis&&globalThis.__decorate||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},Cv=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let T4=class extends I4{constructor(e,t,i,s,o){super(t,i,s,new PO(e.getContainerDomNode(),o)),this.host=void 0;const r=$b.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)}};T4=lte([Cv(1,_t),Cv(2,bt),Cv(3,os),Cv(4,ai)],T4);let x4=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(T4,e);this.mapEditorToService.set(e,t),$f(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=Ft.None){return this.activeService.pick(e,t,i)}createQuickPick(){return this.activeService.createQuickPick()}createInputBox(){return this.activeService.createInputBox()}};x4=lte([Cv(0,_t),Cv(1,ai)],x4);class $b{static get(e){return e.getContribution($b.ID)}constructor(e){this.editor=e,this.widget=new Zx(this.editor)}dispose(){this.widget.dispose()}}$b.ID="editor.controller.quickInput";class Zx{constructor(e){this.codeEditor=e,this.domNode=document.createElement("div"),this.codeEditor.addOverlayWidget(this)}getId(){return Zx.ID}getDomNode(){return this.domNode}getPosition(){return{preference:2}}dispose(){this.codeEditor.removeOverlayWidget(this)}}Zx.ID="editor.contrib.quickInputWidget";ti($b.ID,$b,4);class ZAe{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 XAe(n){if(!n||!Array.isArray(n))return[];const e=[];let t=0;for(let i=0,s=n.length;i{const h=nMe(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 eMe;for(const d of e)o.getId(d);const r=o.getId(i),a=o.getId(s),l=new p7(t,r,a),c=new m7(l);for(let d=0,u=n.length;d"u"){const s=this._match(t),o=iMe(t);i=(s.metadata|o<<8)>>>0,this._cache.set(t,i)}return(i|e<<0)>>>0}}const tMe=/\b(comment|string|regex|regexp)\b/;function iMe(n){const e=n.match(tMe);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 nMe(n,e){return ne?1:0}class p7{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 p7(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 m7{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 m7(this._mainRule.clone()),this._children.set(r,l)),l.insert(a,t,i,s)}}function sMe(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=>Mo(o)?o:void 0;if(i&&Array.isArray(i.src)&&i.src.every(o=>Mo(o.format)&&Mo(o.location)))return{weight:s(i.weight),style:s(i.style),src:i.src.map(o=>({format:o.format,location:ct.parse(o.location)}))}}n.fromJSONObject=t})(hU||(hU={}));class dMe{constructor(){this._onDidChange=new j,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:"^".concat(dt.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="".concat(i," $(").concat(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="".concat(i,": $(").concat(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(;dt.isThemeIcon(o.defaults);)o=this.iconsById[o.defaults.id];return"codicon codicon-".concat(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('||').concat(o.id,"|").concat(dt.isThemeIcon(o.defaults)?o.defaults.id:o.id,"|").concat(o.description||"","|"));i.push("| preview | identifier "),i.push("| ----------- | --------------------------------- |");for(const o of s.filter(r=>!dt.isThemeIcon(r.defaults)).sort(e))i.push('||').concat(o.id,"|"));return i.join("\n")}}const n_=new dMe;en.add(cMe.IconContribution,n_);function Sn(n,e,t,i){return n_.registerIcon(n,e,t,i)}function dte(){return n_}function uMe(){const n=CX();for(const e in n){const t="\\"+n[e].toString(16);n_.registerIcon(e,{fontCharacter:t})}}uMe();const ute="vscode://schemas/icons",hte=en.as(hx.JSONContribution);hte.registerSchema(ute,n_.getIconSchema());const fU=new Si(()=>hte.notifySchemaChanged(ute),200);n_.onDidChange(()=>{fU.isScheduled()||fU.schedule()});const fte=Sn("widget-close",Me.close,m("widgetClose","Icon for the close action in widgets."));Sn("goto-previous-location",Me.arrowUp,m("previousChangeIcon","Icon for goto previous editor location."));Sn("goto-next-location",Me.arrowDown,m("nextChangeIcon","Icon for goto next editor location."));dt.modify(Me.sync,"spin");dt.modify(Me.loading,"spin");function hMe(n){const e=new be,t=e.add(new j),i=dte();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 gte,o={},r=l=>{const c=s.getIcon(l);if(!c)return;const d=c.font;return d?(o[d.id]=d.definition,".codicon-".concat(l.id,":before { content: '").concat(c.fontCharacter,"'; font-family: ").concat(rH(d.id),"; }")):".codicon-".concat(l.id,":before { content: '").concat(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: ".concat(c.weight,";"):"",u=c.style?"font-style: ".concat(c.style,";"):"",h=c.src.map(f=>"".concat(Uf(f.location)," format('").concat(f.format,"')")).join(", ");a.push("@font-face { src: ".concat(h,"; font-family: ").concat(rH(l),";").concat(d).concat(u," font-display: block; }"))}return a.join("\n")}}}class gte{getIcon(e){const t=dte();let i=e.defaults;for(;dt.isThemeIcon(i);){const s=t.getIcon(i.id);if(!s)return;i=s.defaults}return i}}const Cu="vs",sb="vs-dark",Gp="hc-black",Yp="hc-light",pte=en.as(WQ.ColorContribution),fMe=en.as(iJ.ThemingContribution);class mte{constructor(e,t){this.semanticHighlighting=!1,this.themeData=t;const i=t.base;e.length>0?(ED(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,ee.fromHex(this.themeData.colors[t]));if(this.themeData.inherit){const t=N4(this.themeData.base);for(const i in t.colors)e.has(i)||e.set(i,ee.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=pte.resolveDefaultColor(e,this),this.defaultColors[e]=t,t)}defines(e){return this.getColors().has(e)}get type(){switch(this.base){case Cu:return Ca.LIGHT;case Gp:return Ca.HIGH_CONTRAST_DARK;case Yp:return Ca.HIGH_CONTRAST_LIGHT;default:return Ca.DARK}}get tokenTheme(){if(!this._tokenTheme){let e=[],t=[];if(this.themeData.inherit){const o=N4(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=cte.createFromRawTokenTheme(e,t)}return this._tokenTheme}getTokenStyleMetadata(e,t,i){const o=this.tokenTheme._match([e].concat(t).join(".")).metadata,r=Fs.getForeground(o),a=Fs.getFontStyle(o);return{foreground:r,italic:!!(a&1),bold:!!(a&2),underline:!!(a&4),strikethrough:!!(a&8)}}}function ED(n){return n===Cu||n===sb||n===Gp||n===Yp}function N4(n){switch(n){case Cu:return oMe;case sb:return rMe;case Gp:return aMe;case Yp:return lMe}}function tk(n){const e=N4(n);return new mte(n,e)}class gMe extends te{constructor(){super(),this._onColorThemeChange=this._register(new j),this.onDidColorThemeChange=this._onColorThemeChange.event,this._onProductIconThemeChange=this._register(new j),this.onDidProductIconThemeChange=this._onProductIconThemeChange.event,this._environment=Object.create(null),this._builtInProductIconTheme=new gte,this._autoDetectHighContrast=!0,this._knownThemes=new Map,this._knownThemes.set(Cu,tk(Cu)),this._knownThemes.set(sb,tk(sb)),this._knownThemes.set(Gp,tk(Gp)),this._knownThemes.set(Yp,tk(Yp));const e=this._register(hMe(this));this._codiconCSS=e.getCSS(),this._themeCSS="",this._allCSS="".concat(this._codiconCSS,"\n").concat(this._themeCSS),this._globalStyleElement=null,this._styleElements=[],this._colorMapOverride=null,this.setTheme(Cu),this._onOSSchemeChanged(),this._register(e.onDidChange(()=>{this._codiconCSS=e.getCSS(),this._updateCSS()})),NX("(forced-colors: active)",()=>{this._onOSSchemeChanged()})}registerEditorContainer(e){return bE(e)?this._registerShadowDomContainer(e):this._registerRegularEditorContainer()}_registerRegularEditorContainer(){return this._globalStyleElement||(this._globalStyleElement=Na(void 0,e=>{e.className="monaco-colors",e.textContent=this._allCSS}),this._styleElements.push(this._globalStyleElement)),te.None}_registerShadowDomContainer(e){const t=Na(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(Cu),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!==ac(this._theme.type)){let t;Nb(this._theme.type)?t=e?Gp:sb:t=e?Yp:Cu,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)}};fMe.getThemingParticipants().forEach(r=>r(this._theme,i,this._environment));const s=[];for(const r of pte.getColors()){const a=this._theme.getColor(r.id,!0);a&&s.push("".concat(Q8(r.id),": ").concat(a.toString(),";"))}i.addRule(".monaco-editor, .monaco-diff-editor { ".concat(s.join("\n")," }"));const o=this._colorMapOverride||this._theme.tokenTheme.getColorMap();i.addRule(sMe(o)),this._themeCSS=e.join("\n"),this._updateCSS(),nn.setColorMap(o),this._onColorThemeChange.fire(this._theme)}_updateCSS(){this._allCSS="".concat(this._codiconCSS,"\n").concat(this._themeCSS),this._styleElements.forEach(e=>e.textContent=this._allCSS)}getFileIconTheme(){return{hasFileIcons:!1,hasFolderIcons:!1,hidesExplorerArrows:!1}}getProductIconTheme(){return this._builtInProductIconTheme}}const la=Wt("themeService");var pMe=globalThis&&globalThis.__decorate||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},hR=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let A4=class extends te{constructor(e,t,i){super(),this._contextKeyService=e,this._layoutService=t,this._configurationService=i,this._accessibilitySupport=0,this._onDidChangeScreenReaderOptimized=new j,this._onDidChangeReducedMotion=new j,this._accessibilityModeEnabledContext=pS.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(ce(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}};A4=pMe([hR(0,bt),hR(1,x0),hR(2,zt)],A4);var Xx=globalThis&&globalThis.__decorate||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},_m=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},G_,Ah;let M4=class{constructor(e,t){this._commandService=e,this._hiddenStates=new yI(t)}createMenu(e,t,i){return new P4(e,this._hiddenStates,Object.assign({emitEventsForSubmenuChanges:!1,eventDebounceDelay:50},i),this._commandService,t)}resetHiddenStates(e){this._hiddenStates.reset(e)}};M4=Xx([_m(0,gn),_m(1,yl)],M4);let yI=G_=class{constructor(e){this._storageService=e,this._disposables=new be,this._onDidChange=new j,this.onDidChange=this._onDidChange.event,this._ignoreChangeEvent=!1,this._hiddenByDefaultCache=new Map;try{const t=e.get(G_._key,0,"{}");this._data=JSON.parse(t)}catch{this._data=Object.create(null)}this._disposables.add(e.onDidChangeValue(0,G_._key,this._disposables)(()=>{if(!this._ignoreChangeEvent)try{const t=e.get(G_._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("".concat(e.id,"/").concat(t)))!==null&&i!==void 0?i:!1}setDefaultState(e,t,i){this._hiddenByDefaultCache.set("".concat(e.id,"/").concat(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&&wme(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(G_._key,e,0,0)}finally{this._ignoreChangeEvent=!1}}};yI._key="menu.hiddenCommands";yI=G_=Xx([_m(0,yl)],yI);let R4=Ah=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=Ls.getMenuItems(this._id);let t;e.sort(Ah._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(Ah._fillInKbExprKeys(e.when,this._structureContextKeys),iv(e)){if(e.command.precondition&&Ah._fillInKbExprKeys(e.command.precondition,this._preconditionContextKeys),e.command.toggled){const t=e.command.toggled.condition||e.command.toggled;Ah._fillInKbExprKeys(t,this._toggledContextKeys)}}else this._collectContextKeysForSubmenus&&Ls.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=iv(a);l&&this._hiddenStates.setDefaultState(this._id,a.command.id,!!a.isHiddenByDefault);const c=mMe(this._id,l?a.command:a,this._hiddenStates);if(l)r.push(new fl(a.command,a.alt,e,c,this._contextKeyService,this._commandService));else{const d=new Ah(a.submenu,this._hiddenStates,this._collectContextKeysForSubmenus,this._commandService,this._contextKeyService).createActionGroups(e),u=hs.join(...d.map(h=>h[1]));u.length>0&&r.push(new ww(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:Ah._compareTitles(iv(e)?e.command.title:e.title,iv(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)}};R4=Ah=Xx([_m(3,gn),_m(4,bt)],R4);let P4=class{constructor(e,t,i,s,o){this._disposables=new be,this._menuInfo=new R4(e,t,i.emitEventsForSubmenuChanges,s,o);const r=new Si(()=>{this._menuInfo.refresh(),this._onDidChange.fire({menu:this,isStructuralChange:!0,isEnablementChange:!0,isToggleChange:!0})},i.eventDebounceDelay);this._disposables.add(r),this._disposables.add(Ls.onDidChangeMenu(d=>{d.has(e)&&r.schedule()}));const a=this._disposables.add(new be),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 cX({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()}};P4=Xx([_m(3,gn),_m(4,bt)],P4);function mMe(n,e,t){const i=hbe(e)?e.submenu.id:e.id,s=typeof e.title=="string"?e.title:e.title.value,o=Bv({id:"hide/".concat(n.id,"/").concat(i),label:m("hide.label","Hide '{0}'",s),run(){t.updateHidden(n,i,!0)}}),r=Bv({id:"toggle/".concat(n.id,"/").concat(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 _Me=globalThis&&globalThis.__decorate||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},gU=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},Zg=globalThis&&globalThis.__awaiter||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 O4=class extends te{constructor(e,t){super(),this.layoutService=e,this.logService=t,this.mapTextToType=new Map,this.findText="",this.resources=[],(qu||AX)&&this.installWebKitWriteTextWorkaround()}installWebKitWriteTextWorkaround(){const e=()=>{const t=new rx;this.webKitPendingClipboardWritePromise&&!this.webKitPendingClipboardWritePromise.isSettled&&this.webKitPendingClipboardWritePromise.cancel(),this.webKitPendingClipboardWritePromise=t,navigator.clipboard.write([new ClipboardItem({"text/plain":t.p})]).catch(i=>Zg(this,void 0,void 0,function*(){(!(i instanceof Error)||i.name!=="NotAllowedError"||!t.isRejected)&&this.logService.error(i)}))};this.layoutService.hasContainer&&(this._register(ce(this.layoutService.container,"click",e)),this._register(ce(this.layoutService.container,"keydown",e)))}writeText(e,t){return Zg(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(ye("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 Zg(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 Zg(this,void 0,void 0,function*(){return this.findText})}writeFindText(e){return Zg(this,void 0,void 0,function*(){this.findText=e})}writeResources(e){return Zg(this,void 0,void 0,function*(){this.resources=e})}readResources(){return Zg(this,void 0,void 0,function*(){return this.resources})}};O4=_Me([gU(0,x0),gU(1,aa)],O4);const ch=Wt("clipboardService");var vMe=globalThis&&globalThis.__decorate||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},bMe=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};const PC="data-keybinding-context";let _7=class{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 zb extends _7{constructor(){super(-1,null)}setValue(e,t){return!1}removeValue(e){return!1}getValue(e){}}zb.INSTANCE=new zb;class ly extends _7{constructor(e,t,i){super(e,null),this._configurationService=t,this._values=eb.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 mU(o))}else{const o=[];for(const r of s.affectedKeys){const a="config.".concat(r),l=this._values.findSuperstr(a);l!==void 0&&(o.push(...Pt.map(l,([c])=>c)),this._values.deleteSuperstr(a)),this._values.has(a)&&(o.push(a),this._values.delete(a))}i.fire(new mU(o))}})}dispose(){this._listener.dispose()}getValue(e){if(e.indexOf(ly._keyPrefix)!==0)return super.getValue(e);if(this._values.has(e))return this._values.get(e);const t=e.substr(ly._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)}}ly._keyPrefix="config.";class CMe{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 pU{constructor(e){this.key=e}affectsSome(e){return e.has(this.key)}allKeysContainedIn(e){return this.affectsSome(e)}}class mU{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 wMe{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 yMe(n,e){return n.allKeysContainedIn(new Set(Object.keys(e)))}class _te extends te{constructor(e){super(),this._onDidChangeContext=this._register(new nm({merge:t=>new wMe(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 CMe(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 SMe(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 pU(e))}removeContext(e){this._isDisposed||this.getContextValuesContainer(this._myContextId).removeValue(e)&&this._onDidChangeContext.fire(new pU(e))}getContext(e){return this._isDisposed?zb.INSTANCE:this.getContextValuesContainer(LMe(e))}dispose(){super.dispose(),this._isDisposed=!0}}let F4=class extends _te{constructor(e){super(0),this._contexts=new Map,this._lastContextId=0;const t=this._register(new ly(this._myContextId,e,this._onDidChangeContext));this._contexts.set(this._myContextId,t)}getContextValuesContainer(e){return this._isDisposed?zb.INSTANCE:this._contexts.get(e)||zb.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 _7(t,this.getContextValuesContainer(e))),t}disposeContext(e){this._isDisposed||this._contexts.delete(e)}};F4=vMe([bMe(0,zt)],F4);class SMe extends _te{constructor(e,t){if(super(e.createChildContext()),this._parentChangeListener=this._register(new Ts),this._parent=e,this._updateParentChangeListener(),this._domNode=t,this._domNode.hasAttribute(PC)){let i="";this._domNode.classList&&(i=Array.from(this._domNode.classList.values()).join(", ")),console.error("Element already has context attribute".concat(i?": "+i:""))}this._domNode.setAttribute(PC,String(this._myContextId))}_updateParentChangeListener(){this._parentChangeListener.value=this._parent.onDidChangeContext(e=>{const i=this._parent.getContextValuesContainer(this._myContextId).value;yMe(e,i)||this._onDidChangeContext.fire(e)})}dispose(){this._isDisposed||(this._parent.disposeContext(this._myContextId),this._domNode.removeAttribute(PC),super.dispose())}getContextValuesContainer(e){return this._isDisposed?zb.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 LMe(n){for(;n;){if(n.hasAttribute(PC)){const e=n.getAttribute(PC);return e?parseInt(e,10):NaN}n=n.parentElement}return 0}function kMe(n,e,t){n.get(bt).createKey(String(e),DMe(t))}function DMe(n){return ZZ(n,e=>{if(typeof e=="object"&&e.$mid===1)return ct.revive(e).toString();if(e instanceof ct)return e.toString()})}qt.registerCommand("_setContext",kMe);qt.registerCommand({id:"getContextKeyInfo",handler(){return[...Ve.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 Ve.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 EMe=class{constructor(e,t){this.key=e,this.data=t,this.incoming=new Map,this.outgoing=new Map}};class _U{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 EMe(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("".concat(t,"\n (-> incoming)[").concat([...i.incoming.keys()].join(", "),"]\n (outgoing ->)[").concat([...i.outgoing.keys()].join(","),"]\n"));return e.join("\n")}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 IMe=!1;class vU 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: \n".concat(e.toString())}}class SI{constructor(e=new Tx,t=!1,i,s=IMe){var o;this._services=e,this._strict=t,this._parent=i,this._enableTracing=s,this._activeInstantiations=new Set,this._services.set(_t,this),this._globalGraph=s?(o=i==null?void 0:i._globalGraph)!==null&&o!==void 0?o:new _U(r=>r):void 0}createChild(e){return new SI(e,this._strict,this,this._enableTracing)}invokeFunction(e,...t){const i=qo.traceInvocation(this._enableTracing,e);let s=!1;try{return e({get:r=>{if(s)throw m8("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 '".concat(r,"'"));return a}},...t)}finally{s=!0,i.stop()}}createInstance(e,...t){let i,s;return e instanceof Hc?(i=qo.traceCreation(this._enableTracing,e.ctor),s=this._createInstance(e.ctor,e.staticArguments.concat(t),i)):(i=qo.traceCreation(this._enableTracing,e),s=this._createInstance(e,t,i)),i.stop(),s}_createInstance(e,t=[],i){const s=Ql.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] ".concat(e.name," depends on UNKNOWN service ").concat(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 ".concat(e.name," at position ").concat(r+1," conflicts with ").concat(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 Hc)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 Hc?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 '".concat(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 _U(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 vU(o);for(const c of Ql.getServiceDependencies(l.desc.ctor)){const d=this._getServiceInstanceOrDescriptor(c.id);if(d||this._throwIfStrict("[createInstance] ".concat(e," depends on ").concat(c.id," which is NOT registered."),!0),(s=this._globalGraph)===null||s===void 0||s.insertEdge(String(l.id),String(c.id)),d instanceof Hc){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 vU(o);break}for(const{data:c}of l){if(this._getServiceInstanceOrDescriptor(c.id)instanceof Hc){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 Hc)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 ".concat(t.name))}_createServiceInstance(e,t,i=[],s,o){if(s){const r=new SI(void 0,this._strict,this,this._enableTracing);r._globalGraphImplicitDependency=String(e);const a=new Map,l=new aD(()=>{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 To,a.set(d,f)),(p,_,v)=>{const b=f.push([p,_,v]);return vt(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 qo{static traceInvocation(e,t){return e?new qo(2,t.name||new Error().stack.split("\n").slice(3,4).join("\n")):qo._None}static traceCreation(e,t){return e?new qo(1,t.name):qo._None}constructor(e,t){this.type=e,this.name=t,this._start=Date.now(),this._dep=[]}branch(e,t){const i=new qo(3,e.toString());return this._dep.push([e,t,i]),i}stop(){const e=Date.now()-this._start;qo._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("".concat(l,"CREATES -> ").concat(c));const h=i(o+1,u);h&&a.push(h)}else a.push("".concat(l,"uses -> ").concat(c));return a.join("\n")}const s=["".concat(this.type===1?"CREATE":"CALL"," ").concat(this.name),"".concat(i(1,this)),"DONE, took ".concat(e.toFixed(2),"ms (grand total ").concat(qo._totals.toFixed(2),"ms)")];(e>2||t)&&qo.all.add(s.join("\n"))}}qo.all=new Set;qo._None=new class extends qo{constructor(){super(0,null)}stop(){}branch(){return this}};qo._totals=0;const TMe=new Set([Nt.inMemory,Nt.vscodeSourceControl,Nt.walkThrough,Nt.walkThroughSnippet]);class xMe{constructor(){this._byResource=new Js,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 Js,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:Pt.empty():ct.isUri(e)?(o=(s=this._byResource.get(e))===null||s===void 0?void 0:s.values())!==null&&o!==void 0?o:Pt.empty():Pt.map(Pt.concat(...this._byOwner.values()),r=>r[1])}}class NMe{constructor(e){this.errors=0,this.infos=0,this.warnings=0,this.unknowns=0,this._data=new Js,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(TMe.has(e.scheme))return t;for(const{severity:i}of this._service.read({resource:e}))i===rn.Error?t.errors+=1:i===rn.Warning?t.warnings+=1:i===rn.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 Oh{constructor(){this._onMarkerChanged=new cX({delay:0,merge:Oh._merge}),this.onMarkerChanged=this._onMarkerChanged.event,this._data=new xMe,this._stats=new NMe(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(UZ(i))this._data.delete(t,e)&&this._onMarkerChanged.fire([t]);else{const s=[];for(const o of i){const r=Oh._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=Pt.first(o);r&&(i.push(r.resource),this._data.delete(r.resource,e))}if(io(t)){const o=new Js;for(const{resource:r,marker:a}of t){const l=Oh._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(Oh._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(Oh._accept(l,s)){const c=r.push(l);if(o>0&&c===o)return r}return r}else{const r=this._data.values(i!=null?i:t),a=[];for(const l of r)for(const c of l)if(Oh._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 Js;for(const i of e)for(const s of i)t.set(s,!0);return Array.from(t.keys())}}class AMe extends te{constructor(){super(...arguments),this._configurationModel=new Ys}get configurationModel(){return this._configurationModel}reload(){return this.resetConfigurationModel(),this.configurationModel}getConfigurationDefaultOverrides(){return{}}resetConfigurationModel(){this._configurationModel=new Ys;const e=en.as(wc.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 MS=Wt("audioCue");class At{static register(e){return new At(e.fileName)}constructor(e){this.fileName=e}}At.error=At.register({fileName:"error.mp3"});At.warning=At.register({fileName:"warning.mp3"});At.foldedArea=At.register({fileName:"foldedAreas.mp3"});At.break=At.register({fileName:"break.mp3"});At.quickFixes=At.register({fileName:"quickFixes.mp3"});At.taskCompleted=At.register({fileName:"taskCompleted.mp3"});At.taskFailed=At.register({fileName:"taskFailed.mp3"});At.terminalBell=At.register({fileName:"terminalBell.mp3"});At.diffLineInserted=At.register({fileName:"diffLineInserted.mp3"});At.diffLineDeleted=At.register({fileName:"diffLineDeleted.mp3"});At.diffLineModified=At.register({fileName:"diffLineModified.mp3"});At.chatRequestSent=At.register({fileName:"chatRequestSent.mp3"});At.chatResponsePending=At.register({fileName:"chatResponsePending.mp3"});At.chatResponseReceived1=At.register({fileName:"chatResponseReceived1.mp3"});At.chatResponseReceived2=At.register({fileName:"chatResponseReceived2.mp3"});At.chatResponseReceived3=At.register({fileName:"chatResponseReceived3.mp3"});At.chatResponseReceived4=At.register({fileName:"chatResponseReceived4.mp3"});class MMe{constructor(e){this.randomOneOf=e}}class Jt{static register(e){const t=new MMe("randomOneOf"in e.sound?e.sound.randomOneOf:[e.sound]),i=new Jt(t,e.name,e.settingsKey);return Jt._audioCues.add(i),i}constructor(e,t,i){this.sound=e,this.name=t,this.settingsKey=i}}Jt._audioCues=new Set;Jt.error=Jt.register({name:m("audioCues.lineHasError.name","Error on Line"),sound:At.error,settingsKey:"audioCues.lineHasError"});Jt.warning=Jt.register({name:m("audioCues.lineHasWarning.name","Warning on Line"),sound:At.warning,settingsKey:"audioCues.lineHasWarning"});Jt.foldedArea=Jt.register({name:m("audioCues.lineHasFoldedArea.name","Folded Area on Line"),sound:At.foldedArea,settingsKey:"audioCues.lineHasFoldedArea"});Jt.break=Jt.register({name:m("audioCues.lineHasBreakpoint.name","Breakpoint on Line"),sound:At.break,settingsKey:"audioCues.lineHasBreakpoint"});Jt.inlineSuggestion=Jt.register({name:m("audioCues.lineHasInlineSuggestion.name","Inline Suggestion on Line"),sound:At.quickFixes,settingsKey:"audioCues.lineHasInlineSuggestion"});Jt.terminalQuickFix=Jt.register({name:m("audioCues.terminalQuickFix.name","Terminal Quick Fix"),sound:At.quickFixes,settingsKey:"audioCues.terminalQuickFix"});Jt.onDebugBreak=Jt.register({name:m("audioCues.onDebugBreak.name","Debugger Stopped on Breakpoint"),sound:At.break,settingsKey:"audioCues.onDebugBreak"});Jt.noInlayHints=Jt.register({name:m("audioCues.noInlayHints","No Inlay Hints on Line"),sound:At.error,settingsKey:"audioCues.noInlayHints"});Jt.taskCompleted=Jt.register({name:m("audioCues.taskCompleted","Task Completed"),sound:At.taskCompleted,settingsKey:"audioCues.taskCompleted"});Jt.taskFailed=Jt.register({name:m("audioCues.taskFailed","Task Failed"),sound:At.taskFailed,settingsKey:"audioCues.taskFailed"});Jt.terminalCommandFailed=Jt.register({name:m("audioCues.terminalCommandFailed","Terminal Command Failed"),sound:At.error,settingsKey:"audioCues.terminalCommandFailed"});Jt.terminalBell=Jt.register({name:m("audioCues.terminalBell","Terminal Bell"),sound:At.terminalBell,settingsKey:"audioCues.terminalBell"});Jt.notebookCellCompleted=Jt.register({name:m("audioCues.notebookCellCompleted","Notebook Cell Completed"),sound:At.taskCompleted,settingsKey:"audioCues.notebookCellCompleted"});Jt.notebookCellFailed=Jt.register({name:m("audioCues.notebookCellFailed","Notebook Cell Failed"),sound:At.taskFailed,settingsKey:"audioCues.notebookCellFailed"});Jt.diffLineInserted=Jt.register({name:m("audioCues.diffLineInserted","Diff Line Inserted"),sound:At.diffLineInserted,settingsKey:"audioCues.diffLineInserted"});Jt.diffLineDeleted=Jt.register({name:m("audioCues.diffLineDeleted","Diff Line Deleted"),sound:At.diffLineDeleted,settingsKey:"audioCues.diffLineDeleted"});Jt.diffLineModified=Jt.register({name:m("audioCues.diffLineModified","Diff Line Modified"),sound:At.diffLineModified,settingsKey:"audioCues.diffLineModified"});Jt.chatRequestSent=Jt.register({name:m("audioCues.chatRequestSent","Chat Request Sent"),sound:At.chatRequestSent,settingsKey:"audioCues.chatRequestSent"});Jt.chatResponseReceived=Jt.register({name:m("audioCues.chatResponseReceived","Chat Response Received"),settingsKey:"audioCues.chatResponseReceived",sound:{randomOneOf:[At.chatResponseReceived1,At.chatResponseReceived2,At.chatResponseReceived3,At.chatResponseReceived4]}});Jt.chatResponsePending=Jt.register({name:m("audioCues.chatResponsePending","Chat Response Pending"),sound:At.chatResponsePending,settingsKey:"audioCues.chatResponsePending"});class RMe extends te{constructor(e,t=[]){super(),this.logger=new gbe([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 vte=[];function Qx(n){vte.push(n)}function PMe(){return vte.slice(0)}var xg=globalThis&&globalThis.__decorate||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},ys=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},ob=globalThis&&globalThis.__awaiter||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 OMe{constructor(e){this.disposed=!1,this.model=e,this._onWillDispose=new j}get textEditorModel(){return this.model}dispose(){this.disposed=!0,this._onWillDispose.fire()}}let B4=class{constructor(e){this.modelService=e}createModelReference(e){const t=this.modelService.getModel(e);return t?Promise.resolve(new W_e(new OMe(t))):Promise.reject(new Error("Model not found"))}};B4=xg([ys(0,Zi)],B4);class Jx{show(){return Jx.NULL_PROGRESS_RUNNER}showWhile(e,t){return ob(this,void 0,void 0,function*(){yield e})}}Jx.NULL_PROGRESS_RUNNER={done:()=>{},total:()=>{},worked:()=>{}};class FMe{withProgress(e,t,i){return t({report:()=>{}})}}class BMe{constructor(){this.isExtensionDevelopment=!1,this.isBuilt=!1}}class WMe{confirm(e){return ob(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+"\n\n"+t),window.confirm(i)}prompt(e){var t,i;return ob(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 ob(this,void 0,void 0,function*(){yield this.prompt({type:bn.Error,message:e,detail:t})})}}class cy{info(e){return this.notify({severity:bn.Info,message:e})}warn(e){return this.notify({severity:bn.Warning,message:e})}error(e){return this.notify({severity:bn.Error,message:e})}notify(e){switch(e.severity){case bn.Error:console.error(e.message);break;case bn.Warning:console.warn(e.message);break;default:console.log(e.message);break}return cy.NO_OP}prompt(e,t,i,s){return cy.NO_OP}status(e,t){return te.None}}cy.NO_OP=new zEe;let W4=class{constructor(e){this._onWillExecuteCommand=new j,this._onDidExecuteCommand=new j,this.onDidExecuteCommand=this._onDidExecuteCommand.event,this._instantiationService=e}executeCommand(e,...t){const i=qt.getCommand(e);if(!i)return Promise.reject(new Error("command '".concat(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)}}};W4=xg([ys(0,_t)],W4);let Ub=class extends XIe{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 be;g.add(ce(f,Pe.KEY_DOWN,p=>{const _=new Oi(p);this._dispatch(_,_.target)&&(_.preventDefault(),_.stopPropagation())})),g.add(ce(f,Pe.KEY_UP,p=>{const _=new Oi(p);this._singleModifierDispatch(_,_.target)&&_.preventDefault()})),this._domNodeListeners.push(new VMe(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 rl(qt.registerCommand(e,i),this.addDynamicKeybindings([{keybinding:t,command:e,when:s}]))}addDynamicKeybindings(e){const t=e.map(i=>{var s;return{keybinding:HP(i.keybinding,$r),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(),vt(()=>{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 Tz(void 0,o.command,o.commandArgs,r,t,null,!1);else{const l=Yw.resolveKeybinding(a,$r);for(const c of l)i[s++]=new Tz(c,o.command,o.commandArgs,r,t,null,!1)}}return i}resolveKeyboardEvent(e){const t=new Gu(e.ctrlKey,e.shiftKey,e.altKey,e.metaKey,e.keyCode);return new Yw([t],$r)}};Ub=xg([ys(0,bt),ys(1,gn),ys(2,ra),ys(3,Nn),ys(4,aa),ys(5,ai)],Ub);class VMe extends te{constructor(e,t){super(),this.domNode=e,this._register(t)}}function bU(n){return n&&typeof n=="object"&&(!n.overrideIdentifier||typeof n.overrideIdentifier=="string")&&(!n.resource||n.resource instanceof ct)}class bte{constructor(){this._onDidChangeConfiguration=new j,this.onDidChangeConfiguration=this._onDidChangeConfiguration.event;const e=new AMe;this._configuration=new Mx(e.reload(),new Ys,new Ys,new Ys),e.dispose()}getValue(e,t){const i=typeof e=="string"?e:void 0,s=bU(e)?e:bU(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 qIe({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 V4=class{constructor(e,t,i){this.configurationService=e,this.modelService=t,this.languageService=i,this._onDidChangeConfiguration=new j,this.configurationService.onDidChangeConfiguration(s=>{this._onDidChangeConfiguration.fire({affectedKeys:s.affectedKeys,affectsConfiguration:(o,r)=>s.affectsConfiguration(r)})})}getValue(e,t,i){const s=Y.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)}};V4=xg([ys(0,zt),ys(1,Zi),ys(2,qi)],V4);let H4=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:Co||Kt?"\n":"\r\n"}};H4=xg([ys(0,zt)],H4);class HMe{publicLog2(){}}class dy{constructor(){const e=ct.from({scheme:dy.SCHEME,authority:"model",path:"/"});this.workspace={id:dee,folders:[new hTe({uri:e,name:"",index:0})]}}getWorkspace(){return this.workspace}getWorkspaceFolder(e){return e&&e.scheme===dy.SCHEME?this.workspace.folders[0]:null}}dy.SCHEME="inmemory";function LI(n,e,t){if(!e||!(n instanceof bte))return;const i=[];Object.keys(e).forEach(s=>{$Ie(s)&&i.push(["editor.".concat(s),e[s]]),t&&zIe(s)&&i.push(["diffEditor.".concat(s),e[s]])}),i.length>0&&n.updateValues(i)}let $4=class{constructor(e){this._modelService=e}hasPreviewHandler(){return!1}apply(e,t){return ob(this,void 0,void 0,function*(){const i=Array.isArray(e)?e:P9.convert(e),s=new Map;for(const a of i){if(!(a instanceof Ou))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(Yi.replaceMove(I.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:sm(KO.bulkEditServiceSummary,o,r),isApplied:o>0}})}};$4=xg([ys(0,Zi)],$4);class $Me{getUriLabel(e,t){return e.scheme==="file"?e.fsPath:e.path}getUriBasenameLabel(e){return Ra(e)}}let z4=class extends qO{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)}};z4=xg([ys(0,x0),ys(1,ai)],z4);class zMe{constructor(){this._neverEmitter=new j,this.onDidChangeTrust=this._neverEmitter.event}isWorkspaceTrusted(){return!0}}class UMe extends Qw{constructor(){super()}}class jMe extends RMe{constructor(){super(new fbe)}}let U4=class extends u4{constructor(e,t,i,s,o,r){super(e,t,i,s,o,r),this.configure({blockMouse:!1})}};U4=xg([ys(0,ra),ys(1,Nn),ys(2,rh),ys(3,Di),ys(4,Vd),ys(5,bt)],U4);class KMe{playAudioCue(e,t){return ob(this,void 0,void 0,function*(){})}}Gt(zt,bte,0);Gt(j8,V4,0);Gt(NQ,H4,0);Gt(hm,dy,0);Gt(Fb,$Me,0);Gt(ra,HMe,0);Gt(LS,WMe,0);Gt(A9,BMe,0);Gt(Nn,cy,0);Gt(zd,Oh,0);Gt(qi,UMe,0);Gt(la,gMe,0);Gt(aa,jMe,0);Gt(Zi,gI,0);Gt(X8,m4,0);Gt(bt,F4,0);Gt(cee,FMe,0);Gt(Tg,Jx,0);Gt(yl,eNe,0);Gt(Sl,iO,0);Gt(kS,$4,0);Gt(uee,zMe,0);Gt(sr,B4,0);Gt(oh,A4,0);Gt($a,mAe,0);Gt(gn,W4,0);Gt(Di,Ub,0);Gt(yc,x4,0);Gt(rh,z4,0);Gt(Ir,p4,0);Gt(ch,O4,0);Gt(Cl,U4,0);Gt(Vd,M4,0);Gt(MS,KMe,0);var mt;(function(n){const e=new Tx;for(const[l,c]of pH())e.set(l,c);const t=new SI(e,!0);e.set(_t,t);function i(l){s||r({});const c=e.get(l);if(!c)throw new Error("Missing service "+l);return c instanceof Hc?t.invokeFunction(d=>d.get(l)):c}n.get=i;let s=!1;const o=new j;function r(l){if(s)return t;s=!0;for(const[d,u]of pH())e.get(d)||e.set(d,u);for(const d in l)if(l.hasOwnProperty(d)){const u=Wt(d);e.get(u)instanceof Hc&&e.set(u,l[d])}const c=PMe();for(const d of c)try{t.createInstance(d)}catch(u){Dt(u)}return o.fire(),t}n.initialize=r;function a(l){if(s)return l();const c=new be,d=c.add(o.event(()=>{d.dispose(),c.add(l())}));return c}n.withServices=a})(mt||(mt={}));let qMe;function Bu(){return qMe}let Cte;function GMe(n){Cte=n}class wte{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 Cte({owner:i,debugName:()=>{const o=s_(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"".concat(this.debugName,".").concat(a[2]);if(!i)return"".concat(this.debugName," (mapped)")}},o=>s(this.read(o),o))}}class RS extends wte{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 Gi(n,e){const t=new yte(n,e);try{n(t)}finally{t.finish()}}function j4(n,e,t){n?e(n):Gi(e,t)}class yte{constructor(e,t){var i;this._fn=e,this._getDebugName=t,this.updatingObservers=[],(i=Bu())===null||i===void 0||i.handleBeginTransaction(this)}getDebugName(){return this._getDebugName?this._getDebugName():s_(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=Bu())===null||e===void 0||e.handleEndTransaction()}}function v7(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=s_(e),s!==void 0))return s;if(t!==void 0){for(const o in t)if(t[o]===i)return o}}function s_(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 Pi(n,e){return typeof n=="string"?new K4(void 0,n,e):new K4(n,void 0,e)}class K4 extends RS{get debugName(){var e;return(e=v7(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 yte(()=>{},()=>"Setting ".concat(this.debugName)));try{const r=this._value;this._setValue(e),(s=Bu())===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"".concat(this.debugName,": ").concat(this._value)}_setValue(e){this._value=e}}function kI(n,e){return typeof n=="string"?new CU(void 0,n,e):new CU(n,void 0,e)}class CU extends K4{_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 uy=(n,e)=>n===e;function Ut(n,e){return e!==void 0?new fy(n,void 0,e,void 0,void 0,void 0,uy):new fy(void 0,void 0,n,void 0,void 0,void 0,uy)}function wU(n,e){var t;return new fy(n.owner,n.debugName,e,void 0,void 0,void 0,(t=n.equalityComparer)!==null&&t!==void 0?t:uy)}function YMe(n,e){var t;return new fy(n.owner,n.debugName,e,n.createEmptyChangeSummary,n.handleChange,void 0,(t=n.equalityComparer)!==null&&t!==void 0?t:uy)}function hy(n,e){let t,i;e===void 0?(t=n,i=void 0):(i=n,t=e);const s=new be;return new fy(i,()=>{var o;return(o=s_(t))!==null&&o!==void 0?o:"(anonymous)"},o=>(s.clear(),t(o,s)),void 0,void 0,()=>s.dispose(),uy)}GMe(Ut);class fy extends RS{get debugName(){var e;return(e=v7(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=Bu())===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=Bu())===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<".concat(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 Rn}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 b7(n,e){return new tN(n.debugName,e,void 0,void 0)}function xi(n){return new tN(void 0,n,void 0,void 0)}function eN(n,e){return new tN(n.debugName,e,n.createEmptyChangeSummary,n.handleChange)}function pr(n){const e=new be,t=b7({debugName:()=>s_(n)||"(anonymous)"},i=>{e.clear(),n(i,e)});return vt(()=>{t.dispose(),e.dispose()})}class tN{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=s_(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=Bu())===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=Bu())===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=Bu())===null||i===void 0||i.handleAutorunFinished(this);for(const o of this.dependenciesToBeRemoved)o.removeObserver(this);this.dependenciesToBeRemoved.clear()}}toString(){return"Autorun<".concat(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--,Cw(()=>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=tN})(xi||(xi={}));function DI(n){return new ZMe(n)}class ZMe extends wte{constructor(e){super(),this.value=e}get debugName(){return this.toString()}get(){return this.value}addObserver(e){}removeObserver(e){}toString(){return"Const: ".concat(this.value)}}function XMe(n,e){return new Promise(t=>{let i=!1,s=!1;const o=xi(r=>{const a=n.read(r);e(a)&&(i?o.dispose():s=!0,t(a))});i=!0,s&&o.dispose()})}function ks(n,e){return new Ste(n,e)}class Ste extends RS{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=Bu())===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&&Gi(a=>{for(const l of this.observers)a.updateObserver(l,this),l.handleChange(this,void 0)},()=>{const a=this.getDebugName();return"Event fired"+(a?": ".concat(a):"")}),this.hasValue=!0)}}getDebugName(){return s_(this._getValue)}get debugName(){const e=this.getDebugName();return"From Event"+(e?": ".concat(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=Ste})(ks||(ks={}));function Vr(n,e){return new QMe(n,e)}class QMe extends RS{constructor(e,t){super(),this.debugName=e,this.event=t,this.handleEvent=()=>{Gi(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 Lte(n){return typeof n=="string"?new yU(n):new yU(void 0,n)}class yU extends RS{get debugName(){var e;return(e=v7(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){Gi(i=>{this.trigger(i,t)},()=>"Trigger signal ".concat(this.debugName));return}for(const i of this.observers)e.updateObserver(i,this),i.handleChange(this,t)}get(){}}function gy(n){const e=new JMe(!0);return n.addObserver(e),n.reportChanges(),vt(()=>{n.removeObserver(e)})}class JMe{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 kte(){return!!hX.VSCODE_DEV}function eRe(n){if(kte()){const e=tRe();return e.add(n),{dispose(){e.delete(n)}}}else return{dispose(){}}}function tRe(){ik||(ik=new Set);const n=globalThis;return n.$hotReload_applyNewExports||(n.$hotReload_applyNewExports=e=>{for(const t of ik){const i=t(e);if(i)return i}}),ik}let ik;function iRe(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 ".concat(e.debugName)},s=>{const o=e.read(s);i.set(o)})),t.add({dispose:()=>{i.clear()}}),t}function nk(n,e){return n.appendChild(e),vt(()=>{n.removeChild(e)})}class nRe extends te{get width(){return this._width}get height(){return this._height}constructor(e,t){super(),this.elementSizeObserver=this._register(new BQ(e,t)),this._width=Pi(this,this.elementSizeObserver.getWidth()),this._height=Pi(this,this.elementSizeObserver.getHeight()),this._register(this.elementSizeObserver.onDidChange(i=>Gi(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 SU(n,e){let t=n.get(),i=t,s=t;const o=Pi("animatedValue",t);let r=-1;const a=300;let l;e.add(eN({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(sRe(d,i,t-i,a)),d{this._actualTop.set(i,void 0)},this.onComputedHeight=i=>{this._actualHeight.set(i,void 0)}}}class iN{constructor(e,t){this._editor=e,this._domElement=t,this._overlayWidgetId="managedOverlayWidget-".concat(iN._counter++),this._overlayWidget={getId:()=>this._overlayWidgetId,getDomNode:()=>this._domElement,getPosition:()=>null},this._editor.addOverlayWidget(this._overlayWidget)}dispose(){this._editor.removeOverlayWidget(this._overlayWidget)}}iN._counter=0;function If(n,e){return xi(t=>{for(let[i,s]of Object.entries(e))s&&typeof s=="object"&&"read"in s&&(s=s.read(t)),typeof s=="number"&&(s="".concat(s,"px")),i=i.replace(/[A-Z]/g,o=>"-"+o.toLowerCase()),n.style[i]=s})}function Fh(n,e){return oRe([n],e),n}function oRe(n,e){kte()&&Vr("reload",i=>eRe(s=>{if([...Object.values(s)].some(o=>n.includes(o)))return o=>(i(void 0),!0)})).read(e)}function TI(n,e,t){const i=new be,s=[];return i.add(xi(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(eN({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 rRe extends Tn{dispose(){super.dispose(!0)}}var C7=globalThis&&globalThis.__decorate||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},w7=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},aRe=globalThis&&globalThis.__awaiter||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 lRe=Sn("diff-review-insert",Me.add,m("accessibleDiffViewerInsertIcon","Icon for 'Insert' in accessible diff viewer.")),cRe=Sn("diff-review-remove",Me.remove,m("accessibleDiffViewerRemoveIcon","Icon for 'Remove' in accessible diff viewer.")),dRe=Sn("diff-review-close",Me.close,m("accessibleDiffViewerCloseIcon","Icon for 'Close' in accessible diff viewer."));let af=class extends te{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=hy(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(q4,this._diffs,this._editors,this._setVisible,this._canClose)),g=u.add(this._instantiationService.createInstance(G4,this._parentNode,f,this._width,this._height,this._editors));return{model:f,view:g}}),this._register(gy(this.model))}next(){Gi(e=>{const t=this._visible.get();this._setVisible(!0,e),t&&this.model.get().model.nextGroup(e)})}prev(){Gi(e=>{this._setVisible(!0,e),this.model.get().model.previousGroup(e)})}close(){Gi(e=>{this._setVisible(!1,e)})}};af._ttPolicy=sh("diffReview",{createHTML:n=>n});af=C7([w7(8,_t)],af);let q4=class extends te{constructor(e,t,i,s,o){super(),this._diffs=e,this._editors=t,this._setVisible=i,this.canClose=s,this._audioCueService=o,this._groups=Pi(this,[]),this._currentGroupIdx=Pi(this,0),this._currentElementIdx=Pi(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(xi(r=>{const a=this._diffs.read(r);if(!a){this._groups.set([],void 0);return}const l=uRe(a,this._editors.original.getModel().getLineCount(),this._editors.modified.getModel().getLineCount());Gi(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)===ko.Deleted?this._audioCueService.playAudioCue(Jt.diffLineDeleted,{source:"accessibleDiffViewer.currentElementChanged"}):(a==null?void 0:a.type)===ko.Added&&this._audioCueService.playAudioCue(Jt.diffLineInserted,{source:"accessibleDiffViewer.currentElementChanged"})})),this._register(xi(r=>{var a;const l=this.currentElement.read(r);if(l&&l.type!==ko.Header){const c=(a=l.modifiedLineNumber)!==null&&a!==void 0?a:l.diff.modified.startLineNumber;this._editors.modified.setSelection(I.fromPositions(new Y(c,1)))}}))}_goToGroupDelta(e,t){const i=this.groups.get();!i||i.length<=1||j4(t,s=>{this._currentGroupIdx.set(Bt.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||Gi(i=>{this._currentElementIdx.set(Bt.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&&Gi(s=>{this._currentElementIdx.set(i,s)})}revealCurrentElementInEditor(){this._setVisible(!1,void 0);const e=this.currentElement.get();e&&(e.type===ko.Deleted?(this._editors.original.setSelection(I.fromPositions(new Y(e.originalLineNumber,1))),this._editors.original.revealLine(e.originalLineNumber),this._editors.original.focus()):(e.type!==ko.Header&&(this._editors.modified.setSelection(I.fromPositions(new Y(e.modifiedLineNumber,1))),this._editors.modified.revealLine(e.modifiedLineNumber)),this._editors.modified.focus()))}close(){this._setVisible(!1,void 0),this._editors.modified.focus()}};q4=C7([w7(4,MS)],q4);const m1=3;function uRe(n,e,t){const i=[];for(const s of $Z(n,(o,r)=>r.modified.startLineNumber-o.modified.endLineNumberExclusive<2*m1)){const o=[];o.push(new fRe);const r=new Ht(Math.max(1,s[0].original.startLineNumber-m1),Math.min(s[s.length-1].original.endLineNumberExclusive+m1,e+1)),a=new Ht(Math.max(1,s[0].modified.startLineNumber-m1),Math.min(s[s.length-1].modified.endLineNumberExclusive+m1,t+1));zZ(s,(d,u)=>{const h=new Ht(d?d.original.endLineNumberExclusive:r.startLineNumber,u?u.original.startLineNumber:r.endLineNumberExclusive),f=new Ht(d?d.modified.endLineNumberExclusive:a.startLineNumber,u?u.modified.startLineNumber:a.endLineNumberExclusive);h.forEach(g=>{o.push(new mRe(g,f.startLineNumber+(g-h.startLineNumber)))}),u&&(u.original.forEach(g=>{o.push(new gRe(u,g))}),u.modified.forEach(g=>{o.push(new pRe(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 hRe(new kd(l,c),o))}return i}var ko;(function(n){n[n.Header=0]="Header",n[n.Unchanged=1]="Unchanged",n[n.Deleted=2]="Deleted",n[n.Added=3]="Added"})(ko||(ko={}));class hRe{constructor(e,t){this.range=e,this.lines=t}}class fRe{constructor(){this.type=ko.Header}}class gRe{constructor(e,t){this.diff=e,this.originalLineNumber=t,this.type=ko.Deleted,this.modifiedLineNumber=void 0}}class pRe{constructor(e,t){this.diff=e,this.modifiedLineNumber=t,this.type=ko.Added,this.originalLineNumber=void 0}}class mRe{constructor(e,t){this.originalLineNumber=e,this.modifiedLineNumber=t,this.type=ko.Unchanged}}let G4=class extends te{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 Pa(a)),this._register(xi(l=>{this._actionBar.clear(),this._model.canClose.read(l)&&this._actionBar.push(new Ro("diffreview.close",m("label.close","Close"),"close-diff-review "+dt.asClassName(dRe),!0,()=>aRe(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 bS(this._content,{})),Es(this.domNode,this._scrollbar.getDomNode(),a),this._register(vt(()=>{Es(this.domNode)})),this._register(If(this.domNode,{width:this._width,height:this._height})),this._register(If(this._content,{width:this._width,height:this._height})),this._register(pr((l,c)=>{this._model.currentGroup.read(l),this._render(c)})),this._register(In(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.")),Vs(s,i.get(50)),Es(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===ko.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),C=b(p.original.length),w=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,C,p.modified.startLineNumber,w));const y=document.createElement("div");y.className="diff-review-cell diff-review-summary",y.appendChild(document.createTextNode("".concat(_+1,"/").concat(v,": @@ -").concat(p.original.startLineNumber,",").concat(p.original.length," +").concat(p.modified.startLineNumber,",").concat(p.modified.length," @@"))),g.appendChild(y),h=g}else h=this._createRow(u,c,this._width.get(),t,o,a,i,r,l);s.appendChild(h);const f=Ut(g=>this._model.currentElement.read(g)===u);e.add(xi(g=>{const p=f.read(g);h.tabIndex=p?0:-1,p&&h.focus()})),e.add(ce(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 ko.Added:g="diff-review-row line-insert",p=" char-insert",v=lRe;break;case ko.Deleted:g="diff-review-row line-delete",p=" char-delete",v=cRe;break}const b=document.createElement("div");b.style.minWidth=i+"px",b.className=g,b.setAttribute("role","listitem"),b.ariaLevel="";const C=document.createElement("div");C.className="diff-review-cell",C.style.height="".concat(t,"px"),b.appendChild(C);const w=document.createElement("span");w.style.width=u+"px",w.style.minWidth=u+"px",w.className="diff-review-line-number"+p,e.originalLineNumber!==void 0?w.appendChild(document.createTextNode(String(e.originalLineNumber))):w.innerText=" ",C.appendChild(w);const y=document.createElement("span");y.style.width=f+"px",y.style.minWidth=f+"px",y.style.paddingRight="10px",y.className="diff-review-line-number"+p,e.modifiedLineNumber!==void 0?y.appendChild(document.createTextNode(String(e.modifiedLineNumber))):y.innerText=" ",C.appendChild(y);const L=document.createElement("span");if(L.className=_,v){const D=document.createElement("span");D.className=dt.asClassName(v),D.innerText="  ",L.appendChild(D)}else L.innerText="  ";C.appendChild(L);let S;if(e.modifiedLineNumber!==void 0){let D=this._getLineHtml(l,a,c.tabSize,e.modifiedLineNumber,this._languageService.languageIdCodec);af._ttPolicy&&(D=af._ttPolicy.createHTML(D)),C.insertAdjacentHTML("beforeend",D),S=l.getLineContent(e.modifiedLineNumber)}else{let D=this._getLineHtml(o,s,r.tabSize,e.originalLineNumber,this._languageService.languageIdCodec);af._ttPolicy&&(D=af._ttPolicy.createHTML(D)),C.insertAdjacentHTML("beforeend",D),S=o.getLineContent(e.originalLineNumber)}S.length===0&&(S=m("blankLine","blank"));let k="";switch(e.type){case ko.Unchanged:e.originalLineNumber===e.modifiedLineNumber?k=m({key:"unchangedLine",comment:["The placeholders are contents of the line and should not be translated."]},"{0} unchanged line {1}",S,e.originalLineNumber):k=m("equalLine","{0} original line {1} modified line {2}",S,e.originalLineNumber,e.modifiedLineNumber);break;case ko.Added:k=m("insertLine","+ {0} modified line {1}",S,e.modifiedLineNumber);break;case ko.Deleted:k=m("deleteLine","- {0} original line {1}",S,e.originalLineNumber);break}return b.setAttribute("aria-label",k),b}_getLineHtml(e,t,i,s,o){const r=e.getLineContent(s),a=t.get(50),l=ts.createEmpty(r,o),c=Jr.isBasicASCII(r,e.mightContainNonBasicASCII()),d=Jr.containsRTL(r,c,e.mightContainRTL());return mx(new Eg(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)!==Br.OFF,null)).html}};G4=C7([w7(5,qi)],G4);const _Re=Sn("diff-insert",Me.add,m("diffInsertIcon","Line decoration for inserts in the diff editor.")),Ete=Sn("diff-remove",Me.remove,m("diffRemoveIcon","Line decoration for removals in the diff editor.")),LU=kt.register({className:"line-insert",description:"line-insert",isWholeLine:!0,linesDecorationsClassName:"insert-sign "+dt.asClassName(_Re),marginClassName:"gutter-insert"}),kU=kt.register({className:"line-delete",description:"line-delete",isWholeLine:!0,linesDecorationsClassName:"delete-sign "+dt.asClassName(Ete),marginClassName:"gutter-delete"}),DU=kt.register({className:"line-insert",description:"line-insert",isWholeLine:!0,marginClassName:"gutter-insert"}),EU=kt.register({className:"line-delete",description:"line-delete",isWholeLine:!0,marginClassName:"gutter-delete"}),IU=kt.register({className:"char-insert",description:"char-insert",shouldFillLineOnLineBreak:!0}),vRe=kt.register({className:"char-insert",description:"char-insert",isWholeLine:!0}),bRe=kt.register({className:"char-insert diff-range-empty",description:"char-insert diff-range-empty"}),Y4=kt.register({className:"char-delete",description:"char-delete",shouldFillLineOnLineBreak:!0}),CRe=kt.register({className:"char-delete",description:"char-delete",isWholeLine:!0}),wRe=kt.register({className:"char-delete diff-range-empty",description:"char-delete diff-range-empty"}),yRe=kt.register({description:"diff-editor-arrow-revert-change",glyphMarginHoverMessage:new Bs(void 0,{isTrusted:!0,supportThemeIcons:!0}).appendMarkdown(m("revertChangeHoverMessage","Click to revert change")),glyphMarginClassName:"arrow-revert-change "+dt.asClassName(Me.arrowRight),zIndex:10001});class Tf extends te{constructor(e,t,i,s,o){super(),this._rootElement=e,this._diffModel=t,this._originalEditorLayoutInfo=i,this._modifiedEditorLayoutInfo=s,this._editors=o,this._originalScrollTop=ks(this._editors.original.onDidScrollChange,()=>this._editors.original.getScrollTop()),this._modifiedScrollTop=ks(this._editors.modified.onDidScrollChange,()=>this._editors.modified.getScrollTop()),this._viewZonesChanged=Vr("onDidChangeViewZones",this._editors.modified.onDidChangeViewZones),this.width=Pi(this,0),this._modifiedViewZonesChangedSignal=Vr("modified.onDidChangeViewZones",this._editors.modified.onDidChangeViewZones),this._originalViewZonesChangedSignal=Vr("original.onDidChangeViewZones",this._editors.original.onDidChangeViewZones),this._state=hy((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 C=_.map(x=>{function A(de,_e){const ie=_e.getTopForLineNumber(de.startLineNumber,!0),ne=_e.getTopForLineNumber(de.endLineNumberExclusive,!0);return(ie+ne)/2}const T=A(x.lineRangeMapping.original,this._editors.original),P=this._originalScrollTop.read(h),W=A(x.lineRangeMapping.modified,this._editors.modified),$=this._modifiedScrollTop.read(h),X=T-P,J=W-$,Q=Math.min(T,W),le=Math.max(T,W);return{range:new Bt(Q,le),from:X,to:J,fromWithoutScroll:T,toWithoutScroll:W,move:x}});C.sort(kme(Sa(x=>x.fromWithoutScroll>x.toWithoutScroll,Dme),Sa(x=>x.fromWithoutScroll>x.toWithoutScroll?x.fromWithoutScroll:-x.toWithoutScroll,Mu)));const w=y7.compute(C.map(x=>x.range)),y=10,L=v.verticalScrollbarWidth,S=(w.getTrackCount()-1)*10+y*2,k=L+S+(b.contentLeft-Tf.movedCodeBlockPadding);let D=0;for(const x of C){const A=w.getTrack(D),T=L+y+A*10,P=15,W=15,$=k,X=b.glyphMarginWidth+b.lineNumbersWidth,J=18,Q=document.createElementNS("http://www.w3.org/2000/svg","rect");Q.classList.add("arrow-rectangle"),Q.setAttribute("x","".concat($-X)),Q.setAttribute("y","".concat(x.to-J/2)),Q.setAttribute("width","".concat(X)),Q.setAttribute("height","".concat(J)),this._element.appendChild(Q);const le=document.createElementNS("http://www.w3.org/2000/svg","g"),de=document.createElementNS("http://www.w3.org/2000/svg","path");de.setAttribute("d","M 0 ".concat(x.from," L ").concat(T," ").concat(x.from," L ").concat(T," ").concat(x.to," L ").concat($-W," ").concat(x.to)),de.setAttribute("fill","none"),le.appendChild(de);const _e=document.createElementNS("http://www.w3.org/2000/svg","polygon");_e.classList.add("arrow"),f.add(xi(ie=>{de.classList.toggle("currentMove",x.move===p.activeMovedText.read(ie)),_e.classList.toggle("currentMove",x.move===p.activeMovedText.read(ie))})),_e.setAttribute("points","".concat($-W,",").concat(x.to-P/2," ").concat($,",").concat(x.to," ").concat($-W,",").concat(x.to+P/2)),le.appendChild(_e),this._element.appendChild(le),D++}this.width.set(S,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(vt(()=>this._element.remove())),this._register(xi(h=>{const f=this._originalEditorLayoutInfo.read(h),g=this._modifiedEditorLayoutInfo.read(h);!f||!g||(this._element.style.left="".concat(f.width-f.verticalScrollbarWidth,"px"),this._element.style.height="".concat(f.height,"px"),this._element.style.width="".concat(f.verticalScrollbarWidth+f.contentLeft-Tf.movedCodeBlockPadding+this.width.read(h),"px"))})),this._register(gy(this._state));const r=Ut(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 II(DI(p.lineRangeMapping.original.startLineNumber-1),18),modified:new II(DI(p.lineRangeMapping.modified.startLineNumber-1),18)})):[]});this._register(TI(this._editors.original,r.map(h=>h.map(f=>f.original)))),this._register(TI(this._editors.modified,r.map(h=>h.map(f=>f.modified)))),this._register(pr((h,f)=>{const g=r.read(h);for(const p of g)f.add(new TU(this._editors.original,p.original,p.move,"original",this._diffModel.get())),f.add(new TU(this._editors.modified,p.modified,p.move,"modified",this._diffModel.get()))}));const a=ks(this._editors.original.onDidChangeCursorPosition,()=>this._editors.original.getPosition()),l=ks(this._editors.modified.onDidChangeCursorPosition,()=>this._editors.modified.getPosition()),c=Vr("original.onDidFocusEditorWidget",h=>this._editors.original.onDidFocusEditorWidget(()=>setTimeout(()=>h(void 0),0))),d=Vr("modified.onDidFocusEditorWidget",h=>this._editors.modified.onDidFocusEditorWidget(()=>setTimeout(()=>h(void 0),0)));let u="modified";this._register(eN({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)}))}}Tf.movedCodeBlockPadding=4;class y7{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=V1e(t,Sa(a=>a.intersectWithRangeLength(s),Mu)):(o=t.length,t.push(new $8))),t[o].addRange(s),i.push(o)}return new y7(t.length,i)}constructor(e,t){this._trackCount=e,this.trackPerLineIdx=t}getTrack(e){return this.trackPerLineIdx[e]}getTrackCount(){return this._trackCount}}class TU extends Dte{constructor(e,t,i,s,o){const r=vs("div.diff-hidden-lines-widget");super(e,t,r.root),this._editor=e,this._move=i,this._kind=s,this._diffModel=o,this._nodes=vs("div.diff-moved-code-block",{style:{marginRight:"4px"}},[vs("div.text-content@textContent"),vs("div.action-bar@actionBar")]),r.root.appendChild(this._nodes.root);const a=ks(this._editor.onDidLayoutChange,()=>this._editor.getLayoutInfo());this._register(If(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 Pa(this._nodes.actionBar,{highlightToggledItems:!0})),d=new Ro("",l,"",!1);c.push(d,{icon:!1,label:!0});const u=new Ro("","Compare",dt.asClassName(Me.compareChanges),!0,()=>{this._editor.focus(),this._diffModel.movedTextToCompare.set(this._diffModel.movedTextToCompare.get()===i?void 0:this._move,void 0)});this._register(xi(h=>{const f=this._diffModel.movedTextToCompare.read(h)===i;u.checked=f})),c.push(u,{icon:!1,label:!0})}}class SRe extends te{constructor(e,t,i){super(),this._editors=e,this._diffModel=t,this._options=i,this._decorations=Ut(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?kU:EU}),f.lineRangeMapping.modified.isEmpty||u.push({range:f.lineRangeMapping.modified.toInclusiveRange(),options:l?LU:DU}),f.lineRangeMapping.modified.isEmpty||f.lineRangeMapping.original.isEmpty)f.lineRangeMapping.original.isEmpty||d.push({range:f.lineRangeMapping.original.toInclusiveRange(),options:CRe}),f.lineRangeMapping.modified.isEmpty||u.push({range:f.lineRangeMapping.modified.toInclusiveRange(),options:vRe});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?wRe:Y4}),f.lineRangeMapping.modified.contains(g.modifiedRange.startLineNumber)&&u.push({range:g.modifiedRange,options:g.modifiedRange.isEmpty()&&c?bRe:IU});!f.lineRangeMapping.modified.isEmpty&&this._options.shouldRenderRevertArrows.read(s)&&!a&&u.push({range:I.fromPositions(new Y(f.lineRangeMapping.modified.startLineNumber,1)),options:yRe})}if(a)for(const f of a.changes){const g=f.original.toInclusiveRange();g&&d.push({range:g,options:l?kU:EU});const p=f.modified.toInclusiveRange();p&&u.push({range:p,options:l?LU:DU});for(const _ of f.innerChanges||[])d.push({range:_.originalRange,options:Y4}),u.push({range:_.modifiedRange,options:IU})}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:[Tf.movedCodeBlockPadding,0,Tf.movedCodeBlockPadding,Tf.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(EI(this._editors.original,this._decorations.map(s=>(s==null?void 0:s.originalDecorations)||[]))),this._register(EI(this._editors.modified,this._decorations.map(s=>(s==null?void 0:s.modifiedDecorations)||[])))}}class LRe extends te{constructor(e,t,i){super(),this._options=e,this._domNode=t,this._dimensions=i,this._sashRatio=Pi(this,void 0),this.sashLeft=Ut(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 qs(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(xi(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}}let wv=class{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="".concat(t.id,"/").concat(e):(i="".concat(t.id,"/").concat(e.name),t.children.get(i)!==void 0&&(i="".concat(t.id,"/").concat(e.name,"_").concat(e.range.startLineNumber,"_").concat(e.range.startColumn)));let s=i;for(let o=0;t.children.get(s)!==void 0;o++)s="".concat(i,"_").concat(o);return s}static empty(e){return e.children.size===0}},xU=class extends wv{constructor(e,t,i){super(),this.id=e,this.parent=t,this.symbol=i,this.children=new Map}},kRe=class extends wv{constructor(e,t,i,s){super(),this.id=e,this.parent=t,this.label=i,this.order=s,this.children=new Map}},DRe=class op extends wv{static create(e,t,i){const s=new Tn(i),o=new op(t.uri),r=e.ordered(t),a=r.map((c,d)=>{var u;const h=wv.findId("provider_".concat(d),o),f=new kRe(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||[])op._makeOutlineElement(p,f);return f},g=>(Bn(g),f)).then(g=>{wv.empty(g)?g.remove():o._groups.set(h,g)})}),l=e.onDidChange(()=>{const c=e.ordered(t);yn(c,r)||s.cancel()});return Promise.all(a).then(()=>s.token.isCancellationRequested&&!i.isCancellationRequested?op.create(e,t,i):o._compact()).finally(()=>{s.dispose(),l.dispose()})}static _makeOutlineElement(e,t){const i=wv.findId(e,t),s=new xU(i,t,e);if(e.children)for(const o of e.children)op._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=Pt.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 xU?e.push(t.symbol):e.push(...Pt.map(t.children.values(),i=>i.symbol));return e.sort((t,i)=>I.compareRangesUsingStarts(t.range,i.range))}asListOfDocumentSymbols(){const e=this.getTopLevelSymbols(),t=[];return op._flattenDocumentSymbols(t,e,""),t.sort((i,s)=>Y.compare(I.getStartPosition(i.range),I.getStartPosition(s.range))||Y.compare(I.getEndPosition(s.range),I.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&&op._flattenDocumentSymbols(e,s.children,s.name)}};var Ite=globalThis&&globalThis.__decorate||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},Tte=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},ERe=globalThis&&globalThis.__awaiter||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 Z4=class extends te{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=hy(this,(c,d)=>{const u=this._editors.modifiedModel.read(c);if(u)return d.add(new X4(this._languageFeaturesService,u))}),this._register(this._editors.original.onDidChangeCursorPosition(c=>{if(c.reason===3){const d=this._diffModel.get();Gi(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();Gi(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=hy(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=Ut(C=>_.getHiddenOriginalRange(C).startLineNumber-1),b=new II(v,24);h.push(b),d.add(new NU(this._editors.original,b,_,_.originalUnchangedRange,!g,u,C=>this._diffModel.get().ensureModifiedLineIsVisible(C,void 0),this._options))}{const v=Ut(C=>_.getHiddenModifiedRange(C).startLineNumber-1),b=new II(v,24);f.push(b),d.add(new NU(this._editors.modified,b,_,_.modifiedUnchangedRange,!1,u,C=>this._diffModel.get().ensureModifiedLineIsVisible(C,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 Bs(void 0,{isTrusted:!0,supportThemeIcons:!0}).appendMarkdown(m("foldUnchanged","Fold Unchanged Region")),glyphMarginClassName:"fold-unchanged "+dt.asClassName(Me.fold),zIndex:10001};this._register(EI(this._editors.original,Ut(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:I.fromPositions(new Y(h.originalLineNumber,1)),options:l});return u}))),this._register(EI(this._editors.modified,Ut(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:Ht.ofLength(h.modifiedLineNumber,1).toInclusiveRange(),options:l});return u}))),this._register(TI(this._editors.original,r.map(c=>c.origViewZones),c=>this._isUpdatingViewZones=c)),this._register(TI(this._editors.modified,r.map(c=>c.modViewZones),c=>this._isUpdatingViewZones=c)),this._register(xi(c=>{const d=o.read(c);this._editors.original.setHiddenAreas(d.map(u=>u.getHiddenOriginalRange(c).toInclusiveRange()).filter(uw)),this._editors.modified.setHiddenAreas(d.map(u=>u.getHiddenModifiedRange(c).toInclusiveRange()).filter(uw))})),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()}}))}};Z4=Ite([Tte(3,Ze)],Z4);let X4=class extends te{constructor(e,t){super(),this._languageFeaturesService=e,this._textModel=t,this._currentModel=Pi(this,void 0);const i=Vr("documentSymbolProvider.onDidChange",this._languageFeaturesService.documentSymbolProvider.onDidChange),s=Vr("_textModel.onDidChangeContent",We.debounce(o=>this._textModel.onDidChangeContent(o),()=>{},100));this._register(pr((o,r)=>ERe(this,void 0,void 0,function*(){i.read(o),s.read(o);const a=r.add(new rRe),l=yield DRe.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(qZ(Sa(o=>o.range.endLineNumber-o.range.startLineNumber,Mu))),s.map(o=>({name:o.name,kind:o.kind,startLineNumber:o.range.startLineNumber}))}};X4=Ite([Tte(0,Ze)],X4);class NU extends Dte{constructor(e,t,i,s,o,r,a,l){const c=vs("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=vs("div.diff-hidden-lines",[vs("div.top@top",{title:m("diff.hiddenLines.top","Click or drag to show more above")}),vs("div.center@content",{style:{display:"flex"}},[vs("div@first",{style:{display:"flex",justifyContent:"center",alignItems:"center",flexShrink:"0"}},[ye("a",{title:m("showAll","Show all"),role:"button",onclick:()=>{this._unchangedRegion.showAll(void 0)}},...kf("$(unfold)"))]),vs("div@others",{style:{display:"flex",justifyContent:"center",alignItems:"center"}})]),vs("div.bottom@bottom",{title:m("diff.bottom","Click or drag to show more below"),role:"button"})]),c.root.appendChild(this._nodes.root);const d=ks(this._editor.onDidLayoutChange,()=>this._editor.getLayoutInfo());this.hide?Es(this._nodes.first):this._register(If(this._nodes.first,{width:d.map(h=>h.contentLeft)}));const u=this._editor;this._register(ce(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 _=ce(window,"mousemove",b=>{const w=b.clientY-f;g=g||Math.abs(w)>2;const y=Math.round(w/u.getOption(66)),L=Math.max(0,Math.min(p+y,this._unchangedRegion.getMaxVisibleLineCountTop()));this._unchangedRegion.visibleLineCountTop.set(L,void 0)}),v=ce(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(ce(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 _=ce(window,"mousemove",b=>{const w=b.clientY-f;g=g||Math.abs(w)>2;const y=Math.round(w/u.getOption(66)),L=Math.max(0,Math.min(p-y,this._unchangedRegion.getMaxVisibleLineCountBottom())),S=u.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);this._unchangedRegion.visibleLineCountBottom.set(L,void 0);const k=u.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);u.setScrollTop(u.getScrollTop()+(k-S))}),v=ce(window,"mouseup",b=>{if(this._unchangedRegion.isDragged.set(!1,void 0),!g){const C=u.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);this._unchangedRegion.showMoreBelow(this._options.hideUnchangedRegionsRevealLineCount.get(),void 0);const w=u.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);u.setScrollTop(u.getScrollTop()+(w-C))}this._nodes.bottom.classList.toggle("dragging",!1),this._nodes.root.classList.toggle("dragging",!1),_.dispose(),v.dispose()})})),this._register(xi(h=>{const f=[];if(!this.hide){const g=i.getHiddenModifiedRange(h).length,p=m("hiddenLines","{0} hidden lines",g),_=ye("span",{title:m("diff.hiddenLines.expandAll","Double click to unfold")},p);_.addEventListener("dblclick",C=>{C.button===0&&(C.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(ye("span",void 0,"  |  "));for(let C=0;C{this._revealModifiedHiddenLine(w.startLineNumber)}}}}Es(this._nodes.others,...f)}))}}class mc{static capture(e){if(e.getScrollTop()===0||e.hasPendingScrollAnimation())return new mc(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 mc(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 IRe=globalThis&&globalThis.__decorate||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},AU=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},TRe=globalThis&&globalThis.__awaiter||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())})},rp;let xI=rp=class{constructor(e,t,i){this.editorWorkerService=t,this.telemetryService=i,this.onDidChangeEventEmitter=new j,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 TRe(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 Ma(new Ht(1,2),new Ht(1,t.getLineCount()+1),[new Gf(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=rp.diffCache.get(a);if(c&&c.context===l)return c.result;const d=so.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 rp.diffCache.size>10&&rp.diffCache.delete(rp.diffCache.keys().next().value),rp.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()}};xI.diffCache=new Map;xI=rp=IRe([AU(1,Sl),AU(2,ra)],xI);var xRe=globalThis&&globalThis.__decorate||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},NRe=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};const xte=Wt("diffProviderFactoryService");let Q4=class{constructor(e){this.instantiationService=e}createDiffProvider(e,t){return this.instantiationService.createInstance(xI,t)}};Q4=xRe([NRe(0,_t)],Q4);Gt(xte,Q4,1);var ARe=globalThis&&globalThis.__decorate||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},MRe=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},MU=globalThis&&globalThis.__awaiter||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 J4=class extends te{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=Pi(this,!1),this.isDiffUpToDate=this._isDiffUpToDate,this._diff=Pi(this,void 0),this.diff=this._diff,this._unchangedRegions=Pi(this,{regions:[],originalDecorationIds:[],modifiedDecorationIds:[]}),this.unchangedRegions=Ut(this,l=>this._options.hideUnchangedRegions.read(l)?this._unchangedRegions.read(l).regions:(Gi(c=>{for(const d of this._unchangedRegions.get().regions)d.collapseAll(c)}),[])),this.movedTextToCompare=Pi(this,void 0),this._activeMovedText=Pi(this,void 0),this._hoveredMovedText=Pi(this,void 0),this.activeMovedText=Ut(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 Tn,this._diffProvider=Ut(this,l=>{const c=this._diffProviderFactoryService.createDiffProvider(this._editor,{diffAlgorithm:this._options.diffAlgorithm.read(l)}),d=Vr("onDidChange",c.onDidChange);return{diffProvider:c,onChangeSignal:d}}),this._register(vt(()=>this._cancellationTokenSource.cancel()));const o=Lte("contentChangedSignal"),r=this._register(new Si(()=>o.trigger(void 0),200)),a=(l,c,d)=>{const u=NI.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=>Ht.fromRange(v)),g=h.modifiedDecorationIds.map(v=>e.modified.getDecorationRange(v)).filter(v=>!!v).map(v=>Ht.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=Tu.fromModelContentChanges(l.changes);this._lastDiff,e.original,e.modified}r.schedule()})),this._register(e.original.onDidChangeContent(l=>{if(this._diff.get()){const d=Tu.fromModelContentChanges(l.changes);this._lastDiff,e.original,e.modified}r.schedule()})),this._register(pr((l,c)=>MU(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),Fh(TQ,l),Fh(tO,l),this._isDiffUpToDate.set(!1,void 0);let f=[];c.add(e.original.onDidChangeContent(_=>{const v=Tu.fromModelContentChanges(_.changes);f=zE(f,v)}));let g=[];c.add(e.modified.onDidChangeContent(_=>{const v=Tu.fromModelContentChanges(_.changes);g=zE(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=RRe(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,Gi(_=>{a(p,_),this._lastDiff=p;const v=S7.fromDiffResult(p);this._diff.set(v,_),this._isDiffUpToDate.set(!0,_);const b=this.movedTextToCompare.get();this.movedTextToCompare.set(b?this._lastDiff.moves.find(C=>C.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 MU(this,void 0,void 0,function*(){yield XMe(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=>Ht.deserialize(s.range)),i=this._unchangedRegions.get();Gi(s=>{for(const o of i.regions)for(const r of t)if(o.modifiedUnchangedRange.intersect(r)){o.setHiddenModifiedRange(r,s);break}})}};J4=ARe([MRe(3,xte)],J4);function RRe(n,e,t){return{changes:n.changes.map(i=>new Ma(i.original,i.modified,i.innerChanges?i.innerChanges.map(s=>PRe(s,e,t)):void 0)),moves:n.moves,identical:n.identical,quitEarly:n.quitEarly}}function PRe(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 Nte(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 Nte{constructor(e){this.lineRangeMapping=e}}class NI{static fromDiffs(e,t,i,s,o){const r=Ma.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 NI(c,d,u,0,0))):u>=o*2+s&&(c+=o,d+=o,u-=o*2,a.push(new NI(c,d,u,0,0)))}return a}get originalUnchangedRange(){return Ht.ofLength(this.originalLineNumber,this.lineCount)}get modifiedUnchangedRange(){return Ht.ofLength(this.modifiedLineNumber,this.lineCount)}constructor(e,t,i,s,o){this.originalLineNumber=e,this.modifiedLineNumber=t,this.lineCount=i,this._visibleLineCountTop=Pi(this,0),this.visibleLineCountTop=this._visibleLineCountTop,this._visibleLineCountBottom=Pi(this,0),this.visibleLineCountBottom=this._visibleLineCountBottom,this._shouldHideControls=Ut(this,r=>this.visibleLineCountTop.read(r)+this.visibleLineCountBottom.read(r)===this.lineCount&&!this.isDragged.read(r)),this.isDragged=Pi(this,!1),this._visibleLineCountTop.set(s,void 0),this._visibleLineCountBottom.set(o,void 0)}shouldHideControls(e){return this._shouldHideControls.read(e)}getHiddenOriginalRange(e){return Ht.ofLength(this.originalLineNumber+this._visibleLineCountTop.read(e),this.lineCount-this._visibleLineCountTop.read(e)-this._visibleLineCountBottom.read(e))}getHiddenModifiedRange(e){return Ht.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 Ro("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,()=>fR(this,void 0,void 0,function*(){const w=this._originalTextModel.getValueInRange(s.original.toExclusiveRange());yield this._clipboardService.writeText(w)}))),s.original.length>1&&v.push(new Ro("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,()=>fR(this,void 0,void 0,function*(){let w=this._originalTextModel.getLineContent(s.original.startLineNumber+u);w===""&&(w=this._originalTextModel.getEndOfLineSequence()===0?"\n":"\r\n"),yield this._clipboardService.writeText(w)}))),i.getOption(90)||v.push(new Ro("diff.inline.revertChange",m("diff.inline.revertChange.label","Revert this change"),void 0,!0,()=>fR(this,void 0,void 0,function*(){this._editor.revert(this._diff)}))),v},autoSelectFirstItem:!0})};this._register(In(this._diffActions,"mousedown",g=>{const{top:p,height:_}=Un(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}=Un(e),o=t-s,r=Math.floor(o/i),a=r*i;if(this._diffActions.style.top="".concat(a,"px"),this._viewLineCounts){let l=0;for(let c=0;cn});function FRe(n,e,t,i){Vs(i,e.fontInfo);const s=t.length>0,o=new D0(1e4);let r=0,a=0;const l=[];for(let h=0;h');const l=e.getLineContent(),c=Jr.isBasicASCII(l,s),d=Jr.containsRTL(l,c,o),u=gS(new Eg(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!==Br.OFF,null),a);return a.appendString(""),u.characterMapping.getHorizontalOffset(u.characterMapping.length)}var WRe=globalThis&&globalThis.__decorate||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},OU=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let eF=class extends te{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=Pi(this,0),this._originalScrollOffset=Pi(this,0),this._originalScrollOffsetAnimated=SU(this._originalScrollOffset,this._store),this._modifiedTopPadding=Pi(this,0),this._modifiedScrollOffset=Pi(this,0),this._modifiedScrollOffsetAnimated=SU(this._modifiedScrollOffset,this._store);let l=!1;const c=Pi("state",0),d=this._register(new Si(()=>{c.set(c.get()+1,void 0)},0));this._register(this._editors.original.onDidChangeViewZones(w=>{!l&&!this._canIgnoreViewZoneUpdateEvent()&&d.schedule()})),this._register(this._editors.modified.onDidChangeViewZones(w=>{!l&&!this._canIgnoreViewZoneUpdateEvent()&&d.schedule()})),this._register(this._editors.original.onDidChangeConfiguration(w=>{(w.hasChanged(144)||w.hasChanged(66))&&d.schedule()})),this._register(this._editors.modified.onDidChangeConfiguration(w=>{(w.hasChanged(144)||w.hasChanged(66))&&d.schedule()}));const u=this._diffModel.map(w=>w?ks(w.model.original.onDidChangeTokens,()=>w.model.original.tokenization.backgroundTokenizationState===2):void 0).map((w,y)=>w==null?void 0:w.read(y)),h=new Set,f=new Set,g=Ut(w=>{const y=this._diffModel.read(w),L=y==null?void 0:y.diff.read(w);if(!y||!L)return null;c.read(w);const k=this._options.renderSideBySide.read(w);return FU(this._editors.original,this._editors.modified,L.mappings,h,f,k)}),p=Ut(w=>{var y;const L=(y=this._diffModel.read(w))===null||y===void 0?void 0:y.movedTextToCompare.read(w);if(!L)return null;c.read(w);const S=L.changes.map(k=>new Nte(k));return FU(this._editors.original,this._editors.modified,S,h,f,!0)});function _(){const w=document.createElement("div");return w.className="diagonal-fill",w}const v=this._register(new be),b=Ut(w=>{var y,L,S,k,D,x,A,T;v.clear();const P=g.read(w)||[],W=[],$=[],X=this._modifiedTopPadding.read(w);X>0&&$.push({afterLineNumber:0,domNode:document.createElement("div"),heightInPx:X,showInHiddenAreas:!0,suppressMouseDown:!0});const J=this._originalTopPadding.read(w);J>0&&W.push({afterLineNumber:0,domNode:document.createElement("div"),heightInPx:J,showInHiddenAreas:!0,suppressMouseDown:!0});const Q=this._options.renderSideBySide.read(w),le=Q||(y=this._editors.modified._getViewModel())===null||y===void 0?void 0:y.createLineBreaksComputer();if(le){for(const ze of P)if(ze.diff)for(let It=ze.originalRange.startLineNumber;Itthis._editors.original.getModel().tokenization.getLineTokens(we)),ze.originalRange.mapToLineArray(we=>de[_e++]),Ye,pe),je=[];for(const we of ze.diff.innerChanges||[])je.push(new vC(we.originalRange.delta(-(ze.diff.original.startLineNumber-1)),Y4.className,0));const Z=FRe(Xe,Ee,je,Ke),z=document.createElement("div");if(z.className="inline-deleted-margin-view-zone",Vs(z,Ee.fontInfo),this._options.renderIndicators.read(w))for(let we=0;wekp(ae),z,this._editors.modified,ze.diff,this._diffEditorWidget,Z.viewLineCounts,this._editors.original.getModel(),this._contextMenuService,this._clipboardService));for(let we=0;we1&&W.push({afterLineNumber:ze.originalRange.startLineNumber+we,domNode:_(),heightInPx:(Ne-1)*ie,showInHiddenAreas:!0,suppressMouseDown:!0})}$.push({afterLineNumber:ze.modifiedRange.startLineNumber-1,domNode:Ke,heightInPx:Z.heightInLines*ie,minWidthInPx:Z.minWidthInPx,marginDomNode:z,setZoneId(we){ae=we},showInHiddenAreas:!0,suppressMouseDown:!0})}const It=document.createElement("div");It.className="gutter-delete",W.push({afterLineNumber:ze.originalRange.endLineNumberExclusive-1,domNode:_(),heightInPx:ze.modifiedHeightInPx,marginDomNode:It,showInHiddenAreas:!0,suppressMouseDown:!0})}else{const It=ze.modifiedHeightInPx-ze.originalHeightInPx;if(It>0){if(ne!=null&&ne.lineRangeMapping.original.delta(-1).deltaLength(2).contains(ze.originalRange.endLineNumberExclusive-1))continue;W.push({afterLineNumber:ze.originalRange.endLineNumberExclusive-1,domNode:_(),heightInPx:It,showInHiddenAreas:!0,suppressMouseDown:!0})}else{let Ke=function(){const je=document.createElement("div");return je.className="arrow-revert-change "+dt.asClassName(Me.arrowRight),ye("div",{},je)};if(ne!=null&&ne.lineRangeMapping.modified.delta(-1).deltaLength(2).contains(ze.modifiedRange.endLineNumberExclusive-1))continue;let Xe;ze.diff&&ze.diff.modified.isEmpty&&this._options.shouldRenderRevertArrows.read(w)&&(Xe=Ke()),$.push({afterLineNumber:ze.modifiedRange.endLineNumberExclusive-1,domNode:_(),heightInPx:-It,marginDomNode:Xe,showInHiddenAreas:!0,suppressMouseDown:!0})}}for(const ze of(T=p.read(w))!==null&&T!==void 0?T:[]){if(!(ne!=null&&ne.lineRangeMapping.original.intersect(ze.originalRange))||!(ne!=null&&ne.lineRangeMapping.modified.intersect(ze.modifiedRange)))continue;const It=ze.modifiedHeightInPx-ze.originalHeightInPx;It>0?W.push({afterLineNumber:ze.originalRange.endLineNumberExclusive-1,domNode:_(),heightInPx:It,showInHiddenAreas:!0,suppressMouseDown:!0}):$.push({afterLineNumber:ze.modifiedRange.endLineNumberExclusive-1,domNode:_(),heightInPx:-It,showInHiddenAreas:!0,suppressMouseDown:!0})}return{orig:W,mod:$}});this._register(pr(w=>{const y=mc.capture(this._editors.modified),L=b.read(w);l=!0,this._editors.original.changeViewZones(S=>{for(const k of h)S.removeZone(k);h.clear();for(const k of L.orig){const D=S.addZone(k);k.setZoneId&&k.setZoneId(D),h.add(D)}}),this._editors.modified.changeViewZones(S=>{for(const k of f)S.removeZone(k);f.clear();for(const k of L.mod){const D=S.addZone(k);k.setZoneId&&k.setZoneId(D),f.add(D)}}),l=!1,y.restore(this._editors.modified)})),this._register(vt(()=>{this._editors.original.changeViewZones(w=>{for(const y of h)w.removeZone(y);h.clear()}),this._editors.modified.changeViewZones(w=>{for(const y of f)w.removeZone(y);f.clear()})}));let C=!1;this._register(this._editors.original.onDidScrollChange(w=>{w.scrollLeftChanged&&!C&&(C=!0,this._editors.modified.setScrollLeft(w.scrollLeft),C=!1)})),this._register(this._editors.modified.onDidScrollChange(w=>{w.scrollLeftChanged&&!C&&(C=!0,this._editors.original.setScrollLeft(w.scrollLeft),C=!1)})),this._originalScrollTop=ks(this._editors.original.onDidScrollChange,()=>this._editors.original.getScrollTop()),this._modifiedScrollTop=ks(this._editors.modified.onDidScrollChange,()=>this._editors.modified.getScrollTop()),this._register(xi(w=>{const y=this._originalScrollTop.read(w)-(this._originalScrollOffsetAnimated.get()-this._modifiedScrollOffsetAnimated.read(w))-(this._originalTopPadding.get()-this._modifiedTopPadding.read(w));y!==this._editors.modified.getScrollTop()&&this._editors.modified.setScrollTop(y,1)})),this._register(xi(w=>{const y=this._modifiedScrollTop.read(w)-(this._modifiedScrollOffsetAnimated.get()-this._originalScrollOffsetAnimated.read(w))-(this._modifiedTopPadding.get()-this._originalTopPadding.read(w));y!==this._editors.original.getScrollTop()&&this._editors.original.setScrollTop(y,1)})),this._register(xi(w=>{var y;const L=(y=this._diffModel.read(w))===null||y===void 0?void 0:y.movedTextToCompare.read(w);let S=0;if(L){const k=this._editors.original.getTopForLineNumber(L.lineRangeMapping.original.startLineNumber,!0)-this._originalTopPadding.get();S=this._editors.modified.getTopForLineNumber(L.lineRangeMapping.modified.startLineNumber,!0)-this._modifiedTopPadding.get()-k}S>0?(this._modifiedTopPadding.set(0,void 0),this._originalTopPadding.set(S,void 0)):S<0?(this._modifiedTopPadding.set(-S,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()-S,void 0,!0):this._modifiedScrollOffset.set(this._originalScrollOffset.get()+S,void 0,!0)}))}};eF=WRe([OU(5,ch),OU(6,Cl)],eF);function FU(n,e,t,i,s,o){const r=new Ku(BU(n,i)),a=new Ku(BU(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,C=v?v.lineNumber-h:Number.MAX_VALUE;bC?(a.dequeue(),_={lineNumber:v.lineNumber-h+u,heightInPx:0}):(r.dequeue(),a.dequeue()),d.push({originalRange:Ht.ofLength(_.lineNumber,1),modifiedRange:Ht.ofLength(v.lineNumber,1),originalHeightInPx:l+_.heightInPx,modifiedHeightInPx:c+v.heightInPx,diff:void 0})}}for(const g of t){let C=function(w,y){var L,S,k,D;if(wW.lineNumberW+$.heightInPx,0))!==null&&S!==void 0?S:0,P=(D=(k=a.takeWhile(W=>W.lineNumberW+$.heightInPx,0))!==null&&D!==void 0?D:0;d.push({originalRange:x,modifiedRange:A,originalHeightInPx:x.length*l+T,modifiedHeightInPx:A.length*c+P,diff:g.lineRangeMapping}),b=w,v=y};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 w of p.innerChanges||[])w.originalRange.startColumn>1&&w.modifiedRange.startColumn>1&&C(w.originalRange.startLineNumber,w.modifiedRange.startLineNumber),w.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 Y(l.afterLineNumber,1)).lineNumber;t.push({lineNumber:c,heightInPx:l.height})}return iRe(t,i,l=>l.lineNumber,(l,c)=>({lineNumber:l.lineNumber,heightInPx:l.heightInPx+c.heightInPx}))}var VRe=globalThis&&globalThis.__decorate||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},HRe=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},Pl;let Wu=Pl=class extends te{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=ks(this._themeService.onDidColorThemeChange,()=>this._themeService.getColorTheme()),d=Ut(f=>{const g=c.read(f),p=g.getColor(eye)||(g.getColor(Qwe)||cO).transparent(2),_=g.getColor(tye)||(g.getColor(Jwe)||dO).transparent(2);return{insertColor:p,removeColor:_}}),u=ks(this._editors.modified.onDidScrollChange,()=>this._editors.modified.getScrollTop()),h=ks(this._editors.modified.onDidScrollChange,()=>this._editors.modified.getScrollHeight());this._register(pr((f,g)=>{if(!this._options.renderOverviewRuler.read(f))return;const p=ci(document.createElement("div"));p.setClassName("diffViewport"),p.setPosition("absolute");const _=vs("div.diffOverview",{style:{position:"absolute",top:"0px",width:Pl.ENTIRE_DIFF_OVERVIEW_WIDTH+"px"}}).root;g.add(nk(_,p.domNode)),g.add(In(_,Pe.POINTER_DOWN,v=>{this._editors.modified.delegateVerticalScrollbarPointerDown(v)})),g.add(ce(_,Pe.MOUSE_WHEEL,v=>{this._editors.modified.delegateScrollFromMouseWheelEvent(v)},{passive:!1})),g.add(nk(this._rootElement,_)),g.add(pr((v,b)=>{const C=this._diffModel.read(v),w=this._editors.original.createOverviewRuler("original diffOverviewRuler");w&&(b.add(w),b.add(nk(_,w.getDomNode())));const y=this._editors.modified.createOverviewRuler("modified diffOverviewRuler");if(y&&(b.add(y),b.add(nk(_,y.getDomNode()))),!w||!y)return;const L=Vr("viewZoneChanged",this._editors.original.onDidChangeViewZones),S=Vr("viewZoneChanged",this._editors.modified.onDidChangeViewZones),k=Vr("hiddenRangesChanged",this._editors.original.onDidChangeHiddenAreas),D=Vr("hiddenRangesChanged",this._editors.modified.onDidChangeHiddenAreas);b.add(xi(x=>{var A;L.read(x),S.read(x),k.read(x),D.read(x);const T=d.read(x),P=(A=C==null?void 0:C.diff.read(x))===null||A===void 0?void 0:A.mappings;function W(J,Q,le){const de=le._getViewModel();return de?J.filter(_e=>_e.length>0).map(_e=>{const ie=de.coordinatesConverter.convertModelPositionToViewPosition(new Y(_e.startLineNumber,1)),ne=de.coordinatesConverter.convertModelPositionToViewPosition(new Y(_e.endLineNumberExclusive,1)),Ye=ne.lineNumber-ie.lineNumber;return new SJ(ie.lineNumber,ne.lineNumber,Ye,Q.toString())}):[]}const $=W((P||[]).map(J=>J.lineRangeMapping.original),T.removeColor,this._editors.original),X=W((P||[]).map(J=>J.lineRangeMapping.modified),T.insertColor,this._editors.modified);w==null||w.setZones($),y==null||y.setZones(X)})),b.add(xi(x=>{const A=this._rootHeight.read(x),T=this._rootWidth.read(x),P=this._modifiedEditorLayoutInfo.read(x);if(P){const W=Pl.ENTIRE_DIFF_OVERVIEW_WIDTH-2*Pl.ONE_OVERVIEW_WIDTH;w.setLayout({top:0,height:A,right:W+Pl.ONE_OVERVIEW_WIDTH,width:Pl.ONE_OVERVIEW_WIDTH}),y.setLayout({top:0,height:A,right:0,width:Pl.ONE_OVERVIEW_WIDTH});const $=u.read(x),X=h.read(x),J=this._editors.modified.getOption(102),Q=new Rb(J.verticalHasArrows?J.arrowSize:0,J.verticalScrollbarSize,0,P.height,X,$);p.setTop(Q.getSliderPosition()),p.setHeight(Q.getSliderSize())}else p.setTop(0),p.setHeight(0);_.style.height=A+"px",_.style.left=T-Pl.ENTIRE_DIFF_OVERVIEW_WIDTH+"px",p.setWidth(Pl.ENTIRE_DIFF_OVERVIEW_WIDTH)}))}))}))}};Wu.ONE_OVERVIEW_WIDTH=15;Wu.ENTIRE_DIFF_OVERVIEW_WIDTH=Pl.ONE_OVERVIEW_WIDTH*2;Wu=Pl=VRe([HRe(7,os)],Wu);F("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."));F("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 nN extends te{constructor(){super(...arguments),this._id=++nN.idCounter,this._onDidDispose=this._register(new j),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)}}nN.idCounter=0;var $Re=globalThis&&globalThis.__decorate||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},WU=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let tF=class extends te{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 j),this.original=this._register(this._createLeftHandSideEditor(i.editorOptions.get(),s.originalEditor||{})),this.modified=this._register(this._createRightHandSideEditor(i.editorOptions.get(),s.modifiedEditor||{})),this.modifiedModel=ks(this.modified.onDidChangeModel,()=>this.modified.getModel()),this._register(eN({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()+Wu.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=vc.revealHorizontalRightPadding.defaultValue+Wu.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,""):""}};tF=$Re([WU(5,_t),WU(6,Di)],tF);class zRe{get editorOptions(){return this._options}constructor(e,t){this.diffEditorWidth=t,this.couldShowInlineViewBecauseOfSize=Ut(this,s=>this._options.read(s).renderSideBySide&&this.diffEditorWidth.read(s)<=this._options.read(s).renderSideBySideInlineBreakpoint),this.renderOverviewRuler=Ut(this,s=>this._options.read(s).renderOverviewRuler),this.renderSideBySide=Ut(this,s=>this._options.read(s).renderSideBySide&&!(this._options.read(s).useInlineViewWhenSpaceIsLimited&&this.couldShowInlineViewBecauseOfSize.read(s))),this.readOnly=Ut(this,s=>this._options.read(s).readOnly),this.shouldRenderRevertArrows=Ut(this,s=>!(!this._options.read(s).renderMarginRevertIcon||!this.renderSideBySide.read(s)||this.readOnly.read(s))),this.renderIndicators=Ut(this,s=>this._options.read(s).renderIndicators),this.enableSplitViewResizing=Ut(this,s=>this._options.read(s).enableSplitViewResizing),this.splitViewDefaultRatio=Ut(this,s=>this._options.read(s).splitViewDefaultRatio),this.ignoreTrimWhitespace=Ut(this,s=>this._options.read(s).ignoreTrimWhitespace),this.maxComputationTimeMs=Ut(this,s=>this._options.read(s).maxComputationTime),this.showMoves=Ut(this,s=>this._options.read(s).experimental.showMoves&&this.renderSideBySide.read(s)),this.isInEmbeddedEditor=Ut(this,s=>this._options.read(s).isInEmbeddedEditor),this.diffWordWrap=Ut(this,s=>this._options.read(s).diffWordWrap),this.originalEditable=Ut(this,s=>this._options.read(s).originalEditable),this.diffCodeLens=Ut(this,s=>this._options.read(s).diffCodeLens),this.accessibilityVerbose=Ut(this,s=>this._options.read(s).accessibilityVerbose),this.diffAlgorithm=Ut(this,s=>this._options.read(s).diffAlgorithm),this.showEmptyDecorations=Ut(this,s=>this._options.read(s).experimental.showEmptyDecorations),this.onlyShowAccessibleDiffViewer=Ut(this,s=>this._options.read(s).onlyShowAccessibleDiffViewer),this.hideUnchangedRegions=Ut(this,s=>this._options.read(s).hideUnchangedRegions.enabled),this.hideUnchangedRegionsRevealLineCount=Ut(this,s=>this._options.read(s).hideUnchangedRegions.revealLineCount),this.hideUnchangedRegionsContextLineCount=Ut(this,s=>this._options.read(s).hideUnchangedRegions.contextLineCount),this.hideUnchangedRegionsMinimumLineCount=Ut(this,s=>this._options.read(s).hideUnchangedRegions.minimumLineCount);const i=Object.assign(Object.assign({},e),VU(e,co));this._options=Pi(this,i)}updateOptions(e){const t=VU(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 VU(n,e){var t,i,s,o,r,a,l,c;return{enableSplitViewResizing:rt(n.enableSplitViewResizing,e.enableSplitViewResizing),splitViewDefaultRatio:qme(n.splitViewDefaultRatio,.5,.1,.9),renderSideBySide:rt(n.renderSideBySide,e.renderSideBySide),renderMarginRevertIcon:rt(n.renderMarginRevertIcon,e.renderMarginRevertIcon),maxComputationTime:ep(n.maxComputationTime,e.maxComputationTime,0,1073741824),maxFileSize:ep(n.maxFileSize,e.maxFileSize,0,1073741824),ignoreTrimWhitespace:rt(n.ignoreTrimWhitespace,e.ignoreTrimWhitespace),renderIndicators:rt(n.renderIndicators,e.renderIndicators),originalEditable:rt(n.originalEditable,e.originalEditable),diffCodeLens:rt(n.diffCodeLens,e.diffCodeLens),renderOverviewRuler:rt(n.renderOverviewRuler,e.renderOverviewRuler),diffWordWrap:Dn(n.diffWordWrap,e.diffWordWrap,["off","on","inherit"]),diffAlgorithm:Dn(n.diffAlgorithm,e.diffAlgorithm,["legacy","advanced"],{smart:"legacy",experimental:"advanced"}),accessibilityVerbose:rt(n.accessibilityVerbose,e.accessibilityVerbose),experimental:{showMoves:rt((t=n.experimental)===null||t===void 0?void 0:t.showMoves,e.experimental.showMoves),showEmptyDecorations:rt((i=n.experimental)===null||i===void 0?void 0:i.showEmptyDecorations,e.experimental.showEmptyDecorations)},hideUnchangedRegions:{enabled:rt((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:ep((a=n.hideUnchangedRegions)===null||a===void 0?void 0:a.contextLineCount,e.hideUnchangedRegions.contextLineCount,0,1073741824),minimumLineCount:ep((l=n.hideUnchangedRegions)===null||l===void 0?void 0:l.minimumLineCount,e.hideUnchangedRegions.minimumLineCount,0,1073741824),revealLineCount:ep((c=n.hideUnchangedRegions)===null||c===void 0?void 0:c.revealLineCount,e.hideUnchangedRegions.revealLineCount,0,1073741824)},isInEmbeddedEditor:rt(n.isInEmbeddedEditor,e.isInEmbeddedEditor),onlyShowAccessibleDiffViewer:rt(n.onlyShowAccessibleDiffViewer,e.onlyShowAccessibleDiffViewer),renderSideBySideInlineBreakpoint:ep(n.renderSideBySideInlineBreakpoint,e.renderSideBySideInlineBreakpoint,0,1073741824),useInlineViewWhenSpaceIsLimited:rt(n.useInlineViewWhenSpaceIsLimited,e.useInlineViewWhenSpaceIsLimited)}}var URe=globalThis&&globalThis.__decorate||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},_1=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let vm=class extends nN{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=vs("div.monaco-diff-editor.side-by-side",{style:{position:"relative",height:"100%"}},[vs("div.noModificationsOverlay@overlay",{style:{position:"absolute",height:"100%",visibility:"hidden"}},[ye("span",{},"No Changes")]),vs("div.editor.original@original",{style:{position:"absolute",height:"100%"}}),vs("div.editor.modified@modified",{style:{position:"absolute",height:"100%"}}),vs("div.accessibleDiffViewer@accessibleDiffViewer",{style:{position:"absolute",height:"100%"}})]),this._diffModel=this._register(kI("diffModel",void 0)),this.onDidChangeModel=We.fromObservableLight(this._diffModel),this._contextKeyService=this._register(this._parentContextKeyService.createScoped(this._domElement)),this._instantiationService=this._parentInstantiationService.createChild(new Tx([bt,this._contextKeyService])),this._boundarySashes=Pi(this,void 0),this._accessibleDiffViewerShouldBeVisible=Pi(this,!1),this._accessibleDiffViewerVisible=Ut(this,p=>this._options.onlyShowAccessibleDiffViewer.read(p)?!0:this._accessibleDiffViewerShouldBeVisible.read(p)),this.movedBlocksLinesPart=Pi(this,void 0),this._layoutInfo=Ut(this,p=>{var _,v,b;const C=this._rootSizeObserver.width.read(p),w=this._rootSizeObserver.height.read(p),y=(_=this._sash.read(p))===null||_===void 0?void 0:_.sashLeft.read(p),L=y!=null?y:Math.max(5,this._editors.original.getLayoutInfo().decorationsLeft),S=C-L-(this._options.renderOverviewRuler.read(p)?Wu.ENTIRE_DIFF_OVERVIEW_WIDTH:0),k=(b=(v=this.movedBlocksLinesPart.read(p))===null||v===void 0?void 0:v.width.read(p))!==null&&b!==void 0?b:0,D=L-k;return this.elements.original.style.width=D+"px",this.elements.original.style.left="0px",this.elements.modified.style.width=S+"px",this.elements.modified.style.left=L+"px",this._editors.original.layout({width:D,height:w}),this._editors.modified.layout({width:S,height:w}),{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=We.fromObservableLight(this._diffValue),r.willCreateDiffEditor(),this._contextKeyService.createKey("isInDiffEditor",!0),this._domElement.appendChild(this.elements.root),this._register(vt(()=>this._domElement.removeChild(this.elements.root))),this._rootSizeObserver=this._register(new nRe(this.elements.root,t.dimension)),this._rootSizeObserver.setAutomaticLayout((c=t.automaticLayout)!==null&&c!==void 0?c:!1),this._options=new zRe(t,this._rootSizeObserver.width),this._contextKeyService.createKey(O.isEmbeddedDiffEditor.key,!1);const d=O.isEmbeddedDiffEditor.bindTo(this._contextKeyService);this._register(xi(p=>{d.set(this._options.isInEmbeddedEditor.read(p))}));const u=O.comparingMovedCode.bindTo(this._contextKeyService);this._register(xi(p=>{var _;u.set(!!(!((_=this._diffModel.read(p))===null||_===void 0)&&_.movedTextToCompare.read(p)))}));const h=O.diffEditorRenderSideBySideInlineBreakpointReached.bindTo(this._contextKeyService);this._register(xi(p=>{h.set(this._options.couldShowInlineViewBecauseOfSize.read(p))})),this._editors=this._register(this._instantiationService.createInstance(tF,this.elements.original,this.elements.modified,this._options,i,(p,_,v,b)=>this._createInnerEditor(p,_,v,b))),this._sash=hy(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 LRe(this._options,this.elements.root,{height:this._rootSizeObserver.height,width:this._rootSizeObserver.width.map((C,w)=>C-(this._options.renderOverviewRuler.read(w)?Wu.ENTIRE_DIFF_OVERVIEW_WIDTH:0))}));return _.add(xi(C=>{const w=this._boundarySashes.read(C);w&&b.setBoundarySashes(w)})),b}),this._register(gy(this._sash)),this._register(pr((p,_)=>{this.unchangedRangesFeature=_.add(this._instantiationService.createInstance(Fh(Z4,p),this._editors,this._diffModel,this._options))})),this._register(pr((p,_)=>{_.add(new(Fh(SRe,p))(this._editors,this._diffModel,this._options))})),this._register(pr((p,_)=>{_.add(this._instantiationService.createInstance(Fh(eF,p),this._editors,this._diffModel,this._options,this,()=>this.unchangedRangesFeature.isUpdatingViewZones))})),this._register(pr((p,_)=>{_.add(this._instantiationService.createInstance(Fh(Wu,p),this._editors,this.elements.root,this._diffModel,this._rootSizeObserver.width,this._rootSizeObserver.height,this._layoutInfo.map(v=>v.modifiedEditor),this._options))})),this._register(pr((p,_)=>{this._accessibleDiffViewer=_.add(this._register(this._instantiationService.createInstance(Fh(af,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 C;return(C=v==null?void 0:v.diff.read(b))===null||C===void 0?void 0:C.mappings.map(w=>w.lineRangeMapping)}),this._editors)))}));const f=this._accessibleDiffViewerVisible.map(p=>p?"hidden":"visible");this._register(If(this.elements.modified,{visibility:f})),this._register(If(this.elements.original,{visibility:f})),this._createDiffEditorContributions(),r.addDiffEditor(this),this._register(gy(this._layoutInfo)),this._register(pr((p,_)=>{this.movedBlocksLinesPart.set(_.add(new(Fh(Tf,p))(this.elements.root,this._diffModel,this._layoutInfo.map(v=>v.originalEditor),this._layoutInfo.map(v=>v.modifiedEditor),this._editors)),void 0)})),this._register(If(this.elements.overlay,{width:this._layoutInfo.map((p,_)=>p.originalEditor.width+(this._options.renderSideBySide.read(_)?0:p.modifiedEditor.width)),visibility:Ut(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,C=p.target,w=this._diffModel.get();if(!w)return;const y=(v=w.diff.get())===null||v===void 0?void 0:v.mappings;if(!y)return;const L=y.find(S=>(C==null?void 0:C.detail.afterLineNumber)===S.lineRangeMapping.modified.startLineNumber-1||S.lineRangeMapping.modified.startLineNumber===b);if(!L)return;this.revert(L.lineRangeMapping),p.event.stopPropagation()}})),this._register(We.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(C=>C.lineRangeMapping.modified.contains(p.position.lineNumber));b!=null&&b.lineRangeMapping.modified.isEmpty?this._audioCueService.playAudioCue(Jt.diffLineDeleted,{source:"diffEditor.cursorPositionChanged"}):b!=null&&b.lineRangeMapping.original.isEmpty?this._audioCueService.playAudioCue(Jt.diffLineInserted,{source:"diffEditor.cursorPositionChanged"}):b&&this._audioCueService.playAudioCue(Jt.diffLineModified,{source:"diffEditor.cursorPositionChanged"})}}));const g=this._diffModel.map((p,_)=>p==null?void 0:p.isDiffUpToDate.read(_));this._register(pr((p,_)=>{if(g.read(p)===!1){const v=this._editorProgressService.show(!0,1e3);_.add(vt(()=>v.done()))}}))}_createInnerEditor(e,t,i,s){return e.createInstance(Ob,t,i,s)}_createDiffEditorContributions(){const e=Wv.getDiffEditorContributions();for(const t of e)try{this._register(this._instantiationService.createInstance(t.ctor,this))}catch(i){Dt(i)}}get _targetEditor(){return this._editors.modified}getEditorType(){return fS.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(J4,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),Gi(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?qRe(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=HU(a.getStartPosition(),l),d=HU(a.getEndPosition(),l);r=I.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&&Gi(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&&Gi(i=>{for(const s of t)s.showAll(i)})}};vm=URe([_1(3,bt),_1(4,_t),_1(5,ai),_1(6,MS),_1(7,Tg)],vm);function HU(n,e){const t=DE(e,s=>s.original.startLineNumber<=n.lineNumber);if(!t)return I.fromPositions(n);if(t.original.endLineNumberExclusive<=n.lineNumber){const s=n.lineNumber-t.original.endLineNumberExclusive+t.modified.endLineNumberExclusive;return I.fromPositions(new Y(s,n.column))}if(!t.innerChanges)return I.fromPositions(new Y(t.modified.startLineNumber,1));const i=DE(t.innerChanges,s=>s.originalRange.getStartPosition().isBeforeOrEqual(n));if(!i){const s=n.lineNumber-t.original.startLineNumber+t.modified.startLineNumber;return I.fromPositions(new Y(s,n.column))}if(i.originalRange.containsPosition(n))return i.modifiedRange;{const s=jRe(i.originalRange.getEndPosition(),n);return I.fromPositions(KRe(i.modifiedRange.getEndPosition(),s))}}function jRe(n,e){return n.lineNumber===e.lineNumber?new zw(0,e.column-n.column):new zw(e.lineNumber-n.lineNumber,e.column-1)}function KRe(n,e){return e.lineCount===0?new Y(n.lineNumber,n.column+e.columnCount):new Y(n.lineNumber+e.lineCount,e.columnCount+1)}function qRe(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 k7=globalThis&&globalThis.__decorate||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},Ki=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let GRe=0,$U=!1;function YRe(n){if(!n){if($U)return;$U=!0}ZCe(n||document.body)}let AI=class extends Ob{constructor(e,t,i,s,o,r,a,l,c,d,u,h){const f=Object.assign({},t);f.ariaLabel=f.ariaLabel||nI.editorViewAccessibleLabel,f.ariaLabel=f.ariaLabel+";"+nI.accessibilityHelpMessage,super(e,f,{},i,s,o,r,l,c,d,u,h),a instanceof Ub?this._standaloneKeybindingService=a:this._standaloneKeybindingService=null,YRe(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_"+ ++GRe,o=fe.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"),te.None;const t=e.id,i=e.label,s=fe.and(fe.equals("editorId",this.getId()),fe.deserialize(e.precondition)),o=e.keybindings,r=fe.and(s,fe.deserialize(e.keybindingContext)),a=e.contextMenuGroupId||null,l=e.contextMenuOrder||0,c=(f,...g)=>Promise.resolve(e.run(this,...g)),d=new be,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(Ls.appendMenuItem(M.EditorContext,f))}if(Array.isArray(o))for(const f of o)d.add(this._standaloneKeybindingService.addDynamicKeybinding(u,f,c,r));const h=new LJ(u,i,i,s,(...f)=>Promise.resolve(e.run(this,...f)),this._contextKeyService);return this._actions.set(t,h),d.add(vt(()=>{this._actions.delete(t)})),d}_triggerCommand(e,t){if(this._codeEditorService instanceof YE)try{this._codeEditorService.setActiveCodeEditor(this),super._triggerCommand(e,t)}finally{this._codeEditorService.setActiveCodeEditor(null)}else super._triggerCommand(e,t)}};AI=k7([Ki(2,_t),Ki(3,ai),Ki(4,gn),Ki(5,bt),Ki(6,Di),Ki(7,os),Ki(8,Nn),Ki(9,oh),Ki(10,Ni),Ki(11,Ze)],AI);let iF=class extends AI{constructor(e,t,i,s,o,r,a,l,c,d,u,h,f,g,p){const _=Object.assign({},t);LI(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 C;if(typeof b>"u"){const w=f.getLanguageIdByMimeType(_.language)||_.language||Yr;C=Ate(h,f,_.value||"",w,void 0),this._ownsModel=!0}else C=b,this._ownsModel=!1;if(this._attachModel(C),C){const w={oldModelUrl:null,newModelUrl:C.uri};this._onDidChangeModel.fire(w)}}dispose(){super.dispose()}updateOptions(e){LI(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)}};iF=k7([Ki(2,_t),Ki(3,ai),Ki(4,gn),Ki(5,bt),Ki(6,Di),Ki(7,la),Ki(8,Nn),Ki(9,zt),Ki(10,oh),Ki(11,Zi),Ki(12,qi),Ki(13,Ni),Ki(14,Ze)],iF);let nF=class extends vm{constructor(e,t,i,s,o,r,a,l,c,d,u,h){const f=Object.assign({},t);LI(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){LI(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(AI,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)}};nF=k7([Ki(2,_t),Ki(3,bt),Ki(4,ai),Ki(5,la),Ki(6,Nn),Ki(7,zt),Ki(8,Cl),Ki(9,Tg),Ki(10,ch),Ki(11,MS)],nF);function Ate(n,e,t,i,s){if(t=t||"",!i){const o=t.indexOf("\n");let r=t;return o!==-1&&(r=t.substring(0,o)),zU(n,t,e.createByFilepathOrFirstLine(s||null,r),s)}return zU(n,t,e.createById(i),s)}function zU(n,e,t,i){return n.createModel(e,t,i)}var Mte=globalThis&&globalThis.__awaiter||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 ZRe(n,e,t){return mt.initialize(t||{}).createInstance(iF,n,e)}function XRe(n){return mt.get(ai).onCodeEditorAdd(t=>{n(t)})}function QRe(n){return mt.get(ai).onDiffEditorAdd(t=>{n(t)})}function JRe(){return mt.get(ai).listCodeEditors()}function e2e(){return mt.get(ai).listDiffEditors()}function t2e(n,e,t){return mt.initialize(t||{}).createInstance(nF,n,e)}function i2e(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 n2e(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=fe.deserialize(n.precondition),t=(s,...o)=>fs.runEditorCommand(s,o,e,(r,a,l)=>Promise.resolve(n.run(a,...l))),i=new be;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(Ls.appendMenuItem(M.EditorContext,s))}if(Array.isArray(n.keybindings)){const s=mt.get(Di);if(!(s instanceof Ub))console.warn("Cannot add keybinding because the editor is configured with an unrecognized KeybindingService");else{const o=fe.and(e,fe.deserialize(n.keybindingContext));i.add(s.addDynamicKeybindings(n.keybindings.map(r=>({keybinding:r,command:n.id,when:o}))))}}return i}function s2e(n){return Rte([n])}function Rte(n){const e=mt.get(Di);return e instanceof Ub?e.addDynamicKeybindings(n.map(t=>({keybinding:t.keybinding,command:t.command,commandArgs:t.commandArgs,when:fe.deserialize(t.when)}))):(console.warn("Cannot add keybinding because the editor is configured with an unrecognized KeybindingService"),te.None)}function o2e(n,e,t){const i=mt.get(qi),s=i.getLanguageIdByMimeType(e)||e;return Ate(mt.get(Zi),i,n,s,t)}function r2e(n,e){const t=mt.get(qi),i=t.getLanguageIdByMimeType(e)||e||Yr;n.setLanguage(t.createById(i))}function a2e(n,e,t){n&&mt.get(zd).changeOne(e,n.uri,t)}function l2e(n){mt.get(zd).changeAll(n,[])}function c2e(n){return mt.get(zd).read(n)}function d2e(n){return mt.get(zd).onMarkerChanged(n)}function u2e(n){return mt.get(Zi).getModel(n)}function h2e(){return mt.get(Zi).getModels()}function f2e(n){return mt.get(Zi).onModelAdded(n)}function g2e(n){return mt.get(Zi).onModelRemoved(n)}function p2e(n){return mt.get(Zi).onModelLanguageChanged(t=>{n({model:t.model,oldLanguage:t.oldLanguageId})})}function m2e(n){return SCe(mt.get(Zi),mt.get(Ni),n)}function _2e(n,e){const t=mt.get(qi),i=mt.get(la);return Z8.colorizeElement(i,t,n,e).then(()=>{i.registerEditorContainer(n)})}function v2e(n,e,t){const i=mt.get(qi);return mt.get(la).registerEditorContainer(document.body),Z8.colorize(i,n,e,t)}function b2e(n,e,t=4){return mt.get(la).registerEditorContainer(document.body),Z8.colorizeModelLine(n,e,t)}function C2e(n){const e=nn.get(n);return e||{getInitialState:()=>Eb,tokenize:(t,i,s)=>q8(n,s)}}function w2e(n,e){nn.getOrCreate(e);const t=C2e(e),i=Sd(n),s=[];let o=t.getInitialState();for(let r=0,a=i.length;rMte(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 I2e(){return{create:ZRe,getEditors:JRe,getDiffEditors:e2e,onDidCreateEditor:XRe,onDidCreateDiffEditor:QRe,createDiffEditor:t2e,addCommand:i2e,addEditorAction:n2e,addKeybindingRule:s2e,addKeybindingRules:Rte,createModel:o2e,setModelLanguage:r2e,setModelMarkers:a2e,getModelMarkers:c2e,removeAllMarkers:l2e,onDidChangeMarkers:d2e,getModels:h2e,getModel:u2e,onDidCreateModel:f2e,onWillDisposeModel:g2e,onDidChangeModelLanguage:p2e,createWebWorker:m2e,colorizeElement:_2e,colorize:v2e,colorizeModelLine:b2e,tokenize:w2e,defineTheme:y2e,setTheme:S2e,remeasureFonts:L2e,registerCommand:k2e,registerLinkOpener:D2e,registerEditorOpener:E2e,AccessibilitySupport:Y2,ContentWidgetPositionPreference:tP,CursorChangeReason:iP,DefaultEndOfLine:nP,EditorAutoIndentStrategy:oP,EditorOption:rP,EndOfLinePreference:aP,EndOfLineSequence:lP,MinimapPosition:_P,MouseTargetType:vP,OverlayWidgetPositionPreference:bP,OverviewRulerLane:CP,GlyphMarginLane:cP,RenderLineNumbersType:yP,RenderMinimap:SP,ScrollbarVisibility:kP,ScrollType:LP,TextEditorCursorBlinkingStyle:xP,TextEditorCursorStyle:NP,TrackedRangeStickiness:AP,WrappingIndent:MP,InjectedTextCursorStops:uP,PositionAffinity:wP,ConfigurationChangedEvent:oX,BareFontInfo:$p,FontInfo:OP,TextModelResolvedOptions:cD,FindMatch:Lw,ApplyUpdateResult:pC,EditorZoom:ma,EditorType:fS,EditorOptions:vc}}function T2e(n,e){if(!e||!Array.isArray(e))return!1;for(const t of e)if(!n(t))return!1;return!0}function sk(n,e){return typeof n=="boolean"?n:e}function UU(n,e){return typeof n=="string"?n:e}function x2e(n){const e={};for(const t of n)e[t]=!0;return e}function jU(n,e=!1){e&&(n=n.map(function(i){return i.toLowerCase()}));const t=x2e(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 sF(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?Wi(n,"language definition does not contain attribute '"+r+"', used at: "+e):Wi(n,"attribute reference '"+r+"' must be a string, used at: "+e);return K_(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 N2e(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 Wi(n,"a 'bracket' attribute must be either '@open' or '@close', in rule: "+e);if(t.next){if(typeof t.next!="string")throw Wi(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&&!$Ce(n,$h(n,s,"",[],""))))throw Wi(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=sF(e,"^(?:"+(this.matchOnlyAtLineStart?i.substr(1):i)+")")}setAction(e,t){this.action=oF(e,this.name,t)}}function Pte(n,e){if(!e||typeof e!="object")throw new Error("Monarch: expecting a language definition object");const t={};t.languageId=n,t.includeLF=sk(e.includeLF,!1),t.noThrow=!1,t.maxStack=100,t.start=typeof e.start=="string"?e.start:null,t.ignoreCase=sk(e.ignoreCase,!1),t.unicode=sk(e.unicode,!1),t.tokenPostfix=UU(e.tokenPostfix,"."+t.languageId),t.defaultToken=UU(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 Wi(t,"an 'include' attribute must be a string at: "+r);if(d[0]==="@"&&(d=d.substr(1)),!e.tokenizer[d])throw Wi(t,"include target '"+d+"' is not defined at: "+r);s(r+"."+d,a,e.tokenizer[d])}else{const u=new M2e(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 Wi(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 Wi(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=sk(c.matchOnlyAtLineStart,!1)),u.setRegex(i,c.regex),u.setAction(i,c.action)}a.push(u)}}}if(!e.tokenizer||typeof e.tokenizer!="object")throw Wi(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 Wi(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 Wi(t,"open and close brackets in a 'brackets' attribute must be different: "+a.open+"\n 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:yf(t,a.open),close:yf(t,a.close)});else throw Wi(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 R2e=globalThis&&globalThis.__awaiter||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 P2e(n){kb.registerLanguage(n)}function O2e(){let n=[];return n=n.concat(kb.getLanguages()),n}function F2e(n){return mt.get(qi).languageIdCodec.encodeLanguageId(n)}function B2e(n,e){return mt.withServices(()=>{const i=mt.get(qi).onDidRequestRichLanguageFeatures(s=>{s===n&&(i.dispose(),e())});return i})}function W2e(n,e){return mt.withServices(()=>{const i=mt.get(qi).onDidRequestBasicLanguageFeatures(s=>{s===n&&(i.dispose(),e())});return i})}function V2e(n,e){if(!mt.get(qi).isRegisteredLanguageId(n))throw new Error("Cannot set configuration for unknown language ".concat(n));return mt.get(Ni).register(n,e,100)}class H2e{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 py.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 jT(s.tokens,s.endState)}}class py{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:fR2e(this,void 0,void 0,function*(){const i=yield Promise.resolve(e.create());return i?$2e(i)?Fte(n,i):new Nw(mt.get(qi),mt.get(la),n,Pte(n,i),mt.get(zt)):null}));return nn.registerFactory(n,t)}function j2e(n,e){if(!mt.get(qi).isRegisteredLanguageId(n))throw new Error("Cannot set tokens provider for unknown language ".concat(n));return Ote(e)?D7(n,{create:()=>e}):nn.register(n,Fte(n,e))}function K2e(n,e){const t=i=>new Nw(mt.get(qi),mt.get(la),n,Pte(n,i),mt.get(zt));return Ote(e)?D7(n,{create:()=>e}):nn.register(n,t(e))}function q2e(n,e){return mt.get(Ze).referenceProvider.register(n,e)}function G2e(n,e){return mt.get(Ze).renameProvider.register(n,e)}function Y2e(n,e){return mt.get(Ze).signatureHelpProvider.register(n,e)}function Z2e(n,e){return mt.get(Ze).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 I(s.lineNumber,r.startColumn,s.lineNumber,r.endColumn)),a.range||(a.range=new I(s.lineNumber,s.column,s.lineNumber,s.column)),a})}})}function X2e(n,e){return mt.get(Ze).documentSymbolProvider.register(n,e)}function Q2e(n,e){return mt.get(Ze).documentHighlightProvider.register(n,e)}function J2e(n,e){return mt.get(Ze).linkedEditingRangeProvider.register(n,e)}function ePe(n,e){return mt.get(Ze).definitionProvider.register(n,e)}function tPe(n,e){return mt.get(Ze).implementationProvider.register(n,e)}function iPe(n,e){return mt.get(Ze).typeDefinitionProvider.register(n,e)}function nPe(n,e){return mt.get(Ze).codeLensProvider.register(n,e)}function sPe(n,e,t){return mt.get(Ze).codeActionProvider.register(n,{providedCodeActionKinds:t==null?void 0:t.providedCodeActionKinds,documentation:t==null?void 0:t.documentation,provideCodeActions:(s,o,r,a)=>{const c=mt.get(zd).read({resource:s.uri}).filter(d=>I.areIntersectingOrTouching(d,o));return e.provideCodeActions(s,o,{markers:c,only:r.only,trigger:r.trigger},a)},resolveCodeAction:e.resolveCodeAction})}function oPe(n,e){return mt.get(Ze).documentFormattingEditProvider.register(n,e)}function rPe(n,e){return mt.get(Ze).documentRangeFormattingEditProvider.register(n,e)}function aPe(n,e){return mt.get(Ze).onTypeFormattingEditProvider.register(n,e)}function lPe(n,e){return mt.get(Ze).linkProvider.register(n,e)}function cPe(n,e){return mt.get(Ze).completionProvider.register(n,e)}function dPe(n,e){return mt.get(Ze).colorProvider.register(n,e)}function uPe(n,e){return mt.get(Ze).foldingRangeProvider.register(n,e)}function hPe(n,e){return mt.get(Ze).declarationProvider.register(n,e)}function fPe(n,e){return mt.get(Ze).selectionRangeProvider.register(n,e)}function gPe(n,e){return mt.get(Ze).documentSemanticTokensProvider.register(n,e)}function pPe(n,e){return mt.get(Ze).documentRangeSemanticTokensProvider.register(n,e)}function mPe(n,e){return mt.get(Ze).inlineCompletionsProvider.register(n,e)}function _Pe(n,e){return mt.get(Ze).inlayHintsProvider.register(n,e)}function vPe(){return{register:P2e,getLanguages:O2e,onLanguage:B2e,onLanguageEncountered:W2e,getEncodedLanguageId:F2e,setLanguageConfiguration:V2e,setColorMap:U2e,registerTokensProviderFactory:D7,setTokensProvider:j2e,setMonarchTokensProvider:K2e,registerReferenceProvider:q2e,registerRenameProvider:G2e,registerCompletionItemProvider:cPe,registerSignatureHelpProvider:Y2e,registerHoverProvider:Z2e,registerDocumentSymbolProvider:X2e,registerDocumentHighlightProvider:Q2e,registerLinkedEditingRangeProvider:J2e,registerDefinitionProvider:ePe,registerImplementationProvider:tPe,registerTypeDefinitionProvider:iPe,registerCodeLensProvider:nPe,registerCodeActionProvider:sPe,registerDocumentFormattingEditProvider:oPe,registerDocumentRangeFormattingEditProvider:rPe,registerOnTypeFormattingEditProvider:aPe,registerLinkProvider:lPe,registerColorProvider:dPe,registerFoldingRangeProvider:uPe,registerDeclarationProvider:hPe,registerSelectionRangeProvider:fPe,registerDocumentSemanticTokensProvider:gPe,registerDocumentRangeSemanticTokensProvider:pPe,registerInlineCompletionsProvider:mPe,registerInlayHintsProvider:_Pe,DocumentHighlightKind:sP,CompletionItemKind:Q2,CompletionItemTag:J2,CompletionItemInsertTextRule:X2,SymbolKind:IP,SymbolTag:TP,IndentAction:dP,CompletionTriggerKind:eP,SignatureHelpTriggerKind:EP,InlayHintKind:hP,InlineCompletionTriggerKind:fP,CodeActionTriggerType:Z2,FoldingRangeKind:xo,SelectedSuggestionInfo:wX}}const E7=Wt("IEditorCancelService"),Bte=new Ve("cancellableOperation",!1,m("cancellableOperation","Whether the editor runs a cancellable operation, e.g. like 'Peek References'"));Gt(E7,class{constructor(){this._tokens=new WeakMap}add(n,e){let t=this._tokens.get(n);t||(t=n.invokeWithinContext(s=>{const o=Bte.bindTo(s.get(bt)),r=new To;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 bPe extends Tn{constructor(e,t){super(t),this.editor=e,this._unregister=e.invokeWithinContext(i=>i.get(E7).add(e,this))}dispose(){this._unregister(),super.dispose()}}Re(new class extends fs{constructor(){super({id:"editor.cancelOperation",kbOpts:{weight:100,primary:9},precondition:Bte})}runEditorCommand(n,e){n.get(E7).cancel(e)}});let Wte=class rF{constructor(e,t){if(this.flags=t,this.flags&1){const i=e.getModel();this.modelVersionId=i?sm("{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 rF))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 rF(e,this.flags))}};class tg extends bPe{constructor(e,t,i,s){super(e,s),this._listener=new be,t&4&&this._listener.add(e.onDidChangeCursorPosition(o=>{(!i||!I.containsPosition(i,o.position))&&this.cancel()})),t&2&&this._listener.add(e.onDidChangeCursorSelection(o=>{(!i||!I.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 I7 extends Tn{constructor(e,t){super(t),this._listener=e.onDidChangeContent(()=>this.cancel())}dispose(){this._listener.dispose(),super.dispose()}}function Ad(n){return n&&typeof n.getEditorType=="function"?n.getEditorType()===fS.ICodeEditor:!1}function Vte(n){return n&&typeof n.getEditorType=="function"?n.getEditorType()===fS.IDiffEditor:!1}function CPe(n){return!!n&&typeof n=="object"&&typeof n.onDidChangeActiveEditor=="function"}function Hte(n){return Ad(n)?n:Vte(n)?n.getModifiedEditor():CPe(n)&&Ad(n.activeCodeEditor)?n.activeCodeEditor:null}class jb{static _handleEolEdits(e,t){let i;const s=[];for(const o of t)typeof o.eol=="number"&&(i=o.eol),o.range&&typeof o.text=="string"&&s.push(o);return typeof i=="number"&&e.hasModel()&&e.getModel().pushEOL(i),s}static _isFullModelReplaceEdit(e,t){if(!e.hasModel())return!1;const i=e.getModel(),s=i.validateRange(t.range);return i.getFullModelRange().equalsRange(s)}static execute(e,t,i){i&&e.pushUndoStop();const s=mc.capture(e),o=jb._handleEolEdits(e,t);o.length===1&&jb._isFullModelReplaceEdit(e,o[0])?e.executeEdits("formatEditsCommand",o.map(r=>Yi.replace(I.lift(r.range),r.text))):e.executeEdits("formatEditsCommand",o.map(r=>Yi.replaceMove(I.lift(r.range),r.text))),i&&e.pushUndoStop(),s.restoreRelativeVerticalPositionOfCursor(e)}}class KU{constructor(e){this.value=e,this._lower=e.toLowerCase()}static toKey(e){return typeof e=="string"?e.toLowerCase():e._lower}}class wPe{constructor(e){if(this._set=new Set,e)for(const t of e)this.add(t)}add(e){this._set.add(KU.toKey(e))}has(e){return this._set.has(KU.toKey(e))}}var _c=globalThis&&globalThis.__awaiter||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 T7(n){if(n=n.filter(s=>s.range),!n.length)return;let{range:e}=n[0];for(let s=1;s0&&I.areIntersectingOrTouching(u[h-1],v)?u[h-1]=I.fromPositions(u[h-1].getStartPosition(),v.getEndPosition()):h=u.push(v);const f=v=>_c(this,void 0,void 0,function*(){var b,C;l.trace("[format][provideDocumentRangeFormattingEdits] (request)",(b=e.extensionId)===null||b===void 0?void 0:b.value,v);const w=(yield e.provideDocumentRangeFormattingEdits(c,v,c.getFormattingOptions(),d.token))||[];return l.trace("[format][provideDocumentRangeFormattingEdits] (response)",(C=e.extensionId)===null||C===void 0?void 0:C.value,w),w}),g=(v,b)=>{if(!v.length||!b.length)return!1;const C=v.reduce((w,y)=>I.plusRange(w,y.range),v[0].range);if(!b.some(w=>I.intersectRanges(C,w.range)))return!1;for(const w of v)for(const y of b)if(I.intersectRanges(w.range,y.range))return!0;return!1},p=[],_=[];try{if(typeof e.provideDocumentRangesFormattingEdits=="function"){l.trace("[format][provideDocumentRangeFormattingEdits] (request)",(o=e.extensionId)===null||o===void 0?void 0:o.value,u);const v=(yield e.provideDocumentRangesFormattingEdits(c,u,c.getFormattingOptions(),d.token))||[];l.trace("[format][provideDocumentRangeFormattingEdits] (response)",(r=e.extensionId)===null||r===void 0?void 0:r.value,v),_.push(v)}else{for(const v of u){if(d.token.isCancellationRequested)return!0;_.push(yield f(v))}for(let v=0;v({text:C.text,range:I.lift(C.range),forceMoveMarkers:!0})),C=>{for(const{range:w}of C)if(I.areIntersectingOrTouching(w,b))return[new Je(w.startLineNumber,w.startColumn,w.endLineNumber,w.endColumn)];return null})}return!0})}function SPe(n,e,t,i,s){return _c(this,void 0,void 0,function*(){const o=n.get(_t),r=n.get(Ze),a=Ad(e)?e.getModel():e,l=$te(r.documentFormattingEditProvider,r.documentRangeFormattingEditProvider,a),c=yield bm.select(l,a,t);c&&(i.report(c),yield o.invokeFunction(LPe,c,e,t,s))})}function LPe(n,e,t,i,s){return _c(this,void 0,void 0,function*(){const o=n.get(Sl);let r,a;Ad(t)?(r=t.getModel(),a=new tg(t,5,void 0,s)):(r=t,a=new I7(t,s));let l;try{const c=yield e.provideDocumentFormattingEdits(r,r.getFormattingOptions(),a.token);if(l=yield o.computeMoreMinimalEdits(r.uri,c),a.token.isCancellationRequested)return!0}finally{a.dispose()}if(!l||l.length===0)return!1;if(Ad(t))jb.execute(t,l,i!==2),i!==2&&(T7(l),t.revealPositionInCenterIfOutsideViewport(t.getPosition(),1));else{const[{range:c}]=l,d=new Je(c.startLineNumber,c.startColumn,c.endLineNumber,c.endColumn);r.pushEditOperations([d],l.map(u=>({text:u.text,range:I.lift(u.range),forceMoveMarkers:!0})),u=>{for(const{range:h}of u)if(I.areIntersectingOrTouching(h,d))return[new Je(h.startLineNumber,h.startColumn,h.endLineNumber,h.endColumn)];return null})}return!0})}function kPe(n,e,t,i,s,o){return _c(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(Bn);if(io(l))return yield n.computeMoreMinimalEdits(t.uri,l)}})}function DPe(n,e,t,i,s){return _c(this,void 0,void 0,function*(){const o=$te(e.documentFormattingEditProvider,e.documentRangeFormattingEditProvider,t);for(const r of o){const a=yield Promise.resolve(r.provideDocumentFormattingEdits(t,i,s)).catch(Bn);if(io(a))return yield n.computeMoreMinimalEdits(t.uri,a)}})}function Ute(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(Bn).then(l=>n.computeMoreMinimalEdits(t.uri,l))}qt.registerCommand("_executeFormatRangeProvider",function(n,...e){return _c(this,void 0,void 0,function*(){const[t,i,s]=e;bi(ct.isUri(t)),bi(I.isIRange(i));const o=n.get(sr),r=n.get(Sl),a=n.get(Ze),l=yield o.createModelReference(t);try{return kPe(r,a,l.object.textEditorModel,I.lift(i),s,Ft.None)}finally{l.dispose()}})});qt.registerCommand("_executeFormatDocumentProvider",function(n,...e){return _c(this,void 0,void 0,function*(){const[t,i]=e;bi(ct.isUri(t));const s=n.get(sr),o=n.get(Sl),r=n.get(Ze),a=yield s.createModelReference(t);try{return DPe(o,r,a.object.textEditorModel,i,Ft.None)}finally{a.dispose()}})});qt.registerCommand("_executeFormatOnTypeProvider",function(n,...e){return _c(this,void 0,void 0,function*(){const[t,i,s,o]=e;bi(ct.isUri(t)),bi(Y.isIPosition(i)),bi(typeof s=="string");const r=n.get(sr),a=n.get(Sl),l=n.get(Ze),c=yield r.createModelReference(t);try{return Ute(a,l,c.object.textEditorModel,Y.lift(i),s,o,Ft.None)}finally{c.dispose()}})});vc.wrappingIndent.defaultValue=0;vc.glyphMargin.defaultValue=!1;vc.autoIndent.defaultValue=3;vc.overviewRulerLanes.defaultValue=2;bm.setFormatterSelector((n,e,t)=>Promise.resolve(n[0]));const Bo=yX();Bo.editor=I2e();Bo.languages=vPe();const EPe=Bo.CancellationTokenSource,IPe=Bo.Emitter,jte=Bo.KeyCode,Kte=Bo.KeyMod,TPe=Bo.Position,xPe=Bo.Range,NPe=Bo.Selection,APe=Bo.SelectionDirection,MPe=Bo.MarkerSeverity,RPe=Bo.MarkerTag,PPe=Bo.Uri,OPe=Bo.Token,aF=Bo.editor,lF=Bo.languages,gR=globalThis.MonacoEnvironment;(gR!=null&&gR.globalAPI||typeof define=="function"&&define.amd)&&(globalThis.monaco=Bo);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 PS=Object.freeze(Object.defineProperty({__proto__:null,CancellationTokenSource:EPe,Emitter:IPe,KeyCode:jte,KeyMod:Kte,MarkerSeverity:MPe,MarkerTag:RPe,Position:TPe,Range:xPe,Selection:NPe,SelectionDirection:APe,Token:OPe,Uri:PPe,editor:aF,languages:lF},Symbol.toStringTag,{value:"Module"})),FPe="modulepreload",BPe=function(n,e){return new URL(n,e).href},qU={},tt=function(e,t,i){if(!t||t.length===0)return e();const s=document.getElementsByTagName("link");return Promise.all(t.map(o=>{if(o=BPe(o,i),o in qU)return;qU[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="'.concat(o,'"]').concat(a)))return;const c=document.createElement("link");if(c.rel=r?"stylesheet":FPe,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 ".concat(o))))})})).then(()=>e()).catch(o=>{const r=new Event("vite:preloadError",{cancelable:!0});if(r.payload=o,window.dispatchEvent(r),!r.defaultPrevented)throw o})};/*!----------------------------------------------------------------------------- +var Pce=Object.defineProperty;var Oce=(n,e,t)=>e in n?Pce(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var an=(n,e,t)=>(Oce(n,typeof e!="symbol"?e+"":e,t),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)}})();function wB(n,e){const t=Object.create(null),i=n.split(",");for(let s=0;s!!t[s.toLowerCase()]:s=>!!t[s]}const Hn={},Nv=[],ic=()=>{},Fce=()=>!1,Bce=/^on[^a-z]/,kT=n=>Bce.test(n),yB=n=>n.startsWith("onUpdate:"),Is=Object.assign,SB=(n,e)=>{const t=n.indexOf(e);t>-1&&n.splice(t,1)},Wce=Object.prototype.hasOwnProperty,ji=(n,e)=>Wce.call(n,e),Xt=Array.isArray,Av=n=>DT(n)==="[object Map]",XG=n=>DT(n)==="[object Set]",mi=n=>typeof n=="function",ns=n=>typeof n=="string",LB=n=>typeof n=="symbol",Kn=n=>n!==null&&typeof n=="object",QG=n=>Kn(n)&&mi(n.then)&&mi(n.catch),JG=Object.prototype.toString,DT=n=>JG.call(n),Vce=n=>DT(n).slice(8,-1),eY=n=>DT(n)==="[object Object]",kB=n=>ns(n)&&n!=="NaN"&&n[0]!=="-"&&""+parseInt(n,10)===n,Uk=wB(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),ET=n=>{const e=Object.create(null);return t=>e[t]||(e[t]=n(t))},Hce=/-(\w)/g,vd=ET(n=>n.replace(Hce,(e,t)=>t?t.toUpperCase():"")),$ce=/\B([A-Z])/g,Hm=ET(n=>n.replace($ce,"-$1").toLowerCase()),IT=ET(n=>n.charAt(0).toUpperCase()+n.slice(1)),kA=ET(n=>n?"on".concat(IT(n)):""),QC=(n,e)=>!Object.is(n,e),jk=(n,e)=>{for(let t=0;t{Object.defineProperty(n,e,{configurable:!0,enumerable:!1,value:t})},h2=n=>{const e=parseFloat(n);return isNaN(e)?n:e},zce=n=>{const e=ns(n)?Number(n):NaN;return isNaN(e)?n:e};let iW;const f2=()=>iW||(iW=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Fe(n){if(Xt(n)){const e={};for(let t=0;t{if(t){const i=t.split(jce);i.length>1&&(e[i[0].trim()]=i[1].trim())}}),e}function B(n){let e="";if(ns(n))e=n;else if(Xt(n))for(let t=0;tns(n)?n:n==null?"":Xt(n)||Kn(n)&&(n.toString===JG||!mi(n.toString))?JSON.stringify(n,iY,2):String(n),iY=(n,e)=>e&&e.__v_isRef?iY(n,e.value):Av(e)?{["Map(".concat(e.size,")")]:[...e.entries()].reduce((t,[i,s])=>(t["".concat(i," =>")]=s,t),{})}:XG(e)?{["Set(".concat(e.size,")")]:[...e.values()]}:Kn(e)&&!Xt(e)&&!eY(e)?String(e):e;let Rl;class Zce{constructor(e=!1){this.detached=e,this._active=!0,this.effects=[],this.cleanups=[],this.parent=Rl,!e&&Rl&&(this.index=(Rl.scopes||(Rl.scopes=[])).push(this)-1)}get active(){return this._active}run(e){if(this._active){const t=Rl;try{return Rl=this,e()}finally{Rl=t}}}on(){Rl=this}off(){Rl=this.parent}stop(e){if(this._active){let t,i;for(t=0,i=this.effects.length;t{const e=new Set(n);return e.w=0,e.n=0,e},nY=n=>(n.w&Ff)>0,sY=n=>(n.n&Ff)>0,Jce=({deps:n})=>{if(n.length)for(let e=0;e{const{deps:e}=n;if(e.length){let t=0;for(let i=0;i{(d==="length"||d>=l)&&a.push(c)})}else switch(t!==void 0&&a.push(r.get(t)),e){case"add":Xt(n)?kB(t)&&a.push(r.get("length")):(a.push(r.get(Op)),Av(n)&&a.push(r.get(p2)));break;case"delete":Xt(n)||(a.push(r.get(Op)),Av(n)&&a.push(r.get(p2)));break;case"set":Av(n)&&a.push(r.get(Op));break}if(a.length===1)a[0]&&m2(a[0]);else{const l=[];for(const c of a)c&&l.push(...c);m2(DB(l))}}function m2(n,e){const t=Xt(n)?n:[...n];for(const i of t)i.computed&&sW(i);for(const i of t)i.computed||sW(i)}function sW(n,e){(n!==ql||n.allowRecurse)&&(n.scheduler?n.scheduler():n.run())}function tde(n,e){var t;return(t=KD.get(n))==null?void 0:t.get(e)}const ide=wB("__proto__,__v_isRef,__isVue"),aY=new Set(Object.getOwnPropertyNames(Symbol).filter(n=>n!=="arguments"&&n!=="caller").map(n=>Symbol[n]).filter(LB)),nde=IB(),sde=IB(!1,!0),ode=IB(!0),oW=rde();function rde(){const n={};return["includes","indexOf","lastIndexOf"].forEach(e=>{n[e]=function(...t){const i=Hi(this);for(let o=0,r=this.length;o{n[e]=function(...t){g0();const i=Hi(this)[e].apply(this,t);return p0(),i}}),n}function ade(n){const e=Hi(this);return Zr(e,"has",n),e.hasOwnProperty(n)}function IB(n=!1,e=!1){return function(i,s,o){if(s==="__v_isReactive")return!n;if(s==="__v_isReadonly")return n;if(s==="__v_isShallow")return e;if(s==="__v_raw"&&o===(n?e?Sde:hY:e?uY:dY).get(i))return i;const r=Xt(i);if(!n){if(r&&ji(oW,s))return Reflect.get(oW,s,o);if(s==="hasOwnProperty")return ade}const a=Reflect.get(i,s,o);return(LB(s)?aY.has(s):ide(s))||(n||Zr(i,"get",s),e)?a:eo(a)?r&&kB(s)?a:a.value:Kn(a)?n?NB(a):Cn(a):a}}const lde=lY(),cde=lY(!0);function lY(n=!1){return function(t,i,s,o){let r=t[i];if(im(r)&&eo(r)&&!eo(s))return!1;if(!n&&(!qD(s)&&!im(s)&&(r=Hi(r),s=Hi(s)),!Xt(t)&&eo(r)&&!eo(s)))return r.value=s,!0;const a=Xt(t)&&kB(i)?Number(i)n,TT=n=>Reflect.getPrototypeOf(n);function nL(n,e,t=!1,i=!1){n=n.__v_raw;const s=Hi(n),o=Hi(e);t||(e!==o&&Zr(s,"get",e),Zr(s,"get",o));const{has:r}=TT(s),a=i?TB:t?RB:JC;if(r.call(s,e))return a(n.get(e));if(r.call(s,o))return a(n.get(o));n!==s&&n.get(e)}function sL(n,e=!1){const t=this.__v_raw,i=Hi(t),s=Hi(n);return e||(n!==s&&Zr(i,"has",n),Zr(i,"has",s)),n===s?t.has(n):t.has(n)||t.has(s)}function oL(n,e=!1){return n=n.__v_raw,!e&&Zr(Hi(n),"iterate",Op),Reflect.get(n,"size",n)}function rW(n){n=Hi(n);const e=Hi(this);return TT(e).has.call(e,n)||(e.add(n),Uu(e,"add",n,n)),this}function aW(n,e){e=Hi(e);const t=Hi(this),{has:i,get:s}=TT(t);let o=i.call(t,n);o||(n=Hi(n),o=i.call(t,n));const r=s.call(t,n);return t.set(n,e),o?QC(e,r)&&Uu(t,"set",n,e):Uu(t,"add",n,e),this}function lW(n){const e=Hi(this),{has:t,get:i}=TT(e);let s=t.call(e,n);s||(n=Hi(n),s=t.call(e,n)),i&&i.call(e,n);const o=e.delete(n);return s&&Uu(e,"delete",n,void 0),o}function cW(){const n=Hi(this),e=n.size!==0,t=n.clear();return e&&Uu(n,"clear",void 0,void 0),t}function rL(n,e){return function(i,s){const o=this,r=o.__v_raw,a=Hi(r),l=e?TB:n?RB:JC;return!n&&Zr(a,"iterate",Op),r.forEach((c,d)=>i.call(s,l(c),l(d),o))}}function aL(n,e,t){return function(...i){const s=this.__v_raw,o=Hi(s),r=Av(o),a=n==="entries"||n===Symbol.iterator&&r,l=n==="keys"&&r,c=s[n](...i),d=t?TB:e?RB:JC;return!e&&Zr(o,"iterate",l?p2:Op),{next(){const{value:u,done:h}=c.next();return h?{value:u,done:h}:{value:a?[d(u[0]),d(u[1])]:d(u),done:h}},[Symbol.iterator](){return this}}}}function hh(n){return function(...e){return n==="delete"?!1:this}}function pde(){const n={get(o){return nL(this,o)},get size(){return oL(this)},has:sL,add:rW,set:aW,delete:lW,clear:cW,forEach:rL(!1,!1)},e={get(o){return nL(this,o,!1,!0)},get size(){return oL(this)},has:sL,add:rW,set:aW,delete:lW,clear:cW,forEach:rL(!1,!0)},t={get(o){return nL(this,o,!0)},get size(){return oL(this,!0)},has(o){return sL.call(this,o,!0)},add:hh("add"),set:hh("set"),delete:hh("delete"),clear:hh("clear"),forEach:rL(!0,!1)},i={get(o){return nL(this,o,!0,!0)},get size(){return oL(this,!0)},has(o){return sL.call(this,o,!0)},add:hh("add"),set:hh("set"),delete:hh("delete"),clear:hh("clear"),forEach:rL(!0,!0)};return["keys","values","entries",Symbol.iterator].forEach(o=>{n[o]=aL(o,!1,!1),t[o]=aL(o,!0,!1),e[o]=aL(o,!1,!0),i[o]=aL(o,!0,!0)}),[n,t,e,i]}const[mde,_de,vde,bde]=pde();function xB(n,e){const t=e?n?bde:vde:n?_de:mde;return(i,s,o)=>s==="__v_isReactive"?!n:s==="__v_isReadonly"?n:s==="__v_raw"?i:Reflect.get(ji(t,s)&&s in i?t:i,s,o)}const Cde={get:xB(!1,!1)},wde={get:xB(!1,!0)},yde={get:xB(!0,!1)},dY=new WeakMap,uY=new WeakMap,hY=new WeakMap,Sde=new WeakMap;function Lde(n){switch(n){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function kde(n){return n.__v_skip||!Object.isExtensible(n)?0:Lde(Vce(n))}function Cn(n){return im(n)?n:AB(n,!1,cY,Cde,dY)}function Dde(n){return AB(n,!1,gde,wde,uY)}function NB(n){return AB(n,!0,fde,yde,hY)}function AB(n,e,t,i,s){if(!Kn(n)||n.__v_raw&&!(e&&n.__v_isReactive))return n;const o=s.get(n);if(o)return o;const r=kde(n);if(r===0)return n;const a=new Proxy(n,r===2?i:t);return s.set(n,a),a}function Fp(n){return im(n)?Fp(n.__v_raw):!!(n&&n.__v_isReactive)}function im(n){return!!(n&&n.__v_isReadonly)}function qD(n){return!!(n&&n.__v_isShallow)}function MB(n){return Fp(n)||im(n)}function Hi(n){const e=n&&n.__v_raw;return e?Hi(e):n}function fY(n){return jD(n,"__v_skip",!0),n}const JC=n=>Kn(n)?Cn(n):n,RB=n=>Kn(n)?NB(n):n;function gY(n){mf&&ql&&(n=Hi(n),rY(n.dep||(n.dep=DB())))}function pY(n,e){n=Hi(n);const t=n.dep;t&&m2(t)}function eo(n){return!!(n&&n.__v_isRef===!0)}function se(n){return mY(n,!1)}function GD(n){return mY(n,!0)}function mY(n,e){return eo(n)?n:new Ede(n,e)}class Ede{constructor(e,t){this.__v_isShallow=t,this.dep=void 0,this.__v_isRef=!0,this._rawValue=t?e:Hi(e),this._value=t?e:JC(e)}get value(){return gY(this),this._value}set value(e){const t=this.__v_isShallow||qD(e)||im(e);e=t?e:Hi(e),QC(e,this._rawValue)&&(this._rawValue=e,this._value=t?e:JC(e),pY(this))}}function ud(n){return eo(n)?n.value:n}const Ide={get:(n,e,t)=>ud(Reflect.get(n,e,t)),set:(n,e,t,i)=>{const s=n[e];return eo(s)&&!eo(t)?(s.value=t,!0):Reflect.set(n,e,t,i)}};function _Y(n){return Fp(n)?n:new Proxy(n,Ide)}function Tde(n){const e=Xt(n)?new Array(n.length):{};for(const t in n)e[t]=Nde(n,t);return e}class xde{constructor(e,t,i){this._object=e,this._key=t,this._defaultValue=i,this.__v_isRef=!0}get value(){const e=this._object[this._key];return e===void 0?this._defaultValue:e}set value(e){this._object[this._key]=e}get dep(){return tde(Hi(this._object),this._key)}}function Nde(n,e,t){const i=n[e];return eo(i)?i:new xde(n,e,t)}class Ade{constructor(e,t,i,s){this._setter=t,this.dep=void 0,this.__v_isRef=!0,this.__v_isReadonly=!1,this._dirty=!0,this.effect=new EB(e,()=>{this._dirty||(this._dirty=!0,pY(this))}),this.effect.computed=this,this.effect.active=this._cacheable=!s,this.__v_isReadonly=i}get value(){const e=Hi(this);return gY(e),(e._dirty||!e._cacheable)&&(e._dirty=!1,e._value=e.effect.run()),e._value}set value(e){this._setter(e)}}function Mde(n,e,t=!1){let i,s;const o=mi(n);return o?(i=n,s=ic):(i=n.get,s=n.set),new Ade(i,s,o||!s,t)}function _f(n,e,t,i){let s;try{s=i?n(...i):n()}catch(o){xT(o,e,t)}return s}function nl(n,e,t,i){if(mi(n)){const o=_f(n,e,t,i);return o&&QG(o)&&o.catch(r=>{xT(r,e,t)}),o}const s=[];for(let o=0;o>>1;tw(Zo[i])Uc&&Zo.splice(e,1)}function Fde(n){Xt(n)?Mv.push(...n):(!su||!su.includes(n,n.allowRecurse?cp+1:cp))&&Mv.push(n),bY()}function dW(n,e=ew?Uc+1:0){for(;etw(t)-tw(i)),cp=0;cpn.id==null?1/0:n.id,Bde=(n,e)=>{const t=tw(n)-tw(e);if(t===0){if(n.pre&&!e.pre)return-1;if(e.pre&&!n.pre)return 1}return t};function wY(n){_2=!1,ew=!0,Zo.sort(Bde);const e=ic;try{for(Uc=0;Ucns(f)?f.trim():f)),u&&(s=t.map(h2))}let a,l=i[a=kA(e)]||i[a=kA(vd(e))];!l&&o&&(l=i[a=kA(Hm(e))]),l&&nl(l,n,6,s);const c=i[a+"Once"];if(c){if(!n.emitted)n.emitted={};else if(n.emitted[a])return;n.emitted[a]=!0,nl(c,n,6,s)}}function yY(n,e,t=!1){const i=e.emitsCache,s=i.get(n);if(s!==void 0)return s;const o=n.emits;let r={},a=!1;if(!mi(n)){const l=c=>{const d=yY(c,e,!0);d&&(a=!0,Is(r,d))};!t&&e.mixins.length&&e.mixins.forEach(l),n.extends&&l(n.extends),n.mixins&&n.mixins.forEach(l)}return!o&&!a?(Kn(n)&&i.set(n,null),null):(Xt(o)?o.forEach(l=>r[l]=null):Is(r,o),Kn(n)&&i.set(n,r),r)}function NT(n,e){return!n||!kT(e)?!1:(e=e.slice(2).replace(/Once$/,""),ji(n,e[0].toLowerCase()+e.slice(1))||ji(n,Hm(e))||ji(n,e))}let Eo=null,AT=null;function YD(n){const e=Eo;return Eo=n,AT=n&&n.type.__scopeId||null,e}function vg(n){AT=n}function bg(){AT=null}function Lt(n,e=Eo,t){if(!e||n._n)return n;const i=(...s)=>{i._d&&SW(-1);const o=YD(e);let r;try{r=n(...s)}finally{YD(o),i._d&&SW(1)}return r};return i._n=!0,i._c=!0,i._d=!0,i}function DA(n){const{type:e,vnode:t,proxy:i,withProxy:s,props:o,propsOptions:[r],slots:a,attrs:l,emit:c,render:d,renderCache:u,data:h,setupState:f,ctx:g,inheritAttrs:p}=n;let _,v;const b=YD(n);try{if(t.shapeFlag&4){const w=s||i;_=Fc(d.call(w,w,u,o,f,h,g)),v=l}else{const w=e;_=Fc(w.length>1?w(o,{attrs:l,slots:a,emit:c}):w(o,null)),v=e.props?l:Vde(l)}}catch(w){dC.length=0,xT(w,n,1),_=Oe(ya)}let C=_;if(v&&p!==!1){const w=Object.keys(v),{shapeFlag:y}=C;w.length&&y&7&&(r&&w.some(yB)&&(v=Hde(v,r)),C=Bf(C,v))}return t.dirs&&(C=Bf(C),C.dirs=C.dirs?C.dirs.concat(t.dirs):t.dirs),t.transition&&(C.transition=t.transition),_=C,YD(b),_}const Vde=n=>{let e;for(const t in n)(t==="class"||t==="style"||kT(t))&&((e||(e={}))[t]=n[t]);return e},Hde=(n,e)=>{const t={};for(const i in n)(!yB(i)||!(i.slice(9)in e))&&(t[i]=n[i]);return t};function $de(n,e,t){const{props:i,children:s,component:o}=n,{props:r,children:a,patchFlag:l}=e,c=o.emitsOptions;if(e.dirs||e.transition)return!0;if(t&&l>=0){if(l&1024)return!0;if(l&16)return i?uW(i,r,c):!!r;if(l&8){const d=e.dynamicProps;for(let u=0;un.__isSuspense;function jde(n,e){e&&e.pendingBranch?Xt(n)?e.effects.push(...n):e.effects.push(n):Fde(n)}function Kde(n,e){return tS(n,null,e)}function qde(n,e){return tS(n,null,{flush:"post"})}function Gde(n,e){return tS(n,null,{flush:"sync"})}const lL={};function ht(n,e,t){return tS(n,e,t)}function tS(n,e,{immediate:t,deep:i,flush:s,onTrack:o,onTrigger:r}=Hn){var a;const l=Qce()===((a=_o)==null?void 0:a.scope)?_o:null;let c,d=!1,u=!1;if(eo(n)?(c=()=>n.value,d=qD(n)):Fp(n)?(c=()=>n,i=!0):Xt(n)?(u=!0,d=n.some(w=>Fp(w)||qD(w)),c=()=>n.map(w=>{if(eo(w))return w.value;if(Fp(w))return Lp(w);if(mi(w))return _f(w,l,2)})):mi(n)?e?c=()=>_f(n,l,2):c=()=>{if(!(l&&l.isUnmounted))return h&&h(),nl(n,l,3,[f])}:c=ic,e&&i){const w=c;c=()=>Lp(w())}let h,f=w=>{h=b.onStop=()=>{_f(w,l,4)}},g;if(rw)if(f=ic,e?t&&nl(e,l,3,[c(),u?[]:void 0,f]):c(),s==="sync"){const w=Pue();g=w.__watcherHandles||(w.__watcherHandles=[])}else return ic;let p=u?new Array(n.length).fill(lL):lL;const _=()=>{if(b.active)if(e){const w=b.run();(i||d||(u?w.some((y,L)=>QC(y,p[L])):QC(w,p)))&&(h&&h(),nl(e,l,3,[w,p===lL?void 0:u&&p[0]===lL?[]:p,f]),p=w)}else b.run()};_.allowRecurse=!!e;let v;s==="sync"?v=_:s==="post"?v=()=>Ar(_,l&&l.suspense):(_.pre=!0,l&&(_.id=l.uid),v=()=>OB(_));const b=new EB(c,v);e?t?_():p=b.run():s==="post"?Ar(b.run.bind(b),l&&l.suspense):b.run();const C=()=>{b.stop(),l&&l.scope&&SB(l.scope.effects,b)};return g&&g.push(C),C}function Yde(n,e,t){const i=this.proxy,s=ns(n)?n.includes(".")?SY(i,n):()=>i[n]:n.bind(i,i);let o;mi(e)?o=e:(o=e.handler,t=e);const r=_o;ub(this);const a=tS(s,o.bind(i),t);return r?ub(r):Bp(),a}function SY(n,e){const t=e.split(".");return()=>{let i=n;for(let s=0;s{Lp(t,e)});else if(eY(n))for(const t in n)Lp(n[t],e);return n}function wi(n,e){const t=Eo;if(t===null)return n;const i=FT(t)||t.proxy,s=n.dirs||(n.dirs=[]);for(let o=0;o{n.isMounted=!0}),zm(()=>{n.isUnmounting=!0}),n}const ja=[Function,Array],kY={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:ja,onEnter:ja,onAfterEnter:ja,onEnterCancelled:ja,onBeforeLeave:ja,onLeave:ja,onAfterLeave:ja,onLeaveCancelled:ja,onBeforeAppear:ja,onAppear:ja,onAfterAppear:ja,onAppearCancelled:ja},Zde={name:"BaseTransition",props:kY,setup(n,{slots:e}){const t=ih(),i=LY();let s;return()=>{const o=e.default&&FB(e.default(),!0);if(!o||!o.length)return;let r=o[0];if(o.length>1){for(const p of o)if(p.type!==ya){r=p;break}}const a=Hi(n),{mode:l}=a;if(i.isLeaving)return EA(r);const c=hW(r);if(!c)return EA(r);const d=iw(c,a,i,t);nw(c,d);const u=t.subTree,h=u&&hW(u);let f=!1;const{getTransitionKey:g}=c.type;if(g){const p=g();s===void 0?s=p:p!==s&&(s=p,f=!0)}if(h&&h.type!==ya&&(!dp(c,h)||f)){const p=iw(h,a,i,t);if(nw(h,p),l==="out-in")return i.isLeaving=!0,p.afterLeave=()=>{i.isLeaving=!1,t.update.active!==!1&&t.update()},EA(r);l==="in-out"&&c.type!==ya&&(p.delayLeave=(_,v,b)=>{const C=DY(i,h);C[String(h.key)]=h,_._leaveCb=()=>{v(),_._leaveCb=void 0,delete d.delayedLeave},d.delayedLeave=b})}return r}}},Xde=Zde;function DY(n,e){const{leavingVNodes:t}=n;let i=t.get(e.type);return i||(i=Object.create(null),t.set(e.type,i)),i}function iw(n,e,t,i){const{appear:s,mode:o,persisted:r=!1,onBeforeEnter:a,onEnter:l,onAfterEnter:c,onEnterCancelled:d,onBeforeLeave:u,onLeave:h,onAfterLeave:f,onLeaveCancelled:g,onBeforeAppear:p,onAppear:_,onAfterAppear:v,onAppearCancelled:b}=e,C=String(n.key),w=DY(t,n),y=(k,D)=>{k&&nl(k,i,9,D)},L=(k,D)=>{const x=D[1];y(k,D),Xt(k)?k.every(A=>A.length<=1)&&x():k.length<=1&&x()},S={mode:o,persisted:r,beforeEnter(k){let D=a;if(!t.isMounted)if(s)D=p||a;else return;k._leaveCb&&k._leaveCb(!0);const x=w[C];x&&dp(n,x)&&x.el._leaveCb&&x.el._leaveCb(),y(D,[k])},enter(k){let D=l,x=c,A=d;if(!t.isMounted)if(s)D=_||l,x=v||c,A=b||d;else return;let T=!1;const P=k._enterCb=W=>{T||(T=!0,W?y(A,[k]):y(x,[k]),S.delayedLeave&&S.delayedLeave(),k._enterCb=void 0)};D?L(D,[k,P]):P()},leave(k,D){const x=String(n.key);if(k._enterCb&&k._enterCb(!0),t.isUnmounting)return D();y(u,[k]);let A=!1;const T=k._leaveCb=P=>{A||(A=!0,D(),P?y(g,[k]):y(f,[k]),k._leaveCb=void 0,w[x]===n&&delete w[x])};w[x]=n,h?L(h,[k,T]):T()},clone(k){return iw(k,e,t,i)}};return S}function EA(n){if(MT(n))return n=Bf(n),n.children=null,n}function hW(n){return MT(n)?n.children?n.children[0]:void 0:n}function nw(n,e){n.shapeFlag&6&&n.component?nw(n.component.subTree,e):n.shapeFlag&128?(n.ssContent.transition=e.clone(n.ssContent),n.ssFallback.transition=e.clone(n.ssFallback)):n.transition=e}function FB(n,e=!1,t){let i=[],s=0;for(let o=0;o1)for(let o=0;oIs({name:n.name},e,{setup:n}))():n}const rC=n=>!!n.type.__asyncLoader,MT=n=>n.type.__isKeepAlive;function eh(n,e){EY(n,"a",e)}function $m(n,e){EY(n,"da",e)}function EY(n,e,t=_o){const i=n.__wdc||(n.__wdc=()=>{let s=t;for(;s;){if(s.isDeactivated)return;s=s.parent}return n()});if(RT(e,i,t),t){let s=t.parent;for(;s&&s.parent;)MT(s.parent.vnode)&&Qde(i,e,t,s),s=s.parent}}function Qde(n,e,t,i){const s=RT(e,n,i,!0);Cd(()=>{SB(i[e],s)},t)}function RT(n,e,t=_o,i=!1){if(t){const s=t[n]||(t[n]=[]),o=e.__weh||(e.__weh=(...r)=>{if(t.isUnmounted)return;g0(),ub(t);const a=nl(e,t,n,r);return Bp(),p0(),a});return i?s.unshift(o):s.push(o),o}}const th=n=>(e,t=_o)=>(!rw||n==="sp")&&RT(n,(...i)=>e(...i),t),BB=th("bm"),bd=th("m"),IY=th("bu"),Cg=th("u"),zm=th("bum"),Cd=th("um"),Jde=th("sp"),eue=th("rtg"),tue=th("rtc");function iue(n,e=_o){RT("ec",n,e)}const WB="components",nue="directives";function gt(n,e){return VB(WB,n,!0,e)||n}const TY=Symbol.for("v-ndc");function m0(n){return ns(n)?VB(WB,n,!1)||n:n||TY}function hn(n){return VB(nue,n)}function VB(n,e,t=!0,i=!1){const s=Eo||_o;if(s){const o=s.type;if(n===WB){const a=Aue(o,!1);if(a&&(a===e||a===vd(e)||a===IT(vd(e))))return o}const r=fW(s[n]||o[n],e)||fW(s.appContext[n],e);return!r&&i?o:r}}function fW(n,e){return n&&(n[e]||n[vd(e)]||n[IT(vd(e))])}function ss(n,e,t,i){let s;const o=t&&t[i];if(Xt(n)||ns(n)){s=new Array(n.length);for(let r=0,a=n.length;re(r,a,void 0,o&&o[a]));else{const r=Object.keys(n);s=new Array(r.length);for(let a=0,l=r.length;a{const o=i.fn(...s);return o&&(o.key=i.key),o}:i.fn)}return n}function xe(n,e,t={},i,s){if(Eo.isCE||Eo.parent&&rC(Eo.parent)&&Eo.parent.isCE)return e!=="default"&&(t.name=e),Oe("slot",t,i&&i());let o=n[e];o&&o._c&&(o._d=!1),q();const r=o&&xY(o(t)),a=ei(li,{key:t.key||r&&r.key||"_".concat(e)},r||(i?i():[]),r&&n._===1?64:-2);return!s&&a.scopeId&&(a.slotScopeIds=[a.scopeId+"-s"]),o&&o._c&&(o._d=!0),a}function xY(n){return n.some(e=>ow(e)?!(e.type===ya||e.type===li&&!xY(e.children)):!0)?n:null}const v2=n=>n?$Y(n)?FT(n)||n.proxy:v2(n.parent):null,aC=Is(Object.create(null),{$:n=>n,$el:n=>n.vnode.el,$data:n=>n.data,$props:n=>n.props,$attrs:n=>n.attrs,$slots:n=>n.slots,$refs:n=>n.refs,$parent:n=>v2(n.parent),$root:n=>v2(n.root),$emit:n=>n.emit,$options:n=>HB(n),$forceUpdate:n=>n.f||(n.f=()=>OB(n.update)),$nextTick:n=>n.n||(n.n=Fn.bind(n.proxy)),$watch:n=>Yde.bind(n)}),IA=(n,e)=>n!==Hn&&!n.__isScriptSetup&&ji(n,e),sue={get({_:n},e){const{ctx:t,setupState:i,data:s,props:o,accessCache:r,type:a,appContext:l}=n;let c;if(e[0]!=="$"){const f=r[e];if(f!==void 0)switch(f){case 1:return i[e];case 2:return s[e];case 4:return t[e];case 3:return o[e]}else{if(IA(i,e))return r[e]=1,i[e];if(s!==Hn&&ji(s,e))return r[e]=2,s[e];if((c=n.propsOptions[0])&&ji(c,e))return r[e]=3,o[e];if(t!==Hn&&ji(t,e))return r[e]=4,t[e];b2&&(r[e]=0)}}const d=aC[e];let u,h;if(d)return e==="$attrs"&&Zr(n,"get",e),d(n);if((u=a.__cssModules)&&(u=u[e]))return u;if(t!==Hn&&ji(t,e))return r[e]=4,t[e];if(h=l.config.globalProperties,ji(h,e))return h[e]},set({_:n},e,t){const{data:i,setupState:s,ctx:o}=n;return IA(s,e)?(s[e]=t,!0):i!==Hn&&ji(i,e)?(i[e]=t,!0):ji(n.props,e)||e[0]==="$"&&e.slice(1)in n?!1:(o[e]=t,!0)},has({_:{data:n,setupState:e,accessCache:t,ctx:i,appContext:s,propsOptions:o}},r){let a;return!!t[r]||n!==Hn&&ji(n,r)||IA(e,r)||(a=o[0])&&ji(a,r)||ji(i,r)||ji(aC,r)||ji(s.config.globalProperties,r)},defineProperty(n,e,t){return t.get!=null?n._.accessCache[e]=0:ji(t,"value")&&this.set(n,e,t.value,null),Reflect.defineProperty(n,e,t)}};function gW(n){return Xt(n)?n.reduce((e,t)=>(e[t]=null,e),{}):n}let b2=!0;function oue(n){const e=HB(n),t=n.proxy,i=n.ctx;b2=!1,e.beforeCreate&&pW(e.beforeCreate,n,"bc");const{data:s,computed:o,methods:r,watch:a,provide:l,inject:c,created:d,beforeMount:u,mounted:h,beforeUpdate:f,updated:g,activated:p,deactivated:_,beforeDestroy:v,beforeUnmount:b,destroyed:C,unmounted:w,render:y,renderTracked:L,renderTriggered:S,errorCaptured:k,serverPrefetch:D,expose:x,inheritAttrs:A,components:T,directives:P,filters:W}=e;if(c&&rue(c,i,null),r)for(const J in r){const Q=r[J];mi(Q)&&(i[J]=Q.bind(t))}if(s){const J=s.call(t,t);Kn(J)&&(n.data=Cn(J))}if(b2=!0,o)for(const J in o){const Q=o[J],le=mi(Q)?Q.bind(t,t):mi(Q.get)?Q.get.bind(t,t):ic,de=!mi(Q)&&mi(Q.set)?Q.set.bind(t):ic,_e=ve({get:le,set:de});Object.defineProperty(i,J,{enumerable:!0,configurable:!0,get:()=>_e.value,set:ie=>_e.value=ie})}if(a)for(const J in a)NY(a[J],i,t,J);if(l){const J=mi(l)?l.call(t):l;Reflect.ownKeys(J).forEach(Q=>{MY(Q,J[Q])})}d&&pW(d,n,"c");function X(J,Q){Xt(Q)?Q.forEach(le=>J(le.bind(t))):Q&&J(Q.bind(t))}if(X(BB,u),X(bd,h),X(IY,f),X(Cg,g),X(eh,p),X($m,_),X(iue,k),X(tue,L),X(eue,S),X(zm,b),X(Cd,w),X(Jde,D),Xt(x))if(x.length){const J=n.exposed||(n.exposed={});x.forEach(Q=>{Object.defineProperty(J,Q,{get:()=>t[Q],set:le=>t[Q]=le})})}else n.exposed||(n.exposed={});y&&n.render===ic&&(n.render=y),A!=null&&(n.inheritAttrs=A),T&&(n.components=T),P&&(n.directives=P)}function rue(n,e,t=ic){Xt(n)&&(n=C2(n));for(const i in n){const s=n[i];let o;Kn(s)?"default"in s?o=lC(s.from||i,s.default,!0):o=lC(s.from||i):o=lC(s),eo(o)?Object.defineProperty(e,i,{enumerable:!0,configurable:!0,get:()=>o.value,set:r=>o.value=r}):e[i]=o}}function pW(n,e,t){nl(Xt(n)?n.map(i=>i.bind(e.proxy)):n.bind(e.proxy),e,t)}function NY(n,e,t,i){const s=i.includes(".")?SY(t,i):()=>t[i];if(ns(n)){const o=e[n];mi(o)&&ht(s,o)}else if(mi(n))ht(s,n.bind(t));else if(Kn(n))if(Xt(n))n.forEach(o=>NY(o,e,t,i));else{const o=mi(n.handler)?n.handler.bind(t):e[n.handler];mi(o)&&ht(s,o,n)}}function HB(n){const e=n.type,{mixins:t,extends:i}=e,{mixins:s,optionsCache:o,config:{optionMergeStrategies:r}}=n.appContext,a=o.get(e);let l;return a?l=a:!s.length&&!t&&!i?l=e:(l={},s.length&&s.forEach(c=>XD(l,c,r,!0)),XD(l,e,r)),Kn(e)&&o.set(e,l),l}function XD(n,e,t,i=!1){const{mixins:s,extends:o}=e;o&&XD(n,o,t,!0),s&&s.forEach(r=>XD(n,r,t,!0));for(const r in e)if(!(i&&r==="expose")){const a=aue[r]||t&&t[r];n[r]=a?a(n[r],e[r]):e[r]}return n}const aue={data:mW,props:_W,emits:_W,methods:P1,computed:P1,beforeCreate:lr,created:lr,beforeMount:lr,mounted:lr,beforeUpdate:lr,updated:lr,beforeDestroy:lr,beforeUnmount:lr,destroyed:lr,unmounted:lr,activated:lr,deactivated:lr,errorCaptured:lr,serverPrefetch:lr,components:P1,directives:P1,watch:cue,provide:mW,inject:lue};function mW(n,e){return e?n?function(){return Is(mi(n)?n.call(this,this):n,mi(e)?e.call(this,this):e)}:e:n}function lue(n,e){return P1(C2(n),C2(e))}function C2(n){if(Xt(n)){const e={};for(let t=0;t1)return t&&mi(e)?e.call(i&&i.proxy):e}}function hue(n,e,t,i=!1){const s={},o={};jD(o,OT,1),n.propsDefaults=Object.create(null),RY(n,e,s,o);for(const r in n.propsOptions[0])r in s||(s[r]=void 0);t?n.props=i?s:Dde(s):n.type.props?n.props=s:n.props=o,n.attrs=o}function fue(n,e,t,i){const{props:s,attrs:o,vnode:{patchFlag:r}}=n,a=Hi(s),[l]=n.propsOptions;let c=!1;if((i||r>0)&&!(r&16)){if(r&8){const d=n.vnode.dynamicProps;for(let u=0;u{l=!0;const[h,f]=PY(u,e,!0);Is(r,h),f&&a.push(...f)};!t&&e.mixins.length&&e.mixins.forEach(d),n.extends&&d(n.extends),n.mixins&&n.mixins.forEach(d)}if(!o&&!l)return Kn(n)&&i.set(n,Nv),Nv;if(Xt(o))for(let d=0;d-1,f[1]=p<0||g-1||ji(f,"default"))&&a.push(u)}}}const c=[r,a];return Kn(n)&&i.set(n,c),c}function vW(n){return n[0]!=="$"}function bW(n){const e=n&&n.toString().match(/^\s*(function|class) (\w+)/);return e?e[2]:n===null?"null":""}function CW(n,e){return bW(n)===bW(e)}function wW(n,e){return Xt(e)?e.findIndex(t=>CW(t,n)):mi(e)&&CW(e,n)?0:-1}const OY=n=>n[0]==="_"||n==="$stable",$B=n=>Xt(n)?n.map(Fc):[Fc(n)],gue=(n,e,t)=>{if(e._n)return e;const i=Lt((...s)=>$B(e(...s)),t);return i._c=!1,i},FY=(n,e,t)=>{const i=n._ctx;for(const s in n){if(OY(s))continue;const o=n[s];if(mi(o))e[s]=gue(s,o,i);else if(o!=null){const r=$B(o);e[s]=()=>r}}},BY=(n,e)=>{const t=$B(e);n.slots.default=()=>t},pue=(n,e)=>{if(n.vnode.shapeFlag&32){const t=e._;t?(n.slots=Hi(e),jD(e,"_",t)):FY(e,n.slots={})}else n.slots={},e&&BY(n,e);jD(n.slots,OT,1)},mue=(n,e,t)=>{const{vnode:i,slots:s}=n;let o=!0,r=Hn;if(i.shapeFlag&32){const a=e._;a?t&&a===1?o=!1:(Is(s,e),!t&&a===1&&delete s._):(o=!e.$stable,FY(e,s)),r=e}else e&&(BY(n,e),r={default:1});if(o)for(const a in s)!OY(a)&&!(a in r)&&delete s[a]};function y2(n,e,t,i,s=!1){if(Xt(n)){n.forEach((h,f)=>y2(h,e&&(Xt(e)?e[f]:e),t,i,s));return}if(rC(i)&&!s)return;const o=i.shapeFlag&4?FT(i.component)||i.component.proxy:i.el,r=s?null:o,{i:a,r:l}=n,c=e&&e.r,d=a.refs===Hn?a.refs={}:a.refs,u=a.setupState;if(c!=null&&c!==l&&(ns(c)?(d[c]=null,ji(u,c)&&(u[c]=null)):eo(c)&&(c.value=null)),mi(l))_f(l,a,12,[r,d]);else{const h=ns(l),f=eo(l);if(h||f){const g=()=>{if(n.f){const p=h?ji(u,l)?u[l]:d[l]:l.value;s?Xt(p)&&SB(p,o):Xt(p)?p.includes(o)||p.push(o):h?(d[l]=[o],ji(u,l)&&(u[l]=d[l])):(l.value=[o],n.k&&(d[n.k]=l.value))}else h?(d[l]=r,ji(u,l)&&(u[l]=r)):f&&(l.value=r,n.k&&(d[n.k]=r))};r?(g.id=-1,Ar(g,t)):g()}}}const Ar=jde;function _ue(n){return vue(n)}function vue(n,e){const t=f2();t.__VUE__=!0;const{insert:i,remove:s,patchProp:o,createElement:r,createText:a,createComment:l,setText:c,setElementText:d,parentNode:u,nextSibling:h,setScopeId:f=ic,insertStaticContent:g}=n,p=(Z,z,ae,we=null,Ne=null,Ce=null,Be=!1,Ae=null,K=!!z.dynamicChildren)=>{if(Z===z)return;Z&&!dp(Z,z)&&(we=ze(Z),ie(Z,Ne,Ce,!0),Z=null),z.patchFlag===-2&&(K=!1,z.dynamicChildren=null);const{type:V,ref:G,shapeFlag:N}=z;switch(V){case PT:_(Z,z,ae,we);break;case ya:v(Z,z,ae,we);break;case TA:Z==null&&b(z,ae,we,Be);break;case li:T(Z,z,ae,we,Ne,Ce,Be,Ae,K);break;default:N&1?y(Z,z,ae,we,Ne,Ce,Be,Ae,K):N&6?P(Z,z,ae,we,Ne,Ce,Be,Ae,K):(N&64||N&128)&&V.process(Z,z,ae,we,Ne,Ce,Be,Ae,K,Ke)}G!=null&&Ne&&y2(G,Z&&Z.ref,Ce,z||Z,!z)},_=(Z,z,ae,we)=>{if(Z==null)i(z.el=a(z.children),ae,we);else{const Ne=z.el=Z.el;z.children!==Z.children&&c(Ne,z.children)}},v=(Z,z,ae,we)=>{Z==null?i(z.el=l(z.children||""),ae,we):z.el=Z.el},b=(Z,z,ae,we)=>{[Z.el,Z.anchor]=g(Z.children,z,ae,we,Z.el,Z.anchor)},C=({el:Z,anchor:z},ae,we)=>{let Ne;for(;Z&&Z!==z;)Ne=h(Z),i(Z,ae,we),Z=Ne;i(z,ae,we)},w=({el:Z,anchor:z})=>{let ae;for(;Z&&Z!==z;)ae=h(Z),s(Z),Z=ae;s(z)},y=(Z,z,ae,we,Ne,Ce,Be,Ae,K)=>{Be=Be||z.type==="svg",Z==null?L(z,ae,we,Ne,Ce,Be,Ae,K):D(Z,z,Ne,Ce,Be,Ae,K)},L=(Z,z,ae,we,Ne,Ce,Be,Ae)=>{let K,V;const{type:G,props:N,shapeFlag:R,transition:U,dirs:H}=Z;if(K=Z.el=r(Z.type,Ce,N&&N.is,N),R&8?d(K,Z.children):R&16&&k(Z.children,K,null,we,Ne,Ce&&G!=="foreignObject",Be,Ae),H&&zg(Z,null,we,"created"),S(K,Z,Z.scopeId,Be,we),N){for(const Le in N)Le!=="value"&&!Uk(Le)&&o(K,Le,null,N[Le],Ce,Z.children,we,Ne,Ee);"value"in N&&o(K,"value",null,N.value),(V=N.onVnodeBeforeMount)&&Dc(V,we,Z)}H&&zg(Z,null,we,"beforeMount");const he=(!Ne||Ne&&!Ne.pendingBranch)&&U&&!U.persisted;he&&U.beforeEnter(K),i(K,z,ae),((V=N&&N.onVnodeMounted)||he||H)&&Ar(()=>{V&&Dc(V,we,Z),he&&U.enter(K),H&&zg(Z,null,we,"mounted")},Ne)},S=(Z,z,ae,we,Ne)=>{if(ae&&f(Z,ae),we)for(let Ce=0;Ce{for(let V=K;V{const Ae=z.el=Z.el;let{patchFlag:K,dynamicChildren:V,dirs:G}=z;K|=Z.patchFlag&16;const N=Z.props||Hn,R=z.props||Hn;let U;ae&&Ug(ae,!1),(U=R.onVnodeBeforeUpdate)&&Dc(U,ae,z,Z),G&&zg(z,Z,ae,"beforeUpdate"),ae&&Ug(ae,!0);const H=Ne&&z.type!=="foreignObject";if(V?x(Z.dynamicChildren,V,Ae,ae,we,H,Ce):Be||Q(Z,z,Ae,null,ae,we,H,Ce,!1),K>0){if(K&16)A(Ae,z,N,R,ae,we,Ne);else if(K&2&&N.class!==R.class&&o(Ae,"class",null,R.class,Ne),K&4&&o(Ae,"style",N.style,R.style,Ne),K&8){const he=z.dynamicProps;for(let Le=0;Le{U&&Dc(U,ae,z,Z),G&&zg(z,Z,ae,"updated")},we)},x=(Z,z,ae,we,Ne,Ce,Be)=>{for(let Ae=0;Ae{if(ae!==we){if(ae!==Hn)for(const Ae in ae)!Uk(Ae)&&!(Ae in we)&&o(Z,Ae,ae[Ae],null,Be,z.children,Ne,Ce,Ee);for(const Ae in we){if(Uk(Ae))continue;const K=we[Ae],V=ae[Ae];K!==V&&Ae!=="value"&&o(Z,Ae,V,K,Be,z.children,Ne,Ce,Ee)}"value"in we&&o(Z,"value",ae.value,we.value)}},T=(Z,z,ae,we,Ne,Ce,Be,Ae,K)=>{const V=z.el=Z?Z.el:a(""),G=z.anchor=Z?Z.anchor:a("");let{patchFlag:N,dynamicChildren:R,slotScopeIds:U}=z;U&&(Ae=Ae?Ae.concat(U):U),Z==null?(i(V,ae,we),i(G,ae,we),k(z.children,ae,G,Ne,Ce,Be,Ae,K)):N>0&&N&64&&R&&Z.dynamicChildren?(x(Z.dynamicChildren,R,ae,Ne,Ce,Be,Ae),(z.key!=null||Ne&&z===Ne.subTree)&&zB(Z,z,!0)):Q(Z,z,ae,G,Ne,Ce,Be,Ae,K)},P=(Z,z,ae,we,Ne,Ce,Be,Ae,K)=>{z.slotScopeIds=Ae,Z==null?z.shapeFlag&512?Ne.ctx.activate(z,ae,we,Be,K):W(z,ae,we,Ne,Ce,Be,K):$(Z,z,K)},W=(Z,z,ae,we,Ne,Ce,Be)=>{const Ae=Z.component=Eue(Z,we,Ne);if(MT(Z)&&(Ae.ctx.renderer=Ke),Iue(Ae),Ae.asyncDep){if(Ne&&Ne.registerDep(Ae,X),!Z.el){const K=Ae.subTree=Oe(ya);v(null,K,z,ae)}return}X(Ae,Z,z,ae,Ne,Ce,Be)},$=(Z,z,ae)=>{const we=z.component=Z.component;if($de(Z,z,ae))if(we.asyncDep&&!we.asyncResolved){J(we,z,ae);return}else we.next=z,Ode(we.update),we.update();else z.el=Z.el,we.vnode=z},X=(Z,z,ae,we,Ne,Ce,Be)=>{const Ae=()=>{if(Z.isMounted){let{next:G,bu:N,u:R,parent:U,vnode:H}=Z,he=G,Le;Ug(Z,!1),G?(G.el=H.el,J(Z,G,Be)):G=H,N&&jk(N),(Le=G.props&&G.props.onVnodeBeforeUpdate)&&Dc(Le,U,G,H),Ug(Z,!0);const qe=DA(Z),ot=Z.subTree;Z.subTree=qe,p(ot,qe,u(ot.el),ze(ot),Z,Ne,Ce),G.el=qe.el,he===null&&zde(Z,qe.el),R&&Ar(R,Ne),(Le=G.props&&G.props.onVnodeUpdated)&&Ar(()=>Dc(Le,U,G,H),Ne)}else{let G;const{el:N,props:R}=z,{bm:U,m:H,parent:he}=Z,Le=rC(z);if(Ug(Z,!1),U&&jk(U),!Le&&(G=R&&R.onVnodeBeforeMount)&&Dc(G,he,z),Ug(Z,!0),N&&je){const qe=()=>{Z.subTree=DA(Z),je(N,Z.subTree,Z,Ne,null)};Le?z.type.__asyncLoader().then(()=>!Z.isUnmounted&&qe()):qe()}else{const qe=Z.subTree=DA(Z);p(null,qe,ae,we,Z,Ne,Ce),z.el=qe.el}if(H&&Ar(H,Ne),!Le&&(G=R&&R.onVnodeMounted)){const qe=z;Ar(()=>Dc(G,he,qe),Ne)}(z.shapeFlag&256||he&&rC(he.vnode)&&he.vnode.shapeFlag&256)&&Z.a&&Ar(Z.a,Ne),Z.isMounted=!0,z=ae=we=null}},K=Z.effect=new EB(Ae,()=>OB(V),Z.scope),V=Z.update=()=>K.run();V.id=Z.uid,Ug(Z,!0),V()},J=(Z,z,ae)=>{z.component=Z;const we=Z.vnode.props;Z.vnode=z,Z.next=null,fue(Z,z.props,we,ae),mue(Z,z.children,ae),g0(),dW(),p0()},Q=(Z,z,ae,we,Ne,Ce,Be,Ae,K=!1)=>{const V=Z&&Z.children,G=Z?Z.shapeFlag:0,N=z.children,{patchFlag:R,shapeFlag:U}=z;if(R>0){if(R&128){de(V,N,ae,we,Ne,Ce,Be,Ae,K);return}else if(R&256){le(V,N,ae,we,Ne,Ce,Be,Ae,K);return}}U&8?(G&16&&Ee(V,Ne,Ce),N!==V&&d(ae,N)):G&16?U&16?de(V,N,ae,we,Ne,Ce,Be,Ae,K):Ee(V,Ne,Ce,!0):(G&8&&d(ae,""),U&16&&k(N,ae,we,Ne,Ce,Be,Ae,K))},le=(Z,z,ae,we,Ne,Ce,Be,Ae,K)=>{Z=Z||Nv,z=z||Nv;const V=Z.length,G=z.length,N=Math.min(V,G);let R;for(R=0;RG?Ee(Z,Ne,Ce,!0,!1,N):k(z,ae,we,Ne,Ce,Be,Ae,K,N)},de=(Z,z,ae,we,Ne,Ce,Be,Ae,K)=>{let V=0;const G=z.length;let N=Z.length-1,R=G-1;for(;V<=N&&V<=R;){const U=Z[V],H=z[V]=K?Rh(z[V]):Fc(z[V]);if(dp(U,H))p(U,H,ae,null,Ne,Ce,Be,Ae,K);else break;V++}for(;V<=N&&V<=R;){const U=Z[N],H=z[R]=K?Rh(z[R]):Fc(z[R]);if(dp(U,H))p(U,H,ae,null,Ne,Ce,Be,Ae,K);else break;N--,R--}if(V>N){if(V<=R){const U=R+1,H=UR)for(;V<=N;)ie(Z[V],Ne,Ce,!0),V++;else{const U=V,H=V,he=new Map;for(V=H;V<=R;V++){const ft=z[V]=K?Rh(z[V]):Fc(z[V]);ft.key!=null&&he.set(ft.key,V)}let Le,qe=0;const ot=R-H+1;let yt=!1,Et=0;const gi=new Array(ot);for(V=0;V=ot){ie(ft,Ne,Ce,!0);continue}let Ci;if(ft.key!=null)Ci=he.get(ft.key);else for(Le=H;Le<=R;Le++)if(gi[Le-H]===0&&dp(ft,z[Le])){Ci=Le;break}Ci===void 0?ie(ft,Ne,Ce,!0):(gi[Ci-H]=V+1,Ci>=Et?Et=Ci:yt=!0,p(ft,z[Ci],ae,null,Ne,Ce,Be,Ae,K),qe++)}const _i=yt?bue(gi):Nv;for(Le=_i.length-1,V=ot-1;V>=0;V--){const ft=H+V,Ci=z[ft],Xi=ft+1{const{el:Ce,type:Be,transition:Ae,children:K,shapeFlag:V}=Z;if(V&6){_e(Z.component.subTree,z,ae,we);return}if(V&128){Z.suspense.move(z,ae,we);return}if(V&64){Be.move(Z,z,ae,Ke);return}if(Be===li){i(Ce,z,ae);for(let N=0;NAe.enter(Ce),Ne);else{const{leave:N,delayLeave:R,afterLeave:U}=Ae,H=()=>i(Ce,z,ae),he=()=>{N(Ce,()=>{H(),U&&U()})};R?R(Ce,H,he):he()}else i(Ce,z,ae)},ie=(Z,z,ae,we=!1,Ne=!1)=>{const{type:Ce,props:Be,ref:Ae,children:K,dynamicChildren:V,shapeFlag:G,patchFlag:N,dirs:R}=Z;if(Ae!=null&&y2(Ae,null,ae,Z,!0),G&256){z.ctx.deactivate(Z);return}const U=G&1&&R,H=!rC(Z);let he;if(H&&(he=Be&&Be.onVnodeBeforeUnmount)&&Dc(he,z,Z),G&6)pe(Z.component,ae,we);else{if(G&128){Z.suspense.unmount(ae,we);return}U&&zg(Z,null,z,"beforeUnmount"),G&64?Z.type.remove(Z,z,ae,Ne,Ke,we):V&&(Ce!==li||N>0&&N&64)?Ee(V,z,ae,!1,!0):(Ce===li&&N&384||!Ne&&G&16)&&Ee(K,z,ae),we&&ne(Z)}(H&&(he=Be&&Be.onVnodeUnmounted)||U)&&Ar(()=>{he&&Dc(he,z,Z),U&&zg(Z,null,z,"unmounted")},ae)},ne=Z=>{const{type:z,el:ae,anchor:we,transition:Ne}=Z;if(z===li){Ye(ae,we);return}if(z===TA){w(Z);return}const Ce=()=>{s(ae),Ne&&!Ne.persisted&&Ne.afterLeave&&Ne.afterLeave()};if(Z.shapeFlag&1&&Ne&&!Ne.persisted){const{leave:Be,delayLeave:Ae}=Ne,K=()=>Be(ae,Ce);Ae?Ae(Z.el,Ce,K):K()}else Ce()},Ye=(Z,z)=>{let ae;for(;Z!==z;)ae=h(Z),s(Z),Z=ae;s(z)},pe=(Z,z,ae)=>{const{bum:we,scope:Ne,update:Ce,subTree:Be,um:Ae}=Z;we&&jk(we),Ne.stop(),Ce&&(Ce.active=!1,ie(Be,Z,z,ae)),Ae&&Ar(Ae,z),Ar(()=>{Z.isUnmounted=!0},z),z&&z.pendingBranch&&!z.isUnmounted&&Z.asyncDep&&!Z.asyncResolved&&Z.suspenseId===z.pendingId&&(z.deps--,z.deps===0&&z.resolve())},Ee=(Z,z,ae,we=!1,Ne=!1,Ce=0)=>{for(let Be=Ce;BeZ.shapeFlag&6?ze(Z.component.subTree):Z.shapeFlag&128?Z.suspense.next():h(Z.anchor||Z.el),It=(Z,z,ae)=>{Z==null?z._vnode&&ie(z._vnode,null,null,!0):p(z._vnode||null,Z,z,null,null,null,ae),dW(),CY(),z._vnode=Z},Ke={p,um:ie,m:_e,r:ne,mt:W,mc:k,pc:Q,pbc:x,n:ze,o:n};let Xe,je;return e&&([Xe,je]=e(Ke)),{render:It,hydrate:Xe,createApp:uue(It,Xe)}}function Ug({effect:n,update:e},t){n.allowRecurse=e.allowRecurse=t}function zB(n,e,t=!1){const i=n.children,s=e.children;if(Xt(i)&&Xt(s))for(let o=0;o>1,n[t[a]]0&&(e[i]=t[o-1]),t[o]=i)}}for(o=t.length,r=t[o-1];o-- >0;)t[o]=r,r=e[r];return t}const Cue=n=>n.__isTeleport,cC=n=>n&&(n.disabled||n.disabled===""),yW=n=>typeof SVGElement<"u"&&n instanceof SVGElement,S2=(n,e)=>{const t=n&&n.to;return ns(t)?e?e(t):null:t},wue={__isTeleport:!0,process(n,e,t,i,s,o,r,a,l,c){const{mc:d,pc:u,pbc:h,o:{insert:f,querySelector:g,createText:p,createComment:_}}=c,v=cC(e.props);let{shapeFlag:b,children:C,dynamicChildren:w}=e;if(n==null){const y=e.el=p(""),L=e.anchor=p("");f(y,t,i),f(L,t,i);const S=e.target=S2(e.props,g),k=e.targetAnchor=p("");S&&(f(k,S),r=r||yW(S));const D=(x,A)=>{b&16&&d(C,x,A,s,o,r,a,l)};v?D(t,L):S&&D(S,k)}else{e.el=n.el;const y=e.anchor=n.anchor,L=e.target=n.target,S=e.targetAnchor=n.targetAnchor,k=cC(n.props),D=k?t:L,x=k?y:S;if(r=r||yW(L),w?(h(n.dynamicChildren,w,D,s,o,r,a),zB(n,e,!0)):l||u(n,e,D,x,s,o,r,a,!1),v)k||cL(e,t,y,c,1);else if((e.props&&e.props.to)!==(n.props&&n.props.to)){const A=e.target=S2(e.props,g);A&&cL(e,A,null,c,0)}else k&&cL(e,L,S,c,1)}WY(e)},remove(n,e,t,i,{um:s,o:{remove:o}},r){const{shapeFlag:a,children:l,anchor:c,targetAnchor:d,target:u,props:h}=n;if(u&&o(d),(r||!cC(h))&&(o(c),a&16))for(let f=0;f0?Xl||Nv:null,Sue(),sw>0&&Xl&&Xl.push(n),n}function re(n,e,t,i,s,o){return VY(me(n,e,t,i,s,o,!0))}function ei(n,e,t,i,s){return VY(Oe(n,e,t,i,s,!0))}function ow(n){return n?n.__v_isVNode===!0:!1}function dp(n,e){return n.type===e.type&&n.key===e.key}const OT="__vInternal",HY=({key:n})=>n!=null?n:null,Kk=({ref:n,ref_key:e,ref_for:t})=>(typeof n=="number"&&(n=""+n),n!=null?ns(n)||eo(n)||mi(n)?{i:Eo,r:n,k:e,f:!!t}:n:null);function me(n,e=null,t=null,i=0,s=null,o=n===li?0:1,r=!1,a=!1){const l={__v_isVNode:!0,__v_skip:!0,type:n,props:e,key:e&&HY(e),ref:e&&Kk(e),scopeId:AT,slotScopeIds:null,children:t,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetAnchor:null,staticCount:0,shapeFlag:o,patchFlag:i,dynamicProps:s,dynamicChildren:null,appContext:null,ctx:Eo};return a?(UB(l,t),o&128&&n.normalize(l)):t&&(l.shapeFlag|=ns(t)?8:16),sw>0&&!r&&Xl&&(l.patchFlag>0||o&6)&&l.patchFlag!==32&&Xl.push(l),l}const Oe=Lue;function Lue(n,e=null,t=null,i=0,s=null,o=!1){if((!n||n===TY)&&(n=ya),ow(n)){const a=Bf(n,e,!0);return t&&UB(a,t),sw>0&&!o&&Xl&&(a.shapeFlag&6?Xl[Xl.indexOf(n)]=a:Xl.push(a)),a.patchFlag|=-2,a}if(Mue(n)&&(n=n.__vccOpts),e){e=_0(e);let{class:a,style:l}=e;a&&!ns(a)&&(e.class=B(a)),Kn(l)&&(MB(l)&&!Xt(l)&&(l=Is({},l)),e.style=Fe(l))}const r=ns(n)?1:Ude(n)?128:Cue(n)?64:Kn(n)?4:mi(n)?2:0;return me(n,e,t,i,s,r,o,!0)}function _0(n){return n?MB(n)||OT in n?Is({},n):n:null}function Bf(n,e,t=!1){const{props:i,ref:s,patchFlag:o,children:r}=n,a=e?fn(i||{},e):i;return{__v_isVNode:!0,__v_skip:!0,type:n.type,props:a,key:a&&HY(a),ref:e&&e.ref?t&&s?Xt(s)?s.concat(Kk(e)):[s,Kk(e)]:Kk(e):s,scopeId:n.scopeId,slotScopeIds:n.slotScopeIds,children:r,target:n.target,targetAnchor:n.targetAnchor,staticCount:n.staticCount,shapeFlag:n.shapeFlag,patchFlag:e&&n.type!==li?o===-1?16:o|16:o,dynamicProps:n.dynamicProps,dynamicChildren:n.dynamicChildren,appContext:n.appContext,dirs:n.dirs,transition:n.transition,component:n.component,suspense:n.suspense,ssContent:n.ssContent&&Bf(n.ssContent),ssFallback:n.ssFallback&&Bf(n.ssFallback),el:n.el,anchor:n.anchor,ctx:n.ctx,ce:n.ce}}function Mi(n=" ",e=0){return Oe(PT,null,n,e)}function Qe(n="",e=!1){return e?(q(),ei(ya,null,n)):Oe(ya,null,n)}function Fc(n){return n==null||typeof n=="boolean"?Oe(ya):Xt(n)?Oe(li,null,n.slice()):typeof n=="object"?Rh(n):Oe(PT,null,String(n))}function Rh(n){return n.el===null&&n.patchFlag!==-1||n.memo?n:Bf(n)}function UB(n,e){let t=0;const{shapeFlag:i}=n;if(e==null)e=null;else if(Xt(e))t=16;else if(typeof e=="object")if(i&65){const s=e.default;s&&(s._c&&(s._d=!1),UB(n,s()),s._c&&(s._d=!0));return}else{t=32;const s=e._;!s&&!(OT in e)?e._ctx=Eo:s===3&&Eo&&(Eo.slots._===1?e._=1:(e._=2,n.patchFlag|=1024))}else mi(e)?(e={default:e,_ctx:Eo},t=32):(e=String(e),i&64?(t=16,e=[Mi(e)]):t=8);n.children=e,n.shapeFlag|=t}function fn(...n){const e={};for(let t=0;t_o||Eo;let jB,m_,LW="__VUE_INSTANCE_SETTERS__";(m_=f2()[LW])||(m_=f2()[LW]=[]),m_.push(n=>_o=n),jB=n=>{m_.length>1?m_.forEach(e=>e(n)):m_[0](n)};const ub=n=>{jB(n),n.scope.on()},Bp=()=>{_o&&_o.scope.off(),jB(null)};function $Y(n){return n.vnode.shapeFlag&4}let rw=!1;function Iue(n,e=!1){rw=e;const{props:t,children:i}=n.vnode,s=$Y(n);hue(n,t,s,e),pue(n,i);const o=s?Tue(n,e):void 0;return rw=!1,o}function Tue(n,e){const t=n.type;n.accessCache=Object.create(null),n.proxy=fY(new Proxy(n.ctx,sue));const{setup:i}=t;if(i){const s=n.setupContext=i.length>1?Nue(n):null;ub(n),g0();const o=_f(i,n,0,[n.props,s]);if(p0(),Bp(),QG(o)){if(o.then(Bp,Bp),e)return o.then(r=>{kW(n,r,e)}).catch(r=>{xT(r,n,0)});n.asyncDep=o}else kW(n,o,e)}else zY(n,e)}function kW(n,e,t){mi(e)?n.type.__ssrInlineRender?n.ssrRender=e:n.render=e:Kn(e)&&(n.setupState=_Y(e)),zY(n,t)}let DW;function zY(n,e,t){const i=n.type;if(!n.render){if(!e&&DW&&!i.render){const s=i.template||HB(n).template;if(s){const{isCustomElement:o,compilerOptions:r}=n.appContext.config,{delimiters:a,compilerOptions:l}=i,c=Is(Is({isCustomElement:o,delimiters:a},r),l);i.render=DW(s,c)}}n.render=i.render||ic}ub(n),g0(),oue(n),p0(),Bp()}function xue(n){return n.attrsProxy||(n.attrsProxy=new Proxy(n.attrs,{get(e,t){return Zr(n,"get","$attrs"),e[t]}}))}function Nue(n){const e=t=>{n.exposed=t||{}};return{get attrs(){return xue(n)},slots:n.slots,emit:n.emit,expose:e}}function FT(n){if(n.exposed)return n.exposeProxy||(n.exposeProxy=new Proxy(_Y(fY(n.exposed)),{get(e,t){if(t in e)return e[t];if(t in aC)return aC[t](n)},has(e,t){return t in e||t in aC}}))}function Aue(n,e=!0){return mi(n)?n.displayName||n.name:n.name||e&&n.__name}function Mue(n){return mi(n)&&"__vccOpts"in n}const ve=(n,e)=>Mde(n,e,rw);function Bc(n,e,t){const i=arguments.length;return i===2?Kn(e)&&!Xt(e)?ow(e)?Oe(n,null,[e]):Oe(n,e):Oe(n,null,e):(i>3?t=Array.prototype.slice.call(arguments,2):i===3&&ow(t)&&(t=[t]),Oe(n,e,t))}const Rue=Symbol.for("v-scx"),Pue=()=>lC(Rue),Oue="3.3.4",Fue="http://www.w3.org/2000/svg",up=typeof document<"u"?document:null,EW=up&&up.createElement("template"),Bue={insert:(n,e,t)=>{e.insertBefore(n,t||null)},remove:n=>{const e=n.parentNode;e&&e.removeChild(n)},createElement:(n,e,t,i)=>{const s=e?up.createElementNS(Fue,n):up.createElement(n,t?{is:t}:void 0);return n==="select"&&i&&i.multiple!=null&&s.setAttribute("multiple",i.multiple),s},createText:n=>up.createTextNode(n),createComment:n=>up.createComment(n),setText:(n,e)=>{n.nodeValue=e},setElementText:(n,e)=>{n.textContent=e},parentNode:n=>n.parentNode,nextSibling:n=>n.nextSibling,querySelector:n=>up.querySelector(n),setScopeId(n,e){n.setAttribute(e,"")},insertStaticContent(n,e,t,i,s,o){const r=t?t.previousSibling:e.lastChild;if(s&&(s===o||s.nextSibling))for(;e.insertBefore(s.cloneNode(!0),t),!(s===o||!(s=s.nextSibling)););else{EW.innerHTML=i?"".concat(n,""):n;const a=EW.content;if(i){const l=a.firstChild;for(;l.firstChild;)a.appendChild(l.firstChild);a.removeChild(l)}e.insertBefore(a,t)}return[r?r.nextSibling:e.firstChild,t?t.previousSibling:e.lastChild]}};function Wue(n,e,t){const i=n._vtc;i&&(e=(e?[e,...i]:[...i]).join(" ")),e==null?n.removeAttribute("class"):t?n.setAttribute("class",e):n.className=e}function Vue(n,e,t){const i=n.style,s=ns(t);if(t&&!s){if(e&&!ns(e))for(const o in e)t[o]==null&&L2(i,o,"");for(const o in t)L2(i,o,t[o])}else{const o=i.display;s?e!==t&&(i.cssText=t):e&&n.removeAttribute("style"),"_vod"in n&&(i.display=o)}}const IW=/\s*!important$/;function L2(n,e,t){if(Xt(t))t.forEach(i=>L2(n,e,i));else if(t==null&&(t=""),e.startsWith("--"))n.setProperty(e,t);else{const i=Hue(n,e);IW.test(t)?n.setProperty(Hm(i),t.replace(IW,""),"important"):n[i]=t}}const TW=["Webkit","Moz","ms"],xA={};function Hue(n,e){const t=xA[e];if(t)return t;let i=vd(e);if(i!=="filter"&&i in n)return xA[e]=i;i=IT(i);for(let s=0;sNA||(que.then(()=>NA=0),NA=Date.now());function Yue(n,e){const t=i=>{if(!i._vts)i._vts=Date.now();else if(i._vts<=t.attached)return;nl(Zue(i,t.value),e,5,[i])};return t.value=n,t.attached=Gue(),t}function Zue(n,e){if(Xt(e)){const t=n.stopImmediatePropagation;return n.stopImmediatePropagation=()=>{t.call(n),n._stopped=!0},e.map(i=>s=>!s._stopped&&i&&i(s))}else return e}const AW=/^on[a-z]/,Xue=(n,e,t,i,s=!1,o,r,a,l)=>{e==="class"?Wue(n,i,s):e==="style"?Vue(n,t,i):kT(e)?yB(e)||jue(n,e,t,i,r):(e[0]==="."?(e=e.slice(1),!0):e[0]==="^"?(e=e.slice(1),!1):Que(n,e,i,s))?zue(n,e,i,o,r,a,l):(e==="true-value"?n._trueValue=i:e==="false-value"&&(n._falseValue=i),$ue(n,e,i,s))};function Que(n,e,t,i){return i?!!(e==="innerHTML"||e==="textContent"||e in n&&AW.test(e)&&mi(t)):e==="spellcheck"||e==="draggable"||e==="translate"||e==="form"||e==="list"&&n.tagName==="INPUT"||e==="type"&&n.tagName==="TEXTAREA"||AW.test(e)&&ns(t)?!1:e in n}const fh="transition",Y0="animation",On=(n,{slots:e})=>Bc(Xde,jY(n),e);On.displayName="Transition";const UY={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},Jue=On.props=Is({},kY,UY),jg=(n,e=[])=>{Xt(n)?n.forEach(t=>t(...e)):n&&n(...e)},MW=n=>n?Xt(n)?n.some(e=>e.length>1):n.length>1:!1;function jY(n){const e={};for(const T in n)T in UY||(e[T]=n[T]);if(n.css===!1)return e;const{name:t="v",type:i,duration:s,enterFromClass:o="".concat(t,"-enter-from"),enterActiveClass:r="".concat(t,"-enter-active"),enterToClass:a="".concat(t,"-enter-to"),appearFromClass:l=o,appearActiveClass:c=r,appearToClass:d=a,leaveFromClass:u="".concat(t,"-leave-from"),leaveActiveClass:h="".concat(t,"-leave-active"),leaveToClass:f="".concat(t,"-leave-to")}=n,g=ehe(s),p=g&&g[0],_=g&&g[1],{onBeforeEnter:v,onEnter:b,onEnterCancelled:C,onLeave:w,onLeaveCancelled:y,onBeforeAppear:L=v,onAppear:S=b,onAppearCancelled:k=C}=e,D=(T,P,W)=>{kh(T,P?d:a),kh(T,P?c:r),W&&W()},x=(T,P)=>{T._isLeaving=!1,kh(T,u),kh(T,f),kh(T,h),P&&P()},A=T=>(P,W)=>{const $=T?S:b,X=()=>D(P,T,W);jg($,[P,X]),RW(()=>{kh(P,T?l:o),tu(P,T?d:a),MW($)||PW(P,i,p,X)})};return Is(e,{onBeforeEnter(T){jg(v,[T]),tu(T,o),tu(T,r)},onBeforeAppear(T){jg(L,[T]),tu(T,l),tu(T,c)},onEnter:A(!1),onAppear:A(!0),onLeave(T,P){T._isLeaving=!0;const W=()=>x(T,P);tu(T,u),qY(),tu(T,h),RW(()=>{T._isLeaving&&(kh(T,u),tu(T,f),MW(w)||PW(T,i,_,W))}),jg(w,[T,W])},onEnterCancelled(T){D(T,!1),jg(C,[T])},onAppearCancelled(T){D(T,!0),jg(k,[T])},onLeaveCancelled(T){x(T),jg(y,[T])}})}function ehe(n){if(n==null)return null;if(Kn(n))return[AA(n.enter),AA(n.leave)];{const e=AA(n);return[e,e]}}function AA(n){return zce(n)}function tu(n,e){e.split(/\s+/).forEach(t=>t&&n.classList.add(t)),(n._vtc||(n._vtc=new Set)).add(e)}function kh(n,e){e.split(/\s+/).forEach(i=>i&&n.classList.remove(i));const{_vtc:t}=n;t&&(t.delete(e),t.size||(n._vtc=void 0))}function RW(n){requestAnimationFrame(()=>{requestAnimationFrame(n)})}let the=0;function PW(n,e,t,i){const s=n._endId=++the,o=()=>{s===n._endId&&i()};if(t)return setTimeout(o,t);const{type:r,timeout:a,propCount:l}=KY(n,e);if(!r)return i();const c=r+"end";let d=0;const u=()=>{n.removeEventListener(c,h),o()},h=f=>{f.target===n&&++d>=l&&u()};setTimeout(()=>{d(t[g]||"").split(", "),s=i("".concat(fh,"Delay")),o=i("".concat(fh,"Duration")),r=OW(s,o),a=i("".concat(Y0,"Delay")),l=i("".concat(Y0,"Duration")),c=OW(a,l);let d=null,u=0,h=0;e===fh?r>0&&(d=fh,u=r,h=o.length):e===Y0?c>0&&(d=Y0,u=c,h=l.length):(u=Math.max(r,c),d=u>0?r>c?fh:Y0:null,h=d?d===fh?o.length:l.length:0);const f=d===fh&&/\b(transform|all)(,|$)/.test(i("".concat(fh,"Property")).toString());return{type:d,timeout:u,propCount:h,hasTransform:f}}function OW(n,e){for(;n.lengthFW(t)+FW(n[i])))}function FW(n){return Number(n.slice(0,-1).replace(",","."))*1e3}function qY(){return document.body.offsetHeight}const GY=new WeakMap,YY=new WeakMap,ZY={name:"TransitionGroup",props:Is({},Jue,{tag:String,moveClass:String}),setup(n,{slots:e}){const t=ih(),i=LY();let s,o;return Cg(()=>{if(!s.length)return;const r=n.moveClass||"".concat(n.name||"v","-move");if(!ahe(s[0].el,t.vnode.el,r))return;s.forEach(she),s.forEach(ohe);const a=s.filter(rhe);qY(),a.forEach(l=>{const c=l.el,d=c.style;tu(c,r),d.transform=d.webkitTransform=d.transitionDuration="";const u=c._moveCb=h=>{h&&h.target!==c||(!h||/transform$/.test(h.propertyName))&&(c.removeEventListener("transitionend",u),c._moveCb=null,kh(c,r))};c.addEventListener("transitionend",u)})}),()=>{const r=Hi(n),a=jY(r);let l=r.tag||li;s=o,o=e.default?FB(e.default()):[];for(let c=0;cdelete n.mode;ZY.props;const nhe=ZY;function she(n){const e=n.el;e._moveCb&&e._moveCb(),e._enterCb&&e._enterCb()}function ohe(n){YY.set(n,n.el.getBoundingClientRect())}function rhe(n){const e=GY.get(n),t=YY.get(n),i=e.left-t.left,s=e.top-t.top;if(i||s){const o=n.el.style;return o.transform=o.webkitTransform="translate(".concat(i,"px,").concat(s,"px)"),o.transitionDuration="0s",n}}function ahe(n,e,t){const i=n.cloneNode();n._vtc&&n._vtc.forEach(r=>{r.split(/\s+/).forEach(a=>a&&i.classList.remove(a))}),t.split(/\s+/).forEach(r=>r&&i.classList.add(r)),i.style.display="none";const s=e.nodeType===1?e:e.parentNode;s.appendChild(i);const{hasTransform:o}=KY(i);return s.removeChild(i),o}const BW=n=>{const e=n.props["onUpdate:modelValue"]||!1;return Xt(e)?t=>jk(e,t):e};function lhe(n){n.target.composing=!0}function WW(n){const e=n.target;e.composing&&(e.composing=!1,e.dispatchEvent(new Event("input")))}const che={created(n,{modifiers:{lazy:e,trim:t,number:i}},s){n._assign=BW(s);const o=i||s.props&&s.props.type==="number";z_(n,e?"change":"input",r=>{if(r.target.composing)return;let a=n.value;t&&(a=a.trim()),o&&(a=h2(a)),n._assign(a)}),t&&z_(n,"change",()=>{n.value=n.value.trim()}),e||(z_(n,"compositionstart",lhe),z_(n,"compositionend",WW),z_(n,"change",WW))},mounted(n,{value:e}){n.value=e==null?"":e},beforeUpdate(n,{value:e,modifiers:{lazy:t,trim:i,number:s}},o){if(n._assign=BW(o),n.composing||document.activeElement===n&&n.type!=="range"&&(t||i&&n.value.trim()===e||(s||n.type==="number")&&h2(n.value)===e))return;const r=e==null?"":e;n.value!==r&&(n.value=r)}},dhe=["ctrl","shift","alt","meta"],uhe={stop:n=>n.stopPropagation(),prevent:n=>n.preventDefault(),self:n=>n.target!==n.currentTarget,ctrl:n=>!n.ctrlKey,shift:n=>!n.shiftKey,alt:n=>!n.altKey,meta:n=>!n.metaKey,left:n=>"button"in n&&n.button!==0,middle:n=>"button"in n&&n.button!==1,right:n=>"button"in n&&n.button!==2,exact:(n,e)=>dhe.some(t=>n["".concat(t,"Key")]&&!e.includes(t))},Ia=(n,e)=>(t,...i)=>{for(let s=0;st=>{if(!("key"in t))return;const i=Hm(t.key);if(e.some(s=>s===i||hhe[s]===i))return n(t)},hl={beforeMount(n,{value:e},{transition:t}){n._vod=n.style.display==="none"?"":n.style.display,t&&e?t.beforeEnter(n):Z0(n,e)},mounted(n,{value:e},{transition:t}){t&&e&&t.enter(n)},updated(n,{value:e,oldValue:t},{transition:i}){!e!=!t&&(i?e?(i.beforeEnter(n),Z0(n,!0),i.enter(n)):i.leave(n,()=>{Z0(n,!1)}):Z0(n,e))},beforeUnmount(n,{value:e}){Z0(n,e)}};function Z0(n,e){n.style.display=e?n._vod:"none"}const fhe=Is({patchProp:Xue},Bue);let HW;function ghe(){return HW||(HW=_ue(fhe))}const XY=(...n)=>{const e=ghe().createApp(...n),{mount:t}=e;return e.mount=i=>{const s=phe(i);if(!s)return;const o=e._component;!mi(o)&&!o.render&&!o.template&&(o.template=s.innerHTML),s.innerHTML="";const r=t(s,!1,s instanceof SVGElement);return s instanceof Element&&(s.removeAttribute("v-cloak"),s.setAttribute("data-v-app","")),r},e};function phe(n){return ns(n)?document.querySelector(n):n}var mhe=Object.defineProperty,_he=Object.defineProperties,vhe=Object.getOwnPropertyDescriptors,$W=Object.getOwnPropertySymbols,bhe=Object.prototype.hasOwnProperty,Che=Object.prototype.propertyIsEnumerable,zW=(n,e,t)=>e in n?mhe(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,whe=(n,e)=>{for(var t in e||(e={}))bhe.call(e,t)&&zW(n,t,e[t]);if($W)for(var t of $W(e))Che.call(e,t)&&zW(n,t,e[t]);return n},yhe=(n,e)=>_he(n,vhe(e)),Us=n=>typeof n=="string",KB=n=>typeof n=="boolean",qr=n=>typeof n=="number",ju=n=>Object.prototype.toString.call(n)==="[object Object]",She=n=>typeof n=="object"&&n!==null,v0=n=>typeof n=="function",tn=n=>Array.isArray(n),Lhe=n=>n?/^(http)|(\.*\/)/.test(n):!1,hd=n=>n==null||n===""||Array.isArray(n)&&!n.length,qB=n=>n===window,khe=()=>nh()&&"ontouchstart"in window,nh=()=>typeof window<"u",UW=n=>[...new Set(n)],qk=n=>tn(n)?n:[n],JD=(n,e)=>{if(n.length){const t=n.indexOf(e);if(t>-1)return n.splice(t,1)}},Dhe=(n,e,t="start")=>{let i=t==="start"?0:n.length-1;for(;n.length>0&&i>=0&&i<=n.length-1;){if(e(n[i],i,n))return[n[i],i];t==="start"?i++:i--}return[null,-1]},k2=(...n)=>n.map(e=>{if(tn(e)){const[t,i,s=null]=e;return t?i:s}return e}),QY=()=>typeof globalThis<"u"?globalThis:nh()?window:typeof global<"u"?global:self,aw=n=>{const e=QY();return e.requestAnimationFrame?e.requestAnimationFrame(n):e.setTimeout(n)},jW=n=>{const e=QY();e.cancelAnimationFrame?e.cancelAnimationFrame(n):e.clearTimeout(n)},Gk=()=>new Promise(n=>{aw(n)}),Cr=()=>new Promise(n=>{aw(()=>{aw(n)})}),Um=n=>window.getComputedStyle(n),no=n=>{if(qB(n)){const e=n.innerWidth,t=n.innerHeight,i={x:0,y:0,top:0,left:0,right:e,bottom:t,width:e,height:t};return yhe(whe({},i),{toJSON:()=>i})}return n.getBoundingClientRect()},Ehe=n=>{const{top:e,bottom:t,left:i,right:s}=no(n),{width:o,height:r}=no(window),a=i<=o&&s>=0,l=e<=r&&t>=0;return a&&l},Ihe=n=>new Promise(e=>{const t=new FileReader;t.onload=()=>{e(t.result)},t.readAsDataURL(n)}),dc=n=>{n.cancelable!==!1&&n.preventDefault()},hb=n=>{const e="scrollTop"in n?n.scrollTop:n.scrollY;return Math.max(e,0)},GB=n=>{const e="scrollLeft"in n?n.scrollLeft:n.scrollX;return Math.max(e,0)},YB=(n,e=200)=>{let t,i=0;return function s(...o){const r=Date.now(),a=r-i;i||(i=r),t&&window.clearTimeout(t),a>=e?(n.apply(this,o),i=r):t=window.setTimeout(()=>{s.apply(this,o)},e-a)}};function eE(n,...e){if(tn(n))return n.map(t=>t(...e));if(n)return n(...e)}var Ie=n=>n==null?0:Us(n)?(n=parseFloat(n),n=Number.isNaN(n)?0:n,n):KB(n)?Number(n):n,Wf=(n,e,t)=>Math.min(t,Math.max(e,n)),The=(n,e)=>Wf(n,0,e.length-1),xhe=n=>ZB(n).replace(n.charAt(0),n.charAt(0).toUpperCase()),ZB=n=>n.replace(/-(\w)/g,(e,t)=>t.toUpperCase()),JY=n=>n.replace(/([A-Z])/g," $1").trim().split(" ").join("-").toLowerCase();function Nhe(n){return e=>{const t="".concat(n,"-").concat(e),i=s=>s?s[0]==="$"?s.replace("$",n):s.startsWith("--")?"".concat(t).concat(s):"".concat(t,"__").concat(s):t;return{name:xhe(t),n:i,classes:k2}}}function eZ(n,e){return function(){return n.apply(e,arguments)}}const{toString:Ahe}=Object.prototype,{getPrototypeOf:XB}=Object,BT=(n=>e=>{const t=Ahe.call(e);return n[t]||(n[t]=t.slice(8,-1).toLowerCase())})(Object.create(null)),Wd=n=>(n=n.toLowerCase(),e=>BT(e)===n),WT=n=>e=>typeof e===n,{isArray:b0}=Array,lw=WT("undefined");function Mhe(n){return n!==null&&!lw(n)&&n.constructor!==null&&!lw(n.constructor)&&sl(n.constructor.isBuffer)&&n.constructor.isBuffer(n)}const tZ=Wd("ArrayBuffer");function Rhe(n){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(n):e=n&&n.buffer&&tZ(n.buffer),e}const Phe=WT("string"),sl=WT("function"),iZ=WT("number"),VT=n=>n!==null&&typeof n=="object",Ohe=n=>n===!0||n===!1,Yk=n=>{if(BT(n)!=="object")return!1;const e=XB(n);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in n)&&!(Symbol.iterator in n)},Fhe=Wd("Date"),Bhe=Wd("File"),Whe=Wd("Blob"),Vhe=Wd("FileList"),Hhe=n=>VT(n)&&sl(n.pipe),$he=n=>{let e;return n&&(typeof FormData=="function"&&n instanceof FormData||sl(n.append)&&((e=BT(n))==="formdata"||e==="object"&&sl(n.toString)&&n.toString()==="[object FormData]"))},zhe=Wd("URLSearchParams"),Uhe=n=>n.trim?n.trim():n.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function iS(n,e,{allOwnKeys:t=!1}={}){if(n===null||typeof n>"u")return;let i,s;if(typeof n!="object"&&(n=[n]),b0(n))for(i=0,s=n.length;i0;)if(s=t[i],e===s.toLowerCase())return s;return null}const sZ=(()=>typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global)(),oZ=n=>!lw(n)&&n!==sZ;function D2(){const{caseless:n}=oZ(this)&&this||{},e={},t=(i,s)=>{const o=n&&nZ(e,s)||s;Yk(e[o])&&Yk(i)?e[o]=D2(e[o],i):Yk(i)?e[o]=D2({},i):b0(i)?e[o]=i.slice():e[o]=i};for(let i=0,s=arguments.length;i(iS(e,(s,o)=>{t&&sl(s)?n[o]=eZ(s,t):n[o]=s},{allOwnKeys:i}),n),Khe=n=>(n.charCodeAt(0)===65279&&(n=n.slice(1)),n),qhe=(n,e,t,i)=>{n.prototype=Object.create(e.prototype,i),n.prototype.constructor=n,Object.defineProperty(n,"super",{value:e.prototype}),t&&Object.assign(n.prototype,t)},Ghe=(n,e,t,i)=>{let s,o,r;const a={};if(e=e||{},n==null)return e;do{for(s=Object.getOwnPropertyNames(n),o=s.length;o-- >0;)r=s[o],(!i||i(r,n,e))&&!a[r]&&(e[r]=n[r],a[r]=!0);n=t!==!1&&XB(n)}while(n&&(!t||t(n,e))&&n!==Object.prototype);return e},Yhe=(n,e,t)=>{n=String(n),(t===void 0||t>n.length)&&(t=n.length),t-=e.length;const i=n.indexOf(e,t);return i!==-1&&i===t},Zhe=n=>{if(!n)return null;if(b0(n))return n;let e=n.length;if(!iZ(e))return null;const t=new Array(e);for(;e-- >0;)t[e]=n[e];return t},Xhe=(n=>e=>n&&e instanceof n)(typeof Uint8Array<"u"&&XB(Uint8Array)),Qhe=(n,e)=>{const i=(n&&n[Symbol.iterator]).call(n);let s;for(;(s=i.next())&&!s.done;){const o=s.value;e.call(n,o[0],o[1])}},Jhe=(n,e)=>{let t;const i=[];for(;(t=n.exec(e))!==null;)i.push(t);return i},efe=Wd("HTMLFormElement"),tfe=n=>n.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(t,i,s){return i.toUpperCase()+s}),KW=(({hasOwnProperty:n})=>(e,t)=>n.call(e,t))(Object.prototype),ife=Wd("RegExp"),rZ=(n,e)=>{const t=Object.getOwnPropertyDescriptors(n),i={};iS(t,(s,o)=>{let r;(r=e(s,o,n))!==!1&&(i[o]=r||s)}),Object.defineProperties(n,i)},nfe=n=>{rZ(n,(e,t)=>{if(sl(n)&&["arguments","caller","callee"].indexOf(t)!==-1)return!1;const i=n[t];if(sl(i)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+t+"'")})}})},sfe=(n,e)=>{const t={},i=s=>{s.forEach(o=>{t[o]=!0})};return b0(n)?i(n):i(String(n).split(e)),t},ofe=()=>{},rfe=(n,e)=>(n=+n,Number.isFinite(n)?n:e),MA="abcdefghijklmnopqrstuvwxyz",qW="0123456789",aZ={DIGIT:qW,ALPHA:MA,ALPHA_DIGIT:MA+MA.toUpperCase()+qW},afe=(n=16,e=aZ.ALPHA_DIGIT)=>{let t="";const{length:i}=e;for(;n--;)t+=e[Math.random()*i|0];return t};function lfe(n){return!!(n&&sl(n.append)&&n[Symbol.toStringTag]==="FormData"&&n[Symbol.iterator])}const cfe=n=>{const e=new Array(10),t=(i,s)=>{if(VT(i)){if(e.indexOf(i)>=0)return;if(!("toJSON"in i)){e[s]=i;const o=b0(i)?[]:{};return iS(i,(r,a)=>{const l=t(r,s+1);!lw(l)&&(o[a]=l)}),e[s]=void 0,o}}return i};return t(n,0)},dfe=Wd("AsyncFunction"),ufe=n=>n&&(VT(n)||sl(n))&&sl(n.then)&&sl(n.catch),$e={isArray:b0,isArrayBuffer:tZ,isBuffer:Mhe,isFormData:$he,isArrayBufferView:Rhe,isString:Phe,isNumber:iZ,isBoolean:Ohe,isObject:VT,isPlainObject:Yk,isUndefined:lw,isDate:Fhe,isFile:Bhe,isBlob:Whe,isRegExp:ife,isFunction:sl,isStream:Hhe,isURLSearchParams:zhe,isTypedArray:Xhe,isFileList:Vhe,forEach:iS,merge:D2,extend:jhe,trim:Uhe,stripBOM:Khe,inherits:qhe,toFlatObject:Ghe,kindOf:BT,kindOfTest:Wd,endsWith:Yhe,toArray:Zhe,forEachEntry:Qhe,matchAll:Jhe,isHTMLForm:efe,hasOwnProperty:KW,hasOwnProp:KW,reduceDescriptors:rZ,freezeMethods:nfe,toObjectSet:sfe,toCamelCase:tfe,noop:ofe,toFiniteNumber:rfe,findKey:nZ,global:sZ,isContextDefined:oZ,ALPHABET:aZ,generateString:afe,isSpecCompliantForm:lfe,toJSONObject:cfe,isAsyncFn:dfe,isThenable:ufe};function Vi(n,e,t,i,s){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=n,this.name="AxiosError",e&&(this.code=e),t&&(this.config=t),i&&(this.request=i),s&&(this.response=s)}$e.inherits(Vi,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:$e.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const lZ=Vi.prototype,cZ={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(n=>{cZ[n]={value:n}});Object.defineProperties(Vi,cZ);Object.defineProperty(lZ,"isAxiosError",{value:!0});Vi.from=(n,e,t,i,s,o)=>{const r=Object.create(lZ);return $e.toFlatObject(n,r,function(l){return l!==Error.prototype},a=>a!=="isAxiosError"),Vi.call(r,n.message,e,t,i,s),r.cause=n,r.name=n.name,o&&Object.assign(r,o),r};const hfe=null;function E2(n){return $e.isPlainObject(n)||$e.isArray(n)}function dZ(n){return $e.endsWith(n,"[]")?n.slice(0,-2):n}function GW(n,e,t){return n?n.concat(e).map(function(s,o){return s=dZ(s),!t&&o?"["+s+"]":s}).join(t?".":""):e}function ffe(n){return $e.isArray(n)&&!n.some(E2)}const gfe=$e.toFlatObject($e,{},null,function(e){return/^is[A-Z]/.test(e)});function HT(n,e,t){if(!$e.isObject(n))throw new TypeError("target must be an object");e=e||new FormData,t=$e.toFlatObject(t,{metaTokens:!0,dots:!1,indexes:!1},!1,function(p,_){return!$e.isUndefined(_[p])});const i=t.metaTokens,s=t.visitor||d,o=t.dots,r=t.indexes,l=(t.Blob||typeof Blob<"u"&&Blob)&&$e.isSpecCompliantForm(e);if(!$e.isFunction(s))throw new TypeError("visitor must be a function");function c(g){if(g===null)return"";if($e.isDate(g))return g.toISOString();if(!l&&$e.isBlob(g))throw new Vi("Blob is not supported. Use a Buffer instead.");return $e.isArrayBuffer(g)||$e.isTypedArray(g)?l&&typeof Blob=="function"?new Blob([g]):Buffer.from(g):g}function d(g,p,_){let v=g;if(g&&!_&&typeof g=="object"){if($e.endsWith(p,"{}"))p=i?p:p.slice(0,-2),g=JSON.stringify(g);else if($e.isArray(g)&&ffe(g)||($e.isFileList(g)||$e.endsWith(p,"[]"))&&(v=$e.toArray(g)))return p=dZ(p),v.forEach(function(C,w){!($e.isUndefined(C)||C===null)&&e.append(r===!0?GW([p],w,o):r===null?p:p+"[]",c(C))}),!1}return E2(g)?!0:(e.append(GW(_,p,o),c(g)),!1)}const u=[],h=Object.assign(gfe,{defaultVisitor:d,convertValue:c,isVisitable:E2});function f(g,p){if(!$e.isUndefined(g)){if(u.indexOf(g)!==-1)throw Error("Circular reference detected in "+p.join("."));u.push(g),$e.forEach(g,function(v,b){(!($e.isUndefined(v)||v===null)&&s.call(e,v,$e.isString(b)?b.trim():b,p,h))===!0&&f(v,p?p.concat(b):[b])}),u.pop()}}if(!$e.isObject(n))throw new TypeError("data must be an object");return f(n),e}function YW(n){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(n).replace(/[!'()~]|%20|%00/g,function(i){return e[i]})}function QB(n,e){this._pairs=[],n&&HT(n,this,e)}const uZ=QB.prototype;uZ.append=function(e,t){this._pairs.push([e,t])};uZ.toString=function(e){const t=e?function(i){return e.call(this,i,YW)}:YW;return this._pairs.map(function(s){return t(s[0])+"="+t(s[1])},"").join("&")};function pfe(n){return encodeURIComponent(n).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function hZ(n,e,t){if(!e)return n;const i=t&&t.encode||pfe,s=t&&t.serialize;let o;if(s?o=s(e,t):o=$e.isURLSearchParams(e)?e.toString():new QB(e,t).toString(i),o){const r=n.indexOf("#");r!==-1&&(n=n.slice(0,r)),n+=(n.indexOf("?")===-1?"?":"&")+o}return n}class mfe{constructor(){this.handlers=[]}use(e,t,i){return this.handlers.push({fulfilled:e,rejected:t,synchronous:i?i.synchronous:!1,runWhen:i?i.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){$e.forEach(this.handlers,function(i){i!==null&&e(i)})}}const ZW=mfe,fZ={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},_fe=typeof URLSearchParams<"u"?URLSearchParams:QB,vfe=typeof FormData<"u"?FormData:null,bfe=typeof Blob<"u"?Blob:null,Cfe=(()=>{let n;return typeof navigator<"u"&&((n=navigator.product)==="ReactNative"||n==="NativeScript"||n==="NS")?!1:typeof window<"u"&&typeof document<"u"})(),wfe=(()=>typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function")(),ed={isBrowser:!0,classes:{URLSearchParams:_fe,FormData:vfe,Blob:bfe},isStandardBrowserEnv:Cfe,isStandardBrowserWebWorkerEnv:wfe,protocols:["http","https","file","blob","url","data"]};function yfe(n,e){return HT(n,new ed.classes.URLSearchParams,Object.assign({visitor:function(t,i,s,o){return ed.isNode&&$e.isBuffer(t)?(this.append(i,t.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)}},e))}function Sfe(n){return $e.matchAll(/\w+|\[(\w*)]/g,n).map(e=>e[0]==="[]"?"":e[1]||e[0])}function Lfe(n){const e={},t=Object.keys(n);let i;const s=t.length;let o;for(i=0;i=t.length;return r=!r&&$e.isArray(s)?s.length:r,l?($e.hasOwnProp(s,r)?s[r]=[s[r],i]:s[r]=i,!a):((!s[r]||!$e.isObject(s[r]))&&(s[r]=[]),e(t,i,s[r],o)&&$e.isArray(s[r])&&(s[r]=Lfe(s[r])),!a)}if($e.isFormData(n)&&$e.isFunction(n.entries)){const t={};return $e.forEachEntry(n,(i,s)=>{e(Sfe(i),s,t,0)}),t}return null}function kfe(n,e,t){if($e.isString(n))try{return(e||JSON.parse)(n),$e.trim(n)}catch(i){if(i.name!=="SyntaxError")throw i}return(t||JSON.stringify)(n)}const JB={transitional:fZ,adapter:["xhr","http"],transformRequest:[function(e,t){const i=t.getContentType()||"",s=i.indexOf("application/json")>-1,o=$e.isObject(e);if(o&&$e.isHTMLForm(e)&&(e=new FormData(e)),$e.isFormData(e))return s&&s?JSON.stringify(gZ(e)):e;if($e.isArrayBuffer(e)||$e.isBuffer(e)||$e.isStream(e)||$e.isFile(e)||$e.isBlob(e))return e;if($e.isArrayBufferView(e))return e.buffer;if($e.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let a;if(o){if(i.indexOf("application/x-www-form-urlencoded")>-1)return yfe(e,this.formSerializer).toString();if((a=$e.isFileList(e))||i.indexOf("multipart/form-data")>-1){const l=this.env&&this.env.FormData;return HT(a?{"files[]":e}:e,l&&new l,this.formSerializer)}}return o||s?(t.setContentType("application/json",!1),kfe(e)):e}],transformResponse:[function(e){const t=this.transitional||JB.transitional,i=t&&t.forcedJSONParsing,s=this.responseType==="json";if(e&&$e.isString(e)&&(i&&!this.responseType||s)){const r=!(t&&t.silentJSONParsing)&&s;try{return JSON.parse(e)}catch(a){if(r)throw a.name==="SyntaxError"?Vi.from(a,Vi.ERR_BAD_RESPONSE,this,null,this.response):a}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:ed.classes.FormData,Blob:ed.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};$e.forEach(["delete","get","head","post","put","patch"],n=>{JB.headers[n]={}});const e8=JB,Dfe=$e.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Efe=n=>{const e={};let t,i,s;return n&&n.split("\n").forEach(function(r){s=r.indexOf(":"),t=r.substring(0,s).trim().toLowerCase(),i=r.substring(s+1).trim(),!(!t||e[t]&&Dfe[t])&&(t==="set-cookie"?e[t]?e[t].push(i):e[t]=[i]:e[t]=e[t]?e[t]+", "+i:i)}),e},XW=Symbol("internals");function X0(n){return n&&String(n).trim().toLowerCase()}function Zk(n){return n===!1||n==null?n:$e.isArray(n)?n.map(Zk):String(n)}function Ife(n){const e=Object.create(null),t=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let i;for(;i=t.exec(n);)e[i[1]]=i[2];return e}const Tfe=n=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(n.trim());function RA(n,e,t,i,s){if($e.isFunction(i))return i.call(this,e,t);if(s&&(e=t),!!$e.isString(e)){if($e.isString(i))return e.indexOf(i)!==-1;if($e.isRegExp(i))return i.test(e)}}function xfe(n){return n.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,i)=>t.toUpperCase()+i)}function Nfe(n,e){const t=$e.toCamelCase(" "+e);["get","set","has"].forEach(i=>{Object.defineProperty(n,i+t,{value:function(s,o,r){return this[i].call(this,e,s,o,r)},configurable:!0})})}class $T{constructor(e){e&&this.set(e)}set(e,t,i){const s=this;function o(a,l,c){const d=X0(l);if(!d)throw new Error("header name must be a non-empty string");const u=$e.findKey(s,d);(!u||s[u]===void 0||c===!0||c===void 0&&s[u]!==!1)&&(s[u||l]=Zk(a))}const r=(a,l)=>$e.forEach(a,(c,d)=>o(c,d,l));return $e.isPlainObject(e)||e instanceof this.constructor?r(e,t):$e.isString(e)&&(e=e.trim())&&!Tfe(e)?r(Efe(e),t):e!=null&&o(t,e,i),this}get(e,t){if(e=X0(e),e){const i=$e.findKey(this,e);if(i){const s=this[i];if(!t)return s;if(t===!0)return Ife(s);if($e.isFunction(t))return t.call(this,s,i);if($e.isRegExp(t))return t.exec(s);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=X0(e),e){const i=$e.findKey(this,e);return!!(i&&this[i]!==void 0&&(!t||RA(this,this[i],i,t)))}return!1}delete(e,t){const i=this;let s=!1;function o(r){if(r=X0(r),r){const a=$e.findKey(i,r);a&&(!t||RA(i,i[a],a,t))&&(delete i[a],s=!0)}}return $e.isArray(e)?e.forEach(o):o(e),s}clear(e){const t=Object.keys(this);let i=t.length,s=!1;for(;i--;){const o=t[i];(!e||RA(this,this[o],o,e,!0))&&(delete this[o],s=!0)}return s}normalize(e){const t=this,i={};return $e.forEach(this,(s,o)=>{const r=$e.findKey(i,o);if(r){t[r]=Zk(s),delete t[o];return}const a=e?xfe(o):String(o).trim();a!==o&&delete t[o],t[a]=Zk(s),i[a]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return $e.forEach(this,(i,s)=>{i!=null&&i!==!1&&(t[s]=e&&$e.isArray(i)?i.join(", "):i)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+": "+t).join("\n")}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const i=new this(e);return t.forEach(s=>i.set(s)),i}static accessor(e){const i=(this[XW]=this[XW]={accessors:{}}).accessors,s=this.prototype;function o(r){const a=X0(r);i[a]||(Nfe(s,r),i[a]=!0)}return $e.isArray(e)?e.forEach(o):o(e),this}}$T.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);$e.reduceDescriptors($T.prototype,({value:n},e)=>{let t=e[0].toUpperCase()+e.slice(1);return{get:()=>n,set(i){this[t]=i}}});$e.freezeMethods($T);const Au=$T;function PA(n,e){const t=this||e8,i=e||t,s=Au.from(i.headers);let o=i.data;return $e.forEach(n,function(a){o=a.call(t,o,s.normalize(),e?e.status:void 0)}),s.normalize(),o}function pZ(n){return!!(n&&n.__CANCEL__)}function nS(n,e,t){Vi.call(this,n==null?"canceled":n,Vi.ERR_CANCELED,e,t),this.name="CanceledError"}$e.inherits(nS,Vi,{__CANCEL__:!0});function Afe(n,e,t){const i=t.config.validateStatus;!t.status||!i||i(t.status)?n(t):e(new Vi("Request failed with status code "+t.status,[Vi.ERR_BAD_REQUEST,Vi.ERR_BAD_RESPONSE][Math.floor(t.status/100)-4],t.config,t.request,t))}const Mfe=ed.isStandardBrowserEnv?function(){return{write:function(t,i,s,o,r,a){const l=[];l.push(t+"="+encodeURIComponent(i)),$e.isNumber(s)&&l.push("expires="+new Date(s).toGMTString()),$e.isString(o)&&l.push("path="+o),$e.isString(r)&&l.push("domain="+r),a===!0&&l.push("secure"),document.cookie=l.join("; ")},read:function(t){const i=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return i?decodeURIComponent(i[3]):null},remove:function(t){this.write(t,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}();function Rfe(n){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(n)}function Pfe(n,e){return e?n.replace(/\/+$/,"")+"/"+e.replace(/^\/+/,""):n}function mZ(n,e){return n&&!Rfe(e)?Pfe(n,e):e}const Ofe=ed.isStandardBrowserEnv?function(){const e=/(msie|trident)/i.test(navigator.userAgent),t=document.createElement("a");let i;function s(o){let r=o;return e&&(t.setAttribute("href",r),r=t.href),t.setAttribute("href",r),{href:t.href,protocol:t.protocol?t.protocol.replace(/:$/,""):"",host:t.host,search:t.search?t.search.replace(/^\?/,""):"",hash:t.hash?t.hash.replace(/^#/,""):"",hostname:t.hostname,port:t.port,pathname:t.pathname.charAt(0)==="/"?t.pathname:"/"+t.pathname}}return i=s(window.location.href),function(r){const a=$e.isString(r)?s(r):r;return a.protocol===i.protocol&&a.host===i.host}}():function(){return function(){return!0}}();function Ffe(n){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(n);return e&&e[1]||""}function Bfe(n,e){n=n||10;const t=new Array(n),i=new Array(n);let s=0,o=0,r;return e=e!==void 0?e:1e3,function(l){const c=Date.now(),d=i[o];r||(r=c),t[s]=l,i[s]=c;let u=o,h=0;for(;u!==s;)h+=t[u++],u=u%n;if(s=(s+1)%n,s===o&&(o=(o+1)%n),c-r{const o=s.loaded,r=s.lengthComputable?s.total:void 0,a=o-t,l=i(a),c=o<=r;t=o;const d={loaded:o,total:r,progress:r?o/r:void 0,bytes:a,rate:l||void 0,estimated:l&&r&&c?(r-o)/l:void 0,event:s};d[e?"download":"upload"]=!0,n(d)}}const Wfe=typeof XMLHttpRequest<"u",Vfe=Wfe&&function(n){return new Promise(function(t,i){let s=n.data;const o=Au.from(n.headers).normalize(),r=n.responseType;let a;function l(){n.cancelToken&&n.cancelToken.unsubscribe(a),n.signal&&n.signal.removeEventListener("abort",a)}let c;$e.isFormData(s)&&(ed.isStandardBrowserEnv||ed.isStandardBrowserWebWorkerEnv?o.setContentType(!1):o.getContentType(/^\s*multipart\/form-data/)?$e.isString(c=o.getContentType())&&o.setContentType(c.replace(/^\s*(multipart\/form-data);+/,"$1")):o.setContentType("multipart/form-data"));let d=new XMLHttpRequest;if(n.auth){const g=n.auth.username||"",p=n.auth.password?unescape(encodeURIComponent(n.auth.password)):"";o.set("Authorization","Basic "+btoa(g+":"+p))}const u=mZ(n.baseURL,n.url);d.open(n.method.toUpperCase(),hZ(u,n.params,n.paramsSerializer),!0),d.timeout=n.timeout;function h(){if(!d)return;const g=Au.from("getAllResponseHeaders"in d&&d.getAllResponseHeaders()),_={data:!r||r==="text"||r==="json"?d.responseText:d.response,status:d.status,statusText:d.statusText,headers:g,config:n,request:d};Afe(function(b){t(b),l()},function(b){i(b),l()},_),d=null}if("onloadend"in d?d.onloadend=h:d.onreadystatechange=function(){!d||d.readyState!==4||d.status===0&&!(d.responseURL&&d.responseURL.indexOf("file:")===0)||setTimeout(h)},d.onabort=function(){d&&(i(new Vi("Request aborted",Vi.ECONNABORTED,n,d)),d=null)},d.onerror=function(){i(new Vi("Network Error",Vi.ERR_NETWORK,n,d)),d=null},d.ontimeout=function(){let p=n.timeout?"timeout of "+n.timeout+"ms exceeded":"timeout exceeded";const _=n.transitional||fZ;n.timeoutErrorMessage&&(p=n.timeoutErrorMessage),i(new Vi(p,_.clarifyTimeoutError?Vi.ETIMEDOUT:Vi.ECONNABORTED,n,d)),d=null},ed.isStandardBrowserEnv){const g=Ofe(u)&&n.xsrfCookieName&&Mfe.read(n.xsrfCookieName);g&&o.set(n.xsrfHeaderName,g)}s===void 0&&o.setContentType(null),"setRequestHeader"in d&&$e.forEach(o.toJSON(),function(p,_){d.setRequestHeader(_,p)}),$e.isUndefined(n.withCredentials)||(d.withCredentials=!!n.withCredentials),r&&r!=="json"&&(d.responseType=n.responseType),typeof n.onDownloadProgress=="function"&&d.addEventListener("progress",QW(n.onDownloadProgress,!0)),typeof n.onUploadProgress=="function"&&d.upload&&d.upload.addEventListener("progress",QW(n.onUploadProgress)),(n.cancelToken||n.signal)&&(a=g=>{d&&(i(!g||g.type?new nS(null,n,d):g),d.abort(),d=null)},n.cancelToken&&n.cancelToken.subscribe(a),n.signal&&(n.signal.aborted?a():n.signal.addEventListener("abort",a)));const f=Ffe(u);if(f&&ed.protocols.indexOf(f)===-1){i(new Vi("Unsupported protocol "+f+":",Vi.ERR_BAD_REQUEST,n));return}d.send(s||null)})},I2={http:hfe,xhr:Vfe};$e.forEach(I2,(n,e)=>{if(n){try{Object.defineProperty(n,"name",{value:e})}catch{}Object.defineProperty(n,"adapterName",{value:e})}});const JW=n=>"- ".concat(n),Hfe=n=>$e.isFunction(n)||n===null||n===!1,_Z={getAdapter:n=>{n=$e.isArray(n)?n:[n];const{length:e}=n;let t,i;const s={};for(let o=0;o"adapter ".concat(a," ")+(l===!1?"is not supported by the environment":"is not available in the build"));let r=e?o.length>1?"since :\n"+o.map(JW).join("\n"):" "+JW(o[0]):"as no adapter specified";throw new Vi("There is no suitable adapter to dispatch the request "+r,"ERR_NOT_SUPPORT")}return i},adapters:I2};function OA(n){if(n.cancelToken&&n.cancelToken.throwIfRequested(),n.signal&&n.signal.aborted)throw new nS(null,n)}function eV(n){return OA(n),n.headers=Au.from(n.headers),n.data=PA.call(n,n.transformRequest),["post","put","patch"].indexOf(n.method)!==-1&&n.headers.setContentType("application/x-www-form-urlencoded",!1),_Z.getAdapter(n.adapter||e8.adapter)(n).then(function(i){return OA(n),i.data=PA.call(n,n.transformResponse,i),i.headers=Au.from(i.headers),i},function(i){return pZ(i)||(OA(n),i&&i.response&&(i.response.data=PA.call(n,n.transformResponse,i.response),i.response.headers=Au.from(i.response.headers))),Promise.reject(i)})}const tV=n=>n instanceof Au?n.toJSON():n;function fb(n,e){e=e||{};const t={};function i(c,d,u){return $e.isPlainObject(c)&&$e.isPlainObject(d)?$e.merge.call({caseless:u},c,d):$e.isPlainObject(d)?$e.merge({},d):$e.isArray(d)?d.slice():d}function s(c,d,u){if($e.isUndefined(d)){if(!$e.isUndefined(c))return i(void 0,c,u)}else return i(c,d,u)}function o(c,d){if(!$e.isUndefined(d))return i(void 0,d)}function r(c,d){if($e.isUndefined(d)){if(!$e.isUndefined(c))return i(void 0,c)}else return i(void 0,d)}function a(c,d,u){if(u in e)return i(c,d);if(u in n)return i(void 0,c)}const l={url:o,method:o,data:o,baseURL:r,transformRequest:r,transformResponse:r,paramsSerializer:r,timeout:r,timeoutMessage:r,withCredentials:r,adapter:r,responseType:r,xsrfCookieName:r,xsrfHeaderName:r,onUploadProgress:r,onDownloadProgress:r,decompress:r,maxContentLength:r,maxBodyLength:r,beforeRedirect:r,transport:r,httpAgent:r,httpsAgent:r,cancelToken:r,socketPath:r,responseEncoding:r,validateStatus:a,headers:(c,d)=>s(tV(c),tV(d),!0)};return $e.forEach(Object.keys(Object.assign({},n,e)),function(d){const u=l[d]||s,h=u(n[d],e[d],d);$e.isUndefined(h)&&u!==a||(t[d]=h)}),t}const vZ="1.6.0",t8={};["object","boolean","number","function","string","symbol"].forEach((n,e)=>{t8[n]=function(i){return typeof i===n||"a"+(e<1?"n ":" ")+n}});const iV={};t8.transitional=function(e,t,i){function s(o,r){return"[Axios v"+vZ+"] Transitional option '"+o+"'"+r+(i?". "+i:"")}return(o,r,a)=>{if(e===!1)throw new Vi(s(r," has been removed"+(t?" in "+t:"")),Vi.ERR_DEPRECATED);return t&&!iV[r]&&(iV[r]=!0,console.warn(s(r," has been deprecated since v"+t+" and will be removed in the near future"))),e?e(o,r,a):!0}};function $fe(n,e,t){if(typeof n!="object")throw new Vi("options must be an object",Vi.ERR_BAD_OPTION_VALUE);const i=Object.keys(n);let s=i.length;for(;s-- >0;){const o=i[s],r=e[o];if(r){const a=n[o],l=a===void 0||r(a,o,n);if(l!==!0)throw new Vi("option "+o+" must be "+l,Vi.ERR_BAD_OPTION_VALUE);continue}if(t!==!0)throw new Vi("Unknown option "+o,Vi.ERR_BAD_OPTION)}}const T2={assertOptions:$fe,validators:t8},gh=T2.validators;class tE{constructor(e){this.defaults=e,this.interceptors={request:new ZW,response:new ZW}}request(e,t){typeof e=="string"?(t=t||{},t.url=e):t=e||{},t=fb(this.defaults,t);const{transitional:i,paramsSerializer:s,headers:o}=t;i!==void 0&&T2.assertOptions(i,{silentJSONParsing:gh.transitional(gh.boolean),forcedJSONParsing:gh.transitional(gh.boolean),clarifyTimeoutError:gh.transitional(gh.boolean)},!1),s!=null&&($e.isFunction(s)?t.paramsSerializer={serialize:s}:T2.assertOptions(s,{encode:gh.function,serialize:gh.function},!0)),t.method=(t.method||this.defaults.method||"get").toLowerCase();let r=o&&$e.merge(o.common,o[t.method]);o&&$e.forEach(["delete","get","head","post","put","patch","common"],g=>{delete o[g]}),t.headers=Au.concat(r,o);const a=[];let l=!0;this.interceptors.request.forEach(function(p){typeof p.runWhen=="function"&&p.runWhen(t)===!1||(l=l&&p.synchronous,a.unshift(p.fulfilled,p.rejected))});const c=[];this.interceptors.response.forEach(function(p){c.push(p.fulfilled,p.rejected)});let d,u=0,h;if(!l){const g=[eV.bind(this),void 0];for(g.unshift.apply(g,a),g.push.apply(g,c),h=g.length,d=Promise.resolve(t);u{if(!i._listeners)return;let o=i._listeners.length;for(;o-- >0;)i._listeners[o](s);i._listeners=null}),this.promise.then=s=>{let o;const r=new Promise(a=>{i.subscribe(a),o=a}).then(s);return r.cancel=function(){i.unsubscribe(o)},r},e(function(o,r,a){i.reason||(i.reason=new nS(o,r,a),t(i.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);t!==-1&&this._listeners.splice(t,1)}static source(){let e;return{token:new i8(function(s){e=s}),cancel:e}}}const zfe=i8;function Ufe(n){return function(t){return n.apply(null,t)}}function jfe(n){return $e.isObject(n)&&n.isAxiosError===!0}const x2={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(x2).forEach(([n,e])=>{x2[e]=n});const Kfe=x2;function bZ(n){const e=new Xk(n),t=eZ(Xk.prototype.request,e);return $e.extend(t,Xk.prototype,e,{allOwnKeys:!0}),$e.extend(t,e,null,{allOwnKeys:!0}),t.create=function(s){return bZ(fb(n,s))},t}const $s=bZ(e8);$s.Axios=Xk;$s.CanceledError=nS;$s.CancelToken=zfe;$s.isCancel=pZ;$s.VERSION=vZ;$s.toFormData=HT;$s.AxiosError=Vi;$s.Cancel=$s.CanceledError;$s.all=function(e){return Promise.all(e)};$s.spread=Ufe;$s.isAxiosError=jfe;$s.mergeConfig=fb;$s.AxiosHeaders=Au;$s.formToJSON=n=>gZ($e.isHTMLForm(n)?new FormData(n):n);$s.getAdapter=_Z.getAdapter;$s.HttpStatusCode=Kfe;$s.default=$s;const qfe=$s;var Gfe=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Yfe(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}function Zfe(n){if(n.__esModule)return n;var e=n.default;if(typeof e=="function"){var t=function i(){return this instanceof i?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(n).forEach(function(i){var s=Object.getOwnPropertyDescriptor(n,i);Object.defineProperty(t,i,s.get?s:{enumerable:!0,get:function(){return n[i]}})}),t}var Xfe=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var e={},t=Symbol("test"),i=Object(t);if(typeof t=="string"||Object.prototype.toString.call(t)!=="[object Symbol]"||Object.prototype.toString.call(i)!=="[object Symbol]")return!1;var s=42;e[t]=s;for(t in e)return!1;if(typeof Object.keys=="function"&&Object.keys(e).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(e).length!==0)return!1;var o=Object.getOwnPropertySymbols(e);if(o.length!==1||o[0]!==t||!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var r=Object.getOwnPropertyDescriptor(e,t);if(r.value!==s||r.enumerable!==!0)return!1}return!0},nV=typeof Symbol<"u"&&Symbol,Qfe=Xfe,Jfe=function(){return typeof nV!="function"||typeof Symbol!="function"||typeof nV("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:Qfe()},sV={foo:{}},ege=Object,tge=function(){return{__proto__:sV}.foo===sV.foo&&!({__proto__:null}instanceof ege)},ige="Function.prototype.bind called on incompatible ",nge=Object.prototype.toString,sge=Math.max,oge="[object Function]",oV=function(e,t){for(var i=[],s=0;s"u"||!fo?Ei:fo(Uint8Array),Vp={"%AggregateError%":typeof AggregateError>"u"?Ei:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?Ei:ArrayBuffer,"%ArrayIteratorPrototype%":__&&fo?fo([][Symbol.iterator]()):Ei,"%AsyncFromSyncIteratorPrototype%":Ei,"%AsyncFunction%":U_,"%AsyncGenerator%":U_,"%AsyncGeneratorFunction%":U_,"%AsyncIteratorPrototype%":U_,"%Atomics%":typeof Atomics>"u"?Ei:Atomics,"%BigInt%":typeof BigInt>"u"?Ei:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?Ei:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?Ei:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?Ei:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":typeof Float32Array>"u"?Ei:Float32Array,"%Float64Array%":typeof Float64Array>"u"?Ei:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?Ei:FinalizationRegistry,"%Function%":CZ,"%GeneratorFunction%":U_,"%Int8Array%":typeof Int8Array>"u"?Ei:Int8Array,"%Int16Array%":typeof Int16Array>"u"?Ei:Int16Array,"%Int32Array%":typeof Int32Array>"u"?Ei:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":__&&fo?fo(fo([][Symbol.iterator]())):Ei,"%JSON%":typeof JSON=="object"?JSON:Ei,"%Map%":typeof Map>"u"?Ei:Map,"%MapIteratorPrototype%":typeof Map>"u"||!__||!fo?Ei:fo(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?Ei:Promise,"%Proxy%":typeof Proxy>"u"?Ei:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":typeof Reflect>"u"?Ei:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?Ei:Set,"%SetIteratorPrototype%":typeof Set>"u"||!__||!fo?Ei:fo(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?Ei:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":__&&fo?fo(""[Symbol.iterator]()):Ei,"%Symbol%":__?Symbol:Ei,"%SyntaxError%":gb,"%ThrowTypeError%":gge,"%TypedArray%":mge,"%TypeError%":Rv,"%Uint8Array%":typeof Uint8Array>"u"?Ei:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?Ei:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?Ei:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?Ei:Uint32Array,"%URIError%":URIError,"%WeakMap%":typeof WeakMap>"u"?Ei:WeakMap,"%WeakRef%":typeof WeakRef>"u"?Ei:WeakRef,"%WeakSet%":typeof WeakSet>"u"?Ei:WeakSet};if(fo)try{null.error}catch(n){var _ge=fo(fo(n));Vp["%Error.prototype%"]=_ge}var vge=function n(e){var t;if(e==="%AsyncFunction%")t=FA("async function () {}");else if(e==="%GeneratorFunction%")t=FA("function* () {}");else if(e==="%AsyncGeneratorFunction%")t=FA("async function* () {}");else if(e==="%AsyncGenerator%"){var i=n("%AsyncGeneratorFunction%");i&&(t=i.prototype)}else if(e==="%AsyncIteratorPrototype%"){var s=n("%AsyncGenerator%");s&&fo&&(t=fo(s.prototype))}return Vp[e]=t,t},rV={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},sS=n8,iE=fge,bge=sS.call(Function.call,Array.prototype.concat),Cge=sS.call(Function.apply,Array.prototype.splice),aV=sS.call(Function.call,String.prototype.replace),nE=sS.call(Function.call,String.prototype.slice),wge=sS.call(Function.call,RegExp.prototype.exec),yge=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,Sge=/\\(\\)?/g,Lge=function(e){var t=nE(e,0,1),i=nE(e,-1);if(t==="%"&&i!=="%")throw new gb("invalid intrinsic syntax, expected closing `%`");if(i==="%"&&t!=="%")throw new gb("invalid intrinsic syntax, expected opening `%`");var s=[];return aV(e,yge,function(o,r,a,l){s[s.length]=a?aV(l,Sge,"$1"):r||o}),s},kge=function(e,t){var i=e,s;if(iE(rV,i)&&(s=rV[i],i="%"+s[0]+"%"),iE(Vp,i)){var o=Vp[i];if(o===U_&&(o=vge(i)),typeof o>"u"&&!t)throw new Rv("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:s,name:i,value:o}}throw new gb("intrinsic "+e+" does not exist!")},jm=function(e,t){if(typeof e!="string"||e.length===0)throw new Rv("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof t!="boolean")throw new Rv('"allowMissing" argument must be a boolean');if(wge(/^%?[^%]*%?$/,e)===null)throw new gb("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var i=Lge(e),s=i.length>0?i[0]:"",o=kge("%"+s+"%",t),r=o.name,a=o.value,l=!1,c=o.alias;c&&(s=c[0],Cge(i,bge([0,1],c)));for(var d=1,u=!0;d=i.length){var p=Wp(a,h);u=!!p,u&&"get"in p&&!("originalValue"in p.get)?a=p.get:a=a[h]}else u=iE(a,h),a=a[h];u&&!l&&(Vp[r]=a)}}return a},wZ={exports:{}},Dge=jm,N2=Dge("%Object.defineProperty%",!0),A2=function(){if(N2)try{return N2({},"a",{value:1}),!0}catch{return!1}return!1};A2.hasArrayLengthDefineBug=function(){if(!A2())return null;try{return N2([],"length",{value:1}).length!==1}catch{return!0}};var yZ=A2,Ege=jm,Qk=Ege("%Object.getOwnPropertyDescriptor%",!0);if(Qk)try{Qk([],"length")}catch{Qk=null}var SZ=Qk,Ige=yZ(),s8=jm,uC=Ige&&s8("%Object.defineProperty%",!0);if(uC)try{uC({},"a",{value:1})}catch{uC=!1}var Tge=s8("%SyntaxError%"),v_=s8("%TypeError%"),lV=SZ,xge=function(e,t,i){if(!e||typeof e!="object"&&typeof e!="function")throw new v_("`obj` must be an object or a function`");if(typeof t!="string"&&typeof t!="symbol")throw new v_("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new v_("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new v_("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new v_("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new v_("`loose`, if provided, must be a boolean");var s=arguments.length>3?arguments[3]:null,o=arguments.length>4?arguments[4]:null,r=arguments.length>5?arguments[5]:null,a=arguments.length>6?arguments[6]:!1,l=!!lV&&lV(e,t);if(uC)uC(e,t,{configurable:r===null&&l?l.configurable:!r,enumerable:s===null&&l?l.enumerable:!s,value:i,writable:o===null&&l?l.writable:!o});else if(a||!s&&!o&&!r)e[t]=i;else throw new Tge("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},LZ=jm,cV=xge,Nge=yZ(),dV=SZ,uV=LZ("%TypeError%"),Age=LZ("%Math.floor%"),Mge=function(e,t){if(typeof e!="function")throw new uV("`fn` is not a function");if(typeof t!="number"||t<0||t>4294967295||Age(t)!==t)throw new uV("`length` must be a positive 32-bit integer");var i=arguments.length>2&&!!arguments[2],s=!0,o=!0;if("length"in e&&dV){var r=dV(e,"length");r&&!r.configurable&&(s=!1),r&&!r.writable&&(o=!1)}return(s||o||!i)&&(Nge?cV(e,"length",t,!0,!0):cV(e,"length",t)),e};(function(n){var e=n8,t=jm,i=Mge,s=t("%TypeError%"),o=t("%Function.prototype.apply%"),r=t("%Function.prototype.call%"),a=t("%Reflect.apply%",!0)||e.call(r,o),l=t("%Object.defineProperty%",!0),c=t("%Math.max%");if(l)try{l({},"a",{value:1})}catch{l=null}n.exports=function(h){if(typeof h!="function")throw new s("a function is required");var f=a(e,r,arguments);return i(f,1+c(0,h.length-(arguments.length-1)),!0)};var d=function(){return a(e,o,arguments)};l?l(n.exports,"apply",{value:d}):n.exports.apply=d})(wZ);var Rge=wZ.exports,kZ=jm,DZ=Rge,Pge=DZ(kZ("String.prototype.indexOf")),Oge=function(e,t){var i=kZ(e,!!t);return typeof i=="function"&&Pge(e,".prototype.")>-1?DZ(i):i};const Fge={},Bge=Object.freeze(Object.defineProperty({__proto__:null,default:Fge},Symbol.toStringTag,{value:"Module"})),Wge=Zfe(Bge);var o8=typeof Map=="function"&&Map.prototype,WA=Object.getOwnPropertyDescriptor&&o8?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,sE=o8&&WA&&typeof WA.get=="function"?WA.get:null,hV=o8&&Map.prototype.forEach,r8=typeof Set=="function"&&Set.prototype,VA=Object.getOwnPropertyDescriptor&&r8?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,oE=r8&&VA&&typeof VA.get=="function"?VA.get:null,fV=r8&&Set.prototype.forEach,Vge=typeof WeakMap=="function"&&WeakMap.prototype,hC=Vge?WeakMap.prototype.has:null,Hge=typeof WeakSet=="function"&&WeakSet.prototype,fC=Hge?WeakSet.prototype.has:null,$ge=typeof WeakRef=="function"&&WeakRef.prototype,gV=$ge?WeakRef.prototype.deref:null,zge=Boolean.prototype.valueOf,Uge=Object.prototype.toString,jge=Function.prototype.toString,Kge=String.prototype.match,a8=String.prototype.slice,Zh=String.prototype.replace,qge=String.prototype.toUpperCase,pV=String.prototype.toLowerCase,EZ=RegExp.prototype.test,mV=Array.prototype.concat,Wc=Array.prototype.join,Gge=Array.prototype.slice,_V=Math.floor,M2=typeof BigInt=="function"?BigInt.prototype.valueOf:null,HA=Object.getOwnPropertySymbols,R2=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,pb=typeof Symbol=="function"&&typeof Symbol.iterator=="object",Qo=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===pb||"symbol")?Symbol.toStringTag:null,IZ=Object.prototype.propertyIsEnumerable,vV=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(n){return n.__proto__}:null);function bV(n,e){if(n===1/0||n===-1/0||n!==n||n&&n>-1e3&&n<1e3||EZ.call(/e/,e))return e;var t=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof n=="number"){var i=n<0?-_V(-n):_V(n);if(i!==n){var s=String(i),o=a8.call(e,s.length+1);return Zh.call(s,t,"$&_")+"."+Zh.call(Zh.call(o,/([0-9]{3})/g,"$&_"),/_$/,"")}}return Zh.call(e,t,"$&_")}var P2=Wge,CV=P2.custom,wV=xZ(CV)?CV:null,Yge=function n(e,t,i,s){var o=t||{};if(Ph(o,"quoteStyle")&&o.quoteStyle!=="single"&&o.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(Ph(o,"maxStringLength")&&(typeof o.maxStringLength=="number"?o.maxStringLength<0&&o.maxStringLength!==1/0:o.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var r=Ph(o,"customInspect")?o.customInspect:!0;if(typeof r!="boolean"&&r!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(Ph(o,"indent")&&o.indent!==null&&o.indent!==" "&&!(parseInt(o.indent,10)===o.indent&&o.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(Ph(o,"numericSeparator")&&typeof o.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var a=o.numericSeparator;if(typeof e>"u")return"undefined";if(e===null)return"null";if(typeof e=="boolean")return e?"true":"false";if(typeof e=="string")return AZ(e,o);if(typeof e=="number"){if(e===0)return 1/0/e>0?"0":"-0";var l=String(e);return a?bV(e,l):l}if(typeof e=="bigint"){var c=String(e)+"n";return a?bV(e,c):c}var d=typeof o.depth>"u"?5:o.depth;if(typeof i>"u"&&(i=0),i>=d&&d>0&&typeof e=="object")return O2(e)?"[Array]":"[Object]";var u=fpe(o,i);if(typeof s>"u")s=[];else if(NZ(s,e)>=0)return"[Circular]";function h(P,W,$){if(W&&(s=Gge.call(s),s.push(W)),$){var X={depth:o.depth};return Ph(o,"quoteStyle")&&(X.quoteStyle=o.quoteStyle),n(P,X,i+1,s)}return n(P,o,i+1,s)}if(typeof e=="function"&&!yV(e)){var f=spe(e),g=dL(e,h);return"[Function"+(f?": "+f:" (anonymous)")+"]"+(g.length>0?" { "+Wc.call(g,", ")+" }":"")}if(xZ(e)){var p=pb?Zh.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):R2.call(e);return typeof e=="object"&&!pb?Q0(p):p}if(dpe(e)){for(var _="<"+pV.call(String(e.nodeName)),v=e.attributes||[],b=0;b",_}if(O2(e)){if(e.length===0)return"[]";var C=dL(e,h);return u&&!hpe(C)?"["+F2(C,u)+"]":"[ "+Wc.call(C,", ")+" ]"}if(Qge(e)){var w=dL(e,h);return!("cause"in Error.prototype)&&"cause"in e&&!IZ.call(e,"cause")?"{ ["+String(e)+"] "+Wc.call(mV.call("[cause]: "+h(e.cause),w),", ")+" }":w.length===0?"["+String(e)+"]":"{ ["+String(e)+"] "+Wc.call(w,", ")+" }"}if(typeof e=="object"&&r){if(wV&&typeof e[wV]=="function"&&P2)return P2(e,{depth:d-i});if(r!=="symbol"&&typeof e.inspect=="function")return e.inspect()}if(ope(e)){var y=[];return hV&&hV.call(e,function(P,W){y.push(h(W,e,!0)+" => "+h(P,e))}),SV("Map",sE.call(e),y,u)}if(lpe(e)){var L=[];return fV&&fV.call(e,function(P){L.push(h(P,e))}),SV("Set",oE.call(e),L,u)}if(rpe(e))return $A("WeakMap");if(cpe(e))return $A("WeakSet");if(ape(e))return $A("WeakRef");if(epe(e))return Q0(h(Number(e)));if(ipe(e))return Q0(h(M2.call(e)));if(tpe(e))return Q0(zge.call(e));if(Jge(e))return Q0(h(String(e)));if(typeof window<"u"&&e===window)return"{ [object Window] }";if(e===Gfe)return"{ [object globalThis] }";if(!Xge(e)&&!yV(e)){var S=dL(e,h),k=vV?vV(e)===Object.prototype:e instanceof Object||e.constructor===Object,D=e instanceof Object?"":"null prototype",x=!k&&Qo&&Object(e)===e&&Qo in e?a8.call(wg(e),8,-1):D?"Object":"",A=k||typeof e.constructor!="function"?"":e.constructor.name?e.constructor.name+" ":"",T=A+(x||D?"["+Wc.call(mV.call([],x||[],D||[]),": ")+"] ":"");return S.length===0?T+"{}":u?T+"{"+F2(S,u)+"}":T+"{ "+Wc.call(S,", ")+" }"}return String(e)};function TZ(n,e,t){var i=(t.quoteStyle||e)==="double"?'"':"'";return i+n+i}function Zge(n){return Zh.call(String(n),/"/g,""")}function O2(n){return wg(n)==="[object Array]"&&(!Qo||!(typeof n=="object"&&Qo in n))}function Xge(n){return wg(n)==="[object Date]"&&(!Qo||!(typeof n=="object"&&Qo in n))}function yV(n){return wg(n)==="[object RegExp]"&&(!Qo||!(typeof n=="object"&&Qo in n))}function Qge(n){return wg(n)==="[object Error]"&&(!Qo||!(typeof n=="object"&&Qo in n))}function Jge(n){return wg(n)==="[object String]"&&(!Qo||!(typeof n=="object"&&Qo in n))}function epe(n){return wg(n)==="[object Number]"&&(!Qo||!(typeof n=="object"&&Qo in n))}function tpe(n){return wg(n)==="[object Boolean]"&&(!Qo||!(typeof n=="object"&&Qo in n))}function xZ(n){if(pb)return n&&typeof n=="object"&&n instanceof Symbol;if(typeof n=="symbol")return!0;if(!n||typeof n!="object"||!R2)return!1;try{return R2.call(n),!0}catch{}return!1}function ipe(n){if(!n||typeof n!="object"||!M2)return!1;try{return M2.call(n),!0}catch{}return!1}var npe=Object.prototype.hasOwnProperty||function(n){return n in this};function Ph(n,e){return npe.call(n,e)}function wg(n){return Uge.call(n)}function spe(n){if(n.name)return n.name;var e=Kge.call(jge.call(n),/^function\s*([\w$]+)/);return e?e[1]:null}function NZ(n,e){if(n.indexOf)return n.indexOf(e);for(var t=0,i=n.length;te.maxStringLength){var t=n.length-e.maxStringLength,i="... "+t+" more character"+(t>1?"s":"");return AZ(a8.call(n,0,e.maxStringLength),e)+i}var s=Zh.call(Zh.call(n,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,upe);return TZ(s,"single",e)}function upe(n){var e=n.charCodeAt(0),t={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return t?"\\"+t:"\\x"+(e<16?"0":"")+qge.call(e.toString(16))}function Q0(n){return"Object("+n+")"}function $A(n){return n+" { ? }"}function SV(n,e,t,i){var s=i?F2(t,i):Wc.call(t,", ");return n+" ("+e+") {"+s+"}"}function hpe(n){for(var e=0;e=0)return!1;return!0}function fpe(n,e){var t;if(n.indent===" ")t=" ";else if(typeof n.indent=="number"&&n.indent>0)t=Wc.call(Array(n.indent+1)," ");else return null;return{base:t,prev:Wc.call(Array(e+1),t)}}function F2(n,e){if(n.length===0)return"";var t="\n"+e.prev+e.base;return t+Wc.call(n,","+t)+"\n"+e.prev}function dL(n,e){var t=O2(n),i=[];if(t){i.length=n.length;for(var s=0;s1;){var t=e.pop(),i=t.obj[t.prop];if(hp(i)){for(var s=[],o=0;o=48&&c<=57||c>=65&&c<=90||c>=97&&c<=122||o===Ipe.RFC1738&&(c===40||c===41)){a+=r.charAt(l);continue}if(c<128){a=a+Ec[c];continue}if(c<2048){a=a+(Ec[192|c>>6]+Ec[128|c&63]);continue}if(c<55296||c>=57344){a=a+(Ec[224|c>>12]+Ec[128|c>>6&63]+Ec[128|c&63]);continue}l+=1,c=65536+((c&1023)<<10|r.charCodeAt(l)&1023),a+=Ec[240|c>>18]+Ec[128|c>>12&63]+Ec[128|c>>6&63]+Ec[128|c&63]}return a},Rpe=function(e){for(var t=[{obj:{o:e},prop:"o"}],i=[],s=0;s"u"&&(C=0)}if(typeof l=="function"?v=l(t,v):v instanceof Date?v=u(v):i==="comma"&&cu(v)&&(v=Jk.maybeMap(v,function(X){return X instanceof Date?u(X):X})),v===null){if(o)return a&&!g?a(t,zo.encoder,p,"key",h):t;v=""}if($pe(v)||Jk.isBuffer(v)){if(a){var L=g?t:a(t,zo.encoder,p,"key",h);return[f(L)+"="+f(a(v,zo.encoder,p,"value",h))]}return[f(t)+"="+f(String(v))]}var S=[];if(typeof v>"u")return S;var k;if(i==="comma"&&cu(v))g&&a&&(v=Jk.maybeMap(v,a)),k=[{value:v.length>0?v.join(",")||null:void 0}];else if(cu(l))k=l;else{var D=Object.keys(v);k=c?D.sort(c):D}for(var x=s&&cu(v)&&v.length===1?t+"[]":t,A=0;A"u"?zo.allowDots:!!e.allowDots,charset:t,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:zo.charsetSentinel,delimiter:typeof e.delimiter>"u"?zo.delimiter:e.delimiter,encode:typeof e.encode=="boolean"?e.encode:zo.encode,encoder:typeof e.encoder=="function"?e.encoder:zo.encoder,encodeValuesOnly:typeof e.encodeValuesOnly=="boolean"?e.encodeValuesOnly:zo.encodeValuesOnly,filter:o,format:i,formatter:s,serializeDate:typeof e.serializeDate=="function"?e.serializeDate:zo.serializeDate,skipNulls:typeof e.skipNulls=="boolean"?e.skipNulls:zo.skipNulls,sort:typeof e.sort=="function"?e.sort:null,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:zo.strictNullHandling}},jpe=function(n,e){var t=n,i=Upe(e),s,o;typeof i.filter=="function"?(o=i.filter,t=o("",t)):cu(i.filter)&&(o=i.filter,s=o);var r=[];if(typeof t!="object"||t===null)return"";var a;e&&e.arrayFormat in LV?a=e.arrayFormat:e&&"indices"in e?a=e.indices?"indices":"repeat":a="indices";var l=LV[a];if(e&&"commaRoundTrip"in e&&typeof e.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var c=l==="comma"&&e&&e.commaRoundTrip;s||(s=Object.keys(t)),i.sort&&s.sort(i.sort);for(var d=PZ(),u=0;u0?g+f:""},mb=RZ,B2=Object.prototype.hasOwnProperty,Kpe=Array.isArray,uo={allowDots:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:mb.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},qpe=function(n){return n.replace(/&#(\d+);/g,function(e,t){return String.fromCharCode(parseInt(t,10))})},FZ=function(n,e){return n&&typeof n=="string"&&e.comma&&n.indexOf(",")>-1?n.split(","):n},Gpe="utf8=%26%2310003%3B",Ype="utf8=%E2%9C%93",Zpe=function(e,t){var i={__proto__:null},s=t.ignoreQueryPrefix?e.replace(/^\?/,""):e,o=t.parameterLimit===1/0?void 0:t.parameterLimit,r=s.split(t.delimiter,o),a=-1,l,c=t.charset;if(t.charsetSentinel)for(l=0;l-1&&(g=Kpe(g)?[g]:g),B2.call(i,f)?i[f]=mb.combine(i[f],g):i[f]=g}return i},Xpe=function(n,e,t,i){for(var s=i?e:FZ(e,t),o=n.length-1;o>=0;--o){var r,a=n[o];if(a==="[]"&&t.parseArrays)r=[].concat(s);else{r=t.plainObjects?Object.create(null):{};var l=a.charAt(0)==="["&&a.charAt(a.length-1)==="]"?a.slice(1,-1):a,c=parseInt(l,10);!t.parseArrays&&l===""?r={0:s}:!isNaN(c)&&a!==l&&String(c)===l&&c>=0&&t.parseArrays&&c<=t.arrayLimit?(r=[],r[c]=s):l!=="__proto__"&&(r[l]=s)}s=r}return s},Qpe=function(e,t,i,s){if(e){var o=i.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,r=/(\[[^[\]]*])/,a=/(\[[^[\]]*])/g,l=i.depth>0&&r.exec(o),c=l?o.slice(0,l.index):o,d=[];if(c){if(!i.plainObjects&&B2.call(Object.prototype,c)&&!i.allowPrototypes)return;d.push(c)}for(var u=0;i.depth>0&&(l=a.exec(o))!==null&&u"u"?uo.charset:e.charset;return{allowDots:typeof e.allowDots>"u"?uo.allowDots:!!e.allowDots,allowPrototypes:typeof e.allowPrototypes=="boolean"?e.allowPrototypes:uo.allowPrototypes,allowSparse:typeof e.allowSparse=="boolean"?e.allowSparse:uo.allowSparse,arrayLimit:typeof e.arrayLimit=="number"?e.arrayLimit:uo.arrayLimit,charset:t,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:uo.charsetSentinel,comma:typeof e.comma=="boolean"?e.comma:uo.comma,decoder:typeof e.decoder=="function"?e.decoder:uo.decoder,delimiter:typeof e.delimiter=="string"||mb.isRegExp(e.delimiter)?e.delimiter:uo.delimiter,depth:typeof e.depth=="number"||e.depth===!1?+e.depth:uo.depth,ignoreQueryPrefix:e.ignoreQueryPrefix===!0,interpretNumericEntities:typeof e.interpretNumericEntities=="boolean"?e.interpretNumericEntities:uo.interpretNumericEntities,parameterLimit:typeof e.parameterLimit=="number"?e.parameterLimit:uo.parameterLimit,parseArrays:e.parseArrays!==!1,plainObjects:typeof e.plainObjects=="boolean"?e.plainObjects:uo.plainObjects,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:uo.strictNullHandling}},eme=function(n,e){var t=Jpe(e);if(n===""||n===null||typeof n>"u")return t.plainObjects?Object.create(null):{};for(var i=typeof n=="string"?Zpe(n,t):n,s=t.plainObjects?Object.create(null):{},o=Object.keys(i),r=0;rr.append(a,s[a])),s=r}return n[e](i,s,Object.assign({headers:{"Content-Type":t}},o))}}function rme(n={}){const e=qfe.create(n);function t(){return e.defaults.headers.common}function i(o,r){e.defaults.headers.common[o]=r}function s(o){if(typeof o=="string"){Reflect.deleteProperty(e.defaults.headers.common,o);return}o.forEach(r=>Reflect.deleteProperty(e.defaults.headers.common,r))}return{get:Yn(e,"get","json"),getBlob:Yn(e,"get","blob"),getDocument:Yn(e,"get","document"),getArrayBuffer:Yn(e,"get","arraybuffer"),getText:Yn(e,"get","text"),getStream:Yn(e,"get","stream"),head:Yn(e,"head","json"),headBlob:Yn(e,"head","blob"),headDocument:Yn(e,"head","document"),headArrayBuffer:Yn(e,"head","arraybuffer"),headText:Yn(e,"head","text"),headStream:Yn(e,"head","stream"),options:Yn(e,"options","json"),optionsBlob:Yn(e,"options","blob"),optionsDocument:Yn(e,"options","document"),optionsArrayBuffer:Yn(e,"options","arraybuffer"),optionsText:Yn(e,"options","text"),optionsStream:Yn(e,"options","stream"),delete:Yn(e,"delete","json"),deleteBlob:Yn(e,"delete","blob"),deleteDocument:Yn(e,"delete","document"),deleteArrayBuffer:Yn(e,"delete","arraybuffer"),deleteText:Yn(e,"delete","text"),deleteStream:Yn(e,"delete","stream"),post:jd(e,"post","application/json"),postUrlEncode:jd(e,"post","application/x-www-form-urlencoded"),postMultipart:jd(e,"post","multipart/form-data"),put:jd(e,"put","application/json"),putUrlEncode:jd(e,"put","application/x-www-form-urlencoded"),putMultipart:jd(e,"put","multipart/form-data"),patch:jd(e,"patch","application/json"),patchUrlEncode:jd(e,"patch","application/x-www-form-urlencoded"),patchMultipart:jd(e,"patch","multipart/form-data"),getHeaders:t,setHeader:i,removeHeader:s,axios:e}}var ame=Object.defineProperty,lme=Object.defineProperties,cme=Object.getOwnPropertyDescriptors,DV=Object.getOwnPropertySymbols,dme=Object.prototype.hasOwnProperty,ume=Object.prototype.propertyIsEnumerable,EV=(n,e,t)=>e in n?ame(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,cr=(n,e)=>{for(var t in e||(e={}))dme.call(e,t)&&EV(n,t,e[t]);if(DV)for(var t of DV(e))ume.call(e,t)&&EV(n,t,e[t]);return n},j_=(n,e)=>lme(n,cme(e));function hme(n){return n.name==="Text"}function BZ(n){return ju(n)&&n.type==="Expression"}function fme(n){return ju(n)&&!BZ(n)&&!WZ(n)&&!VZ(n)}function WZ(n){return ju(n)&&n.type==="Render"&&n.id}function VZ(n){return ju(n)&&n.type==="VNode"}function gme(n){return JSON.parse(JSON.stringify(n))}function pme(n){return tn(n)?n:Us(n)?n.split(" "):[]}var IV="schema-renderer-style",mme=["$item","$index","$slotProps","$renderArgs"],_me=rme({}),HZ={schema:{type:Object,required:!0,default:()=>({})},components:{type:Object,default:()=>({})},injects:{type:Object,default:()=>({})}},vme=et({props:HZ,setup(n){const e={h:Bc,ref:se,reactive:Cn,computed:ve,readonly:NB,watch:ht,watchEffect:Kde,watchSyncEffect:Gde,watchPostEffect:qde,isRef:eo,unref:ud,toRefs:Tde,isProxy:MB,isReactive:Fp,isReadonly:im,onBeforeMount:BB,onMounted:bd,onBeforeUpdate:IY,onUpdated:Cg,onBeforeUnmount:zm,onUnmounted:Cd,axle:_me};let t=cr(cr({},e),n.injects);const{uid:i}=ih();s(),bd(r),Cd(a),ht(()=>n.schema.css,l),ht(()=>n.injects,()=>{t=cr(cr({},e),n.injects)});function s(){var L,S;const k=(S=(L=n.schema.compatibleCode)!=null?L:n.schema.code)!=null?S:"function setup() { return {} }",x=o(k)();Object.assign(t,x)}function o(L,S){return window.evalWith(L,S!=null?S:t)}function r(){if(!n.schema.css)return;const L=document.createElement("style");L.innerHTML=n.schema.css,L.id="".concat(IV,"-").concat(i),document.head.appendChild(L)}function a(){const L=document.querySelector("#".concat(IV,"-").concat(i));L&&document.head.removeChild(L)}function l(){a(),r()}function c(L,S){return cr(cr({},L),S)}function d(L){return mme.some(S=>L.includes(S))}function u(L,S){return o(L,cr(cr({},t),S))}function h(L,S){return d(L)?u(L,S):o(L)}function f(L,S){return Object.keys(L).reduce((k,D)=>(k[D]=g(L[D],S),k),{})}function g(L,S){var k,D;return WZ(L)?(...x)=>{const A=c(S,{$renderArgs:j_(cr({},S.$renderArgs),{[L.id]:x})}),T=C(L.value,A);return Bc(li,T.map(P=>w(P,A)))}:VZ(L)?((k=g(L.value.if,S))!=null?k:!0)?w(L.value,S):void 0:BZ(L)?h((D=L.compatibleValue)!=null?D:L.value,S):fme(L)?f(L,S):tn(L)?L.map(x=>g(x,S)):L}function p(L,S){const k=b(L,S),D=pme(k.class),x=j_(cr({},k),{class:D});if(hme(L)){const{value:A}=L;return Bc("span",x,g(A,S))}return Bc(_(L.name),x,y(L,S))}function _(L){return n.components[L]}function v(L={}){return Object.entries(L).reduce((k,[D,x])=>{if(!D.startsWith("v-model"))return k[D]=x,k;const A=D.startsWith("v-model:")?D.replace("v-model:",""):"modelValue",T="onUpdate:".concat(A);return k[A]=x,k[T]={type:"Expression",value:"(value) => { ".concat(x.value," = value }")},k},{})}function b(L,S){var k;return Object.entries(v((k=L.props)!=null?k:{})).reduce((x,[A,T])=>(x[A]=g(T,S),x),{})}function C(L,S){return L.filter(k=>{var D;return!!g((D=k.if)!=null?D:!0,S)})}function w(L,S){if(!L.hasOwnProperty("for"))return p(L,S);const k=g(L.for,S);return Bc(li,null,ss(k,(D,x)=>{const A=gme(L);return p(A,c(S,{$item:j_(cr({},S.$item),{[L.id]:D}),$index:j_(cr({},S.$index),{[L.id]:x})}))}))}function y(L,S){var k;try{const D=cr({},(k=L.slots)!=null?k:{});return!D.default&&L.children&&(D.default={children:[...L.children]}),Object.entries(D).reduce((x,[A,T])=>(x[A]=P=>{var W;const $=c(S,{$slotProps:j_(cr({},S.$slotProps),{[L.id]:P})});return C((W=T.children)!=null?W:[],$).map(X=>w(X,$))},x),{})}catch(D){throw console.error("Renderer error, please check console"),D}}return()=>Bc("div",{class:"var-schema-renderer"},y(n.schema,{}))}}),bme=et({props:HZ,setup(n){let e="",t=se(0);return ht(()=>n.schema,i=>{var s;i.code!==e&&t.value++,e=(s=i.code)!=null?s:""},{immediate:!0}),()=>Bc(vme,j_(cr({},n),{key:t.value}))}});function ca(n,e=0){return n[n.length-(1+e)]}function Cme(n){if(n.length===0)throw new Error("Invalid tail call");return[n.slice(0,n.length-1),n[n.length-1]]}function yn(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 yme(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 W2(n,e,t){if(n=n|0,n>=e.length)throw new TypeError("invalid index");const i=e[Math.floor(e.length*Math.random())],s=[],o=[],r=[];for(const a of e){const l=t(a,i);l<0?s.push(a):l>0?o.push(a):r.push(a)}return n!!e)}function xV(n){let e=0;for(let t=0;t0}function Vf(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 jZ(n,e){return n.length>0?n[0]:e}function yo(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 zT(n,e,t){const i=n.slice(0,e),s=n.slice(e);return i.concat(t,s)}function KA(n,e){const t=n.indexOf(e);t>-1&&(n.splice(t,1),n.unshift(e))}function fL(n,e){const t=n.indexOf(e);t>-1&&(n.splice(t,1),n.push(e))}function V2(n,e){for(const t of e)n.push(t)}function u8(n){return Array.isArray(n)?n:[n]}function Lme(n,e,t){const i=KZ(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})(dw||(dw={}));function Sa(n,e){return(t,i)=>e(n(t),n(i))}function kme(...n){return(e,t)=>{for(const i of n){const s=i(e,t);if(!dw.isNeitherLessOrGreaterThan(s))return s}return dw.neitherLessOrGreaterThan}}const Mu=(n,e)=>n-e,Dme=(n,e)=>Mu(n?1:0,e?1:0);function qZ(n){return(e,t)=>-n(e,t)}class Ku{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 fd{constructor(e){this.iterate=e}toArray(){const e=[];return this.iterate(t=>(e.push(t),!0)),e}filter(e){return new fd(t=>this.iterate(i=>e(i)?t(i):!0))}map(e){return new fd(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||dw.isGreaterThan(e(s,t)))&&(i=!1,t=s),!0)),t}}fd.empty=new fd(n=>{});function Mo(n){return typeof n=="string"}function Io(n){return typeof n=="object"&&n!==null&&!Array.isArray(n)&&!(n instanceof RegExp)&&!(n instanceof Date)}function Eme(n){const e=Object.getPrototypeOf(Uint8Array);return typeof n=="object"&&n instanceof e}function Hf(n){return typeof n=="number"&&!isNaN(n)}function AV(n){return!!n&&typeof n[Symbol.iterator]=="function"}function GZ(n){return n===!0||n===!1}function _r(n){return typeof n>"u"}function uw(n){return!Fr(n)}function Fr(n){return _r(n)||n===null}function bi(n,e){if(!n)throw new Error(e?"Unexpected type, expected '".concat(e,"'"):"Unexpected type")}function kp(n){if(Fr(n))throw new Error("Assertion Failed: argument is undefined or null");return n}function hw(n){return typeof n=="function"}function Ime(n,e){const t=Math.min(n.length,e.length);for(let i=0;i{e[t]=i&&typeof i=="object"?du(i):i}),e}function xme(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(YZ.call(t,i)){const s=t[i];typeof s=="object"&&!Object.isFrozen(s)&&!Eme(s)&&e.push(s)}}return n}const YZ=Object.prototype.hasOwnProperty;function ZZ(n,e){return H2(n,e,new Set)}function H2(n,e,t){if(Fr(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(H2(o,e,t));return s}if(Io(n)){if(t.has(n))throw new Error("Cannot clone recursive data-structure");t.add(n);const s={};for(const o in n)YZ.call(n,o)&&(s[o]=H2(n[o],e,t));return t.delete(n),s}return n}function UT(n,e,t=!0){return Io(n)?(Io(e)&&Object.keys(e).forEach(i=>{i in n?t&&(Io(n[i])&&Io(e[i])?UT(n[i],e[i],t):n[i]=e[i]):n[i]=e[i]}),n):e}function Gr(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}globalThis&&globalThis.__awaiter;let Mme=typeof document<"u"&&document.location&&document.location.hash.indexOf("pseudo=true")>=0;function Rme(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}),Mme&&(t="["+t.replace(/[aouei]/g,"$&$&")+"]"),t}function m(n,e,...t){return Rme(e,t)}var qA;const J_="en";let rE=!1,aE=!1,eD=!1,XZ=!1,f8=!1,g8=!1,QZ=!1,gL,tD=J_,MV=J_,Pme,xl;const ol=typeof self=="object"?self:typeof global=="object"?global:{};let So;typeof ol.vscode<"u"&&typeof ol.vscode.process<"u"?So=ol.vscode.process:typeof process<"u"&&(So=process);const Ome=typeof((qA=So==null?void 0:So.versions)===null||qA===void 0?void 0:qA.electron)=="string",Fme=Ome&&(So==null?void 0:So.type)==="renderer";if(typeof navigator=="object"&&!Fme)xl=navigator.userAgent,rE=xl.indexOf("Windows")>=0,aE=xl.indexOf("Macintosh")>=0,g8=(xl.indexOf("Macintosh")>=0||xl.indexOf("iPad")>=0||xl.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,eD=xl.indexOf("Linux")>=0,QZ=(xl==null?void 0:xl.indexOf("Mobi"))>=0,f8=!0,m({key:"ensureLoaderPluginIsLoaded",comment:["{Locked}"]},"_"),gL=J_,tD=gL,MV=navigator.language;else if(typeof So=="object"){rE=So.platform==="win32",aE=So.platform==="darwin",eD=So.platform==="linux",eD&&So.env.SNAP&&So.env.SNAP_REVISION,So.env.CI||So.env.BUILD_ARTIFACTSTAGINGDIRECTORY,gL=J_,tD=J_;const n=So.env.VSCODE_NLS_CONFIG;if(n)try{const e=JSON.parse(n),t=e.availableLanguages["*"];gL=e.locale,MV=e.osLocale,tD=t||J_,Pme=e._translationsConfigFile}catch{}XZ=!0}else console.error("Unable to resolve platform.");const zs=rE,Kt=aE,Co=eD,nc=XZ,yg=f8,Bme=f8&&typeof ol.importScripts=="function",uc=g8,Wme=QZ,yd=xl,Vme=tD,Hme=typeof ol.postMessage=="function"&&!ol.importScripts,JZ=(()=>{if(Hme){const n=[];ol.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}),ol.postMessage({vscodeScheduleAsyncWork:i},"*")}}return n=>setTimeout(n)})(),$r=aE||g8?2:rE?1:3;let RV=!0,PV=!1;function eX(){if(!PV){PV=!0;const n=new Uint8Array(2);n[0]=1,n[1]=2,RV=new Uint16Array(n.buffer)[0]===512+1}return RV}const tX=!!(yd&&yd.indexOf("Chrome")>=0),$me=!!(yd&&yd.indexOf("Firefox")>=0),zme=!!(!tX&&yd&&yd.indexOf("Safari")>=0),Ume=!!(yd&&yd.indexOf("Edg/")>=0);yd&&yd.indexOf("Android")>=0;const Qs={tabSize:4,indentSize:4,insertSpaces:!0,detectIndentation:!0,trimAutoWhitespace:!0,largeFileOptimizations:!0,bracketPairColorizationOptions:{enabled:!0,independentColorPoolPerBracketType:!1}};var Pt;(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 C=b.length-1;C>=0;C--)yield b[C]}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,C){for(const w of b)if(C(w))return!0;return!1}n.some=d;function u(b,C){for(const w of b)if(C(w))return w}n.find=u;function*h(b,C){for(const w of b)C(w)&&(yield w)}n.filter=h;function*f(b,C){let w=0;for(const y of b)yield C(y,w++)}n.map=f;function*g(...b){for(const C of b)for(const w of C)yield w}n.concat=g;function p(b,C,w){let y=w;for(const L of b)y=C(y,L);return y}n.reduce=p;function*_(b,C,w=b.length){for(C<0&&(C+=b.length),w<0?w+=b.length:w>b.length&&(w=b.length);C{s||(s=!0,this._remove(i))}}shift(){if(this._first!==Vn.Undefined){const e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==Vn.Undefined){const e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==Vn.Undefined&&e.next!==Vn.Undefined){const t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===Vn.Undefined&&e.next===Vn.Undefined?(this._first=Vn.Undefined,this._last=Vn.Undefined):e.next===Vn.Undefined?(this._last=this._last.prev,this._last.next=Vn.Undefined):e.prev===Vn.Undefined&&(this._first=this._first.next,this._first.prev=Vn.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==Vn.Undefined;)yield e.element,e=e.next}}const iX="`~!@#$%^&*()-=+[{]}\\|;:'\",.<>/?";function jme(n=""){let e="(-?\\d*\\.\\d\\w*)|([^";for(const t of iX)n.indexOf(t)>=0||(e+="\\"+t);return e+="\\s]+)",new RegExp(e,"g")}const p8=jme();function nX(n){let e=p8;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 sX=new To;sX.unshift({maxLen:1e3,windowSize:15,timeBudget:150});function fw(n,e,t,i,s){if(s||(s=Pt.first(sX)),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),fw(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=Kme(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 Kme(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 Dh=8;class oX{constructor(e){this._values=e}hasChanged(e){return this._values[e]}}class rX{constructor(){this.stableMinimapLayoutInput=null,this.stableFitMaxMinimapScale=0,this.stableFitRemainingWidth=0}}class Ji{constructor(e,t,i,s){this.id=e,this.name=t,this.defaultValue=i,this.schema=s}applyUpdate(e,t){return jT(e,t)}compute(e,t,i){return i}}class pC{constructor(e,t){this.newValue=e,this.didChange=t}}function jT(n,e){if(typeof n!="object"||typeof e!="object"||!n||!e)return new pC(e,n!==e);if(Array.isArray(n)||Array.isArray(e)){const i=Array.isArray(n)&&Array.isArray(e)&&yn(n,e);return new pC(e,!i)}let t=!1;for(const i in e)if(e.hasOwnProperty(i)){const s=jT(n[i],e[i]);s.didChange&&(n[i]=s.newValue,t=!0)}return new pC(n,t)}class oS{constructor(e){this.schema=void 0,this.id=e,this.name="_never_",this.defaultValue=void 0}applyUpdate(e,t){return jT(e,t)}validate(e){return this.defaultValue}}class w0{constructor(e,t,i,s){this.id=e,this.name=t,this.defaultValue=i,this.schema=s}applyUpdate(e,t){return jT(e,t)}validate(e){return typeof e>"u"?this.defaultValue:e}compute(e,t,i){return i}}function rt(n,e){return typeof n>"u"?e:n==="false"?!1:!!n}class Yt extends w0{constructor(e,t,i,s=void 0){typeof s<"u"&&(s.type="boolean",s.default=i),super(e,t,i,s)}validate(e){return rt(e,this.defaultValue)}}function ep(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 Li extends w0{static clampedInt(e,t,i,s){return ep(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 Li.clampedInt(e,this.defaultValue,this.minimum,this.maximum)}}function qme(n,e,t,i){if(typeof n>"u")return e;const s=Qa.float(n,e);return Qa.clamp(s,t,i)}class Qa extends w0{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(Qa.float(e,this.defaultValue))}}class gr extends w0{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 gr.string(e,this.defaultValue)}}function Dn(n,e,t,i){return typeof n!="string"?e:i&&n in i?i[n]:t.indexOf(n)===-1?e:n}class ln extends w0{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 Dn(e,this.defaultValue,this._allowedValues)}}class pL extends Ji{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 Gme(n){switch(n){case"none":return 0;case"keep":return 1;case"brackets":return 2;case"advanced":return 3;case"full":return 4}}class Yme extends Ji{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 Zme extends Ji{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:rt(t.insertSpace,this.defaultValue.insertSpace),ignoreEmptyLines:rt(t.ignoreEmptyLines,this.defaultValue.ignoreEmptyLines)}}}function Xme(n){switch(n){case"blink":return 1;case"smooth":return 2;case"phase":return 3;case"expand":return 4;case"solid":return 5}}var ws;(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"})(ws||(ws={}));function Qme(n){switch(n){case"line":return ws.Line;case"block":return ws.Block;case"underline":return ws.Underline;case"line-thin":return ws.LineThin;case"block-outline":return ws.BlockOutline;case"underline-thin":return ws.UnderlineThin}}class Jme extends oS{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 e_e extends Yt{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 t_e extends Ji{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:Kt},"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:rt(t.cursorMoveOnType,this.defaultValue.cursorMoveOnType),seedSearchStringFromSelection:typeof e.seedSearchStringFromSelection=="boolean"?e.seedSearchStringFromSelection?"always":"never":Dn(t.seedSearchStringFromSelection,this.defaultValue.seedSearchStringFromSelection,["never","always","selection"]),autoFindInSelection:typeof e.autoFindInSelection=="boolean"?e.autoFindInSelection?"always":"never":Dn(t.autoFindInSelection,this.defaultValue.autoFindInSelection,["never","always","multiline"]),globalFindClipboard:rt(t.globalFindClipboard,this.defaultValue.globalFindClipboard),addExtraSpaceOnTop:rt(t.addExtraSpaceOnTop,this.defaultValue.addExtraSpaceOnTop),loop:rt(t.loop,this.defaultValue.loop)}}}class Br extends Ji{constructor(){super(51,"fontLigatures",Br.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"?Br.OFF:e==="true"?Br.ON:e:e?Br.ON:Br.OFF}}Br.OFF='"liga" off, "calt" off';Br.ON='"liga" on, "calt" on';class Gl extends Ji{constructor(){super(54,"fontVariations",Gl.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"?Gl.OFF:e==="true"?Gl.TRANSLATE:e:e?Gl.TRANSLATE:Gl.OFF}compute(e,t,i){return e.fontInfo.fontVariationSettings}}Gl.OFF="normal";Gl.TRANSLATE="translate";class i_e extends oS{constructor(){super(50)}compute(e,t,i){return e.fontInfo}}class n_e extends w0{constructor(){super(52,"fontSize",wr.fontSize,{type:"number",minimum:6,maximum:100,default:wr.fontSize,description:m("fontSize","Controls the font size in pixels.")})}validate(e){const t=Qa.float(e,this.defaultValue);return t===0?wr.fontSize:Qa.clamp(t,6,100)}compute(e,t,i){return e.fontInfo.fontSize}}class jc extends Ji{constructor(){super(53,"fontWeight",wr.fontWeight,{anyOf:[{type:"number",minimum:jc.MINIMUM_VALUE,maximum:jc.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:jc.SUGGESTION_VALUES}],default:wr.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(Li.clampedInt(e,wr.fontWeight,jc.MINIMUM_VALUE,jc.MAXIMUM_VALUE))}}jc.SUGGESTION_VALUES=["normal","bold","100","200","300","400","500","600","700","800","900"];jc.MINIMUM_VALUE=1;jc.MAXIMUM_VALUE=1e3;class s_e extends Ji{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:Dn(a.multiple,this.defaultValue.multiple,["peek","gotoAndPeek","goto"]),multipleDefinitions:(t=a.multipleDefinitions)!==null&&t!==void 0?t:Dn(a.multipleDefinitions,"peek",["peek","gotoAndPeek","goto"]),multipleTypeDefinitions:(i=a.multipleTypeDefinitions)!==null&&i!==void 0?i:Dn(a.multipleTypeDefinitions,"peek",["peek","gotoAndPeek","goto"]),multipleDeclarations:(s=a.multipleDeclarations)!==null&&s!==void 0?s:Dn(a.multipleDeclarations,"peek",["peek","gotoAndPeek","goto"]),multipleImplementations:(o=a.multipleImplementations)!==null&&o!==void 0?o:Dn(a.multipleImplementations,"peek",["peek","gotoAndPeek","goto"]),multipleReferences:(r=a.multipleReferences)!==null&&r!==void 0?r:Dn(a.multipleReferences,"peek",["peek","gotoAndPeek","goto"]),alternativeDefinitionCommand:gr.string(a.alternativeDefinitionCommand,this.defaultValue.alternativeDefinitionCommand),alternativeTypeDefinitionCommand:gr.string(a.alternativeTypeDefinitionCommand,this.defaultValue.alternativeTypeDefinitionCommand),alternativeDeclarationCommand:gr.string(a.alternativeDeclarationCommand,this.defaultValue.alternativeDeclarationCommand),alternativeImplementationCommand:gr.string(a.alternativeImplementationCommand,this.defaultValue.alternativeImplementationCommand),alternativeReferenceCommand:gr.string(a.alternativeReferenceCommand,this.defaultValue.alternativeReferenceCommand)}}}class o_e extends Ji{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:rt(t.enabled,this.defaultValue.enabled),delay:Li.clampedInt(t.delay,this.defaultValue.delay,0,1e4),sticky:rt(t.sticky,this.defaultValue.sticky),hidingDelay:Li.clampedInt(t.hidingDelay,this.defaultValue.hidingDelay,0,6e5),above:rt(t.above,this.defaultValue.above)}}}class Pv extends oS{constructor(){super(143)}compute(e,t,i){return Pv.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,C=e.isViewportWrapping,w=u?2:3;let y=Math.floor(o*s);const L=y/o;let S=!1,k=!1,D=w*h,x=h/o,A=1;if(g==="fill"||g==="fit"){const{typicalViewportLineCount:Q,extraLinesBeforeFirstLine:le,extraLinesBeyondLastLine:de,desiredRatio:_e,minimapLineCount:ie}=Pv.computeContainedMinimapLineCount({viewLineCount:v,scrollBeyondLastLine:d,paddingTop:e.paddingTop,paddingBottom:e.paddingBottom,height:s,lineHeight:l,pixelRatio:o});if(v/ie>1)S=!0,k=!0,h=1,D=1,x=h/o;else{let Ye=!1,pe=h+1;if(g==="fit"){const Ee=Math.ceil((le+v+de)*D);C&&a&&b<=t.stableFitRemainingWidth?(Ye=!0,pe=t.stableFitMaxMinimapScale):Ye=Ee>y}if(g==="fill"||Ye){S=!0;const Ee=h;D=Math.min(l*o,Math.max(1,Math.floor(1/_e))),C&&a&&b<=t.stableFitRemainingWidth&&(pe=t.stableFitMaxMinimapScale),h=Math.min(pe,Math.max(1,Math.floor(D/w))),h>Ee&&(A=Math.min(2,h/Ee)),x=h/o/A,y=Math.ceil(Math.max(Q,le+v+de)*D),C?(t.stableMinimapLayoutInput=e,t.stableFitRemainingWidth=b,t.stableFitMaxMinimapScale=h):(t.stableMinimapLayoutInput=null,t.stableFitRemainingWidth=0)}}}const T=Math.floor(f*x),P=Math.min(T,Math.max(0,Math.floor((b-_-2)*x/(c+x)))+Dh);let W=Math.floor(o*P);const $=W/o;W=Math.floor(W*A);const X=u?1:2,J=p==="left"?0:i-P-_;return{renderMinimap:X,minimapLeft:J,minimapWidth:P,minimapHeightIsEditorHeight:S,minimapIsSampling:k,minimapScale:h,minimapLineHeight:D,minimapCanvasInnerWidth:W,minimapCanvasInnerHeight:y,minimapCanvasOuterWidth:$,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),C=e.get(104),w=e.get(83),y=e.get(72),L=e.get(102),S=L.verticalScrollbarSize,k=L.verticalHasArrows,D=L.arrowSize,x=L.horizontalScrollbarSize,A=e.get(43),T=e.get(109)!=="never";let P=e.get(65);A&&T&&(P+=16);let W=0;if(v){const It=Math.max(r,b);W=Math.round(It*l)}let $=0;_&&($=o*t.glyphMarginDecorationLaneCount);let X=0,J=X+$,Q=J+W,le=Q+P;const de=i-$-W-P;let _e=!1,ie=!1,ne=-1;h==="inherit"&&p?(_e=!0,ie=!0):f==="on"||f==="bounded"?ie=!0:f==="wordWrapColumn"&&(ne=g);const Ye=Pv._computeMinimapLayout({outerWidth:i,outerHeight:s,lineHeight:o,typicalHalfwidthCharacterWidth:a,pixelRatio:c,scrollBeyondLastLine:C,paddingTop:w.top,paddingBottom:w.bottom,minimap:y,verticalScrollbarWidth:S,viewLineCount:d,remainingWidth:de,isViewportWrapping:ie},t.memory||new rX);Ye.renderMinimap!==0&&Ye.minimapLeft===0&&(X+=Ye.minimapWidth,J+=Ye.minimapWidth,Q+=Ye.minimapWidth,le+=Ye.minimapWidth);const pe=de-Ye.minimapWidth,Ee=Math.max(1,Math.floor((pe-S-2)/a)),ze=k?D:0;return ie&&(ne=Math.max(1,Ee),f==="bounded"&&(ne=Math.min(ne,g))),{width:i,height:s,glyphMarginLeft:X,glyphMarginWidth:$,glyphMarginDecorationLaneCount:t.glyphMarginDecorationLaneCount,lineNumbersLeft:J,lineNumbersWidth:W,decorationsLeft:Q,decorationsWidth:P,contentLeft:le,contentWidth:pe,minimap:Ye,viewportColumn:Ee,isWordWrapMinified:_e,isViewportWrapping:ie,wrappingColumn:ne,verticalScrollbarWidth:S,horizontalScrollbarHeight:x,overviewRuler:{top:ze,width:S,height:s-2*ze,right:0}}}}class r_e extends Ji{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 Dn(e,"simple",["simple","advanced"])}compute(e,t,i){return t.get(2)===2?"advanced":i}}class a_e extends Ji{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:rt(e.enabled,this.defaultValue.enabled)}}}class l_e extends Ji{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:rt(t.enabled,this.defaultValue.enabled),maxLineCount:Li.clampedInt(t.maxLineCount,this.defaultValue.maxLineCount,1,10),defaultModel:Dn(t.defaultModel,this.defaultValue.defaultModel,["outlineModel","foldingProviderModel","indentationModel"]),scrollWithEditor:rt(t.scrollWithEditor,this.defaultValue.scrollWithEditor)}}}class c_e extends Ji{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}",Kt?"Ctrl+Option":"Ctrl+Alt"),m("editor.inlayHints.offUnlessPressed","Inlay hints are hidden by default and show when holding {0}",Kt?"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:Dn(t.enabled,this.defaultValue.enabled,["on","off","offUnlessPressed","onUnlessPressed"]),fontSize:Li.clampedInt(t.fontSize,this.defaultValue.fontSize,0,100),fontFamily:gr.string(t.fontFamily,this.defaultValue.fontFamily),padding:rt(t.padding,this.defaultValue.padding)}}}class d_e extends Ji{constructor(){super(65,"lineDecorationsWidth",10)}validate(e){return typeof e=="string"&&/^\d+(\.\d+)?ch$/.test(e)?-parseFloat(e.substring(0,e.length-2)):Li.clampedInt(e,this.defaultValue,0,1e3)}compute(e,t,i){return i<0?Li.clampedInt(-i*e.fontInfo.typicalHalfwidthCharacterWidth,this.defaultValue,0,1e3):i}}class u_e extends Qa{constructor(){super(66,"lineHeight",wr.lineHeight,e=>Qa.clamp(e,0,150),{markdownDescription:m("lineHeight","Controls the line height. \n - Use 0 to automatically compute the line height from the font size.\n - Values between 0 and 8 will be used as a multiplier with the font size.\n - Values greater than or equal to 8 will be used as effective values.")})}compute(e,t,i){return e.fontInfo.lineHeight}}class h_e extends Ji{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:rt(t.enabled,this.defaultValue.enabled),autohide:rt(t.autohide,this.defaultValue.autohide),size:Dn(t.size,this.defaultValue.size,["proportional","fill","fit"]),side:Dn(t.side,this.defaultValue.side,["right","left"]),showSlider:Dn(t.showSlider,this.defaultValue.showSlider,["always","mouseover"]),renderCharacters:rt(t.renderCharacters,this.defaultValue.renderCharacters),scale:Li.clampedInt(t.scale,1,1,3),maxColumn:Li.clampedInt(t.maxColumn,this.defaultValue.maxColumn,1,1e4)}}}function f_e(n){return n==="ctrlCmd"?Kt?"metaKey":"ctrlKey":"altKey"}class g_e extends Ji{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:Li.clampedInt(t.top,0,0,1e3),bottom:Li.clampedInt(t.bottom,0,0,1e3)}}}class p_e extends Ji{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:rt(t.enabled,this.defaultValue.enabled),cycle:rt(t.cycle,this.defaultValue.cycle)}}}class m_e extends oS{constructor(){super(141)}compute(e,t,i){return e.pixelRatio}}class __e extends Ji{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=Dn(t,this.defaultValue.other,o),typeof i=="boolean"?a=i?"on":"off":a=Dn(i,this.defaultValue.comments,o),typeof s=="boolean"?l=s?"on":"off":l=Dn(s,this.defaultValue.strings,o),{other:r,comments:a,strings:l}}}class v_e extends Ji{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 lE(n){const e=n.get(97);return e==="editable"?n.get(90):e!=="on"}class b_e extends Ji{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:Li.clampedInt(i,0,0,1e4),color:null});else if(i&&typeof i=="object"){const s=i;t.push({column:Li.clampedInt(s.column,0,0,1e4),color:s.color})}return t.sort((i,s)=>i.column-s.column),t}return this.defaultValue}}class C_e extends Ji{constructor(){super(91,"readOnlyMessage",void 0)}validate(e){return!e||typeof e!="object"?this.defaultValue:e}}function OV(n,e){if(typeof n!="string")return e;switch(n){case"hidden":return 2;case"visible":return 3;default:return 1}}let w_e=class extends Ji{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=Li.clampedInt(t.horizontalScrollbarSize,this.defaultValue.horizontalScrollbarSize,0,1e3),s=Li.clampedInt(t.verticalScrollbarSize,this.defaultValue.verticalScrollbarSize,0,1e3);return{arrowSize:Li.clampedInt(t.arrowSize,this.defaultValue.arrowSize,0,1e3),vertical:OV(t.vertical,this.defaultValue.vertical),horizontal:OV(t.horizontal,this.defaultValue.horizontal),useShadows:rt(t.useShadows,this.defaultValue.useShadows),verticalHasArrows:rt(t.verticalHasArrows,this.defaultValue.verticalHasArrows),horizontalHasArrows:rt(t.horizontalHasArrows,this.defaultValue.horizontalHasArrows),handleMouseWheel:rt(t.handleMouseWheel,this.defaultValue.handleMouseWheel),alwaysConsumeMouseWheel:rt(t.alwaysConsumeMouseWheel,this.defaultValue.alwaysConsumeMouseWheel),horizontalScrollbarSize:i,horizontalSliderSize:Li.clampedInt(t.horizontalSliderSize,i,0,1e3),verticalScrollbarSize:s,verticalSliderSize:Li.clampedInt(t.verticalSliderSize,s,0,1e3),scrollByPage:rt(t.scrollByPage,this.defaultValue.scrollByPage)}}};const Mr="inUntrustedWorkspace",Go={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 y_e extends Ji{constructor(){const e={nonBasicASCII:Mr,invisibleCharacters:!0,ambiguousCharacters:!0,includeComments:Mr,includeStrings:!0,allowedCharacters:{},allowedLocales:{_os:!0,_vscode:!0}};super(124,"unicodeHighlight",e,{[Go.nonBasicASCII]:{restricted:!0,type:["boolean","string"],enum:[!0,!1,Mr],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.")},[Go.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.")},[Go.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.")},[Go.includeComments]:{restricted:!0,type:["boolean","string"],enum:[!0,!1,Mr],default:e.includeComments,description:m("unicodeHighlight.includeComments","Controls whether characters in comments should also be subject to Unicode highlighting.")},[Go.includeStrings]:{restricted:!0,type:["boolean","string"],enum:[!0,!1,Mr],default:e.includeStrings,description:m("unicodeHighlight.includeStrings","Controls whether characters in strings should also be subject to Unicode highlighting.")},[Go.allowedCharacters]:{restricted:!0,type:"object",default:e.allowedCharacters,description:m("unicodeHighlight.allowedCharacters","Defines allowed characters that are not being highlighted."),additionalProperties:{type:"boolean"}},[Go.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&&(Gr(e.allowedCharacters,t.allowedCharacters)||(e=Object.assign(Object.assign({},e),{allowedCharacters:t.allowedCharacters}),i=!0)),t.allowedLocales&&e&&(Gr(e.allowedLocales,t.allowedLocales)||(e=Object.assign(Object.assign({},e),{allowedLocales:t.allowedLocales}),i=!0));const s=super.applyUpdate(e,t);return i?new pC(s.newValue,!0):s}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{nonBasicASCII:Ov(t.nonBasicASCII,Mr,[!0,!1,Mr]),invisibleCharacters:rt(t.invisibleCharacters,this.defaultValue.invisibleCharacters),ambiguousCharacters:rt(t.ambiguousCharacters,this.defaultValue.ambiguousCharacters),includeComments:Ov(t.includeComments,Mr,[!0,!1,Mr]),includeStrings:Ov(t.includeStrings,Mr,[!0,!1,Mr]),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 S_e extends Ji{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:rt(t.enabled,this.defaultValue.enabled),mode:Dn(t.mode,this.defaultValue.mode,["prefix","subword","subwordSmart"]),showToolbar:Dn(t.showToolbar,this.defaultValue.showToolbar,["always","onHover"]),suppressSuggestions:rt(t.suppressSuggestions,this.defaultValue.suppressSuggestions),keepOnBlur:rt(t.keepOnBlur,this.defaultValue.keepOnBlur)}}}class L_e extends Ji{constructor(){const e={enabled:Qs.bracketPairColorizationOptions.enabled,independentColorPoolPerBracketType:Qs.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:rt(t.enabled,this.defaultValue.enabled),independentColorPoolPerBracketType:rt(t.independentColorPoolPerBracketType,this.defaultValue.independentColorPoolPerBracketType)}}}class k_e extends Ji{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:Ov(t.bracketPairs,this.defaultValue.bracketPairs,[!0,!1,"active"]),bracketPairsHorizontal:Ov(t.bracketPairsHorizontal,this.defaultValue.bracketPairsHorizontal,[!0,!1,"active"]),highlightActiveBracketPair:rt(t.highlightActiveBracketPair,this.defaultValue.highlightActiveBracketPair),indentation:rt(t.indentation,this.defaultValue.indentation),highlightActiveIndentation:Ov(t.highlightActiveIndentation,this.defaultValue.highlightActiveIndentation,[!0,!1,"always"])}}}function Ov(n,e,t){const i=t.indexOf(n);return i===-1?e:t[i]}class D_e extends Ji{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:Dn(t.insertMode,this.defaultValue.insertMode,["insert","replace"]),filterGraceful:rt(t.filterGraceful,this.defaultValue.filterGraceful),snippetsPreventQuickSuggestions:rt(t.snippetsPreventQuickSuggestions,this.defaultValue.filterGraceful),localityBonus:rt(t.localityBonus,this.defaultValue.localityBonus),shareSuggestSelections:rt(t.shareSuggestSelections,this.defaultValue.shareSuggestSelections),selectionMode:Dn(t.selectionMode,this.defaultValue.selectionMode,["always","never","whenQuickSuggestion","whenTriggerCharacter"]),showIcons:rt(t.showIcons,this.defaultValue.showIcons),showStatusBar:rt(t.showStatusBar,this.defaultValue.showStatusBar),preview:rt(t.preview,this.defaultValue.preview),previewMode:Dn(t.previewMode,this.defaultValue.previewMode,["prefix","subword","subwordSmart"]),showInlineDetails:rt(t.showInlineDetails,this.defaultValue.showInlineDetails),showMethods:rt(t.showMethods,this.defaultValue.showMethods),showFunctions:rt(t.showFunctions,this.defaultValue.showFunctions),showConstructors:rt(t.showConstructors,this.defaultValue.showConstructors),showDeprecated:rt(t.showDeprecated,this.defaultValue.showDeprecated),matchOnWordStartOnly:rt(t.matchOnWordStartOnly,this.defaultValue.matchOnWordStartOnly),showFields:rt(t.showFields,this.defaultValue.showFields),showVariables:rt(t.showVariables,this.defaultValue.showVariables),showClasses:rt(t.showClasses,this.defaultValue.showClasses),showStructs:rt(t.showStructs,this.defaultValue.showStructs),showInterfaces:rt(t.showInterfaces,this.defaultValue.showInterfaces),showModules:rt(t.showModules,this.defaultValue.showModules),showProperties:rt(t.showProperties,this.defaultValue.showProperties),showEvents:rt(t.showEvents,this.defaultValue.showEvents),showOperators:rt(t.showOperators,this.defaultValue.showOperators),showUnits:rt(t.showUnits,this.defaultValue.showUnits),showValues:rt(t.showValues,this.defaultValue.showValues),showConstants:rt(t.showConstants,this.defaultValue.showConstants),showEnums:rt(t.showEnums,this.defaultValue.showEnums),showEnumMembers:rt(t.showEnumMembers,this.defaultValue.showEnumMembers),showKeywords:rt(t.showKeywords,this.defaultValue.showKeywords),showWords:rt(t.showWords,this.defaultValue.showWords),showColors:rt(t.showColors,this.defaultValue.showColors),showFiles:rt(t.showFiles,this.defaultValue.showFiles),showReferences:rt(t.showReferences,this.defaultValue.showReferences),showFolders:rt(t.showFolders,this.defaultValue.showFolders),showTypeParameters:rt(t.showTypeParameters,this.defaultValue.showTypeParameters),showSnippets:rt(t.showSnippets,this.defaultValue.showSnippets),showUsers:rt(t.showUsers,this.defaultValue.showUsers),showIssues:rt(t.showIssues,this.defaultValue.showIssues)}}}class E_e extends Ji{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:rt(e.selectLeadingAndTrailingWhitespace,this.defaultValue.selectLeadingAndTrailingWhitespace),selectSubwords:rt(e.selectSubwords,this.defaultValue.selectSubwords)}}}class I_e extends Ji{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 T_e extends oS{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 x_e extends Ji{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:rt(t.enabled,this.defaultValue.enabled),showDropSelector:Dn(t.showDropSelector,this.defaultValue.showDropSelector,["afterDrop","never"])}}}class N_e extends Ji{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:rt(t.enabled,this.defaultValue.enabled),showPasteSelector:Dn(t.showPasteSelector,this.defaultValue.showPasteSelector,["afterPaste","never"])}}}const A_e="Consolas, 'Courier New', monospace",M_e="Menlo, Monaco, 'Courier New', monospace",R_e="'Droid Sans Mono', 'monospace', monospace",wr={fontFamily:Kt?M_e:Co?R_e:A_e,fontWeight:"normal",fontSize:Kt?12:14,lineHeight:0,letterSpacing:0},ev=[];function ke(n){return ev[n.id]=n,n}const vc={acceptSuggestionOnCommitCharacter:ke(new Yt(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:ke(new ln(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:ke(new Yme),accessibilityPageSize:ke(new Li(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:ke(new gr(4,"ariaLabel",m("editorViewAccessibleLabel","Editor content"))),ariaRequired:ke(new Yt(5,"ariaRequired",!1,void 0)),screenReaderAnnounceInlineSuggestion:ke(new Yt(8,"screenReaderAnnounceInlineSuggestion",!0,{description:m("screenReaderAnnounceInlineSuggestion","Control whether inline suggestions are announced by a screen reader."),tags:["accessibility"]})),autoClosingBrackets:ke(new ln(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:ke(new ln(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:ke(new ln(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:ke(new ln(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:ke(new ln(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:ke(new pL(12,"autoIndent",4,"full",["none","keep","brackets","advanced","full"],Gme,{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:ke(new Yt(13,"automaticLayout",!1)),autoSurround:ke(new ln(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:ke(new L_e),bracketPairGuides:ke(new k_e),stickyTabStops:ke(new Yt(115,"stickyTabStops",!1,{description:m("stickyTabStops","Emulate selection behavior of tab characters when using spaces for indentation. Selection will stick to tab stops.")})),codeLens:ke(new Yt(17,"codeLens",!0,{description:m("codeLens","Controls whether the editor shows CodeLens.")})),codeLensFontFamily:ke(new gr(18,"codeLensFontFamily","",{description:m("codeLensFontFamily","Controls the font family for CodeLens.")})),codeLensFontSize:ke(new Li(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:ke(new Yt(20,"colorDecorators",!0,{description:m("colorDecorators","Controls whether the editor should render the inline color decorators and color picker.")})),colorDecoratorActivatedOn:ke(new ln(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:ke(new Li(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:ke(new Yt(22,"columnSelection",!1,{description:m("columnSelection","Enable that the selection with the mouse and keys is doing column selection.")})),comments:ke(new Zme),contextmenu:ke(new Yt(24,"contextmenu",!0)),copyWithSyntaxHighlighting:ke(new Yt(25,"copyWithSyntaxHighlighting",!0,{description:m("copyWithSyntaxHighlighting","Controls whether syntax highlighting should be copied into the clipboard.")})),cursorBlinking:ke(new pL(26,"cursorBlinking",1,"blink",["blink","smooth","phase","expand","solid"],Xme,{description:m("cursorBlinking","Control the cursor animation style.")})),cursorSmoothCaretAnimation:ke(new ln(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:ke(new pL(28,"cursorStyle",ws.Line,"line",["line","block","underline","line-thin","block-outline","underline-thin"],Qme,{description:m("cursorStyle","Controls the cursor style.")})),cursorSurroundingLines:ke(new Li(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:ke(new ln(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:ke(new Li(31,"cursorWidth",0,0,1073741824,{markdownDescription:m("cursorWidth","Controls the width of the cursor when `#editor.cursorStyle#` is set to `line`.")})),disableLayerHinting:ke(new Yt(32,"disableLayerHinting",!1)),disableMonospaceOptimizations:ke(new Yt(33,"disableMonospaceOptimizations",!1)),domReadOnly:ke(new Yt(34,"domReadOnly",!1)),dragAndDrop:ke(new Yt(35,"dragAndDrop",!0,{description:m("dragAndDrop","Controls whether the editor should allow moving selections via drag and drop.")})),emptySelectionClipboard:ke(new e_e),dropIntoEditor:ke(new x_e),stickyScroll:ke(new l_e),experimentalWhitespaceRendering:ke(new ln(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:ke(new gr(39,"extraEditorClassName","")),fastScrollSensitivity:ke(new Qa(40,"fastScrollSensitivity",5,n=>n<=0?5:n,{markdownDescription:m("fastScrollSensitivity","Scrolling speed multiplier when pressing `Alt`.")})),find:ke(new t_e),fixedOverflowWidgets:ke(new Yt(42,"fixedOverflowWidgets",!1)),folding:ke(new Yt(43,"folding",!0,{description:m("folding","Controls whether the editor has code folding enabled.")})),foldingStrategy:ke(new ln(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:ke(new Yt(45,"foldingHighlight",!0,{description:m("foldingHighlight","Controls whether the editor should highlight folded ranges.")})),foldingImportsByDefault:ke(new Yt(46,"foldingImportsByDefault",!1,{description:m("foldingImportsByDefault","Controls whether the editor automatically collapses import ranges.")})),foldingMaximumRegions:ke(new Li(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:ke(new Yt(48,"unfoldOnClickAfterEndOfLine",!1,{description:m("unfoldOnClickAfterEndOfLine","Controls whether clicking on the empty content after a folded line will unfold the line.")})),fontFamily:ke(new gr(49,"fontFamily",wr.fontFamily,{description:m("fontFamily","Controls the font family.")})),fontInfo:ke(new i_e),fontLigatures2:ke(new Br),fontSize:ke(new n_e),fontWeight:ke(new jc),fontVariations:ke(new Gl),formatOnPaste:ke(new Yt(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:ke(new Yt(56,"formatOnType",!1,{description:m("formatOnType","Controls whether the editor should automatically format the line after typing.")})),glyphMargin:ke(new Yt(57,"glyphMargin",!0,{description:m("glyphMargin","Controls whether the editor should render the vertical glyph margin. Glyph margin is mostly used for debugging.")})),gotoLocation:ke(new s_e),hideCursorInOverviewRuler:ke(new Yt(59,"hideCursorInOverviewRuler",!1,{description:m("hideCursorInOverviewRuler","Controls whether the cursor should be hidden in the overview ruler.")})),hover:ke(new o_e),inDiffEditor:ke(new Yt(61,"inDiffEditor",!1)),letterSpacing:ke(new Qa(63,"letterSpacing",wr.letterSpacing,n=>Qa.clamp(n,-5,20),{description:m("letterSpacing","Controls the letter spacing in pixels.")})),lightbulb:ke(new a_e),lineDecorationsWidth:ke(new d_e),lineHeight:ke(new u_e),lineNumbers:ke(new v_e),lineNumbersMinChars:ke(new Li(68,"lineNumbersMinChars",5,1,300)),linkedEditing:ke(new Yt(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:ke(new Yt(70,"links",!0,{description:m("links","Controls whether the editor should detect links and make them clickable.")})),matchBrackets:ke(new ln(71,"matchBrackets","always",["always","near","never"],{description:m("matchBrackets","Highlight matching brackets.")})),minimap:ke(new h_e),mouseStyle:ke(new ln(73,"mouseStyle","text",["text","default","copy"])),mouseWheelScrollSensitivity:ke(new Qa(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:ke(new Yt(75,"mouseWheelZoom",!1,{markdownDescription:m("mouseWheelZoom","Zoom the font of the editor when using mouse wheel and holding `Ctrl`.")})),multiCursorMergeOverlapping:ke(new Yt(76,"multiCursorMergeOverlapping",!0,{description:m("multiCursorMergeOverlapping","Merge multiple cursors when they are overlapping.")})),multiCursorModifier:ke(new pL(77,"multiCursorModifier","altKey","alt",["ctrlCmd","alt"],f_e,{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:ke(new ln(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:ke(new Li(79,"multiCursorLimit",1e4,1,1e5,{markdownDescription:m("multiCursorLimit","Controls the max number of cursors that can be in an active editor at once.")})),occurrencesHighlight:ke(new Yt(80,"occurrencesHighlight",!0,{description:m("occurrencesHighlight","Controls whether the editor should highlight semantic symbol occurrences.")})),overviewRulerBorder:ke(new Yt(81,"overviewRulerBorder",!0,{description:m("overviewRulerBorder","Controls whether a border should be drawn around the overview ruler.")})),overviewRulerLanes:ke(new Li(82,"overviewRulerLanes",3,0,3)),padding:ke(new g_e),pasteAs:ke(new N_e),parameterHints:ke(new p_e),peekWidgetDefaultFocus:ke(new ln(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:ke(new Yt(87,"definitionLinkOpensInPeek",!1,{description:m("definitionLinkOpensInPeek","Controls whether the Go to Definition mouse gesture always opens the peek widget.")})),quickSuggestions:ke(new __e),quickSuggestionsDelay:ke(new Li(89,"quickSuggestionsDelay",10,0,1073741824,{description:m("quickSuggestionsDelay","Controls the delay in milliseconds after which quick suggestions will show up.")})),readOnly:ke(new Yt(90,"readOnly",!1)),readOnlyMessage:ke(new C_e),renameOnType:ke(new Yt(92,"renameOnType",!1,{description:m("renameOnType","Controls whether the editor auto renames on type."),markdownDeprecationMessage:m("renameOnTypeDeprecate","Deprecated, use `editor.linkedEditing` instead.")})),renderControlCharacters:ke(new Yt(93,"renderControlCharacters",!0,{description:m("renderControlCharacters","Controls whether the editor should render control characters."),restricted:!0})),renderFinalNewline:ke(new ln(94,"renderFinalNewline",Co?"dimmed":"on",["off","on","dimmed"],{description:m("renderFinalNewline","Render last line number when the file ends with a newline.")})),renderLineHighlight:ke(new ln(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:ke(new Yt(96,"renderLineHighlightOnlyWhenFocus",!1,{description:m("renderLineHighlightOnlyWhenFocus","Controls if the editor should render the current line highlight only when the editor is focused.")})),renderValidationDecorations:ke(new ln(97,"renderValidationDecorations","editable",["editable","on","off"])),renderWhitespace:ke(new ln(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:ke(new Li(99,"revealHorizontalRightPadding",15,0,1e3)),roundedSelection:ke(new Yt(100,"roundedSelection",!0,{description:m("roundedSelection","Controls whether selections should have rounded corners.")})),rulers:ke(new b_e),scrollbar:ke(new w_e),scrollBeyondLastColumn:ke(new Li(103,"scrollBeyondLastColumn",4,0,1073741824,{description:m("scrollBeyondLastColumn","Controls the number of extra characters beyond which the editor will scroll horizontally.")})),scrollBeyondLastLine:ke(new Yt(104,"scrollBeyondLastLine",!0,{description:m("scrollBeyondLastLine","Controls whether the editor will scroll beyond the last line.")})),scrollPredominantAxis:ke(new Yt(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:ke(new Yt(106,"selectionClipboard",!0,{description:m("selectionClipboard","Controls whether the Linux primary clipboard should be supported."),included:Co})),selectionHighlight:ke(new Yt(107,"selectionHighlight",!0,{description:m("selectionHighlight","Controls whether the editor should highlight matches similar to the selection.")})),selectOnLineNumbers:ke(new Yt(108,"selectOnLineNumbers",!0)),showFoldingControls:ke(new ln(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:ke(new Yt(110,"showUnused",!0,{description:m("showUnused","Controls fading out of unused code.")})),showDeprecated:ke(new Yt(138,"showDeprecated",!0,{description:m("showDeprecated","Controls strikethrough deprecated variables.")})),inlayHints:ke(new c_e),snippetSuggestions:ke(new ln(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:ke(new E_e),smoothScrolling:ke(new Yt(113,"smoothScrolling",!1,{description:m("smoothScrolling","Controls whether the editor will scroll using an animation.")})),stopRenderingLineAfter:ke(new Li(116,"stopRenderingLineAfter",1e4,-1,1073741824)),suggest:ke(new D_e),inlineSuggest:ke(new S_e),inlineCompletionsAccessibilityVerbose:ke(new Yt(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:ke(new Li(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:ke(new Li(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:ke(new Yt(120,"suggestOnTriggerCharacters",!0,{description:m("suggestOnTriggerCharacters","Controls whether suggestions should automatically show up when typing trigger characters.")})),suggestSelection:ke(new ln(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:ke(new ln(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:ke(new Li(123,"tabIndex",0,-1,1073741824)),unicodeHighlight:ke(new y_e),unusualLineTerminators:ke(new ln(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:ke(new Yt(126,"useShadowDOM",!0)),useTabStops:ke(new Yt(127,"useTabStops",!0,{description:m("useTabStops","Inserting and deleting whitespace follows tab stops.")})),wordBreak:ke(new ln(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:ke(new gr(129,"wordSeparators",iX,{description:m("wordSeparators","Characters that will be used as word separators when doing word related navigations or operations.")})),wordWrap:ke(new ln(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:ke(new gr(131,"wordWrapBreakAfterCharacters"," })]?|/&.,;¢°′″‰℃、。。、¢,.:;?!%・・ゝゞヽヾーァィゥェォッャュョヮヵヶぁぃぅぇぉっゃゅょゎゕゖㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ々〻ァィゥェォャュョッー”〉》」』】〕)]}」")),wordWrapBreakBeforeCharacters:ke(new gr(132,"wordWrapBreakBeforeCharacters","([{‘“〈《「『【〔([{「£¥$£¥++")),wordWrapColumn:ke(new Li(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:ke(new ln(134,"wordWrapOverride1","inherit",["off","on","inherit"])),wordWrapOverride2:ke(new ln(135,"wordWrapOverride2","inherit",["off","on","inherit"])),editorClassName:ke(new Jme),defaultColorDecorators:ke(new Yt(145,"defaultColorDecorators",!1,{markdownDescription:m("defaultColorDecorators","Controls whether inline color decorations should be shown using the default document color provider")})),pixelRatio:ke(new m_e),tabFocusMode:ke(new Yt(142,"tabFocusMode",!1,{markdownDescription:m("tabFocusMode","Controls whether the editor receives tabs or defers them to the workbench for navigation.")})),layoutInfo:ke(new Pv),wrappingInfo:ke(new T_e),wrappingIndent:ke(new I_e),wrappingStrategy:ke(new r_e)};class P_e{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?_b.isErrorNoTelemetry(e)?new _b(e.message+"\n\n"+e.stack):new Error(e.message+"\n\n"+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 aX=new P_e;function Dt(n){bc(n)||aX.onUnexpectedError(n)}function Bn(n){bc(n)||aX.onUnexpectedExternalError(n)}function FV(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:_b.isErrorNoTelemetry(n)}}return n}const cE="Canceled";function bc(n){return n instanceof Sg?!0:n instanceof Error&&n.name===cE&&n.message===cE}class Sg extends Error{constructor(){super(cE),this.name=this.message}}function O_e(){const n=new Error(cE);return n.name=n.message,n}function La(n){return n?new Error("Illegal argument: ".concat(n)):new Error("Illegal argument")}function m8(n){return n?new Error("Illegal state: ".concat(n)):new Error("Illegal state")}class F_e extends Error{constructor(e){super("NotSupported"),e&&(this.message=e)}}class _b extends Error{constructor(e){super(e),this.name="CodeExpectedError"}static fromError(e){if(e instanceof _b)return e;const t=new _b;return t.message=e.message,t.stack=e.stack,t}static isErrorNoTelemetry(e){return e.name==="CodeExpectedError"}}class Rn extends Error{constructor(e){super(e||"An unexpected bug occurred."),Object.setPrototypeOf(this,Rn.prototype)}}function $f(n){const e=this;let t=!1,i;return function(){return t||(t=!0,i=n.apply(e,arguments)),i}}function _8(n){return typeof n.dispose=="function"&&n.dispose.length===0}function fi(n){if(Pt.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 rl(...n){return vt(()=>fi(n))}function vt(n){return{dispose:$f(()=>{n()})}}class be{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{fi(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?be.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)}}be.DISABLE_DISPOSED_WARNING=!1;class te{constructor(){this._store=new be,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)}}te.None=Object.freeze({dispose(){}});class Ts{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 B_e{constructor(e){this._disposable=e,this._counter=1}acquire(){return this._counter++,this}release(){return--this._counter===0&&this._disposable.dispose(),this}}class W_e{constructor(e){this.object=e}dispose(){}}class v8{constructor(){this._store=new Map,this._isDisposed=!1}dispose(){this._isDisposed=!0,this.clearAndDisposeAll()}clearAndDisposeAll(){if(this._store.size)try{fi(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 V_e=globalThis.performance&&typeof globalThis.performance.now=="function";class so{static create(e){return new so(e)}constructor(e){this._now=V_e&&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 We;(function(n){n.None=()=>te.None;function e(T,P){return u(T,()=>{},0,void 0,!0,void 0,P)}n.defer=e;function t(T){return(P,W=null,$)=>{let X=!1,J;return J=T(Q=>{if(!X)return J?J.dispose():X=!0,P.call(W,Q)},null,$),X&&J.dispose(),J}}n.once=t;function i(T,P,W){return c(($,X=null,J)=>T(Q=>$.call(X,P(Q)),null,J),W)}n.map=i;function s(T,P,W){return c(($,X=null,J)=>T(Q=>{P(Q),$.call(X,Q)},null,J),W)}n.forEach=s;function o(T,P,W){return c(($,X=null,J)=>T(Q=>P(Q)&&$.call(X,Q),null,J),W)}n.filter=o;function r(T){return T}n.signal=r;function a(...T){return(P,W=null,$)=>{const X=rl(...T.map(J=>J(Q=>P.call(W,Q))));return d(X,$)}}n.any=a;function l(T,P,W,$){let X=W;return i(T,J=>(X=P(X,J),X),$)}n.reduce=l;function c(T,P){let W;const $={onWillAddFirstListener(){W=T(X.fire,X)},onDidRemoveLastListener(){W==null||W.dispose()}},X=new j($);return P==null||P.add(X),X.event}function d(T,P){return P instanceof Array?P.push(T):P&&P.add(T),T}function u(T,P,W=100,$=!1,X=!1,J,Q){let le,de,_e,ie=0,ne;const Ye={leakWarningThreshold:J,onWillAddFirstListener(){le=T(Ee=>{ie++,de=P(de,Ee),$&&!_e&&(pe.fire(de),de=void 0),ne=()=>{const ze=de;de=void 0,_e=void 0,(!$||ie>1)&&pe.fire(ze),ie=0},typeof W=="number"?(clearTimeout(_e),_e=setTimeout(ne,W)):_e===void 0&&(_e=0,queueMicrotask(ne))})},onWillRemoveListener(){X&&ie>0&&(ne==null||ne())},onDidRemoveLastListener(){ne=void 0,le.dispose()}},pe=new j(Ye);return Q==null||Q.add(pe),pe.event}n.debounce=u;function h(T,P=0,W){return n.debounce(T,($,X)=>$?($.push(X),$):[X],P,void 0,!0,void 0,W)}n.accumulate=h;function f(T,P=($,X)=>$===X,W){let $=!0,X;return o(T,J=>{const Q=$||!P(J,X);return $=!1,X=J,Q},W)}n.latch=f;function g(T,P,W){return[n.filter(T,P,W),n.filter(T,$=>!P($),W)]}n.split=g;function p(T,P=!1,W=[],$){let X=W.slice(),J=T(de=>{X?X.push(de):le.fire(de)});$&&$.add(J);const Q=()=>{X==null||X.forEach(de=>le.fire(de)),X=null},le=new j({onWillAddFirstListener(){J||(J=T(de=>le.fire(de)),$&&$.add(J))},onDidAddFirstListener(){X&&(P?setTimeout(Q):Q())},onDidRemoveLastListener(){J&&J.dispose(),J=null}});return $&&$.add(le),le.event}n.buffer=p;function _(T,P){return($,X,J)=>{const Q=P(new b);return T(function(le){const de=Q.evaluate(le);de!==v&&$.call(X,de)},void 0,J)}}n.chain=_;const v=Symbol("HaltChainable");class b{constructor(){this.steps=[]}map(P){return this.steps.push(P),this}forEach(P){return this.steps.push(W=>(P(W),W)),this}filter(P){return this.steps.push(W=>P(W)?W:v),this}reduce(P,W){let $=W;return this.steps.push(X=>($=P($,X),$)),this}latch(P=(W,$)=>W===$){let W=!0,$;return this.steps.push(X=>{const J=W||!P(X,$);return W=!1,$=X,J?X:v}),this}evaluate(P){for(const W of this.steps)if(P=W(P),P===v)break;return P}}function C(T,P,W=$=>$){const $=(...le)=>Q.fire(W(...le)),X=()=>T.on(P,$),J=()=>T.removeListener(P,$),Q=new j({onWillAddFirstListener:X,onDidRemoveLastListener:J});return Q.event}n.fromNodeEventEmitter=C;function w(T,P,W=$=>$){const $=(...le)=>Q.fire(W(...le)),X=()=>T.addEventListener(P,$),J=()=>T.removeEventListener(P,$),Q=new j({onWillAddFirstListener:X,onDidRemoveLastListener:J});return Q.event}n.fromDOMEventEmitter=w;function y(T){return new Promise(P=>t(T)(P))}n.toPromise=y;function L(T){const P=new j;return T.then(W=>{P.fire(W)},()=>{P.fire(void 0)}).finally(()=>{P.dispose()}),P.event}n.fromPromise=L;function S(T,P){return P(void 0),T(W=>P(W))}n.runAndSubscribe=S;function k(T,P){let W=null;function $(J){W==null||W.dispose(),W=new be,P(J,W)}$(void 0);const X=T(J=>$(J));return vt(()=>{X.dispose(),W==null||W.dispose()})}n.runAndSubscribeWithStore=k;class D{constructor(P,W){this._observable=P,this._counter=0,this._hasChanged=!1;const $={onWillAddFirstListener:()=>{P.addObserver(this)},onDidRemoveLastListener:()=>{P.removeObserver(this)}};this.emitter=new j($),W&&W.add(this.emitter)}beginUpdate(P){this._counter++}handlePossibleChange(P){}handleChange(P,W){this._hasChanged=!0}endUpdate(P){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function x(T,P){return new D(T,P).emitter.event}n.fromObservable=x;function A(T){return P=>{let W=0,$=!1;const X={beginUpdate(){W++},endUpdate(){W--,W===0&&(T.reportChanges(),$&&($=!1,P()))},handlePossibleChange(){},handleChange(){$=!0}};return T.addObserver(X),T.reportChanges(),{dispose(){T.removeObserver(X)}}}}n.fromObservableLight=A})(We||(We={}));class vb{constructor(e){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name="".concat(e,"_").concat(vb._idPool++),vb.all.add(this)}start(e){this._stopWatch=new so,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}}}vb.all=new Set;vb._idPool=0;let H_e=-1;class $_e{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 b8{static create(){var e;return new b8((e=new Error().stack)!==null&&e!==void 0?e:"")}constructor(e){this.value=e}print(){console.warn(this.value.split("\n").slice(2).join("\n"))}}class GA{constructor(e){this.value=e}}const z_e=2;let j=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 $_e((s=(i=this._options)===null||i===void 0?void 0:i.leakWarningThreshold)!==null&&s!==void 0?s:H_e):void 0,this._perfMon=!((o=this._options)===null||o===void 0)&&o._profName?new vb(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("[".concat(this._leakageMon.name,"] REFUSES to accept new listeners because it exceeded its threshold by far")),te.None;if(this._disposed)return te.None;i&&(t=t.bind(i));const d=new GA(t);let u;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(d.stack=b8.create(),u=this._leakageMon.check(d.stack,this._size+1)),this._listeners?this._listeners instanceof GA?((c=this._deliveryQueue)!==null&&c!==void 0||(this._deliveryQueue=new lX),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=vt(()=>{u==null||u(),this._removeListener(d)});return s instanceof be?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*z_e<=r.length){let c=0;for(let d=0;d0}};const U_e=()=>new lX;class lX{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 nm extends j{constructor(e){super(e),this._isPaused=0,this._eventQueue=new To,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 cX extends nm{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 j_e extends j{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 K_e{constructor(){this.hasListeners=!1,this.events=[],this.emitter=new j({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),vt($f(()=>{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 C8{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 BV{constructor(){this.listening=!1,this.inputEvent=We.None,this.inputEventListener=te.None,this.emitter=new j({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 dX=Object.freeze(function(n,e){const t=setTimeout(n.bind(e),0);return{dispose(){clearTimeout(t)}}});var Ft;(function(n){function e(t){return t===n.None||t===n.Cancelled||t instanceof iD?!0:!t||typeof t!="object"?!1:typeof t.isCancellationRequested=="boolean"&&typeof t.onCancellationRequested=="function"}n.isCancellationToken=e,n.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:We.None}),n.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:dX})})(Ft||(Ft={}));class iD{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?dX:(this._emitter||(this._emitter=new j),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}}let Tn=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 iD),this._token}cancel(){this._token?this._token instanceof iD&&this._token.cancel():this._token=Ft.Cancelled}dispose(e=!1){var t;e&&this.cancel(),(t=this._parentListener)===null||t===void 0||t.dispose(),this._token?this._token instanceof iD&&this._token.dispose():this._token=Ft.None}};class w8{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 nD=new w8,z2=new w8,U2=new w8,uX=new Array(230),q_e=Object.create(null),G_e=Object.create(null),y8=[];for(let n=0;n<=193;n++)y8[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,q_e[a]=r,G_e[a.toLowerCase()]=r,o&&(y8[r]=l)),!t[l]){if(t[l]=!0,!c)throw new Error("String representation missing for key code ".concat(l," around scan code ").concat(a));nD.define(l,c),z2.define(l,h||c),U2.define(l,f||h||c)}d&&(uX[d]=l)}})();var pu;(function(n){function e(a){return nD.keyCodeToStr(a)}n.toString=e;function t(a){return nD.strToKeyCode(a)}n.fromString=t;function i(a){return z2.keyCodeToStr(a)}n.toUserSettingsUS=i;function s(a){return U2.keyCodeToStr(a)}n.toUserSettingsGeneral=s;function o(a){return z2.strToKeyCode(a)||U2.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 nD.keyCodeToStr(a)}n.toElectronAccelerator=r})(pu||(pu={}));function qn(n,e){const t=(e&65535)<<16>>>0;return(n|t)>>>0}let Fv;if(typeof ol.vscode<"u"&&typeof ol.vscode.process<"u"){const n=ol.vscode.process;Fv={get platform(){return n.platform},get arch(){return n.arch},get env(){return n.env},cwd(){return n.cwd()}}}else typeof process<"u"?Fv={get platform(){return process.platform},get arch(){return process.arch},get env(){return process.env},cwd(){return process.env.VSCODE_CWD||process.cwd()}}:Fv={get platform(){return zs?"win32":Kt?"darwin":"linux"},get arch(){},get env(){return{}},cwd(){return"/"}};const dE=Fv.cwd,hX=Fv.env,Y_e=Fv.platform,Z_e=65,X_e=97,Q_e=90,J_e=122,vf=46,ho=47,Nr=92,ph=58,eve=63;class fX 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 "'.concat(e,'" ').concat(o," ").concat(s," of type ").concat(t);r+=". Received type ".concat(typeof i),super(r),this.code="ERR_INVALID_ARG_TYPE"}}function tve(n,e){if(n===null||typeof n!="object")throw new fX(e,"Object",n)}function ls(n,e){if(typeof n!="string")throw new fX(e,"string",n)}const Lg=Y_e==="win32";function pi(n){return n===ho||n===Nr}function j2(n){return n===ho}function mh(n){return n>=Z_e&&n<=Q_e||n>=X_e&&n<=J_e}function uE(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?"".concat(t,".."):"..",o=2)}else s.length>0?s+="".concat(t).concat(n.slice(r+1,c)):s=n.slice(r+1,c),o=c-r-1;r=c,a=0}else l===vf&&a!==-1?++a:a=-1}return s}function gX(n,e){tve(e,"pathObject");const t=e.dir||e.root,i=e.base||"".concat(e.name||"").concat(e.ext||"");return t?t===e.root?"".concat(t).concat(i):"".concat(t).concat(n).concat(i):i}const vr={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],ls(o,"path"),o.length===0)continue}else e.length===0?o=dE():(o=hX["=".concat(e)]||dE(),(o===void 0||o.slice(0,2).toLowerCase()!==e.toLowerCase()&&o.charCodeAt(2)===Nr)&&(o="".concat(e,"\\")));const r=o.length;let a=0,l="",c=!1;const d=o.charCodeAt(0);if(r===1)pi(d)&&(a=1,c=!0);else if(pi(d))if(c=!0,pi(o.charCodeAt(1))){let u=2,h=u;for(;u2&&pi(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="".concat(o.slice(a),"\\").concat(t),i=c,c&&e.length>0)break}return t=uE(t,!i,"\\",pi),i?"".concat(e,"\\").concat(t):"".concat(e).concat(t)||"."},normalize(n){ls(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 j2(o)?"\\":n;if(pi(o))if(s=!0,pi(n.charCodeAt(1))){let a=2,l=a;for(;a2&&pi(n.charCodeAt(2))&&(s=!0,t=3));let r=t0&&pi(n.charCodeAt(e-1))&&(r+="\\"),i===void 0?s?"\\".concat(r):r:s?"".concat(i,"\\").concat(r):"".concat(i).concat(r)},isAbsolute(n){ls(n,"path");const e=n.length;if(e===0)return!1;const t=n.charCodeAt(0);return pi(t)||e>2&&mh(t)&&n.charCodeAt(1)===ph&&pi(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+="\\".concat(r))}if(e===void 0)return".";let i=!0,s=0;if(typeof t=="string"&&pi(t.charCodeAt(0))){++s;const o=t.length;o>1&&pi(t.charCodeAt(1))&&(++s,o>2&&(pi(t.charCodeAt(2))?++s:i=!1))}if(i){for(;s=2&&(e="\\".concat(e.slice(s)))}return vr.normalize(e)},relative(n,e){if(ls(n,"from"),ls(e,"to"),n===e)return"";const t=vr.resolve(n),i=vr.resolve(e);if(t===i||(n=t.toLowerCase(),e=i.toLowerCase(),n===e))return"";let s=0;for(;ss&&n.charCodeAt(o-1)===Nr;)o--;const r=o-s;let a=0;for(;aa&&e.charCodeAt(l-1)===Nr;)l--;const c=l-a,d=rd){if(e.charCodeAt(a+h)===Nr)return i.slice(a+h+1);if(h===2)return i.slice(a+h)}r>d&&(n.charCodeAt(s+h)===Nr?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)===Nr)&&(f+=f.length===0?"..":"\\..");return a+=u,f.length>0?"".concat(f).concat(i.slice(a,l)):(i.charCodeAt(a)===Nr&&++a,i.slice(a,l))},toNamespacedPath(n){if(typeof n!="string"||n.length===0)return n;const e=vr.resolve(n);if(e.length<=2)return n;if(e.charCodeAt(0)===Nr){if(e.charCodeAt(1)===Nr){const t=e.charCodeAt(2);if(t!==eve&&t!==vf)return"\\\\?\\UNC\\".concat(e.slice(2))}}else if(mh(e.charCodeAt(0))&&e.charCodeAt(1)===ph&&e.charCodeAt(2)===Nr)return"\\\\?\\".concat(e);return n},dirname(n){ls(n,"path");const e=n.length;if(e===0)return".";let t=-1,i=0;const s=n.charCodeAt(0);if(e===1)return pi(s)?n:".";if(pi(s)){if(t=i=1,pi(n.charCodeAt(1))){let a=2,l=a;for(;a2&&pi(n.charCodeAt(2))?3:2,i=t);let o=-1,r=!0;for(let a=e-1;a>=i;--a)if(pi(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&&ls(e,"ext"),ls(n,"path");let t=0,i=-1,s=!0,o;if(n.length>=2&&mh(n.charCodeAt(0))&&n.charCodeAt(1)===ph&&(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(pi(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(pi(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){ls(n,"path");let e=0,t=-1,i=0,s=-1,o=!0,r=0;n.length>=2&&n.charCodeAt(1)===ph&&mh(n.charCodeAt(0))&&(e=i=2);for(let a=n.length-1;a>=e;--a){const l=n.charCodeAt(a);if(pi(l)){if(!o){i=a+1;break}continue}s===-1&&(o=!1,s=a+1),l===vf?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:gX.bind(null,"\\"),parse(n){ls(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 pi(s)?(e.root=e.dir=n,e):(e.base=e.name=n,e);if(pi(s)){if(i=1,pi(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),pi(s)){if(!l){r=c+1;break}continue}a===-1&&(l=!1,a=c+1),s===vf?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},ive=(()=>{if(Lg){const n=/\\/g;return()=>{const e=dE().replace(n,"/");return e.slice(e.indexOf("/"))}}return()=>dE()})(),zn={resolve(...n){let e="",t=!1;for(let i=n.length-1;i>=-1&&!t;i--){const s=i>=0?n[i]:ive();ls(s,"path"),s.length!==0&&(e="".concat(s,"/").concat(e),t=s.charCodeAt(0)===ho)}return e=uE(e,!t,"/",j2),t?"/".concat(e):e.length>0?e:"."},normalize(n){if(ls(n,"path"),n.length===0)return".";const e=n.charCodeAt(0)===ho,t=n.charCodeAt(n.length-1)===ho;return n=uE(n,!e,"/",j2),n.length===0?e?"/":t?"./":".":(t&&(n+="/"),e?"/".concat(n):n)},isAbsolute(n){return ls(n,"path"),n.length>0&&n.charCodeAt(0)===ho},join(...n){if(n.length===0)return".";let e;for(let t=0;t0&&(e===void 0?e=i:e+="/".concat(i))}return e===void 0?".":zn.normalize(e)},relative(n,e){if(ls(n,"from"),ls(e,"to"),n===e||(n=zn.resolve(n),e=zn.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)===ho)return e.slice(o+c+1);if(c===0)return e.slice(o+c)}else s>a&&(n.charCodeAt(t+c)===ho?l=c:c===0&&(l=0));let d="";for(c=t+l+1;c<=i;++c)(c===i||n.charCodeAt(c)===ho)&&(d+=d.length===0?"..":"/..");return"".concat(d).concat(e.slice(o+l))},toNamespacedPath(n){return n},dirname(n){if(ls(n,"path"),n.length===0)return".";const e=n.charCodeAt(0)===ho;let t=-1,i=!0;for(let s=n.length-1;s>=1;--s)if(n.charCodeAt(s)===ho){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&&ls(e,"ext"),ls(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===ho){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)===ho){if(!s){t=o+1;break}}else i===-1&&(s=!1,i=o+1);return i===-1?"":n.slice(t,i)},extname(n){ls(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===ho){if(!s){t=r+1;break}continue}i===-1&&(s=!1,i=r+1),a===vf?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:gX.bind(null,"/"),parse(n){ls(n,"path");const e={root:"",dir:"",base:"",ext:"",name:""};if(n.length===0)return e;const t=n.charCodeAt(0)===ho;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===ho){if(!a){o=l+1;break}continue}r===-1&&(a=!1,r=l+1),d===vf?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};zn.win32=vr.win32=vr;zn.posix=vr.posix=zn;const pX=Lg?vr.normalize:zn.normalize,nve=Lg?vr.resolve:zn.resolve,sve=Lg?vr.relative:zn.relative,mX=Lg?vr.dirname:zn.dirname,bf=Lg?vr.basename:zn.basename,ove=Lg?vr.extname:zn.extname,sc=Lg?vr.sep:zn.sep,rve=/^\w[\w\d+.-]*$/,ave=/^\//,lve=/^\/\//;function cve(n,e){if(!n.scheme&&e)throw new Error('[UriError]: Scheme is missing: {scheme: "", authority: "'.concat(n.authority,'", path: "').concat(n.path,'", query: "').concat(n.query,'", fragment: "').concat(n.fragment,'"}'));if(n.scheme&&!rve.test(n.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(n.path){if(n.authority){if(!ave.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(lve.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 dve(n,e){return!n&&!e?"file":n}function uve(n,e){switch(n){case"https":case"http":case"file":e?e[0]!==zl&&(e=zl+e):e=zl;break}return e}const Ln="",zl="/",hve=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/;class ct{static isUri(e){return e instanceof ct?!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||Ln,this.authority=e.authority||Ln,this.path=e.path||Ln,this.query=e.query||Ln,this.fragment=e.fragment||Ln):(this.scheme=dve(e,r),this.authority=t||Ln,this.path=uve(this.scheme,i||Ln),this.query=s||Ln,this.fragment=o||Ln,cve(this,r))}get fsPath(){return hE(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=Ln),i===void 0?i=this.authority:i===null&&(i=Ln),s===void 0?s=this.path:s===null&&(s=Ln),o===void 0?o=this.query:o===null&&(o=Ln),r===void 0?r=this.fragment:r===null&&(r=Ln),t===this.scheme&&i===this.authority&&s===this.path&&o===this.query&&r===this.fragment?this:new b_(t,i,s,o,r)}static parse(e,t=!1){const i=hve.exec(e);return i?new b_(i[2]||Ln,mL(i[4]||Ln),mL(i[5]||Ln),mL(i[7]||Ln),mL(i[9]||Ln),t):new b_(Ln,Ln,Ln,Ln,Ln)}static file(e){let t=Ln;if(zs&&(e=e.replace(/\\/g,zl)),e[0]===zl&&e[1]===zl){const i=e.indexOf(zl,2);i===-1?(t=e.substring(2),e=zl):(t=e.substring(2,i),e=e.substring(i)||zl)}return new b_("file",t,e,Ln,Ln)}static from(e,t){return new b_(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 zs&&e.scheme==="file"?i=ct.file(vr.join(hE(e,!0),...t)).path:i=zn.join(e.path,...t),e.with({path:i})}toString(e=!1){return K2(this,e)}toJSON(){return this}static revive(e){var t,i;if(e){if(e instanceof ct)return e;{const s=new b_(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=zs?1:void 0;let b_=class extends ct{constructor(){super(...arguments),this._formatted=null,this._fsPath=null}get fsPath(){return this._fsPath||(this._fsPath=hE(this,!1)),this._fsPath}toString(e=!1){return e?K2(this,!0):(this._formatted||(this._formatted=K2(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 vX={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 WV(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=vX[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 fve(n){let e;for(let t=0;t1&&n.scheme==="file"?t="//".concat(n.authority).concat(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,zs&&(t=t.replace(/\//g,"\\")),t}function K2(n,e){const t=e?fve:WV;let i="",{scheme:s,authority:o,path:r,query:a,fragment:l}=n;if(s&&(i+=s,i+=":"),(o||s==="file")&&(i+=zl,i+=zl),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="/".concat(String.fromCharCode(c+32),":").concat(r.substr(3)))}else if(r.length>=2&&r.charCodeAt(1)===58){const c=r.charCodeAt(0);c>=65&&c<=90&&(r="".concat(String.fromCharCode(c+32),":").concat(r.substr(2)))}i+=t(r,!0,!1)}return a&&(i+="?",i+=t(a,!1,!1)),l&&(i+="#",i+=e?l:WV(l,!1,!1)),i}function bX(n){try{return decodeURIComponent(n)}catch{return n.length>3?n.substr(0,3)+bX(n.substr(3)):n}}const VV=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function mL(n){return n.match(VV)?n.replace(VV,e=>bX(e)):n}let Y=class tp{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 tp(e,t)}delta(e=0,t=0){return this.with(this.lineNumber+e,this.column+t)}equals(e){return tp.equals(this,e)}static equals(e,t){return!e&&!t?!0:!!e&&!!t&&e.lineNumber===t.lineNumber&&e.column===t.column}isBefore(e){return tp.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 gs.isEmpty(this)}static isEmpty(e){return e.startLineNumber===e.endLineNumber&&e.startColumn===e.endColumn}containsPosition(e){return gs.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 gs.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 gs.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 gs.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 gs(i,s,o,r)}intersectRanges(e){return gs.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 gs(i,s,o,r)}equalsRange(e){return gs.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 gs.getEndPosition(this)}static getEndPosition(e){return new Y(e.endLineNumber,e.endColumn)}getStartPosition(){return gs.getStartPosition(this)}static getStartPosition(e){return new Y(e.startLineNumber,e.startColumn)}toString(){return"["+this.startLineNumber+","+this.startColumn+" -> "+this.endLineNumber+","+this.endColumn+"]"}setEndPosition(e,t){return new gs(this.startLineNumber,this.startColumn,e,t)}setStartPosition(e,t){return new gs(e,t,this.endLineNumber,this.endColumn)}collapseToStart(){return gs.collapseToStart(this)}static collapseToStart(e){return new gs(e.startLineNumber,e.startColumn,e.startLineNumber,e.startColumn)}collapseToEnd(){return gs.collapseToEnd(this)}static collapseToEnd(e){return new gs(e.endLineNumber,e.endColumn,e.endLineNumber,e.endColumn)}delta(e){return new gs(this.startLineNumber+e,this.startColumn,this.endLineNumber+e,this.endColumn)}static fromPositions(e,t=e){return new gs(e.lineNumber,e.column,t.lineNumber,t.column)}static lift(e){return e?new gs(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}},Je=class qa extends I{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 qa.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 qa(this.startLineNumber,this.startColumn,e,t):new qa(e,t,this.startLineNumber,this.startColumn)}getPosition(){return new Y(this.positionLineNumber,this.positionColumn)}getSelectionStart(){return new Y(this.selectionStartLineNumber,this.selectionStartColumn)}setStartPosition(e,t){return this.getDirection()===0?new qa(e,t,this.endLineNumber,this.endColumn):new qa(this.endLineNumber,this.endColumn,e,t)}static fromPositions(e,t=e){return new qa(e.lineNumber,e.column,t.lineNumber,t.column)}static fromRange(e,t){return t===0?new qa(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn):new qa(e.endLineNumber,e.endColumn,e.startLineNumber,e.startColumn)}static liftSelection(e){return new qa(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 pve(this,e,t);return this._factories.set(e,s),vt(()=>{const o=this._factories.get(e);!o||o!==s||(this._factories.delete(e),o.dispose())})}getOrCreate(e){return G2(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 pve extends te{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 G2(this,void 0,void 0,function*(){return this._resolvePromise||(this._resolvePromise=this._create()),this._resolvePromise})}_create(){return G2(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 gw=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 S8{constructor(e,t){this.tokens=e,this.endState=t,this._tokenizationResultBrand=void 0}}class KT{constructor(e,t){this.tokens=e,this.endState=t,this._encodedTokenizationResultBrand=void 0}}var pw;(function(n){const e=new Map;e.set(0,Me.symbolMethod),e.set(1,Me.symbolFunction),e.set(2,Me.symbolConstructor),e.set(3,Me.symbolField),e.set(4,Me.symbolVariable),e.set(5,Me.symbolClass),e.set(6,Me.symbolStruct),e.set(7,Me.symbolInterface),e.set(8,Me.symbolModule),e.set(9,Me.symbolProperty),e.set(10,Me.symbolEvent),e.set(11,Me.symbolOperator),e.set(12,Me.symbolUnit),e.set(13,Me.symbolValue),e.set(15,Me.symbolEnum),e.set(14,Me.symbolConstant),e.set(15,Me.symbolEnum),e.set(16,Me.symbolEnumMember),e.set(17,Me.symbolKeyword),e.set(27,Me.symbolSnippet),e.set(18,Me.symbolText),e.set(19,Me.symbolColor),e.set(20,Me.symbolFile),e.set(21,Me.symbolReference),e.set(22,Me.symbolCustomColor),e.set(23,Me.symbolFolder),e.set(24,Me.symbolTypeParameter),e.set(25,Me.account),e.set(26,Me.issues);function t(o){let r=e.get(o);return r||(console.info("No codicon found for CompletionItemKind "+o),r=Me.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})(pw||(pw={}));var Ru;(function(n){n[n.Automatic=0]="Automatic",n[n.Explicit=1]="Explicit"})(Ru||(Ru={}));class wX{constructor(e,t,i,s){this.range=e,this.text=t,this.completionKind=i,this.isSnippetText=s}equals(e){return I.lift(this.range).equalsRange(e.range)&&this.text===e.text&&this.completionKind===e.completionKind&&this.isSnippetText===e.isSnippetText}}var gd;(function(n){n[n.Invoke=1]="Invoke",n[n.TriggerCharacter=2]="TriggerCharacter",n[n.ContentChange=3]="ContentChange"})(gd||(gd={}));var mw;(function(n){n[n.Text=0]="Text",n[n.Read=1]="Read",n[n.Write=2]="Write"})(mw||(mw={}));function mve(n){return n&&ct.isUri(n.uri)&&I.isIRange(n.range)&&(I.isIRange(n.originSelectionRange)||I.isIRange(n.targetSelectionRange))}const _ve={17:m("Array","array"),16:m("Boolean","boolean"),4:m("Class","class"),13:m("Constant","constant"),8:m("Constructor","constructor"),9:m("Enum","enumeration"),21:m("EnumMember","enumeration member"),23:m("Event","event"),7:m("Field","field"),0:m("File","file"),11:m("Function","function"),10:m("Interface","interface"),19:m("Key","key"),5:m("Method","method"),1:m("Module","module"),2:m("Namespace","namespace"),20:m("Null","null"),15:m("Number","number"),18:m("Object","object"),24:m("Operator","operator"),3:m("Package","package"),6:m("Property","property"),14:m("String","string"),22:m("Struct","struct"),25:m("TypeParameter","type parameter"),12:m("Variable","variable")};function vve(n,e){return m("symbolAriaLabel","{0} ({1})",n,_ve[e])}var fE;(function(n){const e=new Map;e.set(0,Me.symbolFile),e.set(1,Me.symbolModule),e.set(2,Me.symbolNamespace),e.set(3,Me.symbolPackage),e.set(4,Me.symbolClass),e.set(5,Me.symbolMethod),e.set(6,Me.symbolProperty),e.set(7,Me.symbolField),e.set(8,Me.symbolConstructor),e.set(9,Me.symbolEnum),e.set(10,Me.symbolInterface),e.set(11,Me.symbolFunction),e.set(12,Me.symbolVariable),e.set(13,Me.symbolConstant),e.set(14,Me.symbolString),e.set(15,Me.symbolNumber),e.set(16,Me.symbolBoolean),e.set(17,Me.symbolArray),e.set(18,Me.symbolObject),e.set(19,Me.symbolKey),e.set(20,Me.symbolNull),e.set(21,Me.symbolEnumMember),e.set(22,Me.symbolStruct),e.set(23,Me.symbolEvent),e.set(24,Me.symbolOperator),e.set(25,Me.symbolTypeParameter);function t(i){let s=e.get(i);return s||(console.info("No codicon found for SymbolKind "+i),s=Me.symbolProperty),s}n.toIcon=t})(fE||(fE={}));class xo{static fromValue(e){switch(e){case"comment":return xo.Comment;case"imports":return xo.Imports;case"region":return xo.Region}return new xo(e)}constructor(e){this.value=e}}xo.Comment=new xo("comment");xo.Imports=new xo("imports");xo.Region=new xo("region");var Y2;(function(n){function e(t){return!t||typeof t!="object"?!1:typeof t.id=="string"&&typeof t.title=="string"}n.is=e})(Y2||(Y2={}));var gE;(function(n){n[n.Type=1]="Type",n[n.Parameter=2]="Parameter"})(gE||(gE={}));class bve{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 nn=new gve;var Z2;(function(n){n[n.Unknown=0]="Unknown",n[n.Disabled=1]="Disabled",n[n.Enabled=2]="Enabled"})(Z2||(Z2={}));var X2;(function(n){n[n.Invoke=1]="Invoke",n[n.Auto=2]="Auto"})(X2||(X2={}));var Q2;(function(n){n[n.None=0]="None",n[n.KeepWhitespace=1]="KeepWhitespace",n[n.InsertAsSnippet=4]="InsertAsSnippet"})(Q2||(Q2={}));var J2;(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"})(J2||(J2={}));var eP;(function(n){n[n.Deprecated=1]="Deprecated"})(eP||(eP={}));var tP;(function(n){n[n.Invoke=0]="Invoke",n[n.TriggerCharacter=1]="TriggerCharacter",n[n.TriggerForIncompleteCompletions=2]="TriggerForIncompleteCompletions"})(tP||(tP={}));var iP;(function(n){n[n.EXACT=0]="EXACT",n[n.ABOVE=1]="ABOVE",n[n.BELOW=2]="BELOW"})(iP||(iP={}));var nP;(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"})(nP||(nP={}));var sP;(function(n){n[n.LF=1]="LF",n[n.CRLF=2]="CRLF"})(sP||(sP={}));var oP;(function(n){n[n.Text=0]="Text",n[n.Read=1]="Read",n[n.Write=2]="Write"})(oP||(oP={}));var rP;(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"})(rP||(rP={}));var aP;(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"})(aP||(aP={}));var lP;(function(n){n[n.TextDefined=0]="TextDefined",n[n.LF=1]="LF",n[n.CRLF=2]="CRLF"})(lP||(lP={}));var cP;(function(n){n[n.LF=0]="LF",n[n.CRLF=1]="CRLF"})(cP||(cP={}));var dP;(function(n){n[n.Left=1]="Left",n[n.Right=2]="Right"})(dP||(dP={}));var uP;(function(n){n[n.None=0]="None",n[n.Indent=1]="Indent",n[n.IndentOutdent=2]="IndentOutdent",n[n.Outdent=3]="Outdent"})(uP||(uP={}));var hP;(function(n){n[n.Both=0]="Both",n[n.Right=1]="Right",n[n.Left=2]="Left",n[n.None=3]="None"})(hP||(hP={}));var fP;(function(n){n[n.Type=1]="Type",n[n.Parameter=2]="Parameter"})(fP||(fP={}));var gP;(function(n){n[n.Automatic=0]="Automatic",n[n.Explicit=1]="Explicit"})(gP||(gP={}));var pP;(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"})(pP||(pP={}));var mP;(function(n){n[n.Hint=1]="Hint",n[n.Info=2]="Info",n[n.Warning=4]="Warning",n[n.Error=8]="Error"})(mP||(mP={}));var _P;(function(n){n[n.Unnecessary=1]="Unnecessary",n[n.Deprecated=2]="Deprecated"})(_P||(_P={}));var vP;(function(n){n[n.Inline=1]="Inline",n[n.Gutter=2]="Gutter"})(vP||(vP={}));var bP;(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"})(bP||(bP={}));var CP;(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"})(CP||(CP={}));var wP;(function(n){n[n.Left=1]="Left",n[n.Center=2]="Center",n[n.Right=4]="Right",n[n.Full=7]="Full"})(wP||(wP={}));var yP;(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"})(yP||(yP={}));var SP;(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"})(SP||(SP={}));var LP;(function(n){n[n.None=0]="None",n[n.Text=1]="Text",n[n.Blocks=2]="Blocks"})(LP||(LP={}));var kP;(function(n){n[n.Smooth=0]="Smooth",n[n.Immediate=1]="Immediate"})(kP||(kP={}));var DP;(function(n){n[n.Auto=1]="Auto",n[n.Hidden=2]="Hidden",n[n.Visible=3]="Visible"})(DP||(DP={}));var EP;(function(n){n[n.LTR=0]="LTR",n[n.RTL=1]="RTL"})(EP||(EP={}));var IP;(function(n){n[n.Invoke=1]="Invoke",n[n.TriggerCharacter=2]="TriggerCharacter",n[n.ContentChange=3]="ContentChange"})(IP||(IP={}));var TP;(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"})(TP||(TP={}));var xP;(function(n){n[n.Deprecated=1]="Deprecated"})(xP||(xP={}));var NP;(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"})(NP||(NP={}));var AP;(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"})(AP||(AP={}));var MP;(function(n){n[n.AlwaysGrowsWhenTypingAtEdges=0]="AlwaysGrowsWhenTypingAtEdges",n[n.NeverGrowsWhenTypingAtEdges=1]="NeverGrowsWhenTypingAtEdges",n[n.GrowsOnlyWhenTypingBefore=2]="GrowsOnlyWhenTypingBefore",n[n.GrowsOnlyWhenTypingAfter=3]="GrowsOnlyWhenTypingAfter"})(MP||(MP={}));var RP;(function(n){n[n.None=0]="None",n[n.Same=1]="Same",n[n.Indent=2]="Indent",n[n.DeepIndent=3]="DeepIndent"})(RP||(RP={}));let rS=class{static chord(e,t){return qn(e,t)}};rS.CtrlCmd=2048;rS.Shift=1024;rS.Alt=512;rS.WinCtrl=256;function yX(){return{editor:void 0,languages:void 0,CancellationTokenSource:Tn,Emitter:j,KeyCode:pP,KeyMod:rS,Position:Y,Range:I,Selection:Je,SelectionDirection:EP,MarkerSeverity:mP,MarkerTag:_P,Uri:ct,Token:gw}}class Cve{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 HV{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}}let kg=class{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 bb;function SX(n){return!n||typeof n!="string"?!0:n.trim().length===0}const wve=/{(\d+)}/g;function sm(n,...e){return e.length===0?n:n.replace(wve,function(t,i){const s=parseInt(i,10);return isNaN(s)||s<0||s>=e.length?t:e[s]})}function pE(n){return n.replace(/[<>&]/g,function(e){switch(e){case"<":return"<";case">":return">";case"&":return"&";default:return e}})}function Xr(n){return n.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}function yve(n,e=" "){const t=aS(n,e);return LX(t,e)}function aS(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 LX(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 Sve(n){return n.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}function Lve(n){return n.replace(/\*/g,"")}function kX(n,e,t={}){if(!n)throw new Error("Cannot create regex from empty string");e||(n=Xr(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 kve(n){return n.source==="^"||n.source==="^$"||n.source==="$"||n.source==="^\\s*$"?!1:!!(n.exec("")&&n.lastIndex===0)}function Sd(n){return n.split(/\r\n|\r|\n/)}function bo(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 _w(n,e){return ne?1:0}function L8(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 PP(n,e){return lS(n,e,0,n.length,0,e.length)}function lS(n,e,t=0,i=n.length,s=0,o=e.length){for(;t=128||c>=128)return L8(n.toLowerCase(),e.toLowerCase(),t,i,s,o);Xh(l)&&(l-=32),Xh(c)&&(c-=32);const d=l-c;if(d!==0)return d}const r=i-t,a=o-s;return ra?1:0}function _L(n){return n>=48&&n<=57}function Xh(n){return n>=97&&n<=122}function Vc(n){return n>=65&&n<=90}function tv(n,e){return n.length===e.length&&lS(n,e)===0}function k8(n,e){const t=e.length;return e.length>n.length?!1:lS(n,e,0,t)===0}function om(n,e){const t=Math.min(n.length,e.length);let i;for(i=0;i1){const i=n.charCodeAt(e-2);if(es(i))return D8(i,t)}return t}class E8{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=Dve(this._str,this._offset);return this._offset-=e>=65536?2:1,e}nextCodePoint(){const e=_E(this._str,this._len,this._offset);return this._offset+=e>=65536?2:1,e}eol(){return this._offset>=this._len}}class vE{get offset(){return this._iterator.offset}constructor(e,t=0){this._iterator=new E8(e,t)}nextGraphemeLength(){const e=Qh.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($V(s,r)){t.setOffset(o);break}s=r}return t.offset-i}prevGraphemeLength(){const e=Qh.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($V(r,s)){t.setOffset(o);break}s=r}return i-t.offset}eol(){return this._iterator.eol()}}function I8(n,e){return new vE(n,e).nextGraphemeLength()}function DX(n,e){return new vE(n,e).prevGraphemeLength()}function Eve(n,e){e>0&&rm(n.charCodeAt(e))&&e--;const t=e+I8(n,e);return[t-DX(n,t),t]}let YA;function Ive(){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 Cb(n){return YA||(YA=Ive()),YA.test(n)}const Tve=/^[\t\n\r\x20-\x7E]*$/;function cS(n){return Tve.test(n)}const EX=/[\u2028\u2029]/;function IX(n){return EX.test(n)}function zf(n){return n>=11904&&n<=55215||n>=63744&&n<=64255||n>=65281&&n<=65374}function T8(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 xve=String.fromCharCode(65279);function x8(n){return!!(n&&n.length>0&&n.charCodeAt(0)===65279)}function Nve(n,e=!1){return n?(e&&(n=n.replace(/\\./g,"")),n.toLowerCase()!==n):!1}function TX(n){return n=n%(2*26),n<26?String.fromCharCode(97+n):String.fromCharCode(65+n-26)}function $V(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 Qh{static getInstance(){return Qh._INSTANCE||(Qh._INSTANCE=new Qh),Qh._INSTANCE}constructor(){this._data=Ave()}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}}Qh._INSTANCE=null;function Ave(){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 Mve(n,e){if(n===0)return 0;const t=Rve(n,e);if(t!==void 0)return t;const i=new E8(e,n);return i.prevCodePoint(),i.offset}function Rve(n,e){const t=new E8(e,n);let i=t.prevCodePoint();for(;Pve(i)||i===65039||i===8419;){if(t.offset===0)return;i=t.prevCodePoint()}if(!T8(i))return;let s=t.offset;return s>0&&t.prevCodePoint()===8205&&(s=t.offset),s}function Pve(n){return 127995<=n&&n<=127999}const xX=" ";class am{static getInstance(e){return bb.cache.get(Array.from(e))}static getLocales(){return bb._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())}}bb=am;am.ambiguousCharacterData=new kg(()=>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]}'));am.cache=new Cve(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 bb(l)});am._locales=new kg(()=>Object.keys(bb.ambiguousCharacterData.value).filter(n=>!n.startsWith("_")));class pd{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(pd.getRawData())),this._data}static isInvisibleCharacter(e){return pd.getData().has(e)}static get codePoints(){return pd.getData()}}pd._data=void 0;class OP{constructor(){this._zoomFactor=1}getZoomFactor(){return this._zoomFactor}}OP.INSTANCE=new OP;class Ove extends te{constructor(){super(),this._onDidChange=this._register(new j),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: ".concat(window.devicePixelRatio,"dppx)")),this._mediaQueryList.addEventListener("change",this._listener),e&&this._onDidChange.fire()}}class Fve extends te{get value(){return this._value}constructor(){super(),this._onDidChange=this._register(new j),this.onDidChange=this._onDidChange.event,this._value=this._getPixelRatio();const e=this._register(new Ove);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 Bve{constructor(){this._pixelRatioMonitor=null}_getOrCreatePixelRatioMonitor(){return this._pixelRatioMonitor||(this._pixelRatioMonitor=new Fve),this._pixelRatioMonitor}get value(){return this._getOrCreatePixelRatioMonitor().value}get onDidChange(){return this._getOrCreatePixelRatioMonitor().onDidChange}}function NX(n,e){typeof n=="string"&&(n=window.matchMedia(n)),n.addEventListener("change",e)}const vw=new Bve;function Wve(){return OP.INSTANCE.getZoomFactor()}const y0=navigator.userAgent,Ta=y0.indexOf("Firefox")>=0,Hp=y0.indexOf("AppleWebKit")>=0,N8=y0.indexOf("Chrome")>=0,qu=!N8&&y0.indexOf("Safari")>=0,AX=!N8&&!qu&&Hp;y0.indexOf("Electron/")>=0;const zV=y0.indexOf("Android")>=0;let sD=!1;if(window.matchMedia){const n=window.matchMedia("(display-mode: standalone) or (display-mode: window-controls-overlay)"),e=window.matchMedia("(display-mode: fullscreen)");sD=n.matches,NX(n,({matches:t})=>{sD&&e.matches||(sD=t)})}function Vve(){return sD}class MX{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=El(e);this._maxWidth!==t&&(this._maxWidth=t,this.domNode.style.maxWidth=this._maxWidth)}setWidth(e){const t=El(e);this._width!==t&&(this._width=t,this.domNode.style.width=this._width)}setHeight(e){const t=El(e);this._height!==t&&(this._height=t,this.domNode.style.height=this._height)}setTop(e){const t=El(e);this._top!==t&&(this._top=t,this.domNode.style.top=this._top)}setLeft(e){const t=El(e);this._left!==t&&(this._left=t,this.domNode.style.left=this._left)}setBottom(e){const t=El(e);this._bottom!==t&&(this._bottom=t,this.domNode.style.bottom=this._bottom)}setRight(e){const t=El(e);this._right!==t&&(this._right=t,this.domNode.style.right=this._right)}setPaddingLeft(e){const t=El(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=El(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=El(e);this._lineHeight!==t&&(this._lineHeight=t,this.domNode.style.lineHeight=this._lineHeight)}setLetterSpacing(e){const t=El(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 El(n){return typeof n=="number"?"".concat(n,"px"):n}function ci(n){return new MX(n)}function Vs(n,e){n instanceof MX?(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 Hve{constructor(e,t){this.chr=e,this.type=t,this.width=0}fulfill(e){this.width=e}}class A8{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");Vs(t,this._bareFontInfo),e.appendChild(t);const i=document.createElement("div");Vs(i,this._bareFontInfo),i.style.fontWeight="bold",e.appendChild(i);const s=document.createElement("div");Vs(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");A8._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 FP({pixelRatio:vw.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 Hve(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),C=this._createRequest("·",0,t,i),w=this._createRequest(String.fromCharCode(11825),0,t,null),y="|/-_ilm%";for(let x=0,A=y.length;x.001){S=!1;break}}let D=!0;return S&&b.width!==k&&(D=!1),b.width>v.width&&(D=!1),new FP({pixelRatio:vw.value,fontFamily:e.fontFamily,fontWeight:e.fontWeight,fontSize:e.fontSize,fontFeatureSettings:e.fontFeatureSettings,fontVariationSettings:e.fontVariationSettings,lineHeight:e.lineHeight,letterSpacing:e.letterSpacing,isMonospace:S,typicalHalfwidthCharacterWidth:s.width,typicalFullwidthCharacterWidth:o.width,canUseHalfwidthRightwardsArrow:D,spaceWidth:r.width,middotWidth:C.width,wsmiddotWidth:w.width,maxDigitWidth:L},!0)}}class UV{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 BP=new jve;var Ql;(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})(Ql||(Ql={}));const _t=Wt("instantiationService");function Kve(n,e,t){e[Ql.DI_TARGET]===e?e[Ql.DI_DEPENDENCIES].push({id:n,index:t}):(e[Ql.DI_DEPENDENCIES]=[{id:n,index:t}],e[Ql.DI_TARGET]=e)}function Wt(n){if(Ql.serviceIds.has(n))return Ql.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");Kve(e,t,s)};return e.toString=()=>n,Ql.serviceIds.set(n,e),e}const ai=Wt("codeEditorService"),Zi=Wt("modelService"),sr=Wt("textModelService");var wb=globalThis&&globalThis.__awaiter||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 Ro extends te{constructor(e,t="",i="",s=!0,o){super(),this._onDidChange=this._register(new j),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 wb(this,void 0,void 0,function*(){this._actionCallback&&(yield this._actionCallback(e))})}}class yb extends te{constructor(){super(...arguments),this._onWillRun=this._register(new j),this.onWillRun=this._onWillRun.event,this._onDidRun=this._register(new j),this.onDidRun=this._onDidRun.event}run(e,t){return wb(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 wb(this,void 0,void 0,function*(){yield e.run(t)})}}class hs{constructor(){this.id=hs.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 hs,...i]:t=i);return t}run(){return wb(this,void 0,void 0,function*(){})}}hs.ID="vs.actions.separator";class Sb{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 wb(this,void 0,void 0,function*(){})}}class qT extends Ro{constructor(){super(qT.ID,m("submenu.empty","(empty)"),void 0,!1)}}qT.ID="vs.actions.empty";function Bv(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)=>wb(this,void 0,void 0,function*(){return n.run(...i)}),tooltip:n.label}}var WP;(function(n){function e(t){return t&&typeof t=="object"&&typeof t.id=="string"}n.isThemeColor=e})(WP||(WP={}));var dt;(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("^(".concat(n.iconNameExpression,")(").concat(n.iconModifierExpression,")?$"));function t(h){const f=e.exec(h.id);if(!f)return t(Me.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"||WP.isThemeColor(h.color))}n.isThemeIcon=o;const r=new RegExp("^\\$\\((".concat(n.iconNameExpression,"(?:").concat(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="".concat(g,"~").concat(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})(dt||(dt={}));const gn=Wt("commandService"),qt=new class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new j,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 Ime(c,r),a(l,...c)}}const{id:t}=n;let i=this._commands.get(t);i||(i=new To,this._commands.set(t,i));const s=i.unshift(n),o=vt(()=>{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(gn).executeCommand(e,...i))}getCommand(n){const e=this._commands.get(n);if(!(!e||e.isEmpty()))return Pt.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 XA(...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 qve=m("contextkey.scanner.hint.didYouForgetToOpenOrCloseQuote","Did you forget to open or close the quote?"),Gve=m("contextkey.scanner.hint.didYouForgetToEscapeSlash","Did you forget to escape the '/' (slash) character? Put two backslashes before it to escape, e.g., '\\\\/'.");let fp=class VP{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 m8("unhandled token type: ".concat(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(XA("==","=~"));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(XA("&&"));break;case 124:this._match(124)?this._addToken(16):this._error(XA("||"));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=VP._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(qve);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(Gve);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}};fp._regexFlags=new Set(["i","g","s","m","y","u"].map(n=>n.charCodeAt(0)));fp._keywords=new Map([["not",14],["in",13],["false",12],["true",11]]);const oo=new Map;oo.set("false",!1);oo.set("true",!0);oo.set("isMac",Kt);oo.set("isLinux",Co);oo.set("isWindows",zs);oo.set("isWeb",yg);oo.set("isMacNative",Kt&&!yg);oo.set("isEdge",Ume);oo.set("isFirefox",$me);oo.set("isChrome",tX);oo.set("isSafari",zme);const Yve=Object.prototype.hasOwnProperty,Zve={regexParsingWithErrorRecovery:!0},Xve=m("contextkey.parser.error.emptyString","Empty context key expression"),Qve=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."),Jve=m("contextkey.parser.error.noInAfterNot","'in' after 'not'."),jV=m("contextkey.parser.error.closingParenthesis","closing parenthesis ')'"),ebe=m("contextkey.parser.error.unexpectedToken","Unexpected token"),tbe=m("contextkey.parser.error.unexpectedToken.hint","Did you forget to put && or || before the token?"),ibe=m("contextkey.parser.error.unexpectedEOF","Unexpected end of expression"),nbe=m("contextkey.parser.error.unexpectedEOF.hint","Did you forget to put a context key?");let RX=class O1{constructor(e=Zve){this._config=e,this._scanner=new fp,this._tokens=[],this._current=0,this._parsingErrors=[],this._flagsGYRe=/g|y/g}parse(e){if(e===""){this._parsingErrors.push({message:Xve,offset:0,lexeme:"",additionalInfo:Qve});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?tbe:void 0;throw this._parsingErrors.push({message:ebe,offset:i.offset,lexeme:fp.getLexeme(i),additionalInfo:s}),O1._parseError}return t}catch(t){if(t!==O1._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]:fe.or(...e)}_and(){const e=[this._term()];for(;this._matchOne(15);){const t=this._term();e.push(t)}return e.length===1?e[0]:fe.and(...e)}_term(){if(this._matchOne(2)){const e=this._peek();switch(e.type){case 11:return this._advance(),Po.INSTANCE;case 12:return this._advance(),Jo.INSTANCE;case 0:{this._advance();const t=this._expr();return this._consume(1,jV),t==null?void 0:t.negate()}case 17:return this._advance(),qm.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(),fe.true();case 12:return this._advance(),fe.false();case 0:{this._advance();const t=this._expr();return this._consume(1,jV),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 bw.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 bw.create(t,r)}default:throw this._errExpectedButGot("REGEX",this._peek())}}if(this._matchOne(14)){this._consume(13,Jve);const s=this._value();return fe.notIn(t,s)}switch(this._peek().type){case 3:{this._advance();const s=this._value();if(this._previous().type===18)return fe.equals(t,s);switch(s){case"true":return fe.has(t);case"false":return fe.not(t);default:return fe.equals(t,s)}}case 4:{this._advance();const s=this._value();if(this._previous().type===18)return fe.notEquals(t,s);switch(s){case"true":return fe.not(t);case"false":return fe.has(t);default:return fe.notEquals(t,s)}}case 5:return this._advance(),ex.create(t,this._value());case 6:return this._advance(),tx.create(t,this._value());case 7:return this._advance(),QT.create(t,this._value());case 8:return this._advance(),JT.create(t,this._value());case 13:return this._advance(),fe.in(t,this._value());default:return fe.has(t)}}case 20:throw this._parsingErrors.push({message:ibe,offset:e.offset,lexeme:"",additionalInfo:nbe}),O1._parseError;default:throw this._errExpectedButGot("true | false | KEY \n | KEY '=~' REGEX \n | 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}\nReceived: '{1}'.",e,fp.getLexeme(t)),o=t.offset,r=fp.getLexeme(t);return this._parsingErrors.push({message:s,offset:o,lexeme:r,additionalInfo:i}),O1._parseError}_check(e){return this._peek().type===e}_peek(){return this._tokens[this._current]}_isAtEnd(){return this._peek().type===20}};RX._parseError=new Error;class fe{static false(){return Po.INSTANCE}static true(){return Jo.INSTANCE}static has(e){return Km.create(e)}static equals(e,t){return S0.create(e,t)}static notEquals(e,t){return ZT.create(e,t)}static regex(e,t){return bw.create(e,t)}static in(e,t){return GT.create(e,t)}static notIn(e,t){return YT.create(e,t)}static not(e){return qm.create(e)}static and(...e){return Dp.create(e,null,!0)}static or(...e){return mu.create(e,null,!0)}static deserialize(e){return e==null?void 0:this._parser.parse(e)}}fe._parser=new RX({regexParsingWithErrorRecovery:!1});function sbe(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 mC(n,e){return n.cmp(e)}class Po{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 Jo.INSTANCE}}Po.INSTANCE=new Po;class Jo{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 Po.INSTANCE}}Jo.INSTANCE=new Jo;class Km{static create(e,t=null){const i=oo.get(e);return typeof i=="boolean"?i?Jo.INSTANCE:Po.INSTANCE:new Km(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:OX(this.key,e.key)}equals(e){return e.type===this.type?this.key===e.key:!1}substituteConstants(){const e=oo.get(this.key);return typeof e=="boolean"?e?Jo.INSTANCE:Po.INSTANCE:this}evaluate(e){return!!e.getValue(this.key)}serialize(){return this.key}keys(){return[this.key]}negate(){return this.negated||(this.negated=qm.create(this.key,this)),this.negated}}class S0{static create(e,t,i=null){if(typeof t=="boolean")return t?Km.create(e,i):qm.create(e,i);const s=oo.get(e);return typeof s=="boolean"?t===(s?"true":"false")?Jo.INSTANCE:Po.INSTANCE:new S0(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:Gm(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=oo.get(this.key);if(typeof e=="boolean"){const t=e?"true":"false";return this.value===t?Jo.INSTANCE:Po.INSTANCE}return this}evaluate(e){return e.getValue(this.key)==this.value}serialize(){return"".concat(this.key," == '").concat(this.value,"'")}keys(){return[this.key]}negate(){return this.negated||(this.negated=ZT.create(this.key,this.value,this)),this.negated}}class GT{static create(e,t){return new GT(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:Gm(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?Yve.call(t,i):!1}serialize(){return"".concat(this.key," in '").concat(this.valueKey,"'")}keys(){return[this.key,this.valueKey]}negate(){return this.negated||(this.negated=YT.create(this.key,this.valueKey)),this.negated}}class YT{static create(e,t){return new YT(e,t)}constructor(e,t){this.key=e,this.valueKey=t,this.type=11,this._negated=GT.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"".concat(this.key," not in '").concat(this.valueKey,"'")}keys(){return this._negated.keys()}negate(){return this._negated}}class ZT{static create(e,t,i=null){if(typeof t=="boolean")return t?qm.create(e,i):Km.create(e,i);const s=oo.get(e);return typeof s=="boolean"?t===(s?"true":"false")?Po.INSTANCE:Jo.INSTANCE:new ZT(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:Gm(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=oo.get(this.key);if(typeof e=="boolean"){const t=e?"true":"false";return this.value===t?Po.INSTANCE:Jo.INSTANCE}return this}evaluate(e){return e.getValue(this.key)!=this.value}serialize(){return"".concat(this.key," != '").concat(this.value,"'")}keys(){return[this.key]}negate(){return this.negated||(this.negated=S0.create(this.key,this.value,this)),this.negated}}class qm{static create(e,t=null){const i=oo.get(e);return typeof i=="boolean"?i?Po.INSTANCE:Jo.INSTANCE:new qm(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:OX(this.key,e.key)}equals(e){return e.type===this.type?this.key===e.key:!1}substituteConstants(){const e=oo.get(this.key);return typeof e=="boolean"?e?Po.INSTANCE:Jo.INSTANCE:this}evaluate(e){return!e.getValue(this.key)}serialize(){return"!".concat(this.key)}keys(){return[this.key]}negate(){return this.negated||(this.negated=Km.create(this.key,this)),this.negated}}function XT(n,e){if(typeof n=="string"){const t=parseFloat(n);isNaN(t)||(n=t)}return typeof n=="string"||typeof n=="number"?e(n):Po.INSTANCE}class QT{static create(e,t,i=null){return XT(t,s=>new QT(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:Gm(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"".concat(this.key," > ").concat(this.value)}keys(){return[this.key]}negate(){return this.negated||(this.negated=tx.create(this.key,this.value,this)),this.negated}}class JT{static create(e,t,i=null){return XT(t,s=>new JT(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:Gm(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"".concat(this.key," >= ").concat(this.value)}keys(){return[this.key]}negate(){return this.negated||(this.negated=ex.create(this.key,this.value,this)),this.negated}}class ex{static create(e,t,i=null){return XT(t,s=>new ex(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:Gm(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 tx(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:Gm(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"".concat(this.key," <= ").concat(this.value)}keys(){return[this.key]}negate(){return this.negated||(this.negated=QT.create(this.key,this.value,this)),this.negated}}class bw{static create(e,t){return new bw(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?"/".concat(this.regexp.source,"/").concat(this.regexp.flags):"/invalid/";return"".concat(this.key," =~ ").concat(e)}keys(){return[this.key]}negate(){return this.negated||(this.negated=M8.create(this)),this.negated}}class M8{static create(e){return new M8(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"!(".concat(this._actual.serialize(),")")}keys(){return this._actual.keys()}negate(){return this._actual}}function PX(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=mu.create(r.expr.map(d=>Dp.create([d,a],null,i)),null,l);c&&(s.push(c),s.sort(mC))}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=mu.create(e,this,!0)}return this.negated}}class mu{static create(e,t,i){return mu._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 qV(t))for(const r of qV(i))s.push(Dp.create([o,r],null,!1));e.unshift(mu.create(s,null,!1))}this.negated=mu.create(e,this,!0)}return this.negated}}class Ve extends Km{static all(){return Ve._info.values()}constructor(e,t,i){super(e,null),this._defaultValue=t,typeof i=="object"?Ve._info.push(Object.assign(Object.assign({},i),{key:e})):i!==!0&&Ve._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 S0.create(this.key,e)}}Ve._info=[];const bt=Wt("contextKeyService");function OX(n,e){return ne?1:0}function Gm(n,e,t,i){return nt?1:ei?1:0}function HP(n,e){if(n.type===0||e.type===1)return!0;if(n.type===9)return e.type===9?KV(n.expr,e.expr):!1;if(e.type===9){for(const t of e.expr)if(HP(n,t))return!0;return!1}if(n.type===6){if(e.type===6)return KV(e.expr,n.expr);for(const t of n.expr)if(HP(t,e))return!0;return!1}return n.equals(e)}function KV(n,e){let t=0,i=0;for(;t>>0,i=(n&4294901760)>>>16;return i!==0?new QA([vL(t,e),vL(i,e)]):new QA([vL(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(cbe)),this._cachedMergedKeybindings.slice(0)}}const er=new R8,lbe={EditorModes:"platform.keybindingsRegistry"};en.add(lbe.EditorModes,er);function cbe(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 dbe=globalThis&&globalThis.__decorate||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},GV=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},ube=globalThis&&globalThis.__rest||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}}_u._all=new Map;const Ls=new class{constructor(){this._commands=new Map,this._menuItems=new Map,this._onDidChangeMenu=new j_e({merge:_u.merge}),this.onDidChangeMenu=this._onDidChangeMenu.event}addCommand(n){return this._commands.set(n.id,n),this._onDidChangeMenu.fire(_u.for(M.CommandPalette)),vt(()=>{this._commands.delete(n.id)&&this._onDidChangeMenu.fire(_u.for(M.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 To,this._menuItems.set(n,t));const i=t.push(e);return this._onDidChangeMenu.fire(_u.for(n)),vt(()=>{i(),this._onDidChangeMenu.fire(_u.for(n))})}appendMenuItems(n){const e=new be;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===M.CommandPalette&&this._appendImplicitItems(e),e}_appendImplicitItems(n){const e=new Set;for(const t of n)iv(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 ww extends Sb{constructor(e,t,i){super("submenuitem.".concat(e.submenu.id),typeof e.title=="string"?e.title:e.title.value,i,"submenu"),this.item=e,this.hideActions=t}}let fl=oD=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=oD.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&&dt.isThemeIcon(d.icon)&&(c=d.icon),this.checked&&d.title&&(this.label=typeof d.title=="string"?d.title:d.title.value)}c||(c=dt.isThemeIcon(e.icon)?e.icon:void 0),this.item=e,this.alt=t?new oD(t,void 0,i,s,o,r):void 0,this._options=i,this.class=c&&dt.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)}};fl=oD=dbe([GV(4,bt),GV(5,gn)],fl);class oa{constructor(e){this.desc=e}}function Ui(n){const e=new be,t=new n,i=t.desc,{f1:s,menu:o,keybinding:r,description:a}=i,l=ube(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(Ls.appendMenuItem(c.id,Object.assign({command:Object.assign(Object.assign({},l),{precondition:c.precondition===null?void 0:l.precondition})},c)));else o&&e.add(Ls.appendMenuItem(o.id,Object.assign({command:Object.assign(Object.assign({},l),{precondition:o.precondition===null?void 0:l.precondition})},o)));if(s&&(e.add(Ls.appendMenuItem(M.CommandPalette,{command:l,when:l.precondition})),e.add(Ls.addCommand(l))),Array.isArray(r))for(const c of r)e.add(er.registerKeybindingRule(Object.assign(Object.assign({},c),{id:l.id,when:l.precondition?fe.and(l.precondition,c.when):c.when})));else r&&e.add(er.registerKeybindingRule(Object.assign(Object.assign({},r),{id:l.id,when:l.precondition?fe.and(l.precondition,r.when):r.when})));return e}const ra=Wt("telemetryService"),aa=Wt("logService");var Os;(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"})(Os||(Os={}));const BX=Os.Info;class WX extends te{constructor(){super(...arguments),this.level=BX,this._onDidChangeLogLevel=this._register(new j),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!==Os.Off&&this.level<=e}}class fbe extends WX{constructor(e=BX,t=!0){super(),this.useColors=t,this.setLevel(e)}trace(e,...t){this.checkLogLevel(Os.Trace)&&(this.useColors?console.log("%cTRACE","color: #888",e,...t):console.log(e,...t))}debug(e,...t){this.checkLogLevel(Os.Debug)&&(this.useColors?console.log("%cDEBUG","background: #eee; color: #888",e,...t):console.log(e,...t))}info(e,...t){this.checkLogLevel(Os.Info)&&(this.useColors?console.log("%c INFO","color: #33f",e,...t):console.log(e,...t))}warn(e,...t){this.checkLogLevel(Os.Warning)&&(this.useColors?console.log("%c WARN","color: #993",e,...t):console.log(e,...t))}error(e,...t){this.checkLogLevel(Os.Error)&&(this.useColors?console.log("%c ERR","color: #f33",e,...t):console.error(e,...t))}dispose(){}}class gbe extends WX{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 pbe(n){switch(n){case Os.Trace:return"trace";case Os.Debug:return"debug";case Os.Info:return"info";case Os.Warning:return"warn";case Os.Error:return"error";case Os.Off:return"off"}}new Ve("logLevel",pbe(Os.Info));const P8={clipboard:{writeText:nc||document.queryCommandSupported&&document.queryCommandSupported("copy")||!!(navigator&&navigator.clipboard&&navigator.clipboard.writeText),readText:nc||!!(navigator&&navigator.clipboard&&navigator.clipboard.readText)},keyboard:(()=>nc||Vve()?0:navigator.keyboard||qu?1:2)(),touch:"ontouchstart"in window||navigator.maxTouchPoints>0,pointerEvents:window.PointerEvent&&("ontouchstart"in window||window.navigator.maxTouchPoints>0||navigator.maxTouchPoints>0)};function mbe(n){if(n.charCode){const t=String.fromCharCode(n.charCode).toUpperCase();return pu.fromString(t)}const e=n.keyCode;if(e===3)return 7;if(Ta)switch(e){case 59:return 85;case 60:if(Co)return 97;break;case 61:return 86;case 107:return 109;case 109:return 111;case 173:return 88;case 224:if(Kt)return 57;break}else if(Hp){if(Kt&&e===93)return 57;if(!Kt&&e===92)return 57}return uX[e]||0}const _be=Kt?256:2048,vbe=512,bbe=1024,Cbe=Kt?2048:256;class Oi{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=mbe(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|=_be),this.altKey&&(t|=vbe),this.shiftKey&&(t|=bbe),this.metaKey&&(t|=Cbe),t|=e,t}_computeKeyCodeChord(){let e=0;return this.keyCode!==5&&this.keyCode!==4&&this.keyCode!==6&&this.keyCode!==57&&(e=this.keyCode),new Gu(this.ctrlKey,this.shiftKey,this.altKey,this.metaKey,e)}}let YV=!1,J0=null;function wbe(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 YV=!0,null}catch{return YV=!0,null}return n.parent}class ybe{static getSameOriginWindowChain(){if(!J0){J0=[];let e=window,t;do t=wbe(e),t?J0.push({window:e,iframeElement:e.frameElement||null}):J0.push({window:e,iframeElement:null}),e=t;while(e)}return J0.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 ba{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=ybe.getPositionOfChildWindowRelativeToAncestorWindow(window,e.view);this.posx-=t.left,this.posy-=t.top}preventDefault(){this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent.stopPropagation()}}class lm{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?Ta&&!Kt?this.deltaY=-e.deltaY/3:this.deltaY=-e.deltaY:this.deltaY=-e.deltaY/40}if(typeof s.wheelDeltaX<"u")qu&&zs?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?Ta&&!Kt?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:VX,setPrototypeOf:ZV,isFrozen:Sbe,getPrototypeOf:Lbe,getOwnPropertyDescriptor:kbe}=Object;let{freeze:kr,seal:hc,create:Dbe}=Object,{apply:zP,construct:UP}=typeof Reflect<"u"&&Reflect;zP||(zP=function(e,t,i){return e.apply(t,i)});kr||(kr=function(e){return e});hc||(hc=function(e){return e});UP||(UP=function(e,t){return new e(...t)});const Ebe=gl(Array.prototype.forEach),XV=gl(Array.prototype.pop),e1=gl(Array.prototype.push),rD=gl(String.prototype.toLowerCase),eM=gl(String.prototype.toString),Ibe=gl(String.prototype.match),Il=gl(String.prototype.replace),Tbe=gl(String.prototype.indexOf),xbe=gl(String.prototype.trim),da=gl(RegExp.prototype.test),t1=Nbe(TypeError);function gl(n){return function(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),s=1;s/gm),Obe=hc(/\${[\w\W]*}/gm),Fbe=hc(/^data-[\-\w.\u00B7-\uFFFF]/),Bbe=hc(/^aria-[\-\w]+$/),HX=hc(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Wbe=hc(/^(?:\w+script|data):/i),Vbe=hc(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),$X=hc(/^html$/i);var iH=Object.freeze({__proto__:null,MUSTACHE_EXPR:Rbe,ERB_EXPR:Pbe,TMPLIT_EXPR:Obe,DATA_ATTR:Fbe,ARIA_ATTR:Bbe,IS_ALLOWED_URI:HX,IS_SCRIPT_OR_DATA:Wbe,ATTR_WHITESPACE:Vbe,DOCTYPE_NAME:$X});const Hbe=()=>typeof window>"u"?null:window,$be=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 zX(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Hbe();const e=Rt=>zX(Rt);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=bL(g,"cloneNode"),_=bL(g,"nextSibling"),v=bL(g,"childNodes"),b=bL(g,"parentNode");if(typeof r=="function"){const Rt=s.createElement("template");Rt.content&&Rt.content.ownerDocument&&(s=Rt.content.ownerDocument)}let C,w="";const{implementation:y,createNodeIterator:L,createDocumentFragment:S,getElementsByTagName:k}=s,{importNode:D}=t;let x={};e.isSupported=typeof VX=="function"&&typeof b=="function"&&y&&y.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:A,ERB_EXPR:T,TMPLIT_EXPR:P,DATA_ATTR:W,ARIA_ATTR:$,IS_SCRIPT_OR_DATA:X,ATTR_WHITESPACE:J}=iH;let{IS_ALLOWED_URI:Q}=iH,le=null;const de=vi({},[...QV,...tM,...iM,...nM,...JV]);let _e=null;const ie=vi({},[...eH,...sM,...tH,...CL]);let ne=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}})),Ye=null,pe=null,Ee=!0,ze=!0,It=!1,Ke=!0,Xe=!1,je=!1,Z=!1,z=!1,ae=!1,we=!1,Ne=!1,Ce=!0,Be=!1;const Ae="user-content-";let K=!0,V=!1,G={},N=null;const R=vi({},["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 U=null;const H=vi({},["audio","video","img","source","image","track"]);let he=null;const Le=vi({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),qe="http://www.w3.org/1998/Math/MathML",ot="http://www.w3.org/2000/svg",yt="http://www.w3.org/1999/xhtml";let Et=yt,gi=!1,_i=null;const ft=vi({},[qe,ot,yt],eM);let Ci;const Xi=["application/xhtml+xml","text/html"],za="text/html";let ui,Gn=null;const Bg=s.createElement("form"),Wg=function(ue){return ue instanceof RegExp||ue instanceof Function},Dl=function(ue){if(!(Gn&&Gn===ue)){if((!ue||typeof ue!="object")&&(ue={}),ue=C_(ue),Ci=Xi.indexOf(ue.PARSER_MEDIA_TYPE)===-1?Ci=za:Ci=ue.PARSER_MEDIA_TYPE,ui=Ci==="application/xhtml+xml"?eM:rD,le="ALLOWED_TAGS"in ue?vi({},ue.ALLOWED_TAGS,ui):de,_e="ALLOWED_ATTR"in ue?vi({},ue.ALLOWED_ATTR,ui):ie,_i="ALLOWED_NAMESPACES"in ue?vi({},ue.ALLOWED_NAMESPACES,eM):ft,he="ADD_URI_SAFE_ATTR"in ue?vi(C_(Le),ue.ADD_URI_SAFE_ATTR,ui):Le,U="ADD_DATA_URI_TAGS"in ue?vi(C_(H),ue.ADD_DATA_URI_TAGS,ui):H,N="FORBID_CONTENTS"in ue?vi({},ue.FORBID_CONTENTS,ui):R,Ye="FORBID_TAGS"in ue?vi({},ue.FORBID_TAGS,ui):{},pe="FORBID_ATTR"in ue?vi({},ue.FORBID_ATTR,ui):{},G="USE_PROFILES"in ue?ue.USE_PROFILES:!1,Ee=ue.ALLOW_ARIA_ATTR!==!1,ze=ue.ALLOW_DATA_ATTR!==!1,It=ue.ALLOW_UNKNOWN_PROTOCOLS||!1,Ke=ue.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Xe=ue.SAFE_FOR_TEMPLATES||!1,je=ue.WHOLE_DOCUMENT||!1,ae=ue.RETURN_DOM||!1,we=ue.RETURN_DOM_FRAGMENT||!1,Ne=ue.RETURN_TRUSTED_TYPE||!1,z=ue.FORCE_BODY||!1,Ce=ue.SANITIZE_DOM!==!1,Be=ue.SANITIZE_NAMED_PROPS||!1,K=ue.KEEP_CONTENT!==!1,V=ue.IN_PLACE||!1,Q=ue.ALLOWED_URI_REGEXP||HX,Et=ue.NAMESPACE||yt,ne=ue.CUSTOM_ELEMENT_HANDLING||{},ue.CUSTOM_ELEMENT_HANDLING&&Wg(ue.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(ne.tagNameCheck=ue.CUSTOM_ELEMENT_HANDLING.tagNameCheck),ue.CUSTOM_ELEMENT_HANDLING&&Wg(ue.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(ne.attributeNameCheck=ue.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),ue.CUSTOM_ELEMENT_HANDLING&&typeof ue.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(ne.allowCustomizedBuiltInElements=ue.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Xe&&(ze=!1),we&&(ae=!0),G&&(le=vi({},[...JV]),_e=[],G.html===!0&&(vi(le,QV),vi(_e,eH)),G.svg===!0&&(vi(le,tM),vi(_e,sM),vi(_e,CL)),G.svgFilters===!0&&(vi(le,iM),vi(_e,sM),vi(_e,CL)),G.mathMl===!0&&(vi(le,nM),vi(_e,tH),vi(_e,CL))),ue.ADD_TAGS&&(le===de&&(le=C_(le)),vi(le,ue.ADD_TAGS,ui)),ue.ADD_ATTR&&(_e===ie&&(_e=C_(_e)),vi(_e,ue.ADD_ATTR,ui)),ue.ADD_URI_SAFE_ATTR&&vi(he,ue.ADD_URI_SAFE_ATTR,ui),ue.FORBID_CONTENTS&&(N===R&&(N=C_(N)),vi(N,ue.FORBID_CONTENTS,ui)),K&&(le["#text"]=!0),je&&vi(le,["html","head","body"]),le.table&&(vi(le,["tbody"]),delete Ye.tbody),ue.TRUSTED_TYPES_POLICY){if(typeof ue.TRUSTED_TYPES_POLICY.createHTML!="function")throw t1('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof ue.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw t1('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');C=ue.TRUSTED_TYPES_POLICY,w=C.createHTML("")}else C===void 0&&(C=$be(f,i)),C!==null&&typeof w=="string"&&(w=C.createHTML(""));kr&&kr(ue),Gn=ue}},uh=vi({},["mi","mo","mn","ms","mtext"]),Vg=vi({},["foreignobject","desc","title","annotation-xml"]),Hg=vi({},["title","style","font","a","script"]),p_=vi({},tM);vi(p_,iM),vi(p_,Abe);const $g=vi({},nM);vi($g,Mbe);const SA=function(ue){let it=b(ue);(!it||!it.tagName)&&(it={namespaceURI:Et,tagName:"template"});const Ct=rD(ue.tagName),pn=rD(it.tagName);return _i[ue.namespaceURI]?ue.namespaceURI===ot?it.namespaceURI===yt?Ct==="svg":it.namespaceURI===qe?Ct==="svg"&&(pn==="annotation-xml"||uh[pn]):!!p_[Ct]:ue.namespaceURI===qe?it.namespaceURI===yt?Ct==="math":it.namespaceURI===ot?Ct==="math"&&Vg[pn]:!!$g[Ct]:ue.namespaceURI===yt?it.namespaceURI===ot&&!Vg[pn]||it.namespaceURI===qe&&!uh[pn]?!1:!$g[Ct]&&(Hg[Ct]||!p_[Ct]):!!(Ci==="application/xhtml+xml"&&_i[ue.namespaceURI]):!1},Lc=function(ue){e1(e.removed,{element:ue});try{ue.parentNode.removeChild(ue)}catch{ue.remove()}},q0=function(ue,it){try{e1(e.removed,{attribute:it.getAttributeNode(ue),from:it})}catch{e1(e.removed,{attribute:null,from:it})}if(it.removeAttribute(ue),ue==="is"&&!_e[ue])if(ae||we)try{Lc(it)}catch{}else try{it.setAttribute(ue,"")}catch{}},G0=function(ue){let it,Ct;if(z)ue=""+ue;else{const Ua=Ibe(ue,/^[\r\n\t ]+/);Ct=Ua&&Ua[0]}Ci==="application/xhtml+xml"&&Et===yt&&(ue=''+ue+"");const pn=C?C.createHTML(ue):ue;if(Et===yt)try{it=new h().parseFromString(pn,Ci)}catch{}if(!it||!it.documentElement){it=y.createDocument(Et,"template",null);try{it.documentElement.innerHTML=gi?w:pn}catch{}}const ao=it.body||it.documentElement;return ue&&Ct&&ao.insertBefore(s.createTextNode(Ct),ao.childNodes[0]||null),Et===yt?k.call(it,je?"html":"body")[0]:je?it.documentElement:ao},tL=function(ue){return L.call(ue.ownerDocument||ue,ue,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT,null,!1)},Mce=function(ue){return ue instanceof u&&(typeof ue.nodeName!="string"||typeof ue.textContent!="string"||typeof ue.removeChild!="function"||!(ue.attributes instanceof d)||typeof ue.removeAttribute!="function"||typeof ue.setAttribute!="function"||typeof ue.namespaceURI!="string"||typeof ue.insertBefore!="function"||typeof ue.hasChildNodes!="function")},iL=function(ue){return typeof a=="object"?ue instanceof a:ue&&typeof ue=="object"&&typeof ue.nodeType=="number"&&typeof ue.nodeName=="string"},Ud=function(ue,it,Ct){x[ue]&&Ebe(x[ue],pn=>{pn.call(e,it,Ct,Gn)})},X6=function(ue){let it;if(Ud("beforeSanitizeElements",ue,null),Mce(ue))return Lc(ue),!0;const Ct=ui(ue.nodeName);if(Ud("uponSanitizeElement",ue,{tagName:Ct,allowedTags:le}),ue.hasChildNodes()&&!iL(ue.firstElementChild)&&(!iL(ue.content)||!iL(ue.content.firstElementChild))&&da(/<[/\w]/g,ue.innerHTML)&&da(/<[/\w]/g,ue.textContent))return Lc(ue),!0;if(!le[Ct]||Ye[Ct]){if(!Ye[Ct]&&J6(Ct)&&(ne.tagNameCheck instanceof RegExp&&da(ne.tagNameCheck,Ct)||ne.tagNameCheck instanceof Function&&ne.tagNameCheck(Ct)))return!1;if(K&&!N[Ct]){const pn=b(ue)||ue.parentNode,ao=v(ue)||ue.childNodes;if(ao&&pn){const Ua=ao.length;for(let Qn=Ua-1;Qn>=0;--Qn)pn.insertBefore(p(ao[Qn],!0),_(ue))}}return Lc(ue),!0}return ue instanceof l&&!SA(ue)||(Ct==="noscript"||Ct==="noembed"||Ct==="noframes")&&da(/<\/no(script|embed|frames)/i,ue.innerHTML)?(Lc(ue),!0):(Xe&&ue.nodeType===3&&(it=ue.textContent,it=Il(it,A," "),it=Il(it,T," "),it=Il(it,P," "),ue.textContent!==it&&(e1(e.removed,{element:ue.cloneNode()}),ue.textContent=it)),Ud("afterSanitizeElements",ue,null),!1)},Q6=function(ue,it,Ct){if(Ce&&(it==="id"||it==="name")&&(Ct in s||Ct in Bg))return!1;if(!(ze&&!pe[it]&&da(W,it))){if(!(Ee&&da($,it))){if(!_e[it]||pe[it]){if(!(J6(ue)&&(ne.tagNameCheck instanceof RegExp&&da(ne.tagNameCheck,ue)||ne.tagNameCheck instanceof Function&&ne.tagNameCheck(ue))&&(ne.attributeNameCheck instanceof RegExp&&da(ne.attributeNameCheck,it)||ne.attributeNameCheck instanceof Function&&ne.attributeNameCheck(it))||it==="is"&&ne.allowCustomizedBuiltInElements&&(ne.tagNameCheck instanceof RegExp&&da(ne.tagNameCheck,Ct)||ne.tagNameCheck instanceof Function&&ne.tagNameCheck(Ct))))return!1}else if(!he[it]){if(!da(Q,Il(Ct,J,""))){if(!((it==="src"||it==="xlink:href"||it==="href")&&ue!=="script"&&Tbe(Ct,"data:")===0&&U[ue])){if(!(It&&!da(X,Il(Ct,J,"")))){if(Ct)return!1}}}}}}return!0},J6=function(ue){return ue.indexOf("-")>0},eW=function(ue){let it,Ct,pn,ao;Ud("beforeSanitizeAttributes",ue,null);const{attributes:Ua}=ue;if(!Ua)return;const Qn={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:_e};for(ao=Ua.length;ao--;){it=Ua[ao];const{name:kc,namespaceURI:LA}=it;if(Ct=kc==="value"?it.value:xbe(it.value),pn=ui(kc),Qn.attrName=pn,Qn.attrValue=Ct,Qn.keepAttr=!0,Qn.forceKeepAttr=void 0,Ud("uponSanitizeAttribute",ue,Qn),Ct=Qn.attrValue,Qn.forceKeepAttr||(q0(kc,ue),!Qn.keepAttr))continue;if(!Ke&&da(/\/>/i,Ct)){q0(kc,ue);continue}Xe&&(Ct=Il(Ct,A," "),Ct=Il(Ct,T," "),Ct=Il(Ct,P," "));const tW=ui(ue.nodeName);if(Q6(tW,pn,Ct)){if(Be&&(pn==="id"||pn==="name")&&(q0(kc,ue),Ct=Ae+Ct),C&&typeof f=="object"&&typeof f.getAttributeType=="function"&&!LA)switch(f.getAttributeType(tW,pn)){case"TrustedHTML":{Ct=C.createHTML(Ct);break}case"TrustedScriptURL":{Ct=C.createScriptURL(Ct);break}}try{LA?ue.setAttributeNS(LA,kc,Ct):ue.setAttribute(kc,Ct),XV(e.removed)}catch{}}}Ud("afterSanitizeAttributes",ue,null)},Rce=function Rt(ue){let it;const Ct=tL(ue);for(Ud("beforeSanitizeShadowDOM",ue,null);it=Ct.nextNode();)Ud("uponSanitizeShadowNode",it,null),!X6(it)&&(it.content instanceof o&&Rt(it.content),eW(it));Ud("afterSanitizeShadowDOM",ue,null)};return e.sanitize=function(Rt){let ue=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},it,Ct,pn,ao;if(gi=!Rt,gi&&(Rt=""),typeof Rt!="string"&&!iL(Rt))if(typeof Rt.toString=="function"){if(Rt=Rt.toString(),typeof Rt!="string")throw t1("dirty is not a string, aborting")}else throw t1("toString is not a function");if(!e.isSupported)return Rt;if(Z||Dl(ue),e.removed=[],typeof Rt=="string"&&(V=!1),V){if(Rt.nodeName){const kc=ui(Rt.nodeName);if(!le[kc]||Ye[kc])throw t1("root node is forbidden and cannot be sanitized in-place")}}else if(Rt instanceof a)it=G0(""),Ct=it.ownerDocument.importNode(Rt,!0),Ct.nodeType===1&&Ct.nodeName==="BODY"||Ct.nodeName==="HTML"?it=Ct:it.appendChild(Ct);else{if(!ae&&!Xe&&!je&&Rt.indexOf("<")===-1)return C&&Ne?C.createHTML(Rt):Rt;if(it=G0(Rt),!it)return ae?null:Ne?w:""}it&&z&&Lc(it.firstChild);const Ua=tL(V?Rt:it);for(;pn=Ua.nextNode();)X6(pn)||(pn.content instanceof o&&Rce(pn.content),eW(pn));if(V)return Rt;if(ae){if(we)for(ao=S.call(it.ownerDocument);it.firstChild;)ao.appendChild(it.firstChild);else ao=it;return(_e.shadowroot||_e.shadowrootmode)&&(ao=D.call(t,ao,!0)),ao}let Qn=je?it.outerHTML:it.innerHTML;return je&&le["!doctype"]&&it.ownerDocument&&it.ownerDocument.doctype&&it.ownerDocument.doctype.name&&da($X,it.ownerDocument.doctype.name)&&(Qn="\n"+Qn),Xe&&(Qn=Il(Qn,A," "),Qn=Il(Qn,T," "),Qn=Il(Qn,P," ")),C&&Ne?C.createHTML(Qn):Qn},e.setConfig=function(Rt){Dl(Rt),Z=!0},e.clearConfig=function(){Gn=null,Z=!1},e.isValidAttribute=function(Rt,ue,it){Gn||Dl({});const Ct=ui(Rt),pn=ui(ue);return Q6(Ct,pn,it)},e.addHook=function(Rt,ue){typeof ue=="function"&&(x[Rt]=x[Rt]||[],e1(x[Rt],ue))},e.removeHook=function(Rt){if(x[Rt])return XV(x[Rt])},e.removeHooks=function(Rt){x[Rt]&&(x[Rt]=[])},e.removeAllHooks=function(){x={}},e}var Hd=zX();Hd.version;Hd.isSupported;const UX=Hd.sanitize;Hd.setConfig;Hd.clearConfig;Hd.isValidAttribute;const jX=Hd.addHook,KX=Hd.removeHook;Hd.removeHooks;Hd.removeAllHooks;var Nt;(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"})(Nt||(Nt={}));const zbe="tkn";class Ube{constructor(){this._hosts=Object.create(null),this._ports=Object.create(null),this._connectionTokens=Object.create(null),this._preferredWebSchema="http",this._delegate=null,this._remoteResourcesPath="/".concat(Nt.vscodeRemoteResource)}setPreferredWebSchema(e){this._preferredWebSchema=e}rewrite(e){if(this._delegate)try{return this._delegate(e)}catch(a){return Dt(a),e}const t=e.authority;let i=this._hosts[t];i&&i.indexOf(":")!==-1&&i.indexOf("[")===-1&&(i="[".concat(i,"]"));const s=this._ports[t],o=this._connectionTokens[t];let r="path=".concat(encodeURIComponent(e.path));return typeof o=="string"&&(r+="&".concat(zbe,"=").concat(encodeURIComponent(o))),ct.from({scheme:yg?this._preferredWebSchema:Nt.vscodeRemoteResource,authority:"".concat(i,":").concat(s),path:this._remoteResourcesPath,query:r})}}const qX=new Ube;class yw{uriToBrowserUri(e){return e.scheme===Nt.vscodeRemote?qX.rewrite(e):e.scheme===Nt.file&&(nc||Bme&&ol.origin==="".concat(Nt.vscodeFileResource,"://").concat(yw.FALLBACK_AUTHORITY))?e.with({scheme:Nt.vscodeFileResource,authority:e.authority||yw.FALLBACK_AUTHORITY,query:null,fragment:null}):e}}yw.FALLBACK_AUTHORITY="vscode-app";const GX=new yw;var nH;(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:ct.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})(nH||(nH={}));const{registerWindow:Tit,getWindows:jbe,onDidCreateWindow:xit}=function(){const n=[],e=new j;return{onDidCreateWindow:e.event,registerWindow(t){n.push(t);const i=new be;return i.add(vt(()=>{const s=n.indexOf(t);s!==-1&&n.splice(s,1)})),e.fire({window:t,disposableStore:i}),i},getWindows(){return n}}}();function Ds(n){for(;n.firstChild;)n.firstChild.remove()}function O8(n){var e;return(e=n==null?void 0:n.isConnected)!==null&&e!==void 0?e:!1}class Kbe{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 ce(n,e,t,i){return new Kbe(n,e,t,i)}function YX(n){return function(e){return n(new ba(e))}}function qbe(n){return function(e){return n(new Oi(e))}}const In=function(e,t,i,s){let o=i;return t==="click"||t==="mousedown"?o=YX(i):(t==="keydown"||t==="keypress"||t==="keyup")&&(o=qbe(i)),ce(e,t,o,s)},Gbe=function(e,t,i){const s=YX(t);return Ybe(e,s,i)};function Ybe(n,e,t){return ce(n,uc&&P8.pointerEvents?Pe.POINTER_DOWN:Pe.MOUSE_DOWN,e,t)}let bE,xa;class oM{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){Dt(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(oM.sort),e.shift().execute();i=!1};xa=(o,r=0)=>{const a=new oM(o,r);return n.push(a),t||(t=!0,requestAnimationFrame(s)),a},bE=(o,r)=>{if(i){const a=new oM(o,r);return e.push(a),a}else return xa(o,r)}})();function nx(n){return n.ownerDocument.defaultView.getComputedStyle(n,null)}function L0(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 ii(n.clientWidth,n.clientHeight);if(uc&&(i!=null&&i.visualViewport))return new ii(i.visualViewport.width,i.visualViewport.height);if(i!=null&&i.innerWidth&&i.innerHeight)return new ii(i.innerWidth,i.innerHeight);if(t.body&&t.body.clientWidth&&t.body.clientHeight)return new ii(t.body.clientWidth,t.body.clientHeight);if(t.documentElement&&t.documentElement.clientWidth&&t.documentElement.clientHeight)return new ii(t.documentElement.clientWidth,t.documentElement.clientHeight);throw new Error("Unable to figure out browser width and height")}class vn{static convertToPixels(e,t){return parseFloat(t)||0}static getDimension(e,t,i){const s=nx(e),o=s?s.getPropertyValue(t):"0";return vn.convertToPixels(e,o)}static getBorderLeftWidth(e){return vn.getDimension(e,"border-left-width","borderLeftWidth")}static getBorderRightWidth(e){return vn.getDimension(e,"border-right-width","borderRightWidth")}static getBorderTopWidth(e){return vn.getDimension(e,"border-top-width","borderTopWidth")}static getBorderBottomWidth(e){return vn.getDimension(e,"border-bottom-width","borderBottomWidth")}static getPaddingLeft(e){return vn.getDimension(e,"padding-left","paddingLeft")}static getPaddingRight(e){return vn.getDimension(e,"padding-right","paddingRight")}static getPaddingTop(e){return vn.getDimension(e,"padding-top","paddingTop")}static getPaddingBottom(e){return vn.getDimension(e,"padding-bottom","paddingBottom")}static getMarginLeft(e){return vn.getDimension(e,"margin-left","marginLeft")}static getMarginTop(e){return vn.getDimension(e,"margin-top","marginTop")}static getMarginRight(e){return vn.getDimension(e,"margin-right","marginRight")}static getMarginBottom(e){return vn.getDimension(e,"margin-bottom","marginBottom")}}class ii{constructor(e,t){this.width=e,this.height=t}with(e=this.width,t=this.height){return e!==this.width||t!==this.height?new ii(e,t):this}static is(e){return typeof e=="object"&&typeof e.height=="number"&&typeof e.width=="number"}static lift(e){return e instanceof ii?e:new ii(e.width,e.height)}static equals(e,t){return e===t?!0:!e||!t?!1:e.width===t.width&&e.height===t.height}}ii.None=new ii(0,0);function ZX(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=XX(n)?null:nx(n);s&&(i-=s.direction!=="rtl"?n.scrollLeft:-n.scrollLeft),n===e&&(i+=vn.getBorderLeftWidth(n),t+=vn.getBorderTopWidth(n),t+=n.offsetTop,i+=n.offsetLeft,e=n.offsetParent)}return{left:i,top:t}}function Zbe(n,e,t){typeof e=="number"&&(n.style.width="".concat(e,"px")),typeof t=="number"&&(n.style.height="".concat(t,"px"))}function Un(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 Xbe(n){let e=n,t=1;do{const i=nx(e).zoom;i!=null&&i!=="1"&&(t*=i),e=e.parentElement}while(e!==null&&e!==e.ownerDocument.documentElement);return t}function Ko(n){const e=vn.getMarginLeft(n)+vn.getMarginRight(n);return n.offsetWidth+e}function rM(n){const e=vn.getBorderLeftWidth(n)+vn.getBorderRightWidth(n),t=vn.getPaddingLeft(n)+vn.getPaddingRight(n);return n.offsetWidth-e-t}function Qbe(n){const e=vn.getBorderTopWidth(n)+vn.getBorderBottomWidth(n),t=vn.getPaddingTop(n)+vn.getPaddingBottom(n);return n.offsetHeight-e-t}function Ep(n){const e=vn.getMarginTop(n)+vn.getMarginBottom(n);return n.offsetHeight+e}function Ws(n,e){for(;n;){if(n===e)return!0;n=n.parentNode}return!1}function Jbe(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 aM(n,e,t){return!!Jbe(n,e,t)}function XX(n){return n&&!!n.host&&!!n.mode}function CE(n){return!!cm(n)}function cm(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 XX(n)?n:null}function al(){let n=sx().activeElement;for(;n!=null&&n.shadowRoot;)n=n.shadowRoot.activeElement;return n}function sx(){var n;return(n=[document,...jbe().map(t=>t.document)].find(t=>t.hasFocus()))!==null&&n!==void 0?n:document}function Na(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 lM=null;function QX(){return lM||(lM=Na()),lM}function e0e(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 jP(n,e,t=QX()){!t||!e||t.sheet.insertRule(n+"{"+e+"}",0)}function sH(n,e=QX()){if(!e)return;const t=e0e(e),i=[];for(let s=0;s=0;s--)e.sheet.deleteRule(i[s])}function F8(n){return typeof HTMLElement=="object"?n instanceof HTMLElement:n&&typeof n=="object"&&n.nodeType===1&&typeof n.nodeName=="string"}const Pe={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:Hp?"webkitAnimationStart":"animationstart",ANIMATION_END:Hp?"webkitAnimationEnd":"animationend",ANIMATION_ITERATION:Hp?"webkitAnimationIteration":"animationiteration"};function t0e(n){const e=n;return!!(e&&typeof e.preventDefault=="function"&&typeof e.stopPropagation=="function")}const xt={stop:(n,e)=>(n.preventDefault(),e&&n.stopPropagation(),n)};function i0e(n){const e=[];for(let t=0;n&&n.nodeType===n.ELEMENT_NODE;t++)e[t]=n.scrollTop,n=n.parentNode;return e}function n0e(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 wE extends te{static hasFocusWithin(e){if(F8(e)){const t=cm(e),i=t?t.activeElement:e.ownerDocument.activeElement;return Ws(i,e)}else return Ws(window.document.activeElement,window.document)}constructor(e){super(),this._onDidFocus=this._register(new j),this.onDidFocus=this._onDidFocus.event,this._onDidBlur=this._register(new j),this.onDidBlur=this._onDidBlur.event;let t=wE.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=()=>{wE.hasFocusWithin(e)!==t&&(t?o():s())},this._register(ce(e,Pe.FOCUS,s,!0)),this._register(ce(e,Pe.BLUR,o,!0)),e instanceof HTMLElement&&(this._register(ce(e,Pe.FOCUS_IN,()=>this._refreshStateHandler())),this._register(ce(e,Pe.FOCUS_OUT,()=>this._refreshStateHandler())))}}function Ld(n){return new wE(n)}function ge(n,...e){if(n.append(...e),e.length===1&&typeof e[0]!="string")return e[0]}function JX(n,e){return n.insertBefore(e,n.firstChild),e}function Es(n,...e){n.innerText="",ge(n,...e)}const s0e=/([\w\-]+)?(#([\w\-]+))?((\.([\w\-]+))*)/;var Sw;(function(n){n.HTML="http://www.w3.org/1999/xhtml",n.SVG="http://www.w3.org/2000/svg"})(Sw||(Sw={}));function eQ(n,e,t,...i){const s=s0e.exec(e);if(!s)throw new Error("Bad use of emmet");const o=s[1]||"div";let r;return n!==Sw.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 ye(n,e,...t){return eQ(Sw.HTML,n,e,...t)}ye.SVG=function(n,e,...t){return eQ(Sw.SVG,n,e,...t)};function o0e(n,...e){n?mr(...e):Lo(...e)}function mr(...n){for(const e of n)e.style.display="",e.removeAttribute("aria-hidden")}function Lo(...n){for(const e of n)e.style.display="none",e.setAttribute("aria-hidden","true")}function oH(n){const e=window.devicePixelRatio*n;return Math.max(1,Math.floor(e))/window.devicePixelRatio}function tQ(n){window.open(n,"_blank","noopener")}function r0e(n){const e=()=>{n(),t=xa(e)};let t=xa(e);return vt(()=>t.dispose())}qX.setPreferredWebSchema(/^https:/.test(window.location.href)?"https":"http");function Uf(n){return n?"url('".concat(GX.uriToBrowserUri(n).toString(!0).replace(/'/g,"%27"),"')"):"url('')"}function rH(n){return"'".concat(n.replace(/'/g,"%27"),"'")}function zp(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=zp(i[1].trim(),e)),"var(".concat(i[0],", ").concat(e,")")}return n}return e}function a0e(n,e=!1){const t=document.createElement("a");return jX("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)}}}),vt(()=>{KX("afterSanitizeAttributes")})}const l0e=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 wu extends j{constructor(){super(),this._subscriptions=new be,this._keyStatus={altKey:!1,shiftKey:!1,ctrlKey:!1,metaKey:!1},this._subscriptions.add(ce(window,"keydown",e=>{if(e.defaultPrevented)return;const t=new Oi(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(ce(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(ce(document.body,"mousedown",()=>{this._keyStatus.lastKeyPressed=void 0},!0)),this._subscriptions.add(ce(document.body,"mouseup",()=>{this._keyStatus.lastKeyPressed=void 0},!0)),this._subscriptions.add(ce(document.body,"mousemove",e=>{e.buttons&&(this._keyStatus.lastKeyPressed=void 0)},!0)),this._subscriptions.add(ce(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 wu.instance||(wu.instance=new wu),wu.instance}dispose(){super.dispose(),this._subscriptions.dispose()}}class c0e extends te{constructor(e,t){super(),this.element=e,this.callbacks=t,this.counter=0,this.dragStartTime=0,this.registerListeners()}registerListeners(){this._register(ce(this.element,Pe.DRAG_ENTER,e=>{this.counter++,this.dragStartTime=e.timeStamp,this.callbacks.onDragEnter(e)})),this._register(ce(this.element,Pe.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(ce(this.element,Pe.DRAG_LEAVE,e=>{this.counter--,this.counter===0&&(this.dragStartTime=0,this.callbacks.onDragLeave(e))})),this._register(ce(this.element,Pe.DRAG_END,e=>{this.counter=0,this.dragStartTime=0,this.callbacks.onDragEnd(e)})),this._register(ce(this.element,Pe.DROP,e=>{this.counter=0,this.dragStartTime=0,this.callbacks.onDrop(e)}))}}const d0e=/(?[\w\-]+)?(?:#(?[\w\-]+))?(?(?:\.(?:[\w\-]+))*)(?:@(?(?:[\w\_])+))?/;function vs(n,...e){let t,i;Array.isArray(e[0])?(t={},i=e[0]):(t=e[0]||{},i=e[1]);const s=d0e.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(aH(u),typeof h=="number"?h+"px":""+h);else c==="tabIndex"?r.tabIndex=d:r.setAttribute(aH(c),d.toString());return l.root=r,l}function aH(n){return n.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}class ox{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=fe.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};er.registerKeybindingRule(s)}}qt.registerCommand({id:this.id,handler:(e,t)=>this.runCommand(e,t),description:this._description})}_registerMenuItem(e){Ls.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 k0 extends ox{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(bt).contextMatchesRules(i!=null?i:void 0))return s(a,r,t)})}runCommand(e,t){return fs.runEditorCommand(e,t,this.precondition,(i,s,o)=>this.runEditorCommand(i,s,o))}}class Ue extends fs{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=M.EditorContext),s.title||(s.title=e.label),s.when=fe.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(Ue.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(ra).publicLog2("editorActionInvoked",{name:this.label,id:this.id})}}class nQ extends Ue{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(bt),c=o.get(aa);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 $d(n,e){qt.registerCommand(n,function(t,...i){const s=t.get(_t),[o,r]=i;bi(ct.isUri(o)),bi(Y.isIPosition(r));const a=t.get(Zi).getModel(o);if(a){const l=Y.lift(r);return s.invokeFunction(e,a,l,...i.slice(2))}return t.get(sr).createModelReference(o).then(l=>new Promise((c,d)=>{try{const u=s.invokeFunction(e,l.object.textEditorModel,Y.lift(r),i.slice(2));c(u)}catch(u){d(u)}}).finally(()=>{l.dispose()}))})}function Re(n){return _a.INSTANCE.registerEditorCommand(n),n}function De(n){const e=new n;return _a.INSTANCE.registerEditorAction(e),e}function sQ(n){return _a.INSTANCE.registerEditorAction(n),n}function u0e(n){_a.INSTANCE.registerEditorAction(n)}function ti(n,e,t){_a.INSTANCE.registerEditorContribution(n,e,t)}var Wv;(function(n){function e(r){return _a.INSTANCE.getEditorCommand(r)}n.getEditorCommand=e;function t(){return _a.INSTANCE.getEditorActions()}n.getEditorActions=t;function i(){return _a.INSTANCE.getEditorContributions()}n.getEditorContributions=i;function s(r){return _a.INSTANCE.getEditorContributions().filter(a=>r.indexOf(a.id)>=0)}n.getSomeEditorContributions=s;function o(){return _a.INSTANCE.getDiffEditorContributions()}n.getDiffEditorContributions=o})(Wv||(Wv={}));const h0e={EditorCommonContributions:"editor.contributions"};class _a{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}}_a.INSTANCE=new _a;en.add(h0e.EditorCommonContributions,_a.INSTANCE);function dS(n){return n.register(),n}const oQ=dS(new k0({id:"undo",precondition:void 0,kbOpts:{weight:0,primary:2104},menuOpts:[{menuId:M.MenubarEditMenu,group:"1_do",title:m({key:"miUndo",comment:["&& denotes a mnemonic"]},"&&Undo"),order:1},{menuId:M.CommandPalette,group:"",title:m("undo","Undo"),order:1}]}));dS(new iQ(oQ,{id:"default:undo",precondition:void 0}));const rQ=dS(new k0({id:"redo",precondition:void 0,kbOpts:{weight:0,primary:2103,secondary:[3128],mac:{primary:3128}},menuOpts:[{menuId:M.MenubarEditMenu,group:"1_do",title:m({key:"miRedo",comment:["&& denotes a mnemonic"]},"&&Redo"),order:2},{menuId:M.CommandPalette,group:"",title:m("redo","Redo"),order:1}]}));dS(new iQ(rQ,{id:"default:redo",precondition:void 0}));const f0e=dS(new k0({id:"editor.action.selectAll",precondition:void 0,kbOpts:{weight:0,kbExpr:null,primary:2079},menuOpts:[{menuId:M.MenubarSelectionMenu,group:"1_basic",title:m({key:"miSelectAll",comment:["&& denotes a mnemonic"]},"&&Select All"),order:1},{menuId:M.CommandPalette,group:"",title:m("selectAll","Select All"),order:1}]})),aQ=Symbol("MicrotaskDelay");var fa=globalThis&&globalThis.__awaiter||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())})},F1=globalThis&&globalThis.__asyncValues||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 KP(n){return!!n&&typeof n.then=="function"}function Xn(n){const e=new Tn,t=n(e.token),i=new Promise((s,o)=>{const r=e.token.onCancellationRequested(()=>{r.dispose(),e.dispose(),o(new Sg)});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 rx(n,e,t){return new Promise((i,s)=>{const o=e.onCancellationRequested(()=>{o.dispose(),i(t)});n.then(i,s).finally(()=>o.dispose())})}class g0e{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 p0e=(n,e)=>{let t=!0;const i=setTimeout(()=>{t=!1,e()},n);return{isTriggered:()=>t,dispose:()=>{clearTimeout(i),t=!1}}},m0e=n=>{let e=!0;return queueMicrotask(()=>{e&&(e=!1,n())}),{isTriggered:()=>e,dispose:()=>{e=!1}}};class pl{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===aQ?m0e(i):p0e(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 Sg),this.completionPromise=null)}cancelTimeout(){var e;(e=this.deferred)===null||e===void 0||e.dispose(),this.deferred=null}dispose(){this.cancel()}}class lQ{constructor(e){this.delayer=new pl(e),this.throttler=new g0e}trigger(e,t){return this.delayer.trigger(()=>this.throttler.queue(e),t)}cancel(){this.delayer.cancel()}dispose(){this.delayer.dispose(),this.throttler.dispose()}}function jf(n,e){return e?new Promise((t,i)=>{const s=setTimeout(()=>{o.dispose(),t()},n),o=e.onCancellationRequested(()=>{clearTimeout(s),o.dispose(),i(new Sg)})}):Xn(t=>jf(n,t))}function Kf(n,e=0,t){const i=setTimeout(()=>{n(),t&&s.dispose()},e),s=vt(()=>{clearTimeout(i),t==null||t.deleteAndLeak(s)});return t==null||t.add(s),s}function cQ(n,e=i=>!!i,t=null){let i=0;const s=n.length,o=()=>{if(i>=s)return Promise.resolve(t);const r=n[i++];return Promise.resolve(r()).then(l=>e(l)?Promise.resolve(l):o())};return o()}class _l{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 uS{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 Si{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 yu;(function(){typeof requestIdleCallback!="function"||typeof cancelIdleCallback!="function"?yu=n=>{JZ(()=>{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)}}}:yu=(n,e)=>{const t=requestIdleCallback(n,typeof e=="number"?{timeout:e}:void 0);let i=!1;return{dispose(){i||(i=!0,cancelIdleCallback(t))}}}})();class aD{constructor(e){this._didRun=!1,this._executor=()=>{try{this._value=e()}catch(t){this._error=t}finally{this._didRun=!0}},this._handle=yu(()=>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 ax{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 Sg)}}var qP;(function(n){function e(i){return fa(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)=>fa(this,void 0,void 0,function*(){try{yield i(s,o)}catch(r){o(r)}}))}n.withAsyncBody=t})(qP||(qP={}));class Mn{static fromArray(e){return new Mn(t=>{t.emitMany(e)})}static fromPromise(e){return new Mn(t=>fa(this,void 0,void 0,function*(){t.emitMany(yield e)}))}static fromPromises(e){return new Mn(t=>fa(this,void 0,void 0,function*(){yield Promise.all(e.map(i=>fa(this,void 0,void 0,function*(){return t.emitOne(yield i)})))}))}static merge(e){return new Mn(t=>fa(this,void 0,void 0,function*(){yield Promise.all(e.map(i=>{var s,o,r;return fa(this,void 0,void 0,function*(){var a,l,c,d;try{for(s=!0,o=F1(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 j,queueMicrotask(()=>fa(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:()=>fa(this,void 0,void 0,function*(){do{if(this._state===2)throw this._error;if(efa(this,void 0,void 0,function*(){var s,o,r,a;try{for(var l=!0,c=F1(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 Mn.map(this,e)}static filter(e,t){return new Mn(i=>fa(this,void 0,void 0,function*(){var s,o,r,a;try{for(var l=!0,c=F1(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 Mn.filter(this,e)}static coalesce(e){return Mn.filter(e,t=>!!t)}coalesce(){return Mn.coalesce(this)}static toPromise(e){var t,i,s,o,r,a,l;return fa(this,void 0,void 0,function*(){const c=[];try{for(t=!0,i=F1(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 Mn.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())}}Mn.EMPTY=Mn.fromArray([]);class _0e extends Mn{constructor(e,t){super(t),this._source=e}cancel(){this._source.cancel()}}function v0e(n){const e=new Tn,t=n(e.token);return new _0e(e,i=>fa(this,void 0,void 0,function*(){var s,o,r,a;const l=e.token.onCancellationRequested(()=>{l.dispose(),e.dispose(),i.reject(new Sg)});try{try{for(var c=!0,d=F1(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 b0e="$initialize";let lH=!1;function GP(n){yg&&(lH||(lH=!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 C0e{constructor(e,t,i,s){this.vsWorker=e,this.req=t,this.method=i,this.args=s,this.type=0}}class cH{constructor(e,t,i,s){this.vsWorker=e,this.seq=t,this.res=i,this.err=s,this.type=1}}class w0e{constructor(e,t,i,s){this.vsWorker=e,this.req=t,this.eventName=i,this.arg=s,this.type=2}}class y0e{constructor(e,t,i){this.vsWorker=e,this.req=t,this.event=i,this.type=3}}class S0e{constructor(e,t){this.vsWorker=e,this.req=t,this.type=4}}class L0e{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 C0e(this._workerId,i,e,t))})}listen(e,t){let i=null;const s=new j({onWillAddFirstListener:()=>{i=String(++this._lastSentReq),this._pendingEmitters.set(i,s),this._send(new w0e(this._workerId,i,e,t))},onDidRemoveLastListener:()=>{this._pendingEmitters.delete(i),this._send(new S0e(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 cH(this._workerId,t,s,void 0))},s=>{s.detail instanceof Error&&(s.detail=FV(s.detail)),this._send(new cH(this._workerId,t,void 0,FV(s)))})}_handleSubscribeEventMessage(e){const t=e.req,i=this._handler.handleEvent(e.eventName,e.arg)(s=>{this._send(new y0e(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 L0e({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(uQ(d)){const h=i[d].call(i,u);if(typeof h!="function")throw new Error("Missing dynamic event ".concat(d," on main thread host."));return h}if(dQ(d)){const h=i[d];if(typeof h!="function")throw new Error("Missing event ".concat(d," on main thread host."));return h}throw new Error("Malformed event name ".concat(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=h8(i);this._onModuleLoaded=this._protocol.sendMessage(b0e,[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(D0e(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 dQ(n){return n[0]==="o"&&n[1]==="n"&&Vc(n.charCodeAt(2))}function uQ(n){return/^onDynamic/.test(n)&&Vc(n.charCodeAt(9))}function D0e(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(uQ(r)){o[r]=s(r);continue}if(dQ(r)){o[r]=t(r,void 0);continue}o[r]=i(r)}return o}function sh(n,e){var t;const i=globalThis.MonacoEnvironment;if(i!=null&&i.createTrustedTypesPolicy)try{return i.createTrustedTypesPolicy(n,e)}catch(s){Dt(s);return}try{return(t=window.trustedTypes)===null||t===void 0?void 0:t.createPolicy(n,e)}catch(s){Dt(s);return}}const dH=sh("defaultWorkerFactory",{createScriptURL:n=>n});function E0e(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(dH?dH.createScriptURL(t):t,{name:n})}}throw new Error("You must define a function MonacoEnvironment.getWorkerUrl or MonacoEnvironment.getWorker")}function I0e(n){return typeof n.then=="function"}class T0e{constructor(e,t,i,s,o){this.id=t,this.label=i;const r=E0e(i);I0e(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){Dt(o),Dt(new Error("FAILED to post message to '".concat(this.label,"'-worker"),{cause:o}))}})}dispose(){var e;(e=this.worker)===null||e===void 0||e.then(t=>t.terminate()),this.worker=null}}class lx{constructor(e){this._label=e,this._webWorkerFailedBeforeError=!1}create(e,t,i){const s=++lx.LAST_WORKER_ID;if(this._webWorkerFailedBeforeError)throw this._webWorkerFailedBeforeError;return new T0e(e,s,this._label||"anonymous"+s,t,o=>{GP(o),this._webWorkerFailedBeforeError=o,i(o)})}}lx.LAST_WORKER_ID=0;var Pn;(function(n){n[n.None=0]="None",n[n.Indent=1]="Indent",n[n.IndentOutdent=2]="IndentOutdent",n[n.Outdent=3]="Outdent"})(Pn||(Pn={}));class cM{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 N0e(n,s,r,o+1,n.getStartOffset(r),n.getEndOffset(o))}class N0e{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 Nc(n){return(n&3)!==0}class Lb{constructor(e){if(e.autoClosingPairs?this._autoClosingPairs=e.autoClosingPairs.map(t=>new cM(t)):e.brackets?this._autoClosingPairs=e.brackets.map(t=>new cM({open:t[0],close:t[1]})):this._autoClosingPairs=[],e.__electricCharacterSupport&&e.__electricCharacterSupport.docComment){const t=e.__electricCharacterSupport.docComment;this._autoClosingPairs.push(new cM({open:t.open,close:t.close||""}))}this._autoCloseBeforeForQuotes=typeof e.autoCloseBefore=="string"?e.autoCloseBefore:Lb.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_QUOTES,this._autoCloseBeforeForBrackets=typeof e.autoCloseBefore=="string"?e.autoCloseBefore:Lb.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}}Lb.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_QUOTES=";:.,=}])> \n ";Lb.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_BRACKETS="'\"`;:.,=}])> \n ";const uH=typeof Buffer<"u";let dM;class dx{static wrap(e){return uH&&!Buffer.isBuffer(e)&&(e=Buffer.from(e.buffer,e.byteOffset,e.byteLength)),new dx(e)}constructor(e){this.buffer=e,this.byteLength=this.buffer.byteLength}toString(){return uH?this.buffer.toString():(dM||(dM=new TextDecoder),dM.decode(this.buffer))}}function A0e(n,e){return n[e+0]<<0>>>0|n[e+1]<<8>>>0}function M0e(n,e,t){n[t+0]=e&255,e=e>>>8,n[t+1]=e&255}function Ol(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 Fl(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 hH(n,e){return n[e]}function fH(n,e,t){n[t]=e}let uM;function hQ(){return uM||(uM=new TextDecoder("UTF-16LE")),uM}let hM;function R0e(){return hM||(hM=new TextDecoder("UTF-16BE")),hM}let fM;function fQ(){return fM||(fM=eX()?hQ():R0e()),fM}function P0e(n,e,t){const i=new Uint16Array(n.buffer,e,t);return t>0&&(i[0]===65279||i[0]===65534)?O0e(n,e,t):hQ().decode(i)}function O0e(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 B0e{constructor(e,t){this._richEditBracketsBrand=void 0;const i=F0e(t);this.brackets=i.map((s,o)=>new yE(e,o,s.open,s.close,W0e(s.open,s.close,i,o),V0e(s.open,s.close,i,o))),this.forwardRegex=H0e(this.brackets),this.reversedRegex=$0e(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 gQ(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 pQ(n,e){return n.length-e.length}function ux(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 W0e(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 fQ().decode(s)}let e=null,t=null;return function(s){return e!==s&&(e=s,t=n(e)),t}}();class Ga{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 I(t,l-a+1,t,l+1)}static findPrevBracketInRange(e,t,i,s,o){const a=B8(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 I(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 U0e{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 Vf(e)}onElectricCharacter(e,t,i){if(!this._richEditBrackets||this._richEditBrackets.brackets.length===0)return null;const s=t.findTokenIndexAtOffset(i-1);if(Nc(t.getStandardTokenType(s)))return null;const o=this._richEditBrackets.reversedRegex,r=t.getLineContent().substring(0,i-1)+e,a=Ga.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 wL(n){return n.global&&(n.lastIndex=0),!0}class j0e{constructor(e){this._indentationRules=e}shouldIncrease(e){return!!(this._indentationRules&&this._indentationRules.increaseIndentPattern&&wL(this._indentationRules.increaseIndentPattern)&&this._indentationRules.increaseIndentPattern.test(e))}shouldDecrease(e){return!!(this._indentationRules&&this._indentationRules.decreaseIndentPattern&&wL(this._indentationRules.decreaseIndentPattern)&&this._indentationRules.decreaseIndentPattern.test(e))}shouldIndentNextLine(e){return!!(this._indentationRules&&this._indentationRules.indentNextLinePattern&&wL(this._indentationRules.indentNextLinePattern)&&this._indentationRules.indentNextLinePattern.test(e))}shouldIgnore(e){return!!(this._indentationRules&&this._indentationRules.unIndentedLinePattern&&wL(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 nv{constructor(e){e=e||{},e.brackets=e.brackets||[["(",")"],["{","}"],["[","]"]],this._brackets=[],e.brackets.forEach(t=>{const i=nv._createOpenBracketRegExp(t[0]),s=nv._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 q0e(n){return n.replace(/[\[\]]/g,"")}const qi=Wt("languageService");class Hc{constructor(e,t=[],i=!1){this.ctor=e,this.staticArguments=t,this.supportsDelayedInstantiation=i}}const vQ=[];function Gt(n,e,t){e instanceof Hc||(e=new Hc(e,[],!!t)),vQ.push([n,e])}function pH(){return vQ}const wn=Object.freeze({text:"text/plain",binary:"application/octet-stream",unknown:"application/unknown",markdown:"text/markdown",latex:"text/latex",uriList:"text/uri-list"}),fx={JSONContribution:"base.contributions.json"};function G0e(n){return n.length>0&&n.charAt(n.length-1)==="#"?n.substring(0,n.length-1):n}class Y0e{constructor(){this._onDidChangeSchema=new j,this.schemasById={}}registerSchema(e,t){this.schemasById[G0e(e)]=t,this._onDidChangeSchema.fire(e)}notifySchemaChanged(e){this._onDidChangeSchema.fire(e)}}const Z0e=new Y0e;en.add(fx.JSONContribution,Z0e);const wc={Configuration:"base.contributions.configuration"},n1="vscode://schemas/settings/resourceLanguage",mH=en.as(fx.JSONContribution);class X0e{constructor(){this.overrideIdentifiers=new Set,this._onDidSchemaChange=new j,this._onDidUpdateConfiguration=new j,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={},mH.registerSchema(n1,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),mH.registerSchema(n1,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),qf.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=q0e(a),h={type:"object",default:d,description:m("defaultLanguageConfiguration.description","Configure settings to be overridden for the {0} language.",u),$ref:n1,defaultDefaultValue:d,source:Mo(r)?void 0:r,defaultValueSource:r};s.push(...SE(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=Fr(e.scope)?o:e.scope;const l=e.properties;if(l)for(const d in l){const u=l[d];if(t&&e1e(d,u)){delete l[d];continue}if(u.source=i,u.defaultDefaultValue=l[d].default,this.updatePropertyDefaultValue(d,u),qf.test(d)?u.scope=void 0:(u.scope=Fr(u.scope)?o:u.scope,u.restricted=Fr(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="[".concat(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:n1};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;_r(s)&&(s=t.defaultDefaultValue,o=void 0),_r(s)&&(s=J0e(t.type)),t.default=s,t.defaultValueSource=o}}const bQ="\\[([^\\]]+)\\]",_H=new RegExp(bQ,"g"),Q0e="^(".concat(bQ,")+$"),qf=new RegExp(Q0e);function SE(n){const e=[];if(qf.test(n)){let t=_H.exec(n);for(;t!=null&&t.length;){const i=t[1].trim();i&&e.push(i),t=_H.exec(n)}}return Vf(e)}function J0e(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 lD=new X0e;en.add(wc.Configuration,lD);function e1e(n,e){var t,i,s,o;return n.trim()?qf.test(n)?m("config.property.languageDefault","Cannot register '{0}'. This matches property pattern '\\\\[.*\\\\]$' for describing language specific editor settings. Use 'configurationDefaults' contribution.",n):lD.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&&lD.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,lD.getPolicyConfigurations().get((o=e.policy)===null||o===void 0?void 0:o.name)):null:m("config.property.empty","Cannot register an empty property")}const t1e={ModesRegistry:"editor.modesRegistry"};class i1e{constructor(){this._onDidChangeLanguages=new j,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 o1e(this,a,l),closing:l}}),o=new HV(a=>{const l=new Set,c=new Set;return{info:new r1e(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?vH(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 vH(n){return n.filter(([e,t])=>e!==""&&t!=="")}class CQ{constructor(e,t){this.config=e,this.bracketText=t}get languageId(){return this.config.languageId}}class o1e extends CQ{constructor(e,t,i){super(e,t),this.openedBrackets=i,this.isOpeningBracket=!0}}class r1e extends CQ{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 a1e=globalThis&&globalThis.__decorate||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},bH=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};class gM{constructor(e){this.languageId=e}affects(e){return this.languageId?this.languageId===e:!0}}const Ni=Wt("languageConfigurationService");let ZP=class extends te{constructor(e,t){super(),this.configurationService=e,this.languageService=t,this._registry=this._register(new u1e),this.onDidChangeEmitter=this._register(new j),this.onDidChange=this.onDidChangeEmitter.event,this.configurations=new Map;const i=new Set(Object.values(XP));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 gM(void 0));else for(const a of r)this.languageService.isRegisteredLanguageId(a)&&(this.configurations.delete(a),this.onDidChangeEmitter.fire(new gM(a)))})),this._register(this._registry.onDidChange(s=>{this.configurations.delete(s.languageId),this.onDidChangeEmitter.fire(new gM(s.languageId))}))}register(e,t,i){return this._registry.register(e,t,i)}getLanguageConfiguration(e){let t=this.configurations.get(e);return t||(t=l1e(e,this._registry,this.configurationService,this.languageService),this.configurations.set(e,t)),t}};ZP=a1e([bH(0,zt),bH(1,qi)],ZP);function l1e(n,e,t,i){let s=e.getLanguageConfiguration(n);if(!s){if(!i.isRegisteredLanguageId(n))return new Hv(n,{});s=new Hv(n,{})}const o=c1e(s.languageId,t),r=yQ([s.underlyingConfig,o]);return new Hv(s.languageId,r)}const XP={brackets:"editor.language.brackets",colorizedBracketPairs:"editor.language.colorizedBracketPairs"};function c1e(n,e){const t=e.getValue(XP.brackets,{overrideIdentifier:n}),i=e.getValue(XP.colorizedBracketPairs,{overrideIdentifier:n});return{brackets:CH(t),colorizedBracketPairs:CH(i)}}function CH(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 wQ(n,e,t){const i=n.getLineContent(e);let s=ki(i);return s.length>t-1&&(s=s.substring(0,t-1)),s}function Vv(n,e,t){n.tokenization.forceTokenization(e);const i=n.tokenization.getLineTokens(e),s=typeof t>"u"?n.getLineMaxColumn(e)-1:t-1;return cx(i,s)}class d1e{constructor(e){this.languageId=e,this._resolved=null,this._entries=[],this._order=0,this._resolved=null}register(e,t){const i=new wH(e,t,++this._order);return this._entries.push(i),this._resolved=null,vt(()=>{for(let s=0;se.configuration)))}}function yQ(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 wH{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 yH{constructor(e){this.languageId=e}}class u1e extends te{constructor(){super(),this._entries=new Map,this._onDidChange=this._register(new j),this.onDidChange=this._onDidChange.event,this._register(this.register(Yr,{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 d1e(e),this._entries.set(e,s));const o=s.register(t,i);return this._onDidChange.fire(new yH(e)),vt(()=>{o.dispose(),this._onDidChange.fire(new yH(e))})}getLanguageConfiguration(e){const t=this._entries.get(e);return(t==null?void 0:t.getResolvedConfiguration())||null}}class Hv{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 nv(this.underlyingConfig):null,this.comments=Hv._handleComments(this.underlyingConfig),this.characterPair=new Lb(this.underlyingConfig),this.wordDefinition=this.underlyingConfig.wordPattern||p8,this.indentationRules=this.underlyingConfig.indentationRules,this.underlyingConfig.indentationRules?this.indentRulesSupport=new j0e(this.underlyingConfig.indentationRules):this.indentRulesSupport=null,this.foldingRules=this.underlyingConfig.folding||{},this.bracketsNew=new s1e(e,this.underlyingConfig)}getWordDefinition(){return nX(this.wordDefinition)}get brackets(){return!this._brackets&&this.underlyingConfig.brackets&&(this._brackets=new B0e(this.languageId,this.underlyingConfig.brackets)),this._brackets}get electricCharacter(){return this._electricCharacter||(this._electricCharacter=new U0e(this.brackets)),this._electricCharacter}onEnter(e,t,i,s){return this._onEnterSupport?this._onEnterSupport.onEnter(e,t,i,s):null}getAutoClosingPairs(){return new x0e(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}}Gt(Ni,ZP,1);class Eh{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 SQ(n){return gx(n,0)}function gx(n,e){switch(typeof n){case"object":return n===null?Su(349,e):Array.isArray(n)?f1e(n,e):g1e(n,e);case"string":return W8(n,e);case"boolean":return h1e(n,e);case"number":return Su(n,e);case"undefined":return Su(937,e);default:return Su(617,e)}}function Su(n,e){return(e<<5)-e+n|0}function h1e(n,e){return Su(n?433:863,e)}function W8(n,e){e=Su(149417,e);for(let t=0,i=n.length;tgx(i,t),e)}function g1e(n,e){return e=Su(181387,e),Object.keys(n).sort().reduce((t,i)=>(t=W8(i,t),gx(n[i],t)),e)}function pM(n,e,t=32){const i=t-e,s=~((1<>>i)>>>0}function SH(n,e=0,t=n.byteLength,i=0){for(let s=0;st.toString(16).padStart(2,"0")).join(""):p1e((n>>>0).toString(16),e/4)}class px{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(es(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()),s1(this._h0)+s1(this._h1)+s1(this._h2)+s1(this._h3)+s1(this._h4)}_wrapUp(){this._buff[this._buffLen++]=128,SH(this._buff,this._buffLen),this._buffLen>56&&(this._step(),SH(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=px._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,pM(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=pM(i,5)+l+a+c+e.getUint32(u*4,!1)&4294967295,a=r,r=o,o=pM(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}}px._bigBlock32=new DataView(new ArrayBuffer(320));class LH{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 Eh(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 Kc{constructor(e,t,i=null){this.ContinueProcessingPredicate=i,this._originalSequence=e,this._modifiedSequence=t;const[s,o,r]=Kc._getElements(e),[a,l,c]=Kc._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(Kc._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?(w_.Assert(e===t+1,"originalStart should only be one more than originalEnd"),u=[new Eh(e,0,i,s-i+1)]):e<=t?(w_.Assert(i===s+1,"modifiedStart should only be one more than modifiedEnd"),u=[new Eh(e,t-e+1,i,0)]):(w_.Assert(e===t+1,"originalStart should only be one more than originalEnd"),w_.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 Eh(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 Eh(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 C=null,w=null,y=new kH,L=t,S=i,k=f[0]-_[0]-s,D=-1073741824,x=this.m_forwardHistory.length-1;do{const A=k+e;A===L||A=0&&(c=this.m_forwardHistory[x],e=c[0],L=1,S=c.length-1)}while(--x>=-1);if(C=y.getReverseChanges(),b[0]){let A=f[0]+1,T=_[0]+1;if(C!==null&&C.length>0){const P=C[C.length-1];A=Math.max(A,P.getOriginalEnd()),T=Math.max(T,P.getModifiedEnd())}w=[new Eh(A,h-A+1,T,p-T+1)]}else{y=new kH,L=r,S=a,k=f[0]-_[0]-l,D=1073741824,x=v?this.m_reverseHistory.length-1:this.m_reverseHistory.length-2;do{const A=k+o;A===L||A=d[A+1]?(u=d[A+1]-1,g=u-k-l,u>D&&y.MarkNextChange(),D=u+1,y.AddOriginalElement(u+1,g+1),k=A+1-o):(u=d[A-1],g=u-k-l,u>D&&y.MarkNextChange(),D=u,y.AddModifiedElement(u+1,g+1),k=A-1-o),x>=0&&(d=this.m_reverseHistory[x],o=d[0],L=1,S=d.length-1)}while(--x>=-1);w=y.getChanges()}return this.ConcatenateChanges(C,w)}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,C=t-e,w=e-i,y=t-s,S=(C-b)%2===0;_[b]=e,v[C]=t,a[0]=!1;for(let k=1;k<=g/2+1;k++){let D=0,x=0;d=this.ClipDiagonalBound(b-k,k,b,p),u=this.ClipDiagonalBound(b+k,k,b,p);for(let T=d;T<=u;T+=2){T===d||TD+x&&(D=l,x=c),!S&&Math.abs(T-C)<=k-1&&l>=v[T])return o[0]=l,r[0]=c,P<=v[T]&&1447>0&&k<=1447+1?this.WALKTRACE(b,d,u,w,C,h,f,y,_,v,l,t,o,c,s,r,S,a):null}const A=(D-e+(x-i)-k)/2;if(this.ContinueProcessingPredicate!==null&&!this.ContinueProcessingPredicate(D,A))return a[0]=!0,o[0]=D,r[0]=x,A>0&&1447>0&&k<=1447+1?this.WALKTRACE(b,d,u,w,C,h,f,y,_,v,l,t,o,c,s,r,S,a):(e++,i++,[new Eh(e,t-e+1,i,s-i+1)]);h=this.ClipDiagonalBound(C-k,k,C,p),f=this.ClipDiagonalBound(C+k,k,C,p);for(let T=h;T<=f;T+=2){T===h||T=v[T+1]?l=v[T+1]-1:l=v[T-1],c=l-(T-C)-y;const P=l;for(;l>e&&c>i&&this.ElementsAreEqual(l,c);)l--,c--;if(v[T]=l,S&&Math.abs(T-b)<=k&&l<=_[T])return o[0]=l,r[0]=c,P>=_[T]&&1447>0&&k<=1447+1?this.WALKTRACE(b,d,u,w,C,h,f,y,_,v,l,t,o,c,s,r,S,a):null}if(k<=1447){let T=new Int32Array(u-d+2);T[0]=b-d+1,y_.Copy2(_,d,T,1,u-d+1),this.m_forwardHistory.push(T),T=new Int32Array(f-h+2),T[0]=C-h+1,y_.Copy2(v,h,T,1,f-h+1),this.m_reverseHistory.push(T)}}return this.WALKTRACE(b,d,u,w,C,h,f,y,_,v,l,t,o,c,s,r,S,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 y_.Copy(e,0,s,0,e.length-1),s[e.length-1]=i[0],y_.Copy(t,1,s,e.length,t.length-1),s}else{const s=new Array(e.length+t.length);return y_.Copy(e,0,s,0,e.length),y_.Copy(t,0,s,e.length,t.length),s}}ChangesOverlap(e,t,i){if(w_.Assert(e.originalStart<=t.originalStart,"Left change is not less than or equal to right change"),w_.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 Eh(s,o,r,a),!0}else return i[0]=null,!1}ClipDiagonalBound(e,t,i,s){if(e>=0&&e255?255:n|0}function S_(n){return n<0?0:n>4294967295?4294967295:n|0}class _1e{constructor(e){this.values=e,this.prefixSum=new Uint32Array(e.length),this.prefixSumValidIndex=new Int32Array(1),this.prefixSumValidIndex[0]=-1}insertValues(e,t){e=S_(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=S_(e),t=S_(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=S_(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 LQ(s,e-r)}}class v1e{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 LQ(t,e-i)}removeValues(e,t){this._values.splice(e,t),this._invalidate(e)}insertValues(e,t){this._values=zT(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 kE{constructor(){this._actual=new E0(0)}add(e){this._actual.set(e,1)}has(e){return this._actual.get(e)===1}clear(){return this._actual.clear()}}class C1e{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 C1e(i,t,0);for(let o=0,r=e.length;o=this._maxCharCode?0:this._states.get(e,t)}}let mM=null;function y1e(){return mM===null&&(mM=new w1e([[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]])),mM}let o1=null;function S1e(){if(o1===null){o1=new E0(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=y1e()){const i=S1e(),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}}QP.INSTANCE=new QP;class k1e extends E0{constructor(e){super(0);for(let t=0,i=e.length;t(e.hasOwnProperty(t)||(e[t]=n(t)),e[t])}const Aa=D1e(n=>new k1e(n));var Qr;(function(n){n[n.Left=1]="Left",n[n.Center=2]="Center",n[n.Right=4]="Right",n[n.Full=7]="Full"})(Qr||(Qr={}));var $v;(function(n){n[n.Left=1]="Left",n[n.Right=2]="Right"})($v||($v={}));var yr;(function(n){n[n.Inline=1]="Inline",n[n.Gutter=2]="Gutter"})(yr||(yr={}));var Jl;(function(n){n[n.Both=0]="Both",n[n.Right=1]="Right",n[n.Left=2]="Left",n[n.None=3]="None"})(Jl||(Jl={}));class cD{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&&Gr(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 Lw{constructor(e,t){this._findMatchBrand=void 0,this.range=e,this.matches=t}}function E1e(n){return n&&typeof n.read=="function"}class _M{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 I1e{constructor(e,t,i){this.regex=e,this.wordSeparators=t,this.simpleSearch=i}}class T1e{constructor(e,t,i){this.reverseEdits=e,this.changes=t,this.trimAutoWhitespaceLineNumbers=i}}function x1e(n){return!n.isTooLargeForSyncing()&&!n.isForSimpleWidget}const N1e=999;class ip{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=A1e(this.searchString):e=this.searchString.indexOf("\n")>=0;let t=null;try{t=kX(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 I1e(t,this.wordSeparators?Aa(this.wordSeparators):null,i?this.searchString:null)}}function A1e(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 gp(n,e,t){if(!t)return new Lw(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 yL{static findMatches(e,t,i,s,o){const r=t.parseSearchRequest();return r?r.regex.multiline?this._doFindMatchesMultiline(e,i,new sv(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 I(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\n"?new DH(a):null,c=[];let d=0,u;for(i.reset(0);u=i.next(a);)if(c[d++]=gp(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 sv(e.wordSeparators,e.regex);let u;d.reset(0);do if(u=d.next(t),u&&(r[o++]=gp(new I(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 sv(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 Y(t.lineNumber,1),r=e.getOffsetAt(o),a=e.getLineCount(),l=e.getValueInRange(new I(o.lineNumber,o.column,a,e.getLineMaxColumn(a)),1),c=e.getEOL()==="\r\n"?new DH(l):null;i.reset(t.column-1);const d=i.next(l);return d?gp(this._getMultilineMatchRange(e,r,l,c,d.index,d[0]),d,s):t.lineNumber!==1||t.column!==1?this._doFindNextMatchMultiline(e,new Y(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?gp(new I(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 sv(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 I(1,1,t.lineNumber,t.column),i,s,10*N1e);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 Y(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=gp(new I(i,r.index+1,i,r.index+1+r[0].length),r,s);return o}}function M1e(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 R1e(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 V8(n,e,t,i,s){return M1e(n,e,t,i,s)&&R1e(n,e,t,i,s)}class sv{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){_E(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||V8(this._wordSeparators,e,t,s,o))return i}while(i);return null}}class H8{static computeUnicodeHighlights(e,t,i){const s=i?i.startLineNumber:1,o=i?i.endLineNumber:e.getLineCount(),r=new EH(t),a=r.getCandidateCodePoints();let l;a==="allNonBasicAscii"?l=new RegExp("[^\\t\\n\\r\\x20-\\x7E]","g"):l=new RegExp("".concat(P1e(Array.from(a))),"g");const c=new sv(null,l),d=[];let u=!1,h,f=0,g=0,p=0;e:for(let _=s,v=o;_<=v;_++){const b=e.getLineContent(_),C=b.length;c.reset(0);do if(h=c.next(b),h){let w=h.index,y=h.index+h[0].length;if(w>0){const D=b.charCodeAt(w-1);es(D)&&w--}if(y+1=D){u=!0;break e}d.push(new I(_,w+1,_,y+1))}}while(h)}return{ranges:d,hasMore:u,ambiguousCharacterCount:f,invisibleCharacterCount:g,nonBasicAsciiCharacterCount:p}}static computeUnicodeHighlightReason(e,t){const i=new EH(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=am.getLocales().filter(l=>!am.getInstance(new Set([...t.allowedLocales,l])).isAmbiguous(o));return{kind:0,confusableWith:String.fromCodePoint(r),notAmbiguousInLocales:a}}case 1:return{kind:2}}}}function P1e(n,e){return"[".concat(Xr(n.map(i=>String.fromCodePoint(i)).join("")),"]")}class EH{constructor(e){this.options=e,this.allowedCodePoints=new Set(e.allowedCodePoints),this.ambiguousCharacters=am.getInstance(new Set(e.allowedLocales))}getCandidateCodePoints(){if(this.options.nonBasicASCII)return"allNonBasicAscii";const e=new Set;if(this.options.invisibleCharacters)for(const t of pd.codePoints)IH(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=cS(r);s=s||l,!l&&!this.ambiguousCharacters.isAmbiguous(a)&&!pd.isInvisibleCharacter(a)&&(o=!0)}return!s&&o?0:this.options.invisibleCharacters&&!IH(e)&&pd.isInvisibleCharacter(i)?2:this.options.ambiguousCharacters&&this.ambiguousCharacters.isAmbiguous(i)?3:0}}function IH(n){return n===" "||n==="\n"||n===" "}class dD{constructor(e,t,i){this.changes=e,this.moves=t,this.hitTimeout=i}}class kQ{constructor(e,t){this.lineRangeMapping=e,this.changes=t}}class Bt{static addRange(e,t){let i=0;for(;it))return new Bt(e,t)}static ofLength(e){return new Bt(0,e)}constructor(e,t){if(this.start=e,this.endExclusive=t,e>t)throw new Rn("Invalid range: ".concat(this.toString()))}get isEmpty(){return this.start===this.endExclusive}delta(e){return new Bt(this.start+e,this.endExclusive+e)}deltaStart(e){return new Bt(this.start+e,this.endExclusive)}deltaEnd(e){return new Bt(this.start,this.endExclusive+e)}get length(){return this.endExclusive-this.start}toString(){return"[".concat(this.start,", ").concat(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 EE(n,e,t){const i=O1e(n,e);if(i!==-1)return n[i]}function O1e(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 kw(n,e){const t=Dw(n,e);return t===-1?void 0:n[t]}function Dw(n,e,t=0,i=n.length){let s=t,o=i;for(;s0&&(t=s)}return t}function B1e(n,e){if(n.length===0)return;let t=n[0];for(let i=1;i=0&&(t=s)}return t}function W1e(n,e){return DQ(n,(t,i)=>-e(t,i))}function V1e(n,e){if(n.length===0)return-1;let t=0;for(let i=1;i0&&(t=i)}return t}function H1e(n,e){for(const t of n){const i=e(t);if(i!==void 0)return i}}let Ht=class Ih{static fromRange(e){return new Ih(e.startLineNumber,e.endLineNumber)}static joinMany(e){if(e.length===0)return[];let t=new qc(e[0].slice());for(let i=1;it)throw new Rn("startLineNumber ".concat(e," cannot be after endLineNumberExclusive ").concat(t));this.startLineNumber=e,this.endLineNumberExclusive=t}contains(e){return this.startLineNumber<=e&&es.endLineNumberExclusive>=e.startLineNumber),i=Dw(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=kw(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 Ht(o.startLineNumber,Math.max(o.endLineNumberExclusive,r.endLineNumberExclusive)):(t.push(o),o=r)}return o!==null&&t.push(o),new qc(t)}subtractFrom(e){const t=Ew(this._normalizedRanges,r=>r.endLineNumberExclusive>=e.startLineNumber),i=Dw(this._normalizedRanges,r=>r.startLineNumber<=e.endLineNumberExclusive)+1;if(t===i)return new qc([e]);const s=[];let o=e.startLineNumber;for(let r=t;ro&&s.push(new Ht(o,a.startLineNumber)),o=a.endLineNumberExclusive}return oe.toString()).join(", ")}getIntersection(e){const t=[];let i=0,s=0;for(;it.delta(e)))}}class kd{static inverse(e,t,i){const s=[];let o=1,r=1;for(const l of e){const c=new Ma(new Ht(o,l.original.startLineNumber),new Ht(r,l.modified.startLineNumber),void 0);c.modified.isEmpty||s.push(c),o=l.original.endLineNumberExclusive,r=l.modified.endLineNumberExclusive}const a=new Ma(new Ht(o,t+1),new Ht(r,i+1),void 0);return a.modified.isEmpty||s.push(a),s}constructor(e,t){this.original=e,this.modified=t}toString(){return"{".concat(this.original.toString(),"->").concat(this.modified.toString(),"}")}flip(){return new kd(this.modified,this.original)}join(e){return new kd(this.original.join(e.original),this.modified.join(e.modified))}}class Ma extends kd{constructor(e,t,i){super(e,t),this.innerChanges=i}flip(){var e;return new Ma(this.modified,this.original,(e=this.innerChanges)===null||e===void 0?void 0:e.map(t=>t.flip()))}}class Gf{constructor(e,t){this.originalRange=e,this.modifiedRange=t}toString(){return"{".concat(this.originalRange.toString(),"->").concat(this.modifiedRange.toString(),"}")}flip(){return new Gf(this.modifiedRange,this.originalRange)}}const $1e=3;class z1e{computeDiff(e,t,i){var s;const r=new K1e(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 Ht(c.originalStartLineNumber+1,c.originalStartLineNumber+1):d=new Ht(c.originalStartLineNumber,c.originalEndLineNumber+1);let u;c.modifiedEndLineNumber===0?u=new Ht(c.modifiedStartLineNumber+1,c.modifiedStartLineNumber+1):u=new Ht(c.modifiedStartLineNumber,c.modifiedEndLineNumber+1);let h=new Ma(d,u,(s=c.charChanges)===null||s===void 0?void 0:s.map(f=>new Gf(new I(f.originalStartLineNumber,f.originalStartColumn,f.originalEndLineNumber,f.originalEndColumn),new I(f.modifiedStartLineNumber,f.modifiedStartColumn,f.modifiedEndLineNumber,f.modifiedEndColumn))));l&&(l.modified.endLineNumberExclusive===h.modified.startLineNumber||l.original.endLineNumberExclusive===h.original.startLineNumber)&&(h=new Ma(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 Cw(()=>FX(a,(c,d)=>d.original.startLineNumber-c.original.endLineNumberExclusive===d.modified.startLineNumber-c.modified.endLineNumberExclusive&&c.original.endLineNumberExclusive(e===10?"\\n":String.fromCharCode(e))+"-(".concat(this._lineNumbers[t],",").concat(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 zv{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 zv(s,o,r,a,l,c,d,u)}}function j1e(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=EQ(f,g,o,!0).changes;a&&(p=j1e(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=eO(h,1),p=eO(f,1);const _=h.length+1,v=f.length+1;for(;g<_&&p!0;const e=Date.now();return()=>Date.now()-e{i.push(bs.fromOffsetPairs(s?s.getEndExclusives():td.zero,o?o.getStarts():new td(t,(s?s.seq2Range.endExclusive-s.seq1Range.endExclusive:0)+t)))}),i}static fromOffsetPairs(e,t){return new bs(new Bt(e.offset1,t.offset1),new Bt(e.offset2,t.offset2))}constructor(e,t){this.seq1Range=e,this.seq2Range=t}swap(){return new bs(this.seq2Range,this.seq1Range)}toString(){return"".concat(this.seq1Range," <-> ").concat(this.seq2Range)}join(e){return new bs(this.seq1Range.join(e.seq1Range),this.seq2Range.join(e.seq2Range))}delta(e){return e===0?this:new bs(this.seq1Range.delta(e),this.seq2Range.delta(e))}deltaStart(e){return e===0?this:new bs(this.seq1Range.deltaStart(e),this.seq2Range.deltaStart(e))}deltaEnd(e){return e===0?this:new bs(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 bs(t,i)}getStarts(){return new td(this.seq1Range.start,this.seq2Range.start)}getEndExclusives(){return new td(this.seq1Range.endExclusive,this.seq2Range.endExclusive)}}class td{constructor(e,t){this.offset1=e,this.offset2=t}toString(){return"".concat(this.offset1," <-> ").concat(this.offset2)}}td.zero=new td(0,0);td.max=new td(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER);class Iw{isValid(){return!0}}Iw.instance=new Iw;class q1e{constructor(e){if(this.timeout=e,this.startTime=Date.now(),this.valid=!0,e<=0)throw new Rn("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 C=Math.max(_,v,b);if(C===b){const w=g>0&&p>0?a.get(g-1,p-1):0;a.set(g,p,w+1),r.set(g,p,3)}else C===_?(a.set(g,p,0),r.set(g,p,1)):C===v&&(a.set(g,p,0),r.set(g,p,2));o.set(g,p,C)}const l=[];let c=e.length,d=t.length;function u(g,p){(g+1!==c||p+1!==d)&&l.push(new bs(new Bt(g+1,c),new Bt(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 Pu(l,!1)}}class IQ{compute(e,t,i=Iw.instance){if(e.length===0||t.length===0)return Pu.trivial(e,t);const s=e,o=t;function r(p,_){for(;ps.length||w>o.length)continue;const y=r(C,w);l.set(d,y);const L=C===v?c.get(d+1):c.get(d-1);if(c.set(d,y!==C?new NH(L,C,w,y-C):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 bs(new Bt(p,f),new Bt(_,g))),!u)break;f=u.x,g=u.y,u=u.prev}return h.reverse(),new Pu(h,!1)}}class NH{constructor(e,t,i,s){this.prev=e,this.x=t,this.y=i,this.length=s}}class Y1e{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 Z1e{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 AH,MH;class X1e{constructor(e,t){this.uri=e,this.value=t}}function Q1e(n){return Array.isArray(n)}class Js{constructor(e,t){if(this[AH]="ResourceMap",e instanceof Js)this.map=new Map(e.map),this.toKey=t!=null?t:Js.defaultToKey;else if(Q1e(e)){this.map=new Map,this.toKey=t!=null?t:Js.defaultToKey;for(const[i,s]of e)this.set(i,s)}else this.map=new Map,this.toKey=e!=null?e:Js.defaultToKey}set(e,t){return this.map.set(this.toKey(e),new X1e(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]}*[(AH=Symbol.toStringTag,Symbol.iterator)](){for(const[,e]of this.map)yield[e.uri,e.value]}}Js.defaultToKey=n=>n.toString();class J1e{constructor(){this[MH]="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}[(MH=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 Dg extends J1e{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 eCe{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 z8{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 IE{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 Bt(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=PH(e>0?this.elements[e-1]:-1),i=PH(ei<=e);return new Y(this.lineRange.start+t+1,e-this.firstCharOffsetByLine[t]+this.additionalOffsetByLine[t]+1)}translateRange(e){return I.fromPositions(this.translateOffset(e.start),this.translateOffset(e.endExclusive))}findWordContaining(e){if(e<0||e>=this.elements.length||!bM(this.elements[e]))return;let t=e;for(;t>0&&bM(this.elements[t-1]);)t--;let i=e;for(;ir<=e.start))!==null&&t!==void 0?t:0,o=(i=F1e(this.firstCharOffsetByLine,r=>e.endExclusive<=r))!==null&&i!==void 0?i:this.elements.length;return new Bt(s,o)}}function bM(n){return n>=97&&n<=122||n>=65&&n<=90||n>=48&&n<=57}const tCe={0:0,1:0,2:0,3:10,4:2,5:3,6:10,7:10};function RH(n){return tCe[n]}function PH(n){return n===10?7:n===13?6:tO(n)?5:n>=97&&n<=122?0:n>=65&&n<=90?1:n>=48&&n<=57?2:n===-1?3:4}function iCe(n,e,t,i,s,o){let{moves:r,excludedChanges:a}=nCe(n,e,t,o);if(!o.isValid())return[];const l=n.filter(d=>!a.has(d)),c=sCe(l,i,s,e,t,o);return V2(r,c),r=oCe(r),r=r.filter(d=>d.original.toOffsetRange().slice(e).map(h=>h.trim()).join("\n").length>=10),r=rCe(n,r),r}function nCe(n,e,t,i){const s=[],o=n.filter(l=>l.modified.isEmpty&&l.original.length>=3).map(l=>new Db(l.original,e,l)),r=new Set(n.filter(l=>l.original.isEmpty&&l.modified.length>=3).map(l=>new Db(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 kd(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 sCe(n,e,t,i,s,o){const r=[],a=new z8;for(const h of n)for(let f=h.original.startLineNumber;fh.modified.startLineNumber,Mu));for(const h of n){let f=[];for(let g=h.modified.startLineNumber;g{for(const w of f)if(w.originalLineRange.endLineNumberExclusive+1===b.endLineNumberExclusive&&w.modifiedLineRange.endLineNumberExclusive+1===_.endLineNumberExclusive){w.originalLineRange=new Ht(w.originalLineRange.startLineNumber,b.endLineNumberExclusive),w.modifiedLineRange=new Ht(w.modifiedLineRange.startLineNumber,_.endLineNumberExclusive),v.push(w);return}const C={modifiedLineRange:_,originalLineRange:b};l.push(C),v.push(C)}),f=v}if(!o.isValid())return[]}l.sort(qZ(Sa(h=>h.modifiedLineRange.length,Mu)));const c=new qc,d=new qc;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,C=v.delta(-f);r.push(new kd(C,b)),c.addRange(b),d.addRange(C)}}r.sort(Sa(h=>h.original.startLineNumber,Mu));const u=new hS(n);for(let h=0;hL.original.startLineNumber<=f.original.startLineNumber),p=kw(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||S>s.length||c.contains(S)||d.contains(L)||!OH(i[L-1],s[S-1],o))break}w>0&&(d.addRange(new Ht(f.original.startLineNumber-w,f.original.startLineNumber)),c.addRange(new Ht(f.modified.startLineNumber-w,f.modified.startLineNumber)));let y;for(y=0;yi.length||S>s.length||c.contains(S)||d.contains(L)||!OH(i[L-1],s[S-1],o))break}y>0&&(d.addRange(new Ht(f.original.endLineNumberExclusive,f.original.endLineNumberExclusive+y)),c.addRange(new Ht(f.modified.endLineNumberExclusive,f.modified.endLineNumberExclusive+y))),(w>0||y>0)&&(r[h]=new kd(new Ht(f.original.startLineNumber-w,f.original.endLineNumberExclusive+y),new Ht(f.modified.startLineNumber-w,f.modified.endLineNumberExclusive+y)))}return r}function OH(n,e,t){if(n.trim()===e.trim())return!0;if(n.length>300&&e.length>300)return!1;const s=new IQ().compute(new IE([n],new Bt(0,1),!1),new IE([e],new Bt(0,1),!1),t);let o=0;const r=bs.invert(s.diffs,n.length);for(const d of r)d.seq1Range.forEach(u=>{tO(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 oCe(n){if(n.length===0)return n;n.sort(Sa(t=>t.original.startLineNumber,Mu));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 rCe(n,e){const t=new hS(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 lCe(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 cCe(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 bs(o.seq1Range.join(s.seq1Range),o.seq2Range.join(s.seq2Range)):i.push(s)}return i}function dCe(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 bs(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 hCe(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 fCe(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),C=f.seq1Range.length,w=e.countLinesIn(f.seq2Range),y=f.seq2Range.length,L=n.countLinesIn(g.seq1Range),S=g.seq1Range.length,k=e.countLinesIn(g.seq2Range),D=g.seq2Range.length,x=2*40+50;function A(T){return Math.min(T,x)}return Math.pow(Math.pow(A(b*40+C),1.5)+Math.pow(A(w*40+y),1.5),1.5)+Math.pow(Math.pow(A(L*40+S),1.5)+Math.pow(A(k*40+D),1.5),1.5)>Math.pow(Math.pow(x,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 Sme(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 Bt(h.start,l.seq1Range.start));u(f)&&(d=d.deltaStart(-f.length));const g=n.getText(new Bt(l.seq1Range.endExclusive,h.endExclusive));u(g)&&(d=d.deltaEnd(g.length));const p=bs.fromOffsetPairs(a?a.getEndExclusives():td.zero,c?c.getStarts():td.max),_=d.intersect(p);r.push(_)}),r}class BH{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:WH(this.lines[e-1]),i=e===this.lines.length?0:WH(this.lines[e]);return 1e3-(t+i)}getText(e){return this.lines.slice(e.start,e.endExclusive).join("\n")}isStronglyEqual(e,t){return this.lines[e]===this.lines[t]}}function WH(n){let e=0;for(;ey===L))return new dD([],[],!1);if(e.length===1&&e[0].length===0||t.length===1&&t[0].length===0)return new dD([new Ma(new Ht(1,e.length+1),new Ht(1,t.length+1),[new Gf(new I(1,1,e.length,e[0].length+1),new I(1,1,t.length,t[0].length+1))])],[],!1);const s=i.maxComputationTimeMs===0?Iw.instance:new q1e(i.maxComputationTimeMs),o=!i.ignoreTrimWhitespace,r=new Map;function a(y){let L=r.get(y);return L===void 0&&(L=r.size,r.set(y,L)),L}const l=e.map(y=>a(y.trim())),c=t.map(y=>a(y.trim())),d=new BH(l,e),u=new BH(c,t),h=(()=>d.length+u.length<1700?this.dynamicProgrammingDiffing.compute(d,u,s,(y,L)=>e[y]===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=iO(d,u,f),f=hCe(d,u,f);const p=[],_=y=>{if(o)for(let L=0;Ly.seq1Range.start-v===y.seq2Range.start-b);const L=y.seq1Range.start-v;_(L),v=y.seq1Range.endExclusive,b=y.seq2Range.endExclusive;const S=this.refineDiff(e,t,y,s,o);S.hitTimeout&&(g=!0);for(const k of S.mappings)p.push(k)}_(e.length-v);const C=VH(p,e,t);let w=[];return i.computeMoves&&(w=this.computeMoves(C,e,t,l,c,s,o)),Cw(()=>{function y(S,k){if(S.lineNumber<1||S.lineNumber>k.length)return!1;const D=k[S.lineNumber-1];return!(S.column<1||S.column>D.length+1)}function L(S,k){return!(S.startLineNumber<1||S.startLineNumber>k.length+1||S.endLineNumberExclusive<1||S.endLineNumberExclusive>k.length+1)}for(const S of C){if(!S.innerChanges)return!1;for(const k of S.innerChanges)if(!(y(k.modifiedRange.getStartPosition(),t)&&y(k.modifiedRange.getEndPosition(),t)&&y(k.originalRange.getStartPosition(),e)&&y(k.originalRange.getEndPosition(),e)))return!1;if(!L(S.modified,t)||!L(S.original,e))return!1}return!0}),new dD(C,w,g)}computeMoves(e,t,i,s,o,r,a){return iCe(e,t,i,s,o,r).map(d=>{const u=this.refineDiff(t,i,new bs(d.original.toOffsetRange(),d.modified.toOffsetRange()),r,a),h=VH(u.mappings,t,i,!0);return new kQ(d,h)})}refineDiff(e,t,i,s,o){const r=new IE(e,i.seq1Range,o),a=new IE(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=iO(r,a,c),c=dCe(r,a,c),c=cCe(r,a,c),c=fCe(r,a,c),{mappings:c.map(u=>new Gf(r.translateRange(u.seq1Range),a.translateRange(u.seq2Range))),hitTimeout:l.hitTimeout}}}function VH(n,e,t,i=!1){const s=[];for(const o of $Z(n.map(r=>gCe(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 Ma(r.original.join(a.original),r.modified.join(a.modified),o.map(l=>l.innerChanges[0])))}return Cw(()=>!i&&s.length>0&&s[0].original.startLineNumber!==s[0].modified.startLineNumber?!1:FX(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 Ht(n.originalRange.startLineNumber+i,n.originalRange.endLineNumber+1+s),r=new Ht(n.modifiedRange.startLineNumber+i,n.modifiedRange.endLineNumber+1+s);return new Ma(o,r,[n])}const HH={getLegacy:()=>new z1e,getDefault:()=>new TQ};function Cf(n,e){const t=Math.pow(10,e);return Math.round(n*t)/t}class jt{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=Cf(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 Xa{constructor(e,t,i,s){this._hslaBrand=void 0,this.h=Math.max(Math.min(360,e),0)|0,this.s=Cf(Math.max(Math.min(1,t),0),3),this.l=Cf(Math.max(Math.min(1,i),0),3),this.a=Cf(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=Xa._hue2rgb(d,c,t+1/3),a=Xa._hue2rgb(d,c,t),l=Xa._hue2rgb(d,c,t-1/3)}return new jt(Math.round(r*255),Math.round(a*255),Math.round(l*255),o)}}class id{constructor(e,t,i,s){this._hsvaBrand=void 0,this.h=Math.max(Math.min(360,e),0)|0,this.s=Cf(Math.max(Math.min(1,t),0),3),this.v=Cf(Math.max(Math.min(1,i),0),3),this.a=Cf(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 id(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 jt(c,d,u,o)}}class ee{static fromHex(e){return ee.Format.CSS.parseHex(e)||ee.red}static equals(e,t){return!e&&!t?!0:!e||!t?!1:e.equals(t)}get hsla(){return this._hsla?this._hsla:Xa.fromRGBA(this.rgba)}get hsva(){return this._hsva?this._hsva:id.fromRGBA(this.rgba)}constructor(e){if(e)if(e instanceof jt)this.rgba=e;else if(e instanceof Xa)this._hsla=e,this.rgba=Xa.toRGBA(e);else if(e instanceof id)this._hsva=e,this.rgba=id.toRGBA(e);else throw new Error("Invalid color ctor argument");else throw new Error("Color needs a value")}equals(e){return!!e&&jt.equals(this.rgba,e.rgba)&&Xa.equals(this.hsla,e.hsla)&&id.equals(this.hsva,e.hsva)}getRelativeLuminance(){const e=ee._relativeLuminanceForComponent(this.rgba.r),t=ee._relativeLuminanceForComponent(this.rgba.g),i=ee._relativeLuminanceForComponent(this.rgba.b),s=.2126*e+.7152*t+.0722*i;return Cf(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=$H(r1(n,s),a1(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=$H(r1(n,s),a1(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=zH(r1(n,s),a1(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=zH(r1(n,s),a1(a,c),!0)}else r==="#"&&(l=pCe(r1(n,s),r+a));l&&e.push(l)}return e}function _Ce(n){return!n||typeof n.getValue!="function"||typeof n.positionAt!="function"?[]:mCe(n)}var _h=globalThis&&globalThis.__awaiter||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 vCe extends b1e{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 wf{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 vCe(ct.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 _h(this,void 0,void 0,function*(){const s=this._getModel(e);return s?H8.computeUnicodeHighlights(s,t,i):{ranges:[],hasMore:!1,ambiguousCharacterCount:0,invisibleCharacterCount:0,nonBasicAsciiCharacterCount:0}})}computeDiff(e,t,i,s){return _h(this,void 0,void 0,function*(){const o=this._getModel(e),r=this._getModel(t);return!o||!r?null:wf.computeDiff(o,r,i,s)})}static computeDiff(e,t,i,s){const o=s==="advanced"?HH.getDefault():HH.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 _h(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 I.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;lwf._diffLimit){o.push({range:l,text:c});continue}const h=m1e(u,c,i),f=s.offsetAt(I.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 _h(this,void 0,void 0,function*(){const t=this._getModel(e);return t?L1e(t):null})}computeDefaultDocumentColors(e){return _h(this,void 0,void 0,function*(){const t=this._getModel(e);return t?_Ce(t):null})}textualSuggest(e,t,i,s){return _h(this,void 0,void 0,function*(){const o=new so,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>wf._suggestionsLimit))break e}}return{words:Array.from(a),duration:o.elapsed()}})}computeWordRanges(e,t,i,s){return _h(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(h8(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)}}}wf._diffLimit=1e5;wf._suggestionsLimit=1e4;typeof importScripts=="function"&&(globalThis.monaco=yX());const j8=Wt("textResourceConfigurationService"),NQ=Wt("textResourcePropertiesService"),Ze=Wt("ILanguageFeaturesService");var bCe=globalThis&&globalThis.__decorate||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},l1=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},TE=globalThis&&globalThis.__awaiter||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 UH=60*1e3,jH=5*60*1e3;function pp(n,e){const t=n.getModel(e);return!(!t||t.isTooLargeForSyncing())}let nO=class extends te{constructor(e,t,i,s,o){super(),this._modelService=e,this._workerManager=this._register(new wCe(this._modelService,s)),this._logService=i,this._register(o.linkProvider.register({language:"*",hasAccessToAllModels:!0},{provideLinks:(r,a)=>pp(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 CCe(this._workerManager,t,this._modelService,s)))}dispose(){super.dispose()}canComputeUnicodeHighlights(e){return pp(this._modelService,e)}computedUnicodeHighlights(e,t,i){return this._workerManager.withWorker().then(s=>s.computedUnicodeHighlights(e,t,i))}computeDiff(e,t,i,s){return TE(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 kQ(new kd(new Ht(l[0],l[1]),new Ht(l[2],l[3])),a(l[4])))};function a(l){return l.map(c=>{var d;return new Ma(new Ht(c[0],c[1]),new Ht(c[2],c[3]),(d=c[4])===null||d===void 0?void 0:d.map(u=>new Gf(new I(u[0],u[1],u[2],u[3]),new I(u[4],u[5],u[6],u[7]))))})}})}computeMoreMinimalEdits(e,t,i=!1){if(io(t)){if(!pp(this._modelService,e))return Promise.resolve(t);const s=so.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,jf(1e3).then(()=>t)])}else return Promise.resolve(void 0)}canNavigateValueSet(e){return pp(this._modelService,e)}navigateValueSet(e,t,i){return this._workerManager.withWorker().then(s=>s.navigateValueSet(e,t,i))}canComputeWordRanges(e){return pp(this._modelService,e)}computeWordRanges(e,t){return this._workerManager.withWorker().then(i=>i.computeWordRanges(e,t))}};nO=bCe([l1(0,Zi),l1(1,j8),l1(2,aa),l1(3,Ni),l1(4,Ze)],nO);class CCe{constructor(e,t,i,s){this.languageConfigurationService=s,this._debugDisplayName="wordbasedCompletions",this._workerManager=e,this._configurationService=t,this._modelService=i}provideCompletionItems(e,t){return TE(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")pp(this._modelService,e.uri)&&s.push(e.uri);else for(const u of this._modelService.getModels())pp(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 I(t.lineNumber,r.startColumn,t.lineNumber,r.endColumn):I.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 wCe extends te{constructor(e,t){super(),this.languageConfigurationService=t,this._modelService=e,this._editorWorkerClient=null,this._lastWorkerUsedTime=new Date().getTime(),this._register(new uS).cancelAndSet(()=>this._checkStopIdleWorker(),Math.round(jH/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>jH&&(this._editorWorkerClient.dispose(),this._editorWorkerClient=null)}withWorker(){return this._lastWorkerUsedTime=new Date().getTime(),this._editorWorkerClient||(this._editorWorkerClient=new K8(this._modelService,!1,"editorWorkerService",this.languageConfigurationService)),Promise.resolve(this._editorWorkerClient)}}class yCe extends te{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 uS;s.cancelAndSet(()=>this._checkStopModelSync(),Math.round(UH/2)),this._register(s)}}dispose(){for(const e in this._syncedModels)fi(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]>UH&&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 be;o.add(i.onDidChangeContent(r=>{this._proxy.acceptModelChanged(s.toString(),r)})),o.add(i.onWillDispose(()=>{this._stopModelSync(s)})),o.add(vt(()=>{this._proxy.acceptRemovedModel(s)})),this._syncedModels[s]=o}_stopModelSync(e){const t=this._syncedModels[e];delete this._syncedModels[e],delete this._syncedModelsLastUsedTime[e],fi(t)}}class KH{constructor(e){this._instance=e,this._proxyObj=Promise.resolve(this._instance)}dispose(){this._instance.dispose()}getProxyObject(){return this._proxyObj}}class CM{constructor(e){this._workerClient=e}fhr(e,t){return this._workerClient.fhr(e,t)}}class K8 extends te{constructor(e,t,i,s){super(),this.languageConfigurationService=s,this._disposed=!1,this._modelService=e,this._keepIdleModels=t,this._workerFactory=new lx(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 k0e(this._workerFactory,"vs/editor/common/services/editorSimpleWorker",new CM(this)))}catch(e){GP(e),this._worker=new KH(new wf(new CM(this),null))}return this._worker}_getProxy(){return this._getOrCreateWorker().getProxyObject().then(void 0,e=>(GP(e),this._worker=new KH(new wf(new CM(this),null)),this._getOrCreateWorker().getProxyObject()))}_getOrCreateModelManager(e){return this._modelManager||(this._modelManager=this._register(new yCe(e,this._modelService,this._keepIdleModels))),this._modelManager}_withSyncedResources(e,t=!1){return TE(this,void 0,void 0,function*(){return this._disposed?Promise.reject(O_e()):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 TE(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 SCe(n,e,t){return new LCe(n,e,t)}class LCe extends K8{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?h8(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 fS={ICodeEditor:"vs.editor.ICodeEditor",IDiffEditor:"vs.editor.IDiffEditor"},Eb=new class{clone(){return this}equals(n){return this===n}};function q8(n,e){return new S8([new gw(0,"",n)],e)}function mx(n,e){const t=new Uint32Array(2);return t[0]=0,t[1]=(n<<0|0|0|32768|2<<24)>>>0,new KT(t,e===null?Eb:e)}class Fs{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: ".concat(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:".concat(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 ts{static createEmpty(e,t){const i=ts.defaultTokenMetadata,s=new Uint32Array(2);return s[0]=e.length,s[1]=i,new ts(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 ts?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=Fs.getLanguageId(t);return this._languageIdCodec.decodeLanguageId(i)}getStandardTokenType(e){const t=this._tokens[(e<<1)+1];return Fs.getTokenType(t)}getForeground(e){const t=this._tokens[(e<<1)+1];return Fs.getForeground(t)}getClassName(e){const t=this._tokens[(e<<1)+1];return Fs.getClassNameFromMetadata(t)}getInlineStyle(e,t){const i=this._tokens[(e<<1)+1];return Fs.getInlineStyleFromMetadata(i,t)}getPresentation(e){const t=this._tokens[(e<<1)+1];return Fs.getPresentationFromMetadata(t)}getEndOffset(e){return this._tokens[e<<1]}findTokenIndexAtOffset(e){return ts.findIndexInTokensArray(this._tokens,e)}inflate(){return this}sliceAndInflate(e,t,i){return new G8(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 ts(new Uint32Array(o),s,this._languageIdCodec)}}ts.defaultTokenMetadata=(32768|2<<24)>>>0;class G8{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 G8?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 br{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 br(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 br(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=br._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 kCe{static normalize(e,t){if(t.length===0)return[];const i=[],s=new xE;let o=0;for(let r=0,a=t.length;r1){const p=e.charCodeAt(c-2);es(p)&&c--}if(d>1){const p=e.charCodeAt(d-2);es(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 ds{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 AQ{constructor(e,t){this.startOffset=e,this.endOffset=t}equals(e){return this.startOffset===e.startOffset&&this.endOffset===e.endOffset}}class Eg{constructor(e,t,i,s,o,r,a,l,c,d,u,h,f,g,p,_,v,b,C){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(br.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=C&&C.sort((L,S)=>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=$c.getPartIndex(t),s=$c.getCharIndex(t);return new MQ(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=$c.getPartIndex(a),d=$c.getCharIndex(a),u=$c.getPartIndex(l);let h;c!==u?h=t:h=$c.getCharIndex(l);const f=i-d,g=h-i;return f<=g?o:r}}class sO{constructor(e,t,i){this._renderLineOutputBrand=void 0,this.characterMapping=e,this.containsRTL=t,this.containsForeignElements=i}}function gS(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 $c(1,t+i);return o.setColumnInfo(1,t,0,0),new sO(o,!1,s)}return e.appendString(""),new sO(new $c(0,0),!1,0)}return RCe(ICe(n),e)}class DCe{constructor(e,t,i,s){this.characterMapping=e,this.html=t,this.containsRTL=i,this.containsForeignElements=s}}function _x(n){const e=new D0(1e4),t=gS(n,e);return new DCe(t.characterMapping,e.build(),t.containsRTL,t.containsForeignElements)}class ECe{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 ICe(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 ds(i,"",0,!1));let a=i;for(let l=0,c=t.getCount();l=s){const f=e?Cb(n.substring(a,s)):!1;o[r++]=new ds(s,u,0,f);break}const h=e?Cb(n.substring(a,d)):!1;o[r++]=new ds(d,u,0,h),a=d}return o}function xCe(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 ds(f+1,d,u,h),g=f+1,f=-1);g!==c&&(s[o++]=new ds(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 NCe(n,e){const t=[];let i=new ds(0,"",0,!1),s=0;for(const o of e){const r=o.endIndex;for(;si.endIndex&&(i=new ds(s,o.type,o.metadata,o.containsRTL),t.push(i)),i=new ds(s+1,"mtkcontrol",o.metadata,!1),t.push(i))}s>i.endIndex&&(i=new ds(r,o.type,o.metadata,o.containsRTL),t.push(i))}return t}function ACe(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 C=i.length;let w=!1,y=bo(e),L;y===-1?(w=!0,y=t,L=t):L=oc(e);let S=!1,k=0,D=c&&c[k],x=a%r;for(let T=o;T=D.endOffset&&(k++,D=c&&c[k]);let W;if(TL)W=!0;else if(P===9)W=!0;else if(P===32)if(d)if(S)W=!0;else{const $=T+1T),W&&u&&(W=w||T>L),W&&v&&T>=y&&T<=L&&(W=!1),S){if(!W||!l&&x>=r){if(h){const $=g>0?f[g-1].endIndex:o;for(let X=$+1;X<=T;X++)f[g++]=new ds(X,"mtkw",1,!1)}else f[g++]=new ds(T,"mtkw",1,!1);x=x%r}}else(T===b||W&&T>o)&&(f[g++]=new ds(T,_,0,v),x=x%r);for(P===9?x=r:zf(P)?x+=2:x++,S=W;T===b&&(p++,p0?e.charCodeAt(t-1):0,P=t>1?e.charCodeAt(t-2):0;T===32&&P!==32&&P!==9||(A=!0)}else A=!0;if(A)if(h){const T=g>0?f[g-1].endIndex:o;for(let P=T+1;P<=t;P++)f[g++]=new ds(P,"mtkw",1,!1)}else f[g++]=new ds(t,"mtkw",1,!1);else f[g++]=new ds(t,_,0,v);return f}function MCe(n,e,t,i){i.sort(br.compare);const s=kCe.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 ds(c,p,_,v)),b.endOffset+1<=g)c=b.endOffset+1,a[l++]=new ds(c,p+" "+b.className,_|b.metadata,v),r++;else{c=g,a[l++]=new ds(c,p+" "+b.className,_|b.metadata,v);break}}g>c&&(c=g,a[l++]=new ds(c,p,_,v))}const d=t[t.length-1].endIndex;if(r'):e.appendString("");for(let D=0,x=c.length;D=d&&(de+=ie)}}for(X&&(e.appendString(' style="width:'),e.appendString(String(g*Q)),e.appendString('px"')),e.appendASCIICharCode(62);w1?e.appendCharCode(8594):e.appendCharCode(65515);for(let ie=2;ie<=_e;ie++)e.appendCharCode(160)}else de=2,_e=1,e.appendCharCode(p),e.appendCharCode(8204);L+=de,S+=_e,w>=d&&(y+=_e)}}else for(e.appendASCIICharCode(62);w=d&&(y+=de)}J?k++:k=0,w>=r&&!C&&A.isPseudoAfter()&&(C=!0,b.setColumnInfo(w+1,D,L,S)),e.appendString("")}return C||b.setColumnInfo(r+1,c.length-1,L,S),a&&(e.appendString(''),e.appendString(m("showMore","Show more ({0})",OCe(l))),e.appendString("")),e.appendString(""),new sO(b,f,s)}function PCe(n){return n.toString(16).toUpperCase().padStart(4,"0")}function OCe(n){return n<1024?m("overflow.chars","{0} chars",n):n<1024*1024?"".concat((n/1024).toFixed(1)," KB"):"".concat((n/1024/1024).toFixed(1)," MB")}class GH{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 FCe{constructor(e,t){this.tabSize=e,this.data=t}}class Y8{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 Jr{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=Jr.isBasicASCII(i,r),this.containsRTL=Jr.containsRTL(i,this.isBasicASCII,o),this.tokens=a,this.inlineDecorations=l,this.tabSize=c,this.startVisibleColumn=d}static isBasicASCII(e,t){return t?cS(e):!0}static containsRTL(e,t,i){return!t&&i?Cb(e):!1}}class vC{constructor(e,t,i){this.range=e,this.inlineClassName=t,this.type=i}}class BCe{constructor(e,t,i,s){this.startOffset=e,this.endOffset=t,this.inlineClassName=i,this.inlineClassNameAffectsLetterSpacing=s}toInlineDecoration(e){return new vC(new I(e,this.startOffset+1,e,this.endOffset+1),this.inlineClassName,this.inlineClassNameAffectsLetterSpacing?3:0)}}class PQ{constructor(e,t){this._viewModelDecorationBrand=void 0,this.range=e,this.options=t}}class Tw{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&&yn(e.data,t.data)}static equalsArr(e,t){return yn(e,t,Tw.equals)}}function WCe(n){return Array.isArray(n)}function VCe(n){return!WCe(n)}function OQ(n){return typeof n=="string"}function YH(n){return!OQ(n)}function K_(n){return!n}function yf(n,e){return n.ignoreCase&&e?e.toLowerCase():e}function ZH(n){return n.replace(/[&<>'"_]/g,"-")}function HCe(n,e){console.log("".concat(n.languageId,": ").concat(e))}function Wi(n,e){return new Error("".concat(n.languageId,": ").concat(e))}function $h(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 K_(c)?K_(d)?!K_(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 $Ce(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 zCe=globalThis&&globalThis.__decorate||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},UCe=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},oO;const FQ=5;class xw{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 Uv(e,t);let i=Uv.getStackElementId(e);i.length>0&&(i+="|"),i+=t;let s=this._entries[i];return s||(s=new Uv(e,t),this._entries[i]=s,s)}}xw._INSTANCE=new xw(FQ);class Uv{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 Uv._equals(this,e)}push(e){return xw.create(this,e)}pop(){return this.parent}popall(){let e=this;for(;e.parent;)e=e.parent;return e}switchTo(e){return xw.create(this.parent,e)}}class ov{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 ov(this.languageId,this.state)}}class zh{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 bC(e,t);if(e!==null&&e.depth>=this._maxCacheDepth)return new bC(e,t);const i=Uv.getStackElementId(e);let s=this._entries[i];return s||(s=new bC(e,null),this._entries[i]=s,s)}}zh._INSTANCE=new zh(FQ);class bC{constructor(e,t){this.stack=e,this.embeddedLanguageData=t}clone(){return(this.embeddedLanguageData?this.embeddedLanguageData.clone():null)===this.embeddedLanguageData?this:zh.create(this.stack,this.embeddedLanguageData)}equals(e){return!(e instanceof bC)||!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 jCe{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 gw(e,t,this._languageId)))}nestedLanguageTokenize(e,t,i,s){const o=i.languageId,r=i.state,a=nn.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 gw(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 S8(this._tokens,e)}}class NE{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=nn.get(t);if(i){if(i instanceof oO){const s=i.getLoadStatus();s.loaded===!1&&e.push(s.promise)}continue}nn.isResolved(t)||e.push(nn.getOrCreate(t))}return e.length===0?{loaded:!0}:{loaded:!1,promise:Promise.all(e).then(t=>{})}}getInitialState(){const e=xw.create(null,this._lexer.start);return zh.create(e,null)}tokenize(e,t,i){if(e.length>=this._maxTokenizationLineLength)return q8(this._languageId,i);const s=new jCe,o=this._tokenize(e,t,i,s);return s.finalize(o)}tokenizeEncoded(e,t,i){if(e.length>=this._maxTokenizationLineLength)return mx(this._languageService.languageIdCodec.encodeLanguageId(this._languageId),i);const s=new NE(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=SL(this._lexer,t.stack.state),!i))throw Wi(this._lexer,"tokenizer state is not defined: "+t.stack.state);let s=-1,o=!1;for(const r of i){if(!YH(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+"\n":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 D=this._lexer.tokenizer[v];if(!D&&(D=SL(this._lexer,v),!D))throw Wi(this._lexer,"tokenizer state is not defined: "+v);const x=a.substr(u);for(const A of D)if((u===0||!A.matchOnlyAtLineStart)&&(b=x.match(A.regex),b)){C=b[0],w=A.action;break}}if(b||(b=[""],C=""),w||(u=this._lexer.maxStack)throw Wi(this._lexer,"maximum tokenizer stack size reached: ["+d.state+","+d.parent.state+",...]");d=d.push(v)}else if(w.next==="@pop"){if(d.depth<=1)throw Wi(this._lexer,"trying to pop an empty stack in rule: "+this._safeRuleName(y));d=d.pop()}else if(w.next==="@popall")d=d.popall();else{let D=$h(this._lexer,w.next,C,b,v);if(D[0]==="@"&&(D=D.substr(1)),SL(this._lexer,D))d=d.push(D);else throw Wi(this._lexer,"trying to set a next state '"+D+"' that is undefined in rule: "+this._safeRuleName(y))}}w.log&&typeof w.log=="string"&&HCe(this._lexer,this._lexer.languageId+": "+$h(this._lexer,w.log,C,b,v))}if(S===null)throw Wi(this._lexer,"lexer rule has no well-defined action in rule: "+this._safeRuleName(y));const k=D=>{const x=this._languageService.getLanguageIdByLanguageName(D)||this._languageService.getLanguageIdByMimeType(D)||D,A=this._getNestedEmbeddedLanguageData(x);if(u0)throw Wi(this._lexer,"groups cannot be nested: "+this._safeRuleName(y));if(b.length!==S.length+1)throw Wi(this._lexer,"matched number of groups does not match the number of actions in rule: "+this._safeRuleName(y));let D=0;for(let x=1;xn});class Z8{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=wM==null?void 0:wM.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 qCe(this,void 0,void 0,function*(){const o=e.languageIdCodec;let r=4;s&&typeof s.tabSize=="number"&&(r=s.tabSize),x8(t)&&(t=t.substr(1));const a=Sd(t);if(!e.isRegisteredLanguageId(i))return XH(a,r,o);const l=yield nn.getOrCreate(i);return l?GCe(a,r,l,o):XH(a,r,o)})}static colorizeLine(e,t,i,s,o=4){const r=Jr.isBasicASCII(e,t),a=Jr.containsRTL(e,r,i);return _x(new Eg(!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 GCe(n,e,t,i){return new Promise((s,o)=>{const r=()=>{const a=YCe(n,e,t,i);if(t instanceof Nw){const l=t.getLoadStatus();if(l.loaded===!1){l.promise.then(r,o);return}}s(a)};r()})}function XH(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 YCe(n,e,t,i){let s=[],o=t.getInitialState();for(let r=0,a=n.length;r"),o=c.endState}return s.join("")}const QH=2e4;let mp,uD,rO,hD,aO;function ZCe(n){mp=document.createElement("div"),mp.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"),mp.appendChild(i),i};uD=e(),rO=e();const t=()=>{const i=document.createElement("div");return i.className="monaco-status",i.setAttribute("aria-live","polite"),i.setAttribute("aria-atomic","true"),mp.appendChild(i),i};hD=t(),aO=t(),n.appendChild(mp)}function to(n){mp&&(uD.textContent!==n?(Ds(rO),AE(uD,n)):(Ds(uD),AE(rO,n)))}function Yf(n){mp&&(hD.textContent!==n?(Ds(aO),AE(hD,n)):(Ds(hD),AE(aO,n)))}function AE(n,e){Ds(n),e.length>QH&&(e=e.substr(0,QH)),n.textContent=e,n.style.visibility="hidden",n.style.visibility="visible"}const X8=Wt("markerDecorationsService");var XCe=globalThis&&globalThis.__decorate||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},QCe=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let Aw=class{constructor(e,t){}dispose(){}};Aw.ID="editor.contrib.markerDecorations";Aw=XCe([QCe(1,X8)],Aw);ti(Aw.ID,Aw,0);class BQ extends te{constructor(e,t){super(),this._onDidChange=this._register(new j),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 Sf{constructor(e,t){this.key=e,this.migrate=t}apply(e){const t=Sf._read(e,this.key),i=o=>Sf._read(e,o),s=(o,r)=>Sf._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}}Sf.items=[];function Ig(n,e){Sf.items.push(new Sf(n,e))}function Wa(n,e){Ig(n,(t,i,s)=>{if(typeof t<"u"){for(const[o,r]of e)if(t===o){s(n,r);return}}})}function JCe(n){Sf.items.forEach(e=>e.apply(n))}Wa("wordWrap",[[!0,"on"],[!1,"off"]]);Wa("lineNumbers",[[!0,"on"],[!1,"off"]]);Wa("cursorBlinking",[["visible","solid"]]);Wa("renderWhitespace",[[!0,"boundary"],[!1,"none"]]);Wa("renderLineHighlight",[[!0,"line"],[!1,"none"]]);Wa("acceptSuggestionOnEnter",[[!0,"on"],[!1,"off"]]);Wa("tabCompletion",[[!1,"off"],[!0,"onlySnippets"]]);Wa("hover",[[!0,{enabled:!0}],[!1,{enabled:!1}]]);Wa("parameterHints",[[!0,{enabled:!0}],[!1,{enabled:!1}]]);Wa("autoIndent",[[!1,"advanced"],[!0,"full"]]);Wa("matchBrackets",[[!0,"always"],[!1,"never"]]);Wa("renderFinalNewline",[[!0,"on"],[!1,"off"]]);Wa("cursorSmoothCaretAnimation",[[!0,"on"],[!1,"off"]]);Ig("autoClosingBrackets",(n,e,t)=>{n===!1&&(t("autoClosingBrackets","never"),typeof e("autoClosingQuotes")>"u"&&t("autoClosingQuotes","never"),typeof e("autoSurround")>"u"&&t("autoSurround","never"))});Ig("renderIndentGuides",(n,e,t)=>{typeof n<"u"&&(t("renderIndentGuides",void 0),typeof e("guides.indentation")>"u"&&t("guides.indentation",!!n))});Ig("highlightActiveIndentGuide",(n,e,t)=>{typeof n<"u"&&(t("highlightActiveIndentGuide",void 0),typeof e("guides.highlightActiveIndentation")>"u"&&t("guides.highlightActiveIndentation",!!n))});const ewe={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"};Ig("suggest.filteredTypes",(n,e,t)=>{if(n&&typeof n=="object"){for(const i of Object.entries(ewe))n[i[0]]===!1&&typeof e("suggest.".concat(i[1]))>"u"&&t("suggest.".concat(i[1]),!1);t("suggest.filteredTypes",void 0)}});Ig("quickSuggestions",(n,e,t)=>{if(typeof n=="boolean"){const i=n?"on":"off";t("quickSuggestions",{comments:i,strings:i,other:i})}});Ig("experimental.stickyScroll.enabled",(n,e,t)=>{typeof n=="boolean"&&(t("experimental.stickyScroll.enabled",void 0),typeof e("stickyScroll.enabled")>"u"&&t("stickyScroll.enabled",n))});Ig("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 twe{constructor(){this._tabFocus=!1,this._onDidChangeTabFocus=new j,this.onDidChangeTabFocus=this._onDidChangeTabFocus.event}getTabFocusMode(){return this._tabFocus}setTabFocusMode(e){this._tabFocus=e,this._onDidChangeTabFocus.fire(this._tabFocus)}}const Ib=new twe,oh=Wt("accessibilityService"),pS=new Ve("accessibilityModeEnabled",!1);var iwe=globalThis&&globalThis.__decorate||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},nwe=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let lO=class extends te{constructor(e,t,i,s){super(),this._accessibilityService=s,this._onDidChange=this._register(new j),this.onDidChange=this._onDidChange.event,this._onDidChangeFast=this._register(new j),this.onDidChangeFast=this._onDidChangeFast.event,this._isDominatedByLongLines=!1,this._viewLineCount=1,this._lineNumbersDigitCount=1,this._reservedHeight=0,this._glyphMarginDecorationLaneCount=1,this._computeOptionsMemory=new rX,this.isSimpleWidget=e,this._containerObserver=this._register(new BQ(i,t.dimension)),this._rawOptions=JH(t),this._validatedOptions=Uh.validateOptions(this._rawOptions),this.options=this._computeOptions(),this.options.get(13)&&this._containerObserver.startObserving(),this._register(ma.onDidChangeZoomLevel(()=>this._recomputeOptions())),this._register(Ib.onDidChangeTabFocus(()=>this._recomputeOptions())),this._register(this._containerObserver.onDidChange(()=>this._recomputeOptions())),this._register(BP.onDidChange(()=>this._recomputeOptions())),this._register(vw.onDidChange(()=>this._recomputeOptions())),this._register(this._accessibilityService.onDidChangeScreenReaderOptimized(()=>this._recomputeOptions()))}_recomputeOptions(){const e=this._computeOptions(),t=Uh.checkEquals(this.options,e);t!==null&&(this.options=e,this._onDidChangeFast.fire(t),this._onDidChange.fire(t))}_computeOptions(){const e=this._readEnvConfiguration(),t=$p.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:Ib.getTabFocusMode(),accessibilitySupport:e.accessibilitySupport,glyphMarginDecorationLaneCount:this._glyphMarginDecorationLaneCount};return Uh.computeOptions(this._validatedOptions,s)}_readEnvConfiguration(){return{extraEditorClassName:owe(),outerWidth:this._containerObserver.getWidth(),outerHeight:this._containerObserver.getHeight(),emptySelectionClipboard:Hp||Ta,pixelRatio:vw.value,accessibilitySupport:this._accessibilityService.isScreenReaderOptimized()?2:this._accessibilityService.getAccessibilitySupport()}}_readFontInfo(e){return BP.readFontInfo(e)}getRawOptions(){return this._rawOptions}updateOptions(e){const t=JH(e);Uh.applyUpdate(this._rawOptions,t)&&(this._validatedOptions=Uh.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=swe(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())}};lO=iwe([nwe(3,oh)],lO);function swe(n){let e=0;for(;n;)n=Math.floor(n/10),e++;return e||1}function owe(){let n="";return!qu&&!AX&&(n+="no-user-select "),qu&&(n+="no-minimap-shadow ",n+="enable-user-select "),Kt&&(n+="mac "),n}class rwe{constructor(){this._values=[]}_read(e){return this._values[e]}get(e){return this._values[e]}_write(e,t){this._values[e]=t}}class awe{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 Uh{static validateOptions(e){const t=new rwe;for(const i of ev){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 awe;for(const s of ev)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)?yn(e,t):!1;if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const i in e)if(!Uh._deepEquals(e[i],t[i]))return!1;return!0}static checkEquals(e,t){const i=[];let s=!1;for(const o of ev){const r=!Uh._deepEquals(e._read(o.id),t._read(o.id));i[o.id]=r,r&&(s=!0)}return s?new oX(i):null}static applyUpdate(e,t){let i=!1;for(const s of ev)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 JH(n){const e=du(n);return JCe(e),e}function xn(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$".concat(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 lwe=globalThis&&globalThis.__decorate||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},Ti;(function(n){n.Tap="-monaco-gesturetap",n.Change="-monaco-gesturechange",n.Start="-monaco-gesturestart",n.End="-monaco-gesturesend",n.Contextmenu="-monaco-gesturecontextmenu"})(Ti||(Ti={}));class Ii extends te{constructor(){super(),this.dispatched=!1,this.targets=new To,this.ignoreTargets=new To,this.activeTouches={},this.handle=null,this._lastSetTapCountTime=0,this._register(ce(document,"touchstart",e=>this.onTouchStart(e),{passive:!1})),this._register(ce(document,"touchend",e=>this.onTouchEnd(e))),this._register(ce(document,"touchmove",e=>this.onTouchMove(e),{passive:!1}))}static addTarget(e){if(!Ii.isTouchDevice())return te.None;Ii.INSTANCE||(Ii.INSTANCE=new Ii);const t=Ii.INSTANCE.targets.push(e);return vt(t)}static ignoreTarget(e){if(!Ii.isTouchDevice())return te.None;Ii.INSTANCE||(Ii.INSTANCE=new Ii);const t=Ii.INSTANCE.ignoreTargets.push(e);return vt(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=Ii.HOLD_DELAY&&Math.abs(a.initialPageX-ca(a.rollingPageX))<30&&Math.abs(a.initialPageY-ca(a.rollingPageY))<30){const c=this.newGestureEvent(Ti.Contextmenu,a.initialTarget);c.pageX=ca(a.rollingPageX),c.pageY=ca(a.rollingPageY),this.dispatchEvent(c)}else if(i===1){const c=ca(a.rollingPageX),d=ca(a.rollingPageY),u=ca(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(Ti.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===Ti.Tap){const t=new Date().getTime();let i=0;t-this._lastSetTapCountTime>Ii.CLEAR_TAP_COUNT_TIME?i=1:i=2,this._lastSetTapCountTime=t,e.tapCount=i}else(e.type===Ti.Change||e.type===Ti.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=xa(()=>{const c=Date.now(),d=c-t;let u=0,h=0,f=!0;i+=Ii.SCROLL_FRICTION*d,r+=Ii.SCROLL_FRICTION*d,i>0&&(f=!1,u=s*i*d),r>0&&(f=!1,h=a*r*d);const g=this.newGestureEvent(Ti.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)}}Ii.SCROLL_FRICTION=-.005;Ii.HOLD_DELAY=700;Ii.CLEAR_TAP_COUNT_TIME=400;lwe([xn],Ii,"isTouchDevice",null);class I0{constructor(){this._hooks=new be,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(vt(()=>{try{e.releasePointerCapture(t)}catch{}}))}catch{r=window}this._hooks.add(ce(r,Pe.POINTER_MOVE,a=>{if(a.buttons!==i){this.stopMonitoring(!0);return}a.preventDefault(),this._pointerMoveCallback(a)})),this._hooks.add(ce(r,Pe.POINTER_UP,a=>this.stopMonitoring(!0)))}}function Q8(n){return"--vscode-".concat(n.replace(/\./g,"-"))}function He(n){return"var(".concat(Q8(n),")")}function cwe(n,e){return"var(".concat(Q8(n),", ").concat(e,")")}const WQ={ColorContribution:"base.contributions.colors"};class dwe{constructor(){this._onDidChangeSchema=new j,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 Nl(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=>"- `".concat(t,"`: ").concat(this.colorsById[t].description)).join("\n")}}const vx=new dwe;en.add(WQ.ColorContribution,vx);function F(n,e,t,i,s){return vx.registerColor(n,e,t,i,s)}const Te=F("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."));F("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 uwe=F("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."));F("descriptionForeground",{light:"#717171",dark:nt(Te,.7),hcDark:nt(Te,.7),hcLight:nt(Te,.7)},m("descriptionForeground","Foreground color for description text providing additional information, for example for a label."));const Jh=F("icon.foreground",{dark:"#C5C5C5",light:"#424242",hcDark:"#FFFFFF",hcLight:"#292929"},m("iconForeground","The default color for icons in the workbench.")),zr=F("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.")),$t=F("contrastBorder",{light:null,dark:null,hcDark:"#6FC3DF",hcLight:"#0F4A85"},m("contrastBorder","An extra border around elements to separate them from others for greater contrast.")),$i=F("contrastActiveBorder",{light:null,dark:null,hcDark:zr,hcLight:zr},m("activeContrastBorder","An extra border around active elements to separate them from others for greater contrast."));F("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."));F("textSeparator.foreground",{light:"#0000002e",dark:"#ffffff2e",hcDark:ee.black,hcLight:"#292929"},m("textSeparatorForeground","Color for text separators."));const hwe=F("textLink.foreground",{light:"#006AB1",dark:"#3794FF",hcDark:"#3794FF",hcLight:"#0F4A85"},m("textLinkForeground","Foreground color for links in text."));F("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."));F("textPreformat.foreground",{light:"#A31515",dark:"#D7BA7D",hcDark:"#D7BA7D",hcLight:"#292929"},m("textPreformatForeground","Foreground color for preformatted text segments."));F("textBlockQuote.background",{light:"#7f7f7f1a",dark:"#7f7f7f1a",hcDark:null,hcLight:"#F2F2F2"},m("textBlockQuoteBackground","Background color for block quotes in text."));F("textBlockQuote.border",{light:"#007acc80",dark:"#007acc80",hcDark:ee.white,hcLight:"#292929"},m("textBlockQuoteBorder","Border color for block quotes in text."));F("textCodeBlock.background",{light:"#dcdcdc66",dark:"#0a0a0a66",hcDark:ee.black,hcLight:"#F2F2F2"},m("textCodeBlockBackground","Background color for code blocks in text."));const nd=F("widget.shadow",{dark:nt(ee.black,.36),light:nt(ee.black,.16),hcDark:null,hcLight:null},m("widgetShadow","Shadow color of widgets such as find/replace inside the editor.")),J8=F("widget.border",{dark:null,light:null,hcDark:$t,hcLight:$t},m("widgetBorder","Border color of widgets such as find/replace inside the editor.")),VQ=F("input.background",{dark:"#3C3C3C",light:ee.white,hcDark:ee.black,hcLight:ee.white},m("inputBoxBackground","Input box background.")),HQ=F("input.foreground",{dark:Te,light:Te,hcDark:Te,hcLight:Te},m("inputBoxForeground","Input box foreground.")),$Q=F("input.border",{dark:null,light:null,hcDark:$t,hcLight:$t},m("inputBoxBorder","Input box border.")),e9=F("inputOption.activeBorder",{dark:"#007ACC",light:"#007ACC",hcDark:$t,hcLight:$t},m("inputBoxActiveOptionBorder","Border color of activated options in input fields."));F("inputOption.hoverBackground",{dark:"#5a5d5e80",light:"#b8b8b850",hcDark:null,hcLight:null},m("inputOption.hoverBackground","Background color of activated options in input fields."));const Ip=F("inputOption.activeBackground",{dark:nt(zr,.4),light:nt(zr,.2),hcDark:ee.transparent,hcLight:ee.transparent},m("inputOption.activeBackground","Background hover color of options in input fields.")),t9=F("inputOption.activeForeground",{dark:ee.white,light:ee.black,hcDark:Te,hcLight:Te},m("inputOption.activeForeground","Foreground color of activated options in input fields."));F("input.placeholderForeground",{light:nt(Te,.5),dark:nt(Te,.5),hcDark:nt(Te,.7),hcLight:nt(Te,.7)},m("inputPlaceholderForeground","Input box foreground color for placeholder text."));const fwe=F("inputValidation.infoBackground",{dark:"#063B49",light:"#D6ECF2",hcDark:ee.black,hcLight:ee.white},m("inputValidationInfoBackground","Input validation background color for information severity.")),gwe=F("inputValidation.infoForeground",{dark:null,light:null,hcDark:null,hcLight:Te},m("inputValidationInfoForeground","Input validation foreground color for information severity.")),pwe=F("inputValidation.infoBorder",{dark:"#007acc",light:"#007acc",hcDark:$t,hcLight:$t},m("inputValidationInfoBorder","Input validation border color for information severity.")),mwe=F("inputValidation.warningBackground",{dark:"#352A05",light:"#F6F5D2",hcDark:ee.black,hcLight:ee.white},m("inputValidationWarningBackground","Input validation background color for warning severity.")),_we=F("inputValidation.warningForeground",{dark:null,light:null,hcDark:null,hcLight:Te},m("inputValidationWarningForeground","Input validation foreground color for warning severity.")),vwe=F("inputValidation.warningBorder",{dark:"#B89500",light:"#B89500",hcDark:$t,hcLight:$t},m("inputValidationWarningBorder","Input validation border color for warning severity.")),bwe=F("inputValidation.errorBackground",{dark:"#5A1D1D",light:"#F2DEDE",hcDark:ee.black,hcLight:ee.white},m("inputValidationErrorBackground","Input validation background color for error severity.")),Cwe=F("inputValidation.errorForeground",{dark:null,light:null,hcDark:null,hcLight:Te},m("inputValidationErrorForeground","Input validation foreground color for error severity.")),wwe=F("inputValidation.errorBorder",{dark:"#BE1100",light:"#BE1100",hcDark:$t,hcLight:$t},m("inputValidationErrorBorder","Input validation border color for error severity.")),sd=F("dropdown.background",{dark:"#3C3C3C",light:ee.white,hcDark:ee.black,hcLight:ee.white},m("dropdownBackground","Dropdown background.")),ywe=F("dropdown.listBackground",{dark:null,light:null,hcDark:ee.black,hcLight:ee.white},m("dropdownListBackground","Dropdown list background.")),Lu=F("dropdown.foreground",{dark:"#F0F0F0",light:Te,hcDark:ee.white,hcLight:Te},m("dropdownForeground","Dropdown foreground.")),rv=F("dropdown.border",{dark:sd,light:"#CECECE",hcDark:$t,hcLight:$t},m("dropdownBorder","Dropdown border.")),B1=F("button.foreground",{dark:ee.white,light:ee.white,hcDark:ee.white,hcLight:ee.white},m("buttonForeground","Button foreground color.")),Swe=F("button.separator",{dark:nt(B1,.4),light:nt(B1,.4),hcDark:nt(B1,.4),hcLight:nt(B1,.4)},m("buttonSeparator","Button separator color.")),W1=F("button.background",{dark:"#0E639C",light:"#007ACC",hcDark:null,hcLight:"#0F4A85"},m("buttonBackground","Button background color.")),Lwe=F("button.hoverBackground",{dark:rc(W1,.2),light:Ym(W1,.2),hcDark:W1,hcLight:W1},m("buttonHoverBackground","Button background color when hovering.")),kwe=F("button.border",{dark:$t,light:$t,hcDark:$t,hcLight:$t},m("buttonBorder","Button border color.")),Dwe=F("button.secondaryForeground",{dark:ee.white,light:ee.white,hcDark:ee.white,hcLight:Te},m("buttonSecondaryForeground","Secondary button foreground color.")),cO=F("button.secondaryBackground",{dark:"#3A3D41",light:"#5F6A79",hcDark:null,hcLight:ee.white},m("buttonSecondaryBackground","Secondary button background color.")),Ewe=F("button.secondaryHoverBackground",{dark:rc(cO,.2),light:Ym(cO,.2),hcDark:null,hcLight:null},m("buttonSecondaryHoverBackground","Secondary button background color when hovering.")),fD=F("badge.background",{dark:"#4D4D4D",light:"#C4C4C4",hcDark:ee.black,hcLight:"#0F4A85"},m("badgeBackground","Badge background color. Badges are small information labels, e.g. for search results count.")),Iwe=F("badge.foreground",{dark:ee.white,light:"#333",hcDark:ee.white,hcLight:ee.white},m("badgeForeground","Badge foreground color. Badges are small information labels, e.g. for search results count.")),Twe=F("scrollbar.shadow",{dark:"#000000",light:"#DDDDDD",hcDark:null,hcLight:null},m("scrollbarShadow","Scrollbar shadow to indicate that the view is scrolled.")),V1=F("scrollbarSlider.background",{dark:ee.fromHex("#797979").transparent(.4),light:ee.fromHex("#646464").transparent(.4),hcDark:nt($t,.6),hcLight:nt($t,.4)},m("scrollbarSliderBackground","Scrollbar slider background color.")),H1=F("scrollbarSlider.hoverBackground",{dark:ee.fromHex("#646464").transparent(.7),light:ee.fromHex("#646464").transparent(.7),hcDark:nt($t,.8),hcLight:nt($t,.8)},m("scrollbarSliderHoverBackground","Scrollbar slider background color when hovering.")),$1=F("scrollbarSlider.activeBackground",{dark:ee.fromHex("#BFBFBF").transparent(.4),light:ee.fromHex("#000000").transparent(.6),hcDark:$t,hcLight:$t},m("scrollbarSliderActiveBackground","Scrollbar slider background color when clicked on.")),xwe=F("progressBar.background",{dark:ee.fromHex("#0E70C0"),light:ee.fromHex("#0E70C0"),hcDark:$t,hcLight:$t},m("progressBarBackground","Background color of the progress bar that can show for long running operations."));F("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 od=F("editorError.foreground",{dark:"#F14C4C",light:"#E51400",hcDark:"#F48771",hcLight:"#B5200D"},m("editorError.foreground","Foreground color of error squigglies in the editor.")),Nwe=F("editorError.border",{dark:null,light:null,hcDark:ee.fromHex("#E47777").transparent(.8),hcLight:"#B5200D"},m("errorBorder","If set, color of double underlines for errors in the editor."));F("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 Ur=F("editorWarning.foreground",{dark:"#CCA700",light:"#BF8803",hcDark:"#FFD370",hcLight:"#895503"},m("editorWarning.foreground","Foreground color of warning squigglies in the editor.")),Mw=F("editorWarning.border",{dark:null,light:null,hcDark:ee.fromHex("#FFCC00").transparent(.8),hcLight:ee.fromHex("#FFCC00").transparent(.8)},m("warningBorder","If set, color of double underlines for warnings in the editor."));F("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 Xo=F("editorInfo.foreground",{dark:"#3794FF",light:"#1a85ff",hcDark:"#3794FF",hcLight:"#1a85ff"},m("editorInfo.foreground","Foreground color of info squigglies in the editor.")),Rw=F("editorInfo.border",{dark:null,light:null,hcDark:ee.fromHex("#3794FF").transparent(.8),hcLight:"#292929"},m("infoBorder","If set, color of double underlines for infos in the editor.")),Awe=F("editorHint.foreground",{dark:ee.fromHex("#eeeeee").transparent(.7),light:"#6c6c6c",hcDark:null,hcLight:null},m("editorHint.foreground","Foreground color of hint squigglies in the editor."));F("editorHint.border",{dark:null,light:null,hcDark:ee.fromHex("#eeeeee").transparent(.8),hcLight:"#292929"},m("hintBorder","If set, color of double underlines for hints in the editor."));F("sash.hoverBorder",{dark:zr,light:zr,hcDark:zr,hcLight:zr},m("sashActiveBorder","Border color of active sashes."));const is=F("editor.background",{light:"#ffffff",dark:"#1E1E1E",hcDark:ee.black,hcLight:ee.white},m("editorBackground","Editor background color.")),Ja=F("editor.foreground",{light:"#333333",dark:"#BBBBBB",hcDark:ee.white,hcLight:Te},m("editorForeground","Editor default foreground color."));F("editorStickyScroll.background",{light:is,dark:is,hcDark:is,hcLight:is},m("editorStickyScrollBackground","Sticky scroll background color for the editor"));F("editorStickyScrollHover.background",{dark:"#2A2D2E",light:"#F0F0F0",hcDark:null,hcLight:ee.fromHex("#0F4A85").transparent(.1)},m("editorStickyScrollHoverBackground","Sticky scroll on hover background color for the editor"));const un=F("editorWidget.background",{dark:"#252526",light:"#F3F3F3",hcDark:"#0C141F",hcLight:ee.white},m("editorWidgetBackground","Background color of editor widgets, such as find/replace.")),rd=F("editorWidget.foreground",{dark:Te,light:Te,hcDark:Te,hcLight:Te},m("editorWidgetForeground","Foreground color of editor widgets, such as find/replace.")),ad=F("editorWidget.border",{dark:"#454545",light:"#C8C8C8",hcDark:$t,hcLight:$t},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.")),Mwe=F("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.")),e$=F("quickInput.background",{dark:un,light:un,hcDark:un,hcLight:un},m("pickerBackground","Quick picker background color. The quick picker widget is the container for pickers like the command palette.")),Rwe=F("quickInput.foreground",{dark:rd,light:rd,hcDark:rd,hcLight:rd},m("pickerForeground","Quick picker foreground color. The quick picker widget is the container for pickers like the command palette.")),Pwe=F("quickInputTitle.background",{dark:new ee(new jt(255,255,255,.105)),light:new ee(new jt(0,0,0,.06)),hcDark:"#000000",hcLight:ee.white},m("pickerTitleBackground","Quick picker title background color. The quick picker widget is the container for pickers like the command palette.")),zQ=F("pickerGroup.foreground",{dark:"#3794FF",light:"#0066BF",hcDark:ee.white,hcLight:"#0F4A85"},m("pickerGroupForeground","Quick picker color for grouping labels.")),Owe=F("pickerGroup.border",{dark:"#3F3F46",light:"#CCCEDB",hcDark:ee.white,hcLight:"#0F4A85"},m("pickerGroupBorder","Quick picker color for grouping borders.")),Fwe=F("keybindingLabel.background",{dark:new ee(new jt(128,128,128,.17)),light:new ee(new jt(221,221,221,.4)),hcDark:ee.transparent,hcLight:ee.transparent},m("keybindingLabelBackground","Keybinding label background color. The keybinding label is used to represent a keyboard shortcut.")),Bwe=F("keybindingLabel.foreground",{dark:ee.fromHex("#CCCCCC"),light:ee.fromHex("#555555"),hcDark:ee.white,hcLight:Te},m("keybindingLabelForeground","Keybinding label foreground color. The keybinding label is used to represent a keyboard shortcut.")),Wwe=F("keybindingLabel.border",{dark:new ee(new jt(51,51,51,.6)),light:new ee(new jt(204,204,204,.4)),hcDark:new ee(new jt(111,195,223)),hcLight:$t},m("keybindingLabelBorder","Keybinding label border color. The keybinding label is used to represent a keyboard shortcut.")),Vwe=F("keybindingLabel.bottomBorder",{dark:new ee(new jt(68,68,68,.6)),light:new ee(new jt(187,187,187,.4)),hcDark:new ee(new jt(111,195,223)),hcLight:Te},m("keybindingLabelBottomBorder","Keybinding label border bottom color. The keybinding label is used to represent a keyboard shortcut.")),ef=F("editor.selectionBackground",{light:"#ADD6FF",dark:"#264F78",hcDark:"#f3f518",hcLight:"#0F4A85"},m("editorSelectionBackground","Color of the editor selection.")),Hwe=F("editor.selectionForeground",{light:null,dark:null,hcDark:"#000000",hcLight:ee.white},m("editorSelectionForeground","Color of the selected text for high contrast.")),UQ=F("editor.inactiveSelectionBackground",{light:nt(ef,.5),dark:nt(ef,.5),hcDark:nt(ef,.7),hcLight:nt(ef,.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),i9=F("editor.selectionHighlightBackground",{light:a$(ef,is,.3,.6),dark:a$(ef,is,.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);F("editor.selectionHighlightBorder",{light:null,dark:null,hcDark:$i,hcLight:$i},m("editorSelectionHighlightBorder","Border color for regions with the same content as the selection."));const $we=F("editor.findMatchBackground",{light:"#A8AC94",dark:"#515C6A",hcDark:null,hcLight:null},m("editorFindMatch","Color of the current search match.")),ld=F("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),zwe=F("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),Uwe=F("editor.findMatchBorder",{light:null,dark:null,hcDark:$i,hcLight:$i},m("editorFindMatchBorder","Border color of the current search match.")),tf=F("editor.findMatchHighlightBorder",{light:null,dark:null,hcDark:$i,hcLight:$i},m("findMatchHighlightBorder","Border color of the other search matches.")),jwe=F("editor.findRangeHighlightBorder",{dark:null,light:null,hcDark:nt($i,.4),hcLight:nt($i,.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);F("searchEditor.findMatchBackground",{light:nt(ld,.66),dark:nt(ld,.66),hcDark:ld,hcLight:ld},m("searchEditor.queryMatch","Color of the Search Editor query matches."));F("searchEditor.findMatchBorder",{light:nt(tf,.66),dark:nt(tf,.66),hcDark:tf,hcLight:tf},m("searchEditor.editorFindMatchBorder","Border color of the Search Editor query matches."));F("search.resultsInfoForeground",{light:Te,dark:nt(Te,.65),hcDark:Te,hcLight:Te},m("search.resultsInfoForeground","Color of the text in the search viewlet's completion message."));F("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 ME=F("editorHoverWidget.background",{light:un,dark:un,hcDark:un,hcLight:un},m("hoverBackground","Background color of the editor hover."));F("editorHoverWidget.foreground",{light:rd,dark:rd,hcDark:rd,hcLight:rd},m("hoverForeground","Foreground color of the editor hover."));const Kwe=F("editorHoverWidget.border",{light:ad,dark:ad,hcDark:ad,hcLight:ad},m("hoverBorder","Border color of the editor hover."));F("editorHoverWidget.statusBarBackground",{dark:rc(ME,.2),light:Ym(ME,.05),hcDark:un,hcLight:un},m("statusBarBackground","Background color of the editor hover status bar."));const qwe=F("editorLink.activeForeground",{dark:"#4E94CE",light:ee.blue,hcDark:ee.cyan,hcLight:"#292929"},m("activeLinkForeground","Color of active links.")),ku=F("editorInlayHint.foreground",{dark:"#969696",light:"#969696",hcDark:ee.white,hcLight:ee.black},m("editorInlayHintForeground","Foreground color of inline hints")),Du=F("editorInlayHint.background",{dark:nt(fD,.1),light:nt(fD,.1),hcDark:nt(ee.white,.1),hcLight:nt(fD,.1)},m("editorInlayHintBackground","Background color of inline hints")),Gwe=F("editorInlayHint.typeForeground",{dark:ku,light:ku,hcDark:ku,hcLight:ku},m("editorInlayHintForegroundTypes","Foreground color of inline hints for types")),Ywe=F("editorInlayHint.typeBackground",{dark:Du,light:Du,hcDark:Du,hcLight:Du},m("editorInlayHintBackgroundTypes","Background color of inline hints for types")),Zwe=F("editorInlayHint.parameterForeground",{dark:ku,light:ku,hcDark:ku,hcLight:ku},m("editorInlayHintForegroundParameter","Foreground color of inline hints for parameters")),Xwe=F("editorInlayHint.parameterBackground",{dark:Du,light:Du,hcDark:Du,hcLight:Du},m("editorInlayHintBackgroundParameter","Background color of inline hints for parameters"));F("editorLightBulb.foreground",{dark:"#FFCC00",light:"#DDB100",hcDark:"#FFCC00",hcLight:"#007ACC"},m("editorLightBulbForeground","The color used for the lightbulb actions icon."));F("editorLightBulbAutoFix.foreground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},m("editorLightBulbAutoFixForeground","The color used for the lightbulb auto fix actions icon."));const dO=new ee(new jt(155,185,85,.2)),uO=new ee(new jt(255,0,0,.2)),Qwe=F("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),Jwe=F("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);F("diffEditor.insertedLineBackground",{dark:dO,light:dO,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);F("diffEditor.removedLineBackground",{dark:uO,light:uO,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);F("diffEditorGutter.insertedLineBackground",{dark:null,light:null,hcDark:null,hcLight:null},m("diffEditorInsertedLineGutter","Background color for the margin where lines got inserted."));F("diffEditorGutter.removedLineBackground",{dark:null,light:null,hcDark:null,hcLight:null},m("diffEditorRemovedLineGutter","Background color for the margin where lines got removed."));const eye=F("diffEditorOverview.insertedForeground",{dark:null,light:null,hcDark:null,hcLight:null},m("diffEditorOverviewInserted","Diff overview ruler foreground for inserted content.")),tye=F("diffEditorOverview.removedForeground",{dark:null,light:null,hcDark:null,hcLight:null},m("diffEditorOverviewRemoved","Diff overview ruler foreground for removed content."));F("diffEditor.insertedTextBorder",{dark:null,light:null,hcDark:"#33ff2eff",hcLight:"#374E06"},m("diffEditorInsertedOutline","Outline color for the text that got inserted."));F("diffEditor.removedTextBorder",{dark:null,light:null,hcDark:"#FF008F",hcLight:"#AD0707"},m("diffEditorRemovedOutline","Outline color for text that got removed."));F("diffEditor.border",{dark:null,light:null,hcDark:$t,hcLight:$t},m("diffEditorBorder","Border color between the two text editors."));F("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."));F("diffEditor.unchangedRegionBackground",{dark:"#3e3e3e",light:"#e4e4e4",hcDark:null,hcLight:null},m("diffEditor.unchangedRegionBackground","The background color of unchanged blocks in the diff editor."));F("diffEditor.unchangedRegionForeground",{dark:"#a3a2a2",light:"#4d4c4c",hcDark:null,hcLight:null},m("diffEditor.unchangedRegionForeground","The foreground color of unchanged blocks in the diff editor."));F("diffEditor.unchangedCodeBackground",{dark:"#74747429",light:"#b8b8b829",hcDark:null,hcLight:null},m("diffEditor.unchangedCodeBackground","The background color of unchanged code in the diff editor."));const iye=F("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.")),nye=F("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.")),sye=F("list.focusOutline",{dark:zr,light:zr,hcDark:$i,hcLight:$i},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.")),oye=F("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.")),Eu=F("list.activeSelectionBackground",{dark:"#04395E",light:"#0060C0",hcDark:null,hcLight:ee.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.")),cd=F("list.activeSelectionForeground",{dark:ee.white,light:ee.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.")),z1=F("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.")),rye=F("list.inactiveSelectionBackground",{dark:"#37373D",light:"#E4E6F1",hcDark:null,hcLight:ee.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.")),aye=F("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.")),lye=F("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.")),cye=F("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.")),dye=F("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.")),jQ=F("list.hoverBackground",{dark:"#2A2D2E",light:"#F0F0F0",hcDark:ee.white.transparent(.1),hcLight:ee.fromHex("#0F4A85").transparent(.1)},m("listHoverBackground","List/Tree background when hovering over items using the mouse.")),KQ=F("list.hoverForeground",{dark:null,light:null,hcDark:null,hcLight:null},m("listHoverForeground","List/Tree foreground when hovering over items using the mouse.")),uye=F("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.")),el=F("list.highlightForeground",{dark:"#2AAAFF",light:"#0066BF",hcDark:zr,hcLight:zr},m("highlight","List/Tree foreground color of the match highlights when searching inside the list/tree.")),LL=F("list.focusHighlightForeground",{dark:el,light:Hye(Eu,el,"#BBE7FF"),hcDark:el,hcLight:el},m("listFocusHighlightForeground","List/Tree foreground color of the match highlights on actively focused items when searching inside the list/tree."));F("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."));F("list.errorForeground",{dark:"#F88070",light:"#B01011",hcDark:null,hcLight:null},m("listErrorForeground","Foreground color of list items containing errors."));F("list.warningForeground",{dark:"#CCA700",light:"#855F00",hcDark:null,hcLight:null},m("listWarningForeground","Foreground color of list items containing warnings."));const hye=F("listFilterWidget.background",{light:Ym(un,0),dark:rc(un,0),hcDark:un,hcLight:un},m("listFilterWidgetBackground","Background color of the type filter widget in lists and trees.")),fye=F("listFilterWidget.outline",{dark:ee.transparent,light:ee.transparent,hcDark:"#f38518",hcLight:"#007ACC"},m("listFilterWidgetOutline","Outline color of the type filter widget in lists and trees.")),gye=F("listFilterWidget.noMatchesOutline",{dark:"#BE1100",light:"#BE1100",hcDark:$t,hcLight:$t},m("listFilterWidgetNoMatchesOutline","Outline color of the type filter widget in lists and trees, when there are no matches.")),pye=F("listFilterWidget.shadow",{dark:nd,light:nd,hcDark:nd,hcLight:nd},m("listFilterWidgetShadow","Shadow color of the type filter widget in lists and trees."));F("list.filterMatchBackground",{dark:ld,light:ld,hcDark:null,hcLight:null},m("listFilterMatchHighlight","Background color of the filtered match."));F("list.filterMatchBorder",{dark:tf,light:tf,hcDark:$t,hcLight:$i},m("listFilterMatchHighlightBorder","Border color of the filtered match."));const U1=F("tree.indentGuidesStroke",{dark:"#585858",light:"#a9a9a9",hcDark:"#a9a9a9",hcLight:"#a5a5a5"},m("treeIndentGuidesStroke","Tree stroke color for the indentation guides.")),mye=F("tree.inactiveIndentGuidesStroke",{dark:nt(U1,.4),light:nt(U1,.4),hcDark:nt(U1,.4),hcLight:nt(U1,.4)},m("treeInactiveIndentGuidesStroke","Tree stroke color for the indentation guides that are not active.")),_ye=F("tree.tableColumnsBorder",{dark:"#CCCCCC20",light:"#61616120",hcDark:null,hcLight:null},m("tableColumnsBorder","Table border color between columns.")),vye=F("tree.tableOddRowsBackground",{dark:nt(Te,.04),light:nt(Te,.04),hcDark:null,hcLight:null},m("tableOddRowsBackgroundColor","Background color for odd table rows."));F("list.deemphasizedForeground",{dark:"#8C8C8C",light:"#8E8E90",hcDark:"#A7A8A9",hcLight:"#666666"},m("listDeemphasizedForeground","List/Tree foreground color for items that are deemphasized. "));const bye=F("checkbox.background",{dark:sd,light:sd,hcDark:sd,hcLight:sd},m("checkbox.background","Background color of checkbox widget."));F("checkbox.selectBackground",{dark:un,light:un,hcDark:un,hcLight:un},m("checkbox.select.background","Background color of checkbox widget when the element it's in is selected."));const Cye=F("checkbox.foreground",{dark:Lu,light:Lu,hcDark:Lu,hcLight:Lu},m("checkbox.foreground","Foreground color of checkbox widget.")),wye=F("checkbox.border",{dark:rv,light:rv,hcDark:rv,hcLight:rv},m("checkbox.border","Border color of checkbox widget."));F("checkbox.selectBorder",{dark:Jh,light:Jh,hcDark:Jh,hcLight:Jh},m("checkbox.select.border","Border color of checkbox widget when the element it's in is selected."));const t$=F("quickInput.list.focusBackground",{dark:null,light:null,hcDark:null,hcLight:null},"",void 0,m("quickInput.list.focusBackground deprecation","Please use quickInputList.focusBackground instead")),Tp=F("quickInputList.focusForeground",{dark:cd,light:cd,hcDark:cd,hcLight:cd},m("quickInput.listFocusForeground","Quick picker foreground color for the focused item.")),av=F("quickInputList.focusIconForeground",{dark:z1,light:z1,hcDark:z1,hcLight:z1},m("quickInput.listFocusIconForeground","Quick picker icon foreground color for the focused item.")),xp=F("quickInputList.focusBackground",{dark:Pw(t$,Eu),light:Pw(t$,Eu),hcDark:null,hcLight:null},m("quickInput.listFocusBackground","Quick picker background color for the focused item.")),yye=F("menu.border",{dark:null,light:null,hcDark:$t,hcLight:$t},m("menuBorder","Border color of menus.")),Sye=F("menu.foreground",{dark:Lu,light:Lu,hcDark:Lu,hcLight:Lu},m("menuForeground","Foreground color of menu items.")),Lye=F("menu.background",{dark:sd,light:sd,hcDark:sd,hcLight:sd},m("menuBackground","Background color of menu items.")),kye=F("menu.selectionForeground",{dark:cd,light:cd,hcDark:cd,hcLight:cd},m("menuSelectionForeground","Foreground color of the selected menu item in menus.")),Dye=F("menu.selectionBackground",{dark:Eu,light:Eu,hcDark:Eu,hcLight:Eu},m("menuSelectionBackground","Background color of the selected menu item in menus.")),Eye=F("menu.selectionBorder",{dark:null,light:null,hcDark:$i,hcLight:$i},m("menuSelectionBorder","Border color of the selected menu item in menus.")),Iye=F("menu.separatorBackground",{dark:"#606060",light:"#D4D4D4",hcDark:$t,hcLight:$t},m("menuSeparatorBackground","Color of a separator menu item in menus.")),hO=F("toolbar.hoverBackground",{dark:"#5a5d5e50",light:"#b8b8b850",hcDark:null,hcLight:null},m("toolbarHoverBackground","Toolbar background when hovering over actions using the mouse"));F("toolbar.hoverOutline",{dark:null,light:null,hcDark:$i,hcLight:$i},m("toolbarHoverOutline","Toolbar outline when hovering over actions using the mouse"));F("toolbar.activeBackground",{dark:rc(hO,.1),light:Ym(hO,.1),hcDark:null,hcLight:null},m("toolbarActiveBackground","Toolbar background when holding the mouse over actions"));F("editor.snippetTabstopHighlightBackground",{dark:new ee(new jt(124,124,124,.3)),light:new ee(new jt(10,50,100,.2)),hcDark:new ee(new jt(124,124,124,.3)),hcLight:new ee(new jt(10,50,100,.2))},m("snippetTabstopHighlightBackground","Highlight background color of a snippet tabstop."));F("editor.snippetTabstopHighlightBorder",{dark:null,light:null,hcDark:null,hcLight:null},m("snippetTabstopHighlightBorder","Highlight border color of a snippet tabstop."));F("editor.snippetFinalTabstopHighlightBackground",{dark:null,light:null,hcDark:null,hcLight:null},m("snippetFinalTabstopHighlightBackground","Highlight background color of the final tabstop of a snippet."));F("editor.snippetFinalTabstopHighlightBorder",{dark:"#525252",light:new ee(new jt(10,50,100,.5)),hcDark:"#525252",hcLight:"#292929"},m("snippetFinalTabstopHighlightBorder","Highlight border color of the final tabstop of a snippet."));const Tye=F("breadcrumb.foreground",{light:nt(Te,.8),dark:nt(Te,.8),hcDark:nt(Te,.8),hcLight:nt(Te,.8)},m("breadcrumbsFocusForeground","Color of focused breadcrumb items.")),xye=F("breadcrumb.background",{light:is,dark:is,hcDark:is,hcLight:is},m("breadcrumbsBackground","Background color of breadcrumb items.")),i$=F("breadcrumb.focusForeground",{light:Ym(Te,.2),dark:rc(Te,.1),hcDark:rc(Te,.1),hcLight:rc(Te,.1)},m("breadcrumbsFocusForeground","Color of focused breadcrumb items.")),Nye=F("breadcrumb.activeSelectionForeground",{light:Ym(Te,.2),dark:rc(Te,.1),hcDark:rc(Te,.1),hcLight:rc(Te,.1)},m("breadcrumbsSelectedForeground","Color of selected breadcrumb items."));F("breadcrumbPicker.background",{light:un,dark:un,hcDark:un,hcLight:un},m("breadcrumbsSelectedBackground","Background color of breadcrumb item picker."));const qQ=.5,n$=ee.fromHex("#40C8AE").transparent(qQ),s$=ee.fromHex("#40A6FF").transparent(qQ),o$=ee.fromHex("#606060").transparent(.4),tl=.4,Tb=1,lv=F("merge.currentHeaderBackground",{dark:n$,light:n$,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);F("merge.currentContentBackground",{dark:nt(lv,tl),light:nt(lv,tl),hcDark:nt(lv,tl),hcLight:nt(lv,tl)},m("mergeCurrentContentBackground","Current content background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);const cv=F("merge.incomingHeaderBackground",{dark:s$,light:s$,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);F("merge.incomingContentBackground",{dark:nt(cv,tl),light:nt(cv,tl),hcDark:nt(cv,tl),hcLight:nt(cv,tl)},m("mergeIncomingContentBackground","Incoming content background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);const dv=F("merge.commonHeaderBackground",{dark:o$,light:o$,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);F("merge.commonContentBackground",{dark:nt(dv,tl),light:nt(dv,tl),hcDark:nt(dv,tl),hcLight:nt(dv,tl)},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 xb=F("merge.border",{dark:null,light:null,hcDark:"#C3DF6F",hcLight:"#007ACC"},m("mergeBorder","Border color on headers and the splitter in inline merge-conflicts."));F("editorOverviewRuler.currentContentForeground",{dark:nt(lv,Tb),light:nt(lv,Tb),hcDark:xb,hcLight:xb},m("overviewRulerCurrentContentForeground","Current overview ruler foreground for inline merge-conflicts."));F("editorOverviewRuler.incomingContentForeground",{dark:nt(cv,Tb),light:nt(cv,Tb),hcDark:xb,hcLight:xb},m("overviewRulerIncomingContentForeground","Incoming overview ruler foreground for inline merge-conflicts."));F("editorOverviewRuler.commonContentForeground",{dark:nt(dv,Tb),light:nt(dv,Tb),hcDark:xb,hcLight:xb},m("overviewRulerCommonContentForeground","Common ancestor overview ruler foreground for inline merge-conflicts."));const n9=F("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),j1=F("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),uv=F("minimap.findMatchHighlight",{light:"#d18616",dark:"#d18616",hcDark:"#AB5A00",hcLight:"#0F4A85"},m("minimapFindMatchHighlight","Minimap marker color for find matches."),!0),bx=F("minimap.selectionOccurrenceHighlight",{light:"#c9c9c9",dark:"#676767",hcDark:"#ffffff",hcLight:"#0F4A85"},m("minimapSelectionOccurrenceHighlight","Minimap marker color for repeating editor selections."),!0),r$=F("minimap.selectionHighlight",{light:"#ADD6FF",dark:"#264F78",hcDark:"#ffffff",hcLight:"#0F4A85"},m("minimapSelectionHighlight","Minimap marker color for the editor selection."),!0),Aye=F("minimap.infoHighlight",{dark:Xo,light:Xo,hcDark:Rw,hcLight:Rw},m("minimapInfo","Minimap marker color for infos.")),Mye=F("minimap.warningHighlight",{dark:Ur,light:Ur,hcDark:Mw,hcLight:Mw},m("overviewRuleWarning","Minimap marker color for warnings.")),Rye=F("minimap.errorHighlight",{dark:new ee(new jt(255,18,18,.7)),light:new ee(new jt(255,18,18,.7)),hcDark:new ee(new jt(255,50,50,1)),hcLight:"#B5200D"},m("minimapError","Minimap marker color for errors.")),Pye=F("minimap.background",{dark:null,light:null,hcDark:null,hcLight:null},m("minimapBackground","Minimap background color.")),Oye=F("minimap.foregroundOpacity",{dark:ee.fromHex("#000f"),light:ee.fromHex("#000f"),hcDark:ee.fromHex("#000f"),hcLight:ee.fromHex("#000f")},m("minimapForegroundOpacity",'Opacity of foreground elements rendered in the minimap. For example, "#000000c0" will render the elements with 75% opacity.'));F("minimapSlider.background",{light:nt(V1,.5),dark:nt(V1,.5),hcDark:nt(V1,.5),hcLight:nt(V1,.5)},m("minimapSliderBackground","Minimap slider background color."));F("minimapSlider.hoverBackground",{light:nt(H1,.5),dark:nt(H1,.5),hcDark:nt(H1,.5),hcLight:nt(H1,.5)},m("minimapSliderHoverBackground","Minimap slider background color when hovering."));F("minimapSlider.activeBackground",{light:nt($1,.5),dark:nt($1,.5),hcDark:nt($1,.5),hcLight:nt($1,.5)},m("minimapSliderActiveBackground","Minimap slider background color when clicked on."));const Fye=F("problemsErrorIcon.foreground",{dark:od,light:od,hcDark:od,hcLight:od},m("problemsErrorIconForeground","The color used for the problems error icon.")),Bye=F("problemsWarningIcon.foreground",{dark:Ur,light:Ur,hcDark:Ur,hcLight:Ur},m("problemsWarningIconForeground","The color used for the problems warning icon.")),Wye=F("problemsInfoIcon.foreground",{dark:Xo,light:Xo,hcDark:Xo,hcLight:Xo},m("problemsInfoIconForeground","The color used for the problems info icon."));F("charts.foreground",{dark:Te,light:Te,hcDark:Te,hcLight:Te},m("chartsForeground","The foreground color used in charts."));F("charts.lines",{dark:nt(Te,.5),light:nt(Te,.5),hcDark:nt(Te,.5),hcLight:nt(Te,.5)},m("chartsLines","The color used for horizontal lines in charts."));F("charts.red",{dark:od,light:od,hcDark:od,hcLight:od},m("chartsRed","The red color used in chart visualizations."));F("charts.blue",{dark:Xo,light:Xo,hcDark:Xo,hcLight:Xo},m("chartsBlue","The blue color used in chart visualizations."));F("charts.yellow",{dark:Ur,light:Ur,hcDark:Ur,hcLight:Ur},m("chartsYellow","The yellow color used in chart visualizations."));F("charts.orange",{dark:uv,light:uv,hcDark:uv,hcLight:uv},m("chartsOrange","The orange color used in chart visualizations."));F("charts.green",{dark:"#89D185",light:"#388A34",hcDark:"#89D185",hcLight:"#374e06"},m("chartsGreen","The green color used in chart visualizations."));F("charts.purple",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},m("chartsPurple","The purple color used in chart visualizations."));function Vye(n,e){var t,i,s,o;switch(n.op){case 0:return(t=Nl(n.value,e))===null||t===void 0?void 0:t.darken(n.factor);case 1:return(i=Nl(n.value,e))===null||i===void 0?void 0:i.lighten(n.factor);case 2:return(s=Nl(n.value,e))===null||s===void 0?void 0:s.transparent(n.factor);case 3:{const r=Nl(n.background,e);return r?(o=Nl(n.value,e))===null||o===void 0?void 0:o.makeOpaque(r):Nl(n.value,e)}case 4:for(const r of n.values){const a=Nl(r,e);if(a)return a}return;case 6:return Nl(e.defines(n.if)?n.then:n.else,e);case 5:{const r=Nl(n.value,e);if(!r)return;const a=Nl(n.background,e);return a?r.isDarkerThan(a)?ee.getLighterColor(r,a,n.factor).transparent(n.transparency):ee.getDarkerColor(r,a,n.factor).transparent(n.transparency):r.transparent(n.factor*n.transparency)}default:throw ix()}}function Ym(n,e){return{op:0,value:n,factor:e}}function rc(n,e){return{op:1,value:n,factor:e}}function nt(n,e){return{op:2,value:n,factor:e}}function Pw(...n){return{op:4,values:n}}function Hye(n,e,t){return{op:6,if:n,then:e,else:t}}function a$(n,e,t,i){return{op:5,value:n,background:e,factor:t,transparency:i}}function Nl(n,e){if(n!==null){if(typeof n=="string")return n[0]==="#"?ee.fromHex(n):e.getColor(n);if(n instanceof ee)return n;if(typeof n=="object")return Vye(n,e)}}const GQ="vscode://schemas/workbench-colors",YQ=en.as(fx.JSONContribution);YQ.registerSchema(GQ,vx.getColorSchema());const l$=new Si(()=>YQ.notifySchemaChanged(GQ),200);vx.onDidChangeSchema(()=>{l$.isScheduled()||l$.schedule()});class Cx{constructor(e,t){this.x=e,this.y=t,this._pageCoordinatesBrand=void 0}toClientCoordinates(){return new ZQ(this.x-window.scrollX,this.y-window.scrollY)}}class ZQ{constructor(e,t){this.clientX=e,this.clientY=t,this._clientCoordinatesBrand=void 0}toPageCoordinates(){return new Cx(this.clientX+window.scrollX,this.clientY+window.scrollY)}}class $ye{constructor(e,t,i,s){this.x=e,this.y=t,this.width=i,this.height=s,this._editorPagePositionBrand=void 0}}class zye{constructor(e,t){this.x=e,this.y=t,this._positionRelativeToEditorBrand=void 0}}function s9(n){const e=Un(n);return new $ye(e.left,e.top,e.width,e.height)}function o9(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 zye(o,r)}class Zf extends ba{constructor(e,t,i){super(e),this._editorMouseEventBrand=void 0,this.isFromPointerCapture=t,this.pos=new Cx(this.posx,this.posy),this.editorPos=s9(i),this.relativePos=o9(i,this.editorPos,this.pos)}}class Uye{constructor(e){this._editorViewDomNode=e}_create(e){return new Zf(e,!1,this._editorViewDomNode)}onContextMenu(e,t){return ce(e,"contextmenu",i=>{t(this._create(i))})}onMouseUp(e,t){return ce(e,"mouseup",i=>{t(this._create(i))})}onMouseDown(e,t){return ce(e,Pe.MOUSE_DOWN,i=>{t(this._create(i))})}onPointerDown(e,t){return ce(e,Pe.POINTER_DOWN,i=>{t(this._create(i),i.pointerId)})}onMouseLeave(e,t){return ce(e,Pe.MOUSE_LEAVE,i=>{t(this._create(i))})}onMouseMove(e,t){return ce(e,"mousemove",i=>t(this._create(i)))}}class jye{constructor(e){this._editorViewDomNode=e}_create(e){return new Zf(e,!1,this._editorViewDomNode)}onPointerUp(e,t){return ce(e,"pointerup",i=>{t(this._create(i))})}onPointerDown(e,t){return ce(e,Pe.POINTER_DOWN,i=>{t(this._create(i),i.pointerId)})}onPointerLeave(e,t){return ce(e,Pe.POINTER_LEAVE,i=>{t(this._create(i))})}onPointerMove(e,t){return ce(e,"pointermove",i=>t(this._create(i)))}}class Kye extends te{constructor(e){super(),this._editorViewDomNode=e,this._globalPointerMoveMonitor=this._register(new I0),this._keydownListener=null}startMonitoring(e,t,i,s,o){this._keydownListener=In(e.ownerDocument,"keydown",r=>{r.toKeyCodeChord().isModifierKey()||this._globalPointerMoveMonitor.stopMonitoring(!0,r.browserEvent)},!0),this._globalPointerMoveMonitor.startMonitoring(e,t,i,r=>{s(new Zf(r,!0,this._editorViewDomNode))},r=>{this._keydownListener.dispose(),o(r)})}stopMonitoring(){this._globalPointerMoveMonitor.stopMonitoring(!0)}}class mS{constructor(e){this._editor=e,this._instanceId=++mS._idPool,this._counter=0,this._rules=new Map,this._garbageCollectionScheduler=new Si(()=>this.garbageCollect(),1e3)}createClassNameRef(e){const t=this.getOrCreateRule(e);return t.increaseRefCount(),{className:t.className,dispose:()=>{t.decreaseRefCount(),this._garbageCollectionScheduler.schedule()}}}getOrCreateRule(e){const t=this.computeUniqueKey(e);let i=this._rules.get(t);if(!i){const s=this._counter++;i=new qye(t,"dyn-rule-".concat(this._instanceId,"-").concat(s),CE(this._editor.getContainerDomNode())?this._editor.getContainerDomNode():void 0,e),this._rules.set(t,i)}return i}computeUniqueKey(e){return JSON.stringify(e)}garbageCollect(){for(const e of this._rules.values())e.hasReferences()||(this._rules.delete(e.key),e.dispose())}}mS._idPool=0;class qye{constructor(e,t,i,s){this.key=e,this.className=t,this.properties=s,this._referenceCount=0,this._styleElement=Na(i),this._styleElement.textContent=this.getCssText(this.className,this.properties)}getCssText(e,t){let i=".".concat(e," {");for(const s in t){const o=t[s];let r;typeof o=="object"?r=He(o.id):r=o;const a=Gye(s);i+="\n ".concat(a,": ").concat(r,";")}return i+="\n}",i}dispose(){this._styleElement.remove()}increaseRefCount(){this._referenceCount++}decreaseRefCount(){this._referenceCount--}hasReferences(){return this._referenceCount>0}}function Gye(n){return n.replace(/(^[A-Z])/,([e])=>e.toLowerCase()).replace(/([A-Z])/g,([e])=>"-".concat(e.toLowerCase()))}class _S extends te{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 Ca;(function(n){n.DARK="dark",n.LIGHT="light",n.HIGH_CONTRAST_DARK="hcDark",n.HIGH_CONTRAST_LIGHT="hcLight"})(Ca||(Ca={}));function ac(n){return n===Ca.HIGH_CONTRAST_DARK||n===Ca.HIGH_CONTRAST_LIGHT}function Nb(n){return n===Ca.DARK||n===Ca.HIGH_CONTRAST_DARK}const Jye=function(){return nc?!0:!(Co||Ta||qu)}();let jv=!0;class d${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 Gc{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=ci(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 ac(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=br.filter(o.inlineDecorations,e,o.minColumn,o.maxColumn);let l=null;if(ac(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=gS(c,s);s.appendString("");let u=null;return jv&&Jye&&o.isBasicASCII&&r.useMonospaceOptimizations&&d.containsForeignElements===0&&(u=new kL(this._renderedViewLine?this._renderedViewLine.domNode:null,c,d.characterMapping)),u||(u=QQ(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 kL:!1}monospaceAssumptionsAreValid(){return this._renderedViewLine&&this._renderedViewLine instanceof kL?this._renderedViewLine.monospaceAssumptionsAreValid():jv}onMonospaceAssumptionsInvalidated(){this._renderedViewLine&&this._renderedViewLine instanceof kL&&(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 c$(!0,[new Up(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 c$(!1,r):null}getColumnOfNodeOffset(e,t){return this._renderedViewLine?this._renderedViewLine.getColumnOfNodeOffset(e,t):1}}Gc.CLASS_NAME="view-line";class kL{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!"),jv=!1)}return jv}toSlowRenderedLine(){return QQ(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 Up(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=gD.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 r9(this._characterMapping,e,t)}}class XQ{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 Up(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 Up(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=gD.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=gD.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 Up(0,this.getWidth(s))];const o=this._characterMapping.getDomPosition(t),r=this._characterMapping.getDomPosition(i);return gD.readHorizontalRanges(this._getReadingTarget(e),o.partIndex,o.charIndex,r.partIndex,r.charIndex,s)}getColumnOfNodeOffset(e,t){return r9(this._characterMapping,e,t)}}class eSe extends XQ{_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 Ab{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 Ab.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 Y(i.afterLineNumber+1,1)),i.afterLineNumber>0&&(r=new Y(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,Ms._getMouseColumn(this.mouseContentHorizontalOffset,e.typicalHalfwidthCharacterWidth))}}class a9 extends sSe{constructor(e,t,i,s,o){super(e,t,i,s),this._ctx=e,o?(this.target=o,this.targetPath=Dd.collect(o,e.viewDomNode)):(this.target=null,this.targetPath=new Uint8Array(0))}toString(){return"pos(".concat(this.pos.x,",").concat(this.pos.y,"), editorPos(").concat(this.editorPos.x,",").concat(this.editorPos.y,"), relativePos(").concat(this.relativePos.x,",").concat(this.relativePos.y,"), mouseVerticalOffset: ").concat(this.mouseVerticalOffset,", mouseContentHorizontalOffset: ").concat(this.mouseContentHorizontalOffset,"\n target: ").concat(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 Tr.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(!Tr.isChildOfViewLines(t.targetPath))return null;if(e.isInTopPadding(t.mouseVerticalOffset))return t.fulfillContentEmpty(new Y(1,1),u$);if(e.isAfterLines(t.mouseVerticalOffset)||e.isInBottomPadding(t.mouseVerticalOffset)){const o=e.viewModel.getLineCount(),r=e.viewModel.getLineMaxColumn(o);return t.fulfillContentEmpty(new Y(o,r),u$)}if(i){if(Tr.isStrictChildOfViewLines(t.targetPath)){const o=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset);if(e.viewModel.getLineLength(o)===0){const a=e.getLineWidth(o),l=yM(t.mouseContentHorizontalOffset-a);return t.fulfillContentEmpty(new Y(o,1),l)}const r=e.getLineWidth(o);if(t.mouseContentHorizontalOffset>=r){const a=yM(t.mouseContentHorizontalOffset-r),l=new Y(o,e.viewModel.getLineMaxColumn(o));return t.fulfillContentEmpty(l,a)}}return t.fulfillUnknown()}const s=Ms._doHitTest(e,t);return s.type===1?Ms.createMouseTargetFromHitTestPosition(e,t,s.spanNode,s.position,s.injectedText):this._createMouseTarget(e,t.withTarget(s.hitTarget),!0)}static _hitTestMinimap(e,t){if(Tr.isChildOfMinimap(t.targetPath)){const i=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),s=e.viewModel.getLineMaxColumn(i);return t.fulfillScrollbar(new Y(i,s))}return null}static _hitTestScrollbarSlider(e,t){if(Tr.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 Y(s,o))}}return null}static _hitTestScrollbar(e,t){if(Tr.isChildOfScrollableElement(t.targetPath)){const i=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),s=e.viewModel.getLineMaxColumn(i);return t.fulfillScrollbar(new Y(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 Ms._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=yM(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 Cx(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=cm(e.viewDomNode);let s;if(i?typeof i.caretRangeFromPoint>"u"?s=oSe(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 Th;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)===Gc.CLASS_NAME?_p.createFromDOMInfo(e,r,s.startOffset):new Th(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)===Gc.CLASS_NAME?_p.createFromDOMInfo(e,o,o.textContent.length):new Th(o)}return new Th}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)===Gc.CLASS_NAME?_p.createFromDOMInfo(e,i.offsetNode.parentNode,i.offset):new Th(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===Gc.CLASS_NAME){const l=i.offsetNode.childNodes[Math.min(i.offset,i.offsetNode.childNodes.length-1)];if(l)return _p.createFromDOMInfo(e,l,0)}else if(a===Gc.CLASS_NAME)return _p.createFromDOMInfo(e,i.offsetNode,0)}return new Th(i.offsetNode)}static _snapToSoftTabBoundary(e,t){const i=t.getLineContent(e.lineNumber),{tabSize:s}=t.model.getOptions(),o=Ow.atomicPosition(i,e.column-1,s,2);return o!==-1?new Y(e.lineNumber,o+1):e}static _doHitTest(e,t){let i=new Th;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 JQ(o,i.spanNode,s))}return i}}function oSe(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="".concat(r," ").concat(a," ").concat(l," ").concat(c,"/").concat(d," ").concat(u),f=s.innerText;let g=o.left,p=0,_;if(e>o.left+o.width)p=f.length;else{const v=Np.getInstance();for(let b=0;bt(new ba(i))))}onmousedown(e,t){this._register(ce(e,Pe.MOUSE_DOWN,i=>t(new ba(i))))}onmouseover(e,t){this._register(ce(e,Pe.MOUSE_OVER,i=>t(new ba(i))))}onmouseleave(e,t){this._register(ce(e,Pe.MOUSE_LEAVE,i=>t(new ba(i))))}onkeydown(e,t){this._register(ce(e,Pe.KEY_DOWN,i=>t(new Oi(i))))}onkeyup(e,t){this._register(ce(e,Pe.KEY_UP,i=>t(new Oi(i))))}oninput(e,t){this._register(ce(e,Pe.INPUT,t))}onblur(e,t){this._register(ce(e,Pe.BLUR,t))}onfocus(e,t){this._register(ce(e,Pe.FOCUS,t))}ignoreGesture(e){return Ii.ignoreTarget(e)}};const Mb=11;class rSe extends vl{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(...dt.asClassNameArray(e.icon)),this.domNode.style.position="absolute",this.domNode.style.width=Mb+"px",this.domNode.style.height=Mb+"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 I0),this._register(In(this.bgDomNode,Pe.POINTER_DOWN,t=>this._arrowPointerDown(t))),this._register(In(this.domNode,Pe.POINTER_DOWN,t=>this._arrowPointerDown(t))),this._pointerdownRepeatTimer=this._register(new uS),this._pointerdownScheduleRepeatTimer=this._register(new _l)}_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 aSe extends te{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 _l)}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 lSe=140;class eJ extends vl{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 aSe(e.visibility,"visible scrollbar "+e.extraScrollbarClassName,"invisible scrollbar "+e.extraScrollbarClassName)),this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._pointerMoveMonitor=this._register(new I0),this._shouldRender=!0,this.domNode=ci(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(ce(this.domNode.domNode,Pe.POINTER_DOWN,t=>this._domNodePointerDown(t)))}_createArrow(e){const t=this._register(new rSe(e));this.domNode.domNode.appendChild(t.bgDomNode),this.domNode.domNode.appendChild(t.domNode)}_createSlider(e,t,i,s){this.slider=ci(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(ce(this.slider.domNode,Pe.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=Un(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(zs&&a>lSe){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 cSe=20;class Rb{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 Rb(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(cSe,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=Rb._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 lm(null,1,0))}),this._createArrow({className:"scra",icon:Me.scrollbarButtonRight,top:a,left:void 0,bottom:void 0,right:r,bgWidth:t.arrowSize,bgHeight:t.horizontalScrollbarSize,onActivate:()=>this._host.onMouseWheel(new lm(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 uSe extends eJ{constructor(e,t,i){const s=e.getScrollDimensions(),o=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:i,scrollbarState:new Rb(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-Mb)/2,a=(t.verticalScrollbarSize-Mb)/2;this._createArrow({className:"scra",icon:Me.scrollbarButtonUp,top:r,left:a,bottom:void 0,right:void 0,bgWidth:t.verticalScrollbarSize,bgHeight:t.arrowSize,onActivate:()=>this._host.onMouseWheel(new lm(null,0,1))}),this._createArrow({className:"scra",icon:Me.scrollbarButtonDown,top:void 0,left:a,bottom:r,right:void 0,bgWidth:t.verticalScrollbarSize,bgHeight:t.arrowSize,onActivate:()=>this._host.onMouseWheel(new lm(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 RE{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 RE(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 RE(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 vS extends te{constructor(e){super(),this._scrollableBrand=void 0,this._onScroll=this._register(new j),this.onScroll=this._onScroll.event,this._smoothScrollDuration=e.smoothScrollDuration,this._scheduleAtNextAnimationFrame=e.scheduleAtNextAnimationFrame,this._state=new RE(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 Fw(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=Fw.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 h${constructor(e,t,i){this.scrollLeft=e,this.scrollTop=t,this.isDone=i}}function SM(n,e){const t=e-n;return function(i){return n+t*gSe(i)}}function hSe(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}}PE.INSTANCE=new PE;class l9 extends vl{get options(){return this._options}constructor(e,t,i){super(),this._onScroll=this._register(new j),this.onScroll=this._onScroll.event,this._onWillScroll=this._register(new j),e.style.overflow="hidden",this._options=_Se(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 uSe(this._scrollable,this._options,s)),this._horizontalScrollbar=this._register(new dSe(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=ci(document.createElement("div")),this._leftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._leftShadowDomNode.domNode),this._topShadowDomNode=ci(document.createElement("div")),this._topShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topShadowDomNode.domNode),this._topLeftShadowDomNode=ci(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 _l),this._isDragging=!1,this._mouseIsOver=!1,this._shouldRender=!0,this._revealOnScroll=!0}dispose(){this._mouseWheelToDispose=fi(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,Kt&&(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 lm(e))}_setListeningToMouseWheel(e){if(this._mouseWheelToDispose.length>0!==e&&(this._mouseWheelToDispose=fi(this._mouseWheelToDispose),e)){const i=s=>{this._onMouseWheel(new lm(s))};this._mouseWheelToDispose.push(ce(this._listenOnDomNode,Pe.MOUSE_WHEEL,i,{passive:!1}))}}_onMouseWheel(e){var t;if(!((t=e.browserEvent)===null||t===void 0)&&t.defaultPrevented)return;const i=PE.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=!Kt&&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=f$*r,h=c.scrollTop-(u<0?Math.floor(u):Math.ceil(u));this._verticalScrollbar.writeScrollPosition(d,h)}if(a){const u=f$*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".concat(s)),this._topShadowDomNode.setClassName("shadow".concat(o)),this._topLeftShadowDomNode.setClassName("shadow".concat(r).concat(o).concat(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(),pSe)}}class tJ extends l9{constructor(e,t){t=t||{},t.mouseWheelSmoothScroll=!1;const i=new vS({forceIntegerValues:!0,smoothScrollDuration:0,scheduleAtNextAnimationFrame:s=>xa(s)});super(e,t,i),this._register(i)}setScrollPosition(e){this._scrollable.setScrollPositionNow(e)}}class c9 extends l9{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 bS extends l9{constructor(e,t){t=t||{},t.mouseWheelSmoothScroll=!1;const i=new vS({forceIntegerValues:!1,smoothScrollDuration:0,scheduleAtNextAnimationFrame:s=>xa(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 _Se(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,Kt&&(e.className+=" mac"),e}class d9 extends _S{constructor(e,t,i){super(),this._mouseLeaveMonitor=null,this._context=e,this.viewController=t,this.viewHelper=i,this.mouseTargetFactory=new Ms(this._context,i),this._mouseDownOperation=this._register(new vSe(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 Uye(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=ce(this.viewHelper.viewDomNode.ownerDocument,"mousemove",a=>{this.viewHelper.viewDomNode.contains(a.target)||this._onMouseLeave(new Zf(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(ce(this.viewHelper.viewDomNode,Pe.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=PE.INSTANCE;let t=0,i=ma.getZoomLevel(),s=!1,o=0;const r=l=>{if(this.viewController.emitMouseWheel(l),!this._context.configuration.options.get(75))return;const c=new lm(l);if(e.acceptStandardWheelEvent(c),e.isPhysicalMouseWheel()){if(a(l)){const d=ma.getZoomLevel(),u=c.deltaY>0?1:-1;ma.setZoomLevel(d+u),c.preventDefault(),c.stopPropagation()}}else Date.now()-t>50&&(i=ma.getZoomLevel(),s=a(l),o=0),t=Date.now(),o+=c.deltaY,s&&(ma.setZoomLevel(i+o/5),c.preventDefault(),c.stopPropagation())};this._register(ce(this.viewHelper.viewDomNode,Pe.MOUSE_WHEEL,r,{capture:!0,passive:!1}));function a(l){return Kt?(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 ZQ(e,t).toPageCoordinates(),o=s9(this.viewHelper.viewDomNode);if(s.yo.y+o.height||s.xo.x+o.width)return null;const r=o9(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=cm(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 vSe extends te{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 Kye(this._viewHelper.viewDomNode)),this._topBottomDragScrolling=this._register(new bSe(this._context,this._viewHelper,this._mouseTargetFactory,(a,l,c)=>this._dispatchMouse(a,l,c))),this._mouseState=new yx,this._currentSelection=new Je(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=Ab.getZoneAtCoord(this._context,l);if(c){const u=this._helpPositionJumpOverViewZone(c);if(u)return po.createOutsideEditor(o,u,"below",a)}const d=s.getLineNumberAtVerticalOffset(l);return po.createOutsideEditor(o,new Y(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 po.createOutsideEditor(o,new Y(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 po.createViewZone(s.type,s.element,s.mouseColumn,r,s.detail)}return s}_helpPositionJumpOverViewZone(e){const t=new Y(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 bSe extends te{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 CSe(this._context,this._viewHelper,this._mouseTargetFactory,this._dispatchMouse,e,t)}stop(){this._operation&&(this._operation.dispose(),this._operation=null)}}class CSe extends te{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=xa(()=>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=s9(this._viewHelper.viewDomNode),d=this._context.configuration.options.get(143).horizontalScrollbarHeight,u=new Cx(this._mouseEvent.pos.x,c.y+c.height-d-.1),h=o9(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=po.createOutsideEditor(this._position.mouseColumn,new Y(a,1),"above",this._position.outsideDistance):l=po.createOutsideEditor(this._position.mouseColumn,new Y(a,this._context.viewModel.getLineMaxColumn(a)),"below",this._position.outsideDistance)),this._dispatchMouse(l,!0,2),this._animationFrameDisposable=xa(()=>this._execute())}}class yx{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>yx.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)}}yx.CLEAR_MOUSE_DOWN_COUNT_TIME=400;class Vt{get event(){return this.emitter.event}constructor(e,t,i){const s=o=>this.emitter.fire(o);this.emitter=new j({onWillAddFirstListener:()=>e.addEventListener(t,s,i),onDidRemoveLastListener:()=>e.removeEventListener(t,s,i)})}dispose(){this.emitter.dispose()}}var nf;(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++,C())}function b(S,k){const D=performance.getEntriesByName(S)[0].duration;k.total+=D,k.min=Math.min(k.min,D),k.max=Math.max(k.max,D)}function C(){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 w(){if(o===0)return;const S={keydown:y(e),input:y(t),render:y(i),total:y(s),sampleCount:o};return L(e),L(t),L(i),L(s),o=0,S}n.getAndClearMeasurements=w;function y(S){return{average:S.total/o,max:S.max,min:S.min}}function L(S){S.total=0,S.min=Number.MAX_VALUE,S.max=0}})(nf||(nf={}));class _s{constructor(e,t,i,s,o){this.value=e,this.selectionStart=t,this.selectionEnd=i,this.selection=s,this.newlineCountBeforeSelection=o}toString(){return"[ <".concat(this.value,">, selectionStart: ").concat(this.selectionStart,", selectionEnd: ").concat(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 _s(i,s,o,null,r)}collapseSelection(){return this.selectionStart===this.value.length?this:new _s(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("\n",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(om(e.value,t.value),e.selectionStart,t.selectionStart),o=Math.min(mE(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(om(e.value,t.value),e.selectionEnd),s=Math.min(mE(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}}}_s.EMPTY=new _s("",0,0,null,void 0);class hv{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 I(s,1,o+1,1)}static fromEditorSelection(e,t,i,s){const r=hv._getPageOfLine(t.startLineNumber,i),a=hv._getRangeForPage(r,i),l=hv._getPageOfLine(t.endLineNumber,i),c=hv._getRangeForPage(l,i);let d=a.intersectRanges(new I(1,1,t.startLineNumber,t.startColumn));if(s&&e.getValueLengthInRange(d,1)>500){const v=e.modifyPosition(d.getEndPosition(),-500);d=I.fromPositions(v,d.getEndPosition())}const u=e.getValueInRange(d,1),h=e.getLineCount(),f=e.getLineMaxColumn(h);let g=c.intersectRanges(new I(t.endLineNumber,t.endColumn,h,f));if(s&&e.getValueLengthInRange(g,1)>500){const v=e.modifyPosition(g.getStartPosition(),500);g=I.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 _s(u+_+p,u.length,u.length+_.length,t,d.endLineNumber-d.startLineNumber)}}var OE;(function(n){n.Tap="-monaco-textarea-synthetic-tap"})(OE||(OE={}));const fO={forceCopyWithSyntaxHighlighting:!1};class Bw{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)}}Bw.INSTANCE=new Bw;class wSe{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 ySe extends te{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 j),this.onFocus=this._onFocus.event,this._onBlur=this._register(new j),this.onBlur=this._onBlur.event,this._onKeyDown=this._register(new j),this.onKeyDown=this._onKeyDown.event,this._onKeyUp=this._register(new j),this.onKeyUp=this._onKeyUp.event,this._onCut=this._register(new j),this.onCut=this._onCut.event,this._onPaste=this._register(new j),this.onPaste=this._onPaste.event,this._onType=this._register(new j),this.onType=this._onType.event,this._onCompositionStart=this._register(new j),this.onCompositionStart=this._onCompositionStart.event,this._onCompositionUpdate=this._register(new j),this.onCompositionUpdate=this._onCompositionUpdate.event,this._onCompositionEnd=this._register(new j),this.onCompositionEnd=this._onCompositionEnd.event,this._onSelectionChangeRequest=this._register(new j),this.onSelectionChangeRequest=this._onSelectionChangeRequest.event,this._asyncTriggerCut=this._register(new Si(()=>this._onCut.fire(),0)),this._asyncFocusGainWriteScreenReaderContent=this._register(new Si(()=>this.writeScreenReaderContent("asyncFocusGain"),0)),this._textAreaState=_s.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 Oi(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 Oi(r);this._onKeyUp.fire(a)})),this._register(this._textArea.onCompositionStart(r=>{const a=new wSe;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=_s.readFromTextArea(this._textArea,this._textAreaState),d=_s.deduceAndroidCompositionInput(this._textAreaState,c);this._textAreaState=c,this._onType.fire(d),this._onCompositionUpdate.fire(r);return}const l=a.handleCompositionUpdate(r.data);this._textAreaState=_s.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=_s.readFromTextArea(this._textArea,this._textAreaState),d=_s.deduceAndroidCompositionInput(this._textAreaState,c);this._textAreaState=c,this._onType.fire(d),this._onCompositionEnd.fire();return}const l=a.handleCompositionUpdate(r.data);this._textAreaState=_s.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=_s.readFromTextArea(this._textArea,this._textAreaState),l=_s.deduceInput(this._textAreaState,a,this._OS===2);l.replacePrevCharCnt===0&&l.text.length===1&&(es(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]=gO.getTextData(r.clipboardData);a&&(l=l||Bw.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 ce(this._textArea.ownerDocument,"selectionchange",t=>{if(nf.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 Je(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};Bw.INSTANCE.set(this._browser.isFirefox?t.text.replace(/\r\n/g,"\n"):t.text,i),e.preventDefault(),e.clipboardData&&gO.setTextData(e.clipboardData,t.text,t.html,i)}}const gO={getTextData(n){const e=n.getData(wn.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("\n"),null]:[e,t]},setTextData(n,e,t,i){n.setData(wn.text,e),typeof t=="string"&&n.setData("text/html",t),n.setData("vscode-editor-data",JSON.stringify(i))}};class SSe extends te{get ownerDocument(){return this._actual.ownerDocument}constructor(e){super(),this._actual=e,this.onKeyDown=this._register(new Vt(this._actual,"keydown")).event,this.onKeyUp=this._register(new Vt(this._actual,"keyup")).event,this.onCompositionStart=this._register(new Vt(this._actual,"compositionstart")).event,this.onCompositionUpdate=this._register(new Vt(this._actual,"compositionupdate")).event,this.onCompositionEnd=this._register(new Vt(this._actual,"compositionend")).event,this.onBeforeInput=this._register(new Vt(this._actual,"beforeinput")).event,this.onInput=this._register(new Vt(this._actual,"input")).event,this.onCut=this._register(new Vt(this._actual,"cut")).event,this.onCopy=this._register(new Vt(this._actual,"copy")).event,this.onPaste=this._register(new Vt(this._actual,"paste")).event,this.onFocus=this._register(new Vt(this._actual,"focus")).event,this.onBlur=this._register(new Vt(this._actual,"blur")).event,this._onSyntheticTap=this._register(new j),this.onSyntheticTap=this._onSyntheticTap.event,this._ignoreSelectionChangeTime=0,this._register(this.onKeyDown(()=>nf.onKeyDown())),this._register(this.onBeforeInput(()=>nf.onBeforeInput())),this._register(this.onInput(()=>nf.onInput())),this._register(this.onKeyUp(()=>nf.onKeyUp())),this._register(ce(this._actual,OE.Tap,()=>this._onSyntheticTap.fire()))}hasFocus(){const e=cm(this._actual);return e?e.activeElement===this._actual:O8(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=cm(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){Ta&&window.parent!==window&&s.focus();return}if(a){this.setIgnoreSelectionChangeTime("setSelectionRange"),s.setSelectionRange(t,i),Ta&&window.parent!==window&&s.focus();return}try{const d=i0e(s);this.setIgnoreSelectionChangeTime("setSelectionRange"),s.focus(),s.setSelectionRange(t,i),n0e(s,d)}catch{}}}class LSe extends d9{constructor(e,t,i){super(e,t,i),this._register(Ii.addTarget(this.viewHelper.linesContentDomNode)),this._register(ce(this.viewHelper.linesContentDomNode,Ti.Tap,o=>this.onTap(o))),this._register(ce(this.viewHelper.linesContentDomNode,Ti.Change,o=>this.onChange(o))),this._register(ce(this.viewHelper.linesContentDomNode,Ti.Contextmenu,o=>this._onContextMenu(new Zf(o,!1,this.viewHelper.viewDomNode),!1))),this._lastPointerType="mouse",this._register(ce(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 jye(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 Zf(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 kSe extends d9{constructor(e,t,i){super(e,t,i),this._register(Ii.addTarget(this.viewHelper.linesContentDomNode)),this._register(ce(this.viewHelper.linesContentDomNode,Ti.Tap,s=>this.onTap(s))),this._register(ce(this.viewHelper.linesContentDomNode,Ti.Change,s=>this.onChange(s))),this._register(ce(this.viewHelper.linesContentDomNode,Ti.Contextmenu,s=>this._onContextMenu(new Zf(s,!1,this.viewHelper.viewDomNode),!1)))}onTap(e){e.preventDefault(),this.viewHelper.focusTextArea();const t=this._createMouseTarget(new Zf(e,!1,this.viewHelper.viewDomNode),!1);if(t.position){const i=document.createEvent("CustomEvent");i.initEvent(OE.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 DSe extends te{constructor(e,t,i){super(),uc&&P8.pointerEvents?this.handler=this._register(new LSe(e,t,i)):window.TouchEvent?this.handler=this._register(new kSe(e,t,i)):this.handler=this._register(new d9(e,t,i))}getTargetAtClientPoint(e,t){return this.handler.getTargetAtClientPoint(e,t)}}class Zm extends _S{}const os=Wt("themeService");function sn(n){return{id:n}}function pO(n){switch(n){case Ca.DARK:return"vs-dark";case Ca.HIGH_CONTRAST_DARK:return"hc-black";case Ca.HIGH_CONTRAST_LIGHT:return"hc-light";default:return"vs"}}const iJ={ThemingContribution:"base.contributions.theming"};class ESe{constructor(){this.themingParticipants=[],this.themingParticipants=[],this.onThemingParticipantAddedEmitter=new j}onColorThemeChange(e){return this.themingParticipants.push(e),this.onThemingParticipantAddedEmitter.fire(e),vt(()=>{const t=this.themingParticipants.indexOf(e);this.themingParticipants.splice(t,1)})}getThemingParticipants(){return this.themingParticipants}}const nJ=new ESe;en.add(iJ.ThemingContribution,nJ);function bl(n){return nJ.onColorThemeChange(n)}class ISe extends te{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 sJ=F("editor.lineHighlightBackground",{dark:null,light:null,hcDark:null,hcLight:null},m("lineHighlight","Background color for the highlight of line at the cursor position.")),g$=F("editor.lineHighlightBorder",{dark:"#282828",light:"#eeeeee",hcDark:"#f38518",hcLight:$t},m("lineHighlightBorderBox","Background color for the border around the line at the cursor position."));F("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);F("editor.rangeHighlightBorder",{dark:null,light:null,hcDark:$i,hcLight:$i},m("rangeHighlightBorder","Background color of the border around highlighted ranges."),!0);F("editor.symbolHighlightBackground",{dark:ld,light:ld,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);F("editor.symbolHighlightBorder",{dark:null,light:null,hcDark:$i,hcLight:$i},m("symbolHighlightBorder","Background color of the border around highlighted symbols."),!0);const oJ=F("editorCursor.foreground",{dark:"#AEAFAD",light:ee.black,hcDark:ee.white,hcLight:"#0F4A85"},m("caret","Color of the editor cursor.")),TSe=F("editorCursor.background",null,m("editorCursorBackground","The background color of the editor cursor. Allows customizing the color of a character overlapped by a block cursor.")),Iu=F("editorWhitespace.foreground",{dark:"#e3e4e229",light:"#33333333",hcDark:"#e3e4e229",hcLight:"#CCCCCC"},m("editorWhitespaces","Color of whitespace characters in the editor.")),xSe=F("editorLineNumber.foreground",{dark:"#858585",light:"#237893",hcDark:ee.white,hcLight:"#292929"},m("editorLineNumbers","Color of editor line numbers.")),DL=F("editorIndentGuide.background",{dark:Iu,light:Iu,hcDark:Iu,hcLight:Iu},m("editorIndentGuides","Color of the editor indentation guides."),!1,m("deprecatedEditorIndentGuides","'editorIndentGuide.background' is deprecated. Use 'editorIndentGuide.background1' instead.")),EL=F("editorIndentGuide.activeBackground",{dark:Iu,light:Iu,hcDark:Iu,hcLight:Iu},m("editorActiveIndentGuide","Color of the active editor indentation guides."),!1,m("deprecatedEditorActiveIndentGuide","'editorIndentGuide.activeBackground' is deprecated. Use 'editorIndentGuide.activeBackground1' instead.")),CS=F("editorIndentGuide.background1",{dark:DL,light:DL,hcDark:DL,hcLight:DL},m("editorIndentGuides1","Color of the editor indentation guides (1).")),NSe=F("editorIndentGuide.background2",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},m("editorIndentGuides2","Color of the editor indentation guides (2).")),ASe=F("editorIndentGuide.background3",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},m("editorIndentGuides3","Color of the editor indentation guides (3).")),MSe=F("editorIndentGuide.background4",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},m("editorIndentGuides4","Color of the editor indentation guides (4).")),RSe=F("editorIndentGuide.background5",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},m("editorIndentGuides5","Color of the editor indentation guides (5).")),PSe=F("editorIndentGuide.background6",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},m("editorIndentGuides6","Color of the editor indentation guides (6).")),wS=F("editorIndentGuide.activeBackground1",{dark:EL,light:EL,hcDark:EL,hcLight:EL},m("editorActiveIndentGuide1","Color of the active editor indentation guides (1).")),OSe=F("editorIndentGuide.activeBackground2",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},m("editorActiveIndentGuide2","Color of the active editor indentation guides (2).")),FSe=F("editorIndentGuide.activeBackground3",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},m("editorActiveIndentGuide3","Color of the active editor indentation guides (3).")),BSe=F("editorIndentGuide.activeBackground4",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},m("editorActiveIndentGuide4","Color of the active editor indentation guides (4).")),WSe=F("editorIndentGuide.activeBackground5",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},m("editorActiveIndentGuide5","Color of the active editor indentation guides (5).")),VSe=F("editorIndentGuide.activeBackground6",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},m("editorActiveIndentGuide6","Color of the active editor indentation guides (6).")),IL=F("editorActiveLineNumber.foreground",{dark:"#c6c6c6",light:"#0B216F",hcDark:$i,hcLight:$i},m("editorActiveLineNumber","Color of editor active line number"),!1,m("deprecatedEditorActiveLineNumber","Id is deprecated. Use 'editorLineNumber.activeForeground' instead."));F("editorLineNumber.activeForeground",{dark:IL,light:IL,hcDark:IL,hcLight:IL},m("editorActiveLineNumber","Color of editor active line number"));const HSe=F("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."));F("editorRuler.foreground",{dark:"#5A5A5A",light:ee.lightgrey,hcDark:ee.white,hcLight:"#292929"},m("editorRuler","Color of the editor rulers."));F("editorCodeLens.foreground",{dark:"#999999",light:"#919191",hcDark:"#999999",hcLight:"#292929"},m("editorCodeLensForeground","Foreground color of editor CodeLens"));F("editorBracketMatch.background",{dark:"#0064001a",light:"#0064001a",hcDark:"#0064001a",hcLight:"#0000"},m("editorBracketMatchBackground","Background color behind matching brackets"));F("editorBracketMatch.border",{dark:"#888",light:"#B9B9B9",hcDark:$t,hcLight:$t},m("editorBracketMatchBorder","Color for matching brackets boxes"));const $Se=F("editorOverviewRuler.border",{dark:"#7f7f7f4d",light:"#7f7f7f4d",hcDark:"#7f7f7f4d",hcLight:"#666666"},m("editorOverviewRulerBorder","Color of the overview ruler border.")),zSe=F("editorOverviewRuler.background",null,m("editorOverviewRulerBackground","Background color of the editor overview ruler."));F("editorGutter.background",{dark:is,light:is,hcDark:is,hcLight:is},m("editorGutter","Background color of the editor gutter. The gutter contains the glyph margins and the line numbers."));F("editorUnnecessaryCode.border",{dark:null,light:null,hcDark:ee.fromHex("#fff").transparent(.8),hcLight:$t},m("unnecessaryCodeBorder","Border color of unnecessary (unused) source code in the editor."));const USe=F("editorUnnecessaryCode.opacity",{dark:ee.fromHex("#000a"),light:ee.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."));F("editorGhostText.border",{dark:null,light:null,hcDark:ee.fromHex("#fff").transparent(.8),hcLight:ee.fromHex("#292929").transparent(.8)},m("editorGhostTextBorder","Border color of ghost text in the editor."));F("editorGhostText.foreground",{dark:ee.fromHex("#ffffff56"),light:ee.fromHex("#0007"),hcDark:null,hcLight:null},m("editorGhostTextForeground","Foreground color of the ghost text in the editor."));F("editorGhostText.background",{dark:null,light:null,hcDark:null,hcLight:null},m("editorGhostTextBackground","Background color of the ghost text in the editor."));const TL=new ee(new jt(0,122,204,.6)),rJ=F("editorOverviewRuler.rangeHighlightForeground",{dark:TL,light:TL,hcDark:TL,hcLight:TL},m("overviewRulerRangeHighlight","Overview ruler marker color for range highlights. The color must not be opaque so as not to hide underlying decorations."),!0),jSe=F("editorOverviewRuler.errorForeground",{dark:new ee(new jt(255,18,18,.7)),light:new ee(new jt(255,18,18,.7)),hcDark:new ee(new jt(255,50,50,1)),hcLight:"#B5200D"},m("overviewRuleError","Overview ruler marker color for errors.")),KSe=F("editorOverviewRuler.warningForeground",{dark:Ur,light:Ur,hcDark:Mw,hcLight:Mw},m("overviewRuleWarning","Overview ruler marker color for warnings.")),qSe=F("editorOverviewRuler.infoForeground",{dark:Xo,light:Xo,hcDark:Rw,hcLight:Rw},m("overviewRuleInfo","Overview ruler marker color for infos.")),aJ=F("editorBracketHighlight.foreground1",{dark:"#FFD700",light:"#0431FAFF",hcDark:"#FFD700",hcLight:"#0431FAFF"},m("editorBracketHighlightForeground1","Foreground color of brackets (1). Requires enabling bracket pair colorization.")),lJ=F("editorBracketHighlight.foreground2",{dark:"#DA70D6",light:"#319331FF",hcDark:"#DA70D6",hcLight:"#319331FF"},m("editorBracketHighlightForeground2","Foreground color of brackets (2). Requires enabling bracket pair colorization.")),cJ=F("editorBracketHighlight.foreground3",{dark:"#179FFF",light:"#7B3814FF",hcDark:"#87CEFA",hcLight:"#7B3814FF"},m("editorBracketHighlightForeground3","Foreground color of brackets (3). Requires enabling bracket pair colorization.")),dJ=F("editorBracketHighlight.foreground4",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},m("editorBracketHighlightForeground4","Foreground color of brackets (4). Requires enabling bracket pair colorization.")),uJ=F("editorBracketHighlight.foreground5",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},m("editorBracketHighlightForeground5","Foreground color of brackets (5). Requires enabling bracket pair colorization.")),hJ=F("editorBracketHighlight.foreground6",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},m("editorBracketHighlightForeground6","Foreground color of brackets (6). Requires enabling bracket pair colorization.")),GSe=F("editorBracketHighlight.unexpectedBracket.foreground",{dark:new ee(new jt(255,18,18,.8)),light:new ee(new jt(255,18,18,.8)),hcDark:new ee(new jt(255,50,50,1)),hcLight:""},m("editorBracketHighlightUnexpectedBracketForeground","Foreground color of unexpected brackets.")),YSe=F("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.")),ZSe=F("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.")),XSe=F("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.")),QSe=F("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.")),JSe=F("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.")),eLe=F("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.")),tLe=F("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.")),iLe=F("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.")),nLe=F("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.")),sLe=F("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.")),oLe=F("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.")),rLe=F("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."));F("editorUnicodeHighlight.border",{dark:"#BD9B03",light:"#CEA33D",hcDark:"#ff0000",hcLight:"#CEA33D"},m("editorUnicodeHighlight.border","Border color used to highlight unicode characters."));F("editorUnicodeHighlight.background",{dark:"#bd9b0326",light:"#cea33d14",hcDark:"#00000000",hcLight:"#cea33d14"},m("editorUnicodeHighlight.background","Background color used to highlight unicode characters."));bl((n,e)=>{const t=n.getColor(is),i=n.getColor(sJ),s=i&&!i.isTransparent()?i:t;s&&e.addRule(".monaco-editor .inputarea.ime-input { background-color: ".concat(s,"; }"))});class yS extends Zm{constructor(e){super(),this._context=e,this._readConfig(),this._lastCursorModelPosition=new Y(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 Y(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=Co?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]='
    ').concat(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]}}yS.CLASS_NAME="line-numbers";bl((n,e)=>{const t=n.getColor(xSe),i=n.getColor(HSe);i?e.addRule(".monaco-editor .line-numbers.dimmed-line-number { color: ".concat(i,"; }")):t&&e.addRule(".monaco-editor .line-numbers.dimmed-line-number { color: ".concat(t.transparent(.4),"; }"))});class dm extends Er{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=ci(document.createElement("div")),this._domNode.setClassName(dm.OUTER_CLASS_NAME),this._domNode.setPosition("absolute"),this._domNode.setAttribute("role","presentation"),this._domNode.setAttribute("aria-hidden","true"),this._glyphMarginBackgroundDomNode=ci(document.createElement("div")),this._glyphMarginBackgroundDomNode.setClassName(dm.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)}}dm.CLASS_NAME="glyph-margin";dm.OUTER_CLASS_NAME="margin";const Kv="monaco-mouse-cursor-text";class aLe{constructor(){this._onDidChange=new j,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 CC=new aLe,Di=Wt("keybindingService");var lLe=globalThis&&globalThis.__decorate||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},cLe=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};class dLe{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 Y(this.modelLineNumber,this.distanceToModelLineStart+1),i=new Y(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 LM=Ta;let mO=class extends Er{constructor(e,t,i,s){super(e),this._keybindingService=s,this._primaryCursorPosition=new Y(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 Je(1,1,1,1)],this._modelSelections=[new Je(1,1,1,1)],this._lastRenderPosition=null,this.textArea=ci(document.createElement("textarea")),Dd.write(this.textArea,6),this.textArea.setClassName("inputarea ".concat(Kv)),this.textArea.setAttribute("wrap",this._textAreaWrapping&&!this._visibleTextArea?"on":"off");const{tabSize:a}=this._context.viewModel.model.getOptions();this.textArea.domNode.style.tabSize="".concat(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=ci(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,zs),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(fO.forceCopyWithSyntaxHighlighting||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(Kt&&u.isEmpty()){const f=u.getStartPosition();let g=this._getWordBeforePosition(f);if(g.length===0&&(g=this._getCharacterBeforePosition(f)),g.length>0)return new _s(g,g.length,g.length,I.fromPositions(f),0)}const h=500;if(Kt&&!u.isEmpty()&&l.getValueLengthInRange(u,0)0)return new _s(f,g,g,I.fromPositions(h),0)}return _s.EMPTY}return hv.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 SSe(this.textArea.domNode));this._textAreaInput=this._register(new ySe(c,d,$r,{isAndroid:zV,isChrome:N8,isFirefox:Ta,isSafari:qu})),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("\n"),C=v.substring(b+1),w=C.lastIndexOf(" "),y=C.length-w-1,L=f.getStartPosition(),S=Math.min(L.column-1,y),k=L.column-1-S,D=C.substring(0,C.length-S),{tabSize:x}=this._context.viewModel.model.getOptions(),A=uLe(this.textArea.domNode.ownerDocument,D,this._fontInfo,x);return{distanceToModelLineStart:k,widthOfHiddenTextBefore:A}})(),{distanceToModelLineEnd:_}=(()=>{const v=h.value.substring(Math.max(h.selectionStart,h.selectionEnd)),b=v.indexOf("\n"),C=b===-1?v:v.substring(0,b),w=C.indexOf(" "),y=w===-1?C.length:C.length-w-1,L=f.getEndPosition(),S=Math.min(this._context.viewModel.model.getLineMaxColumn(L.lineNumber)-L.column,y);return{distanceToModelLineEnd:this._context.viewModel.model.getLineMaxColumn(L.lineNumber)-L.column-S}})();this._context.viewModel.revealRange("keyboard",!0,I.fromPositions(this._selections[0].getStartPosition()),0,1),this._visibleTextArea=new dLe(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 ".concat(Kv," 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 ".concat(Kv)),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(CC.onDidChange(()=>{this._ensureReadOnlyAttribute()}))}writeScreenReaderContent(e){this._textAreaInput.writeScreenReaderContent(e)}dispose(){super.dispose()}_getAndroidWordAtPosition(e){const t='`~!@#$%^&*()-=+[{]}\\|;:",.<>/?',i=this._context.viewModel.getLineContent(e.lineNumber),s=Aa(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=Aa(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(!es(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===vc.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=LM?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="".concat(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;!CC.enabled||e.get(34)&&e.get(90)?this.textArea.setAttribute("readonly","true"):this.textArea.removeAttribute("readonly")}prepareRender(e){var t;this._primaryCursorPosition=new Y(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:(nn.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(Kt){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:LM?0:1,useCover:!1})}_newlinecount(e){let t=0,i=-1;do{if(i=e.indexOf("\n",i+1),i===-1)break;t++}while(!0);return t}_renderAtTopLeft(){this._doRender({lastRenderPosition:null,top:0,left:0,width:this._textAreaWidth,height:LM?0:1,useCover:!0})}_doRender(e){this._lastRenderPosition=e.lastRenderPosition;const t=this.textArea,i=this.textAreaCover;Vs(t,this._fontInfo),t.setTop(e.top),t.setLeft(e.left),t.setWidth(e.width),t.setHeight(e.height),t.setColor(e.color?ee.Format.CSS.formatHex(e.color):""),t.setFontStyle(e.italic?"italic":""),e.bold&&t.setFontWeight("bold"),t.setTextDecoration("".concat(e.underline?" underline":"").concat(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 "+dm.OUTER_CLASS_NAME):s.get(67).renderType!==0?i.setClassName("monaco-editor-background textAreaCover "+yS.CLASS_NAME):i.setClassName("monaco-editor-background textAreaCover")}};mO=lLe([cLe(3,Di)],mO);function uLe(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");Vs(o,t),o.style.whiteSpace="pre",o.style.tabSize="".concat(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 hLe(n,e,t){let i=0;for(let o=0;o!0,gLe=()=>!1,pLe=n=>n===" "||n===" ";class L_{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=cx(t,i-1),o=this.languageConfigurationService.getLanguageConfiguration(s.languageId).electricCharacter;return o?o.onElectricCharacter(e,s,i-s.firstCharOffset):null}normalizeIndentation(e){return FE(e,this.indentSize,this.insertSpaces)}_getShouldAutoClose(e,t,i){switch(t){case"beforeWhitespace":return pLe;case"languageDefined":return this._getLanguageDefinedShouldAutoClose(e,i);case"always":return fLe;case"never":return gLe}}_getLanguageDefinedShouldAutoClose(e,t){const i=this.languageConfigurationService.getLanguageConfiguration(e).getAutoCloseBeforeSet(t);return s=>i.indexOf(s)!==-1}visibleColumnFromColumn(e,t){return Zn.visibleColumnFromColumn(e.getLineContent(t.lineNumber),t.column,this.tabSize)}columnFromVisibleColumn(e,t,i){const s=Zn.columnFromVisibleColumn(e.getLineContent(t),i,this.tabSize),o=e.getLineMinColumn(t);if(sr?r:s}}let Qt=class fJ{static fromModelState(e){return new mLe(e)}static fromViewState(e){return new _Le(e)}static fromModelSelection(e){const t=Je.liftSelection(e),i=new Cs(I.fromPositions(t.getSelectionStart()),0,0,t.getPosition(),0);return fJ.fromModelState(i)}static fromModelSelections(e){const t=[];for(let i=0,s=e.length;io,c=s>r,d=sr||vs||_0&&s--,vp.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 Y(l,c));s=Math.max(s,d)}let a=i.toViewVisualColumn;return ae.getLineMinColumn(t.lineNumber))return t.delta(void 0,-DX(e.getLineContent(t.lineNumber),t.column-1));if(t.lineNumber>1){const i=t.lineNumber-1;return new Y(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=Ow.atomicPosition(o,t.column-1,i,0);if(r!==-1&&r+1>=s)return new Y(t.lineNumber,r+1)}return this.leftPosition(e,t)}static left(e,t,i){const s=e.stickyTabStops?di.leftPositionAtomicSoftTabs(t,i,e.tabSize):di.leftPosition(t,i);return new kM(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(di.clipPositionColumn(l,t),0),d=di.left(e,t,c);r=d.lineNumber,a=d.column}return i.move(s,r,a,0)}static clipPositionColumn(e,t){return new Y(e.lineNumber,di.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-Zn.visibleColumnFromColumn(t.getLineContent(i),s,e.tabSize),l!==void 0){const g=new Y(i,s),p=t.normalizePosition(g,l);o=o+(s-p.column),i=p.lineNumber,s=p.column}return new kM(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=di.down(e,t,r+l,a,i.leftoverVisibleColumns,o,!0),t.normalizePosition(new Y(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(xh(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,C=a.length;b1){const o=t.getLineContent(s.lineNumber),r=bo(o),a=r===-1?o.length+1:r+1;if(s.column<=a){const l=i.visibleColumnFromColumn(t,s),c=Zn.prevIndentTabStop(l,i.indentSize),d=i.columnFromVisibleColumn(t,s.lineNumber,c);return new I(s.lineNumber,d,s.lineNumber,s.column)}}return I.fromPositions(um.getPositionAfterDeleteLeft(s,t),s)}static getPositionAfterDeleteLeft(e,t){if(e.column>1){const i=Mve(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 Y(i,t.getLineMaxColumn(i))}else return e}static cut(e,t,i){const s=[];let o=null;i.sort((r,a)=>Y.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 I(d,u,h,f);o=g,g.isEmpty()?s[r]=null:s[r]=new Rs(g,"")}else s[r]=null;else s[r]=new Rs(l,"")}return new Uo(0,s,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!0})}}class oi{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=oi._findPreviousWordOnLine(e,t,new Y(o,r));if(s===0)return new Y(o,a?a.start+1:1);if(s===1)return a&&a.wordType===2&&a.end-a.start===1&&a.nextCharClass===0&&(a=oi._findPreviousWordOnLine(e,t,new Y(o,a.start+1))),new Y(o,a?a.start+1:1);if(s===3){for(;a&&a.wordType===2;)a=oi._findPreviousWordOnLine(e,t,new Y(o,a.start+1));return new Y(o,a?a.start+1:1)}return a&&r<=a.end+1&&(a=oi._findPreviousWordOnLine(e,t,new Y(o,a.start+1))),new Y(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 Y(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 Y(i,r);if(a===45&&l!==45)return new Y(i,r);if((Xh(a)||_L(a))&&Vc(l))return new Y(i,r);if(Vc(a)&&Vc(l)&&r+1=l.start+1&&(l=oi._findNextWordOnLine(e,t,new Y(o,l.end+1))),l?r=l.start+1:r=t.getLineMaxColumn(o);return new Y(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=oi._findPreviousWordOnLine(i,s,new Y(l,d.start+1))),d?c=d.end+1:c>1?c=1:(l--,c=s.getLineMaxColumn(l))),new I(l,c,a.lineNumber,a.column)}static deleteInsideWord(e,t,i){if(!i.isEmpty())return i;const s=new Y(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 I(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 I(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=oi._findPreviousWordOnLine(e,t,i);if(c&&r(c))return l(c);const d=oi._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=oi._moveWordPartLeft(e,i);return new I(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=oi._findNextWordOnLine(i,s,new Y(l,h.end+1))),h?c=h.start+1:c!!e)}class ms{static addCursorDown(e,t,i){const s=[];let o=0;for(let r=0,a=t.length;rc&&(d=c,u=e.model.getLineMaxColumn(d)),Qt.fromModelState(new Cs(new I(r.lineNumber,1,d,u),2,0,new Y(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)),Qt.fromViewState(t.viewState.move(!0,d,u,0))}else{const c=t.modelState.selectionStart.getEndPosition();return Qt.fromModelState(t.modelState.move(!0,c.lineNumber,c.column,0))}}static word(e,t,i,s){const o=e.model.validatePosition(s);return Qt.fromModelState(oi.word(e.cursorConfig,e.model,t.modelState,i,o))}static cancelSelection(e,t){if(!t.modelState.hasSelection())return new Qt(t.modelState,t.viewState);const i=t.viewState.position.lineNumber,s=t.viewState.position.column;return Qt.fromViewState(new Cs(new I(i,s,i,s),0,0,new Y(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 Y(o.lineNumber,o.column),r):e.coordinatesConverter.convertModelPositionToViewPosition(r);return Qt.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=>Qt.fromViewState(di.moveToPrevBlankLine(e.cursorConfig,e,a.viewState,s))):t.map(a=>Qt.fromModelState(di.moveToPrevBlankLine(e.cursorConfig,e.model,a.modelState,s)));case 5:return r===2?t.map(a=>Qt.fromViewState(di.moveToNextBlankLine(e.cursorConfig,e,a.viewState,s))):t.map(a=>Qt.fromModelState(di.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:oQt.fromViewState(di.moveLeft(e.cursorConfig,e,o.viewState,i,s)))}static _moveHalfLineLeft(e,t,i){const s=[];for(let o=0,r=t.length;oQt.fromViewState(di.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=Vv(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===Pn.Indent&&(h=" "+h):u===Pn.Indent||u===Pn.IndentOutdent?h=" ":h="";let g=wQ(e,t.startLineNumber,t.startColumn);return f&&(g=g.substring(0,g.length-f)),{indentAction:u,appendText:h,removeText:f,indentation:g}}var bLe=globalThis&&globalThis.__decorate||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},CLe=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},mD;const DM=Object.create(null);function Kg(n,e){if(e<=0)return"";DM[n]||(DM[n]=["",n]);const t=DM[n];for(let i=t.length;i<=e;i++)t[i]=t[i-1]+n;return t[e]}let va=mD=class{static unshiftIndent(e,t,i,s,o){const r=Zn.visibleColumnFromColumn(e,t,i);if(o){const a=Kg(" ",s),c=Zn.prevIndentTabStop(r,s)/s;return Kg(a,c)}else{const a=" ",c=Zn.prevRenderTabStop(r,i)/i;return Kg(a,c)}}static shiftIndent(e,t,i,s,o){const r=Zn.visibleColumnFromColumn(e,t,i);if(o){const a=Kg(" ",s),c=Zn.nextIndentTabStop(r,s)/s;return Kg(a,c)}else{const a=" ",c=Zn.nextRenderTabStop(r,i)/i;return Kg(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=bo(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&&Zn.visibleColumnFromColumn(h,f+1,o)%r!==0&&e.tokenization.isCheapToTokenize(u-1)){const _=qv(this._opts.autoIndent,e,new I(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 Lx(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=SLe(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:ki(a),action:Pn.Indent,line:r};if(o.shouldDecrease(a))return{indentation:ki(a),action:null,line:r};{if(r===1)return{indentation:ki(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:ki(e.getLineContent(d+1)),action:null,line:d+1}}if(i)return{indentation:ki(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:ki(u),action:Pn.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:ki(e.getLineContent(h+1)),action:null,line:h+1}}else if(o.shouldDecrease(u))return{indentation:ki(u),action:null,line:d}}return{indentation:ki(e.getLineContent(1)),action:null,line:1}}}function wC(n,e,t,i,s,o){if(n<4)return null;const r=o.getLanguageConfiguration(t);if(!r)return null;const a=o.getLanguageConfiguration(t).indentRulesSupport;if(!a)return null;const l=Lx(n,e,i,void 0,o),c=e.getLineContent(i);if(l){const d=l.line;if(d!==void 0){let u=!0;for(let h=d;h0&&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=Vv(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=ki(c),g={tokenization:{getLineTokens:b=>e.tokenization.getLineTokens(b),getLanguageId:()=>e.getLanguageId(),getLanguageIdAtPosition:(b,C)=>e.getLanguageIdAtPosition(b,C)},getLineContent:b=>b===t.startLineNumber?h:e.getLineContent(b)},p=ki(o.getLineContent()),_=Lx(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===Pn.Indent&&(v=i.shiftIndent(v)),u.shouldDecrease(d)&&(v=i.unshiftIndent(v)),{beforeEnter:l?p:f,afterEnter:v}}function kLe(n,e,t,i,s,o){if(n<4)return null;const r=Vv(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=Vv(e,t.endLineNumber,t.endColumn).getLineContent().substr(t.endColumn-1-r.firstCharOffset),!a.shouldDecrease(c+d)&&a.shouldDecrease(c+i+d)){const u=Lx(n,e,t.startLineNumber,!1,o);if(!u)return null;let h=u.indentation;return u.action!==Pn.Indent&&(h=s.unshiftIndent(h)),h}return null}function gJ(n,e,t){const i=t.getLanguageConfiguration(n.getLanguageId()).indentRulesSupport;return!i||e<1||e>n.getLineCount()?null:i.getIndentMetadata(n.getLineContent(e))}class Qi{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(oc(d)>=0)break}if(a<1)return null;const l=t.getLineMaxColumn(a),c=qv(e.autoIndent,t,new I(a,l,a,l),e.languageConfigurationService);c&&(o=c.indentation+c.appendText)}return s&&(s===Pn.Indent&&(o=Qi.shiftIndent(e,o)),s===Pn.Outdent&&(o=Qi.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 Uo(4,c,{shouldPushStackElementBefore:AL(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 I(a.lineNumber,l,a.lineNumber,c);return e.getValueInRange(d)===i&&r===0?null:new pD(d,i,0,r)}static _typeCommand(e,t,i){return i?new xL(e,t,!0):new Rs(e,t,!0)}static _enter(e,t,i,s){if(e.autoIndent===0)return Qi._typeCommand(s,"\n",i);if(!t.tokenization.isCheapToTokenize(s.getStartPosition().lineNumber)||e.autoIndent===1){const l=t.getLineContent(s.startLineNumber),c=ki(l).substring(0,s.startColumn-1);return Qi._typeCommand(s,"\n"+e.normalizeIndentation(c),i)}const o=qv(e.autoIndent,t,s,e.languageConfigurationService);if(o){if(o.indentAction===Pn.None)return Qi._typeCommand(s,"\n"+e.normalizeIndentation(o.indentation+o.appendText),i);if(o.indentAction===Pn.Indent)return Qi._typeCommand(s,"\n"+e.normalizeIndentation(o.indentation+o.appendText),i);if(o.indentAction===Pn.IndentOutdent){const l=e.normalizeIndentation(o.indentation),c=e.normalizeIndentation(o.indentation+o.appendText),d="\n"+c+"\n"+l;return i?new xL(s,d,!0):new pD(s,d,-1,c.length-l.length,!0)}else if(o.indentAction===Pn.Outdent){const l=Qi.unshiftIndent(e,o.indentation);return Qi._typeCommand(s,"\n"+e.normalizeIndentation(l+o.appendText),i)}}const r=t.getLineContent(s.startLineNumber),a=ki(r).substring(0,s.startColumn-1);if(e.autoIndent>=4){const l=LLe(e.autoIndent,t,s,{unshiftIndent:c=>Qi.unshiftIndent(e,c),shiftIndent:c=>Qi.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=bo(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 xL(s,"\n"+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 pD(s,"\n"+e.normalizeIndentation(l.afterEnter),0,f,!0)}}}return Qi._typeCommand(s,"\n"+e.normalizeIndentation(a),i)}static _isAutoIndentType(e,t,i){if(e.autoIndent<4)return!1;for(let s=0,o=i.length;sQi.shiftIndent(e,a),unshiftIndent:a=>Qi.unshiftIndent(e,a)},e.languageConfigurationService);if(r===null)return null;if(r!==e.normalizeIndentation(o)){const a=t.getLineFirstNonWhitespaceColumn(i.startLineNumber);return a===0?Qi._typeCommand(new I(i.startLineNumber,1,i.endLineNumber,i.endColumn),e.normalizeIndentation(r)+s,!1):Qi._typeCommand(new I(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 I(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 Y(g.lineNumber,g.beforeColumn)),s);if(!a)return null;let l,c;if(xh(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),C=b.substring(0,_-1),w=b.substring(v-1);if(w.startsWith(h)||(f=!1),w.length>0){const k=w.charAt(0);if(!Qi._isBeforeClosingBrace(e,w)&&!c(k))return null}if(a.open.length===1&&(s==="'"||s==='"')&&l!=="always"){const k=Aa(e.wordSeparators);if(C.length>0){const D=C.charCodeAt(C.length-1);if(k.get(D)===0)return null}}if(!t.tokenization.isCheapToTokenize(p))return null;t.tokenization.forceTokenization(p);const y=t.tokenization.getLineTokens(p),L=cx(y,_-1);if(!a.shouldAutoClose(L,_-L.firstCharOffset))return null;const S=a.findNeutralCharacter();if(S){const k=t.tokenization.getTokenTypeIfInsertingCharacter(p,_,S);if(!a.isOK(k))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 Rs(new I(h.positionLineNumber,h.positionColumn,h.positionLineNumber,h.positionColumn+1),"",!1));return new Uo(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==="\n"){const d=[];for(let u=0,h=o.length;u{const s=t.get(ai).getFocusedCodeEditor();return s&&s.hasTextFocus()?this._runEditorCommand(t,s,i):!1}),e.addImplementation(1e3,"generic-dom-input-textarea",(t,i)=>{const s=al();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(ai).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 rs;(function(n){class e extends cn{constructor(b){super(b),this._inSelectionMode=b.inSelectionMode}runCoreEditorCommand(b,C){if(!C.position)return;b.model.pushStackElement(),b.setCursorStates(C.source,3,[ms.moveTo(b,b.getPrimaryCursorState(),this._inSelectionMode,C.position,C.viewPosition)])&&C.revealType!==2&&b.revealPrimaryCursor(C.source,!0,!0)}}n.MoveTo=Re(new e({id:"_moveTo",inSelectionMode:!1,precondition:void 0})),n.MoveToSelect=Re(new e({id:"_moveToSelect",inSelectionMode:!0,precondition:void 0}));class t extends cn{runCoreEditorCommand(b,C){b.model.pushStackElement();const w=this._getColumnSelectResult(b,b.getPrimaryCursorState(),b.getCursorColumnSelectData(),C);w!==null&&(b.setCursorStates(C.source,3,w.viewStates.map(y=>Qt.fromViewState(y))),b.setCursorColumnSelectData({isReal:!0,fromViewLineNumber:w.fromLineNumber,fromViewVisualColumn:w.fromVisualColumn,toViewLineNumber:w.toLineNumber,toViewVisualColumn:w.toVisualColumn}),w.reversed?b.revealTopMostCursor(C.source):b.revealBottomMostCursor(C.source))}}n.ColumnSelect=Re(new class extends t{constructor(){super({id:"columnSelect",precondition:void 0})}_getColumnSelectResult(v,b,C,w){if(typeof w.position>"u"||typeof w.viewPosition>"u"||typeof w.mouseColumn>"u")return null;const y=v.model.validatePosition(w.position),L=v.coordinatesConverter.validateViewPosition(new Y(w.viewPosition.lineNumber,w.viewPosition.column),y),S=w.doColumnSelect?C.fromViewLineNumber:L.lineNumber,k=w.doColumnSelect?C.fromViewVisualColumn:w.mouseColumn-1;return vp.columnSelect(v.cursorConfig,v,S,k,L.lineNumber,w.mouseColumn-1)}}),n.CursorColumnSelectLeft=Re(new class extends t{constructor(){super({id:"cursorColumnSelectLeft",precondition:void 0,kbOpts:{weight:ni,kbExpr:O.textInputFocus,primary:3599,linux:{primary:0}}})}_getColumnSelectResult(v,b,C,w){return vp.columnSelectLeft(v.cursorConfig,v,C)}}),n.CursorColumnSelectRight=Re(new class extends t{constructor(){super({id:"cursorColumnSelectRight",precondition:void 0,kbOpts:{weight:ni,kbExpr:O.textInputFocus,primary:3601,linux:{primary:0}}})}_getColumnSelectResult(v,b,C,w){return vp.columnSelectRight(v.cursorConfig,v,C)}});class i extends t{constructor(b){super(b),this._isPaged=b.isPaged}_getColumnSelectResult(b,C,w,y){return vp.columnSelectUp(b.cursorConfig,b,w,this._isPaged)}}n.CursorColumnSelectUp=Re(new i({isPaged:!1,id:"cursorColumnSelectUp",precondition:void 0,kbOpts:{weight:ni,kbExpr:O.textInputFocus,primary:3600,linux:{primary:0}}})),n.CursorColumnSelectPageUp=Re(new i({isPaged:!0,id:"cursorColumnSelectPageUp",precondition:void 0,kbOpts:{weight:ni,kbExpr:O.textInputFocus,primary:3595,linux:{primary:0}}}));class s extends t{constructor(b){super(b),this._isPaged=b.isPaged}_getColumnSelectResult(b,C,w,y){return vp.columnSelectDown(b.cursorConfig,b,w,this._isPaged)}}n.CursorColumnSelectDown=Re(new s({isPaged:!1,id:"cursorColumnSelectDown",precondition:void 0,kbOpts:{weight:ni,kbExpr:O.textInputFocus,primary:3602,linux:{primary:0}}})),n.CursorColumnSelectPageDown=Re(new s({isPaged:!0,id:"cursorColumnSelectPageDown",precondition:void 0,kbOpts:{weight:ni,kbExpr:O.textInputFocus,primary:3596,linux:{primary:0}}}));class o extends cn{constructor(){super({id:"cursorMove",precondition:void 0,description:BE.description})}runCoreEditorCommand(b,C){const w=BE.parse(C);w&&this._runCursorMove(b,C.source,w)}_runCursorMove(b,C,w){b.model.pushStackElement(),b.setCursorStates(C,3,o._move(b,b.getCursorStates(),w)),b.revealPrimaryCursor(C,!0)}static _move(b,C,w){const y=w.select,L=w.value;switch(w.direction){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:case 10:return ms.simpleMove(b,C,w.direction,y,L,w.unit);case 11:case 13:case 12:case 14:return ms.viewportMove(b,C,w.direction,y,L);default:return null}}}n.CursorMoveImpl=o,n.CursorMove=Re(new o);class r extends cn{constructor(b){super(b),this._staticArgs=b.args}runCoreEditorCommand(b,C){let w=this._staticArgs;this._staticArgs.value===-1&&(w={direction:this._staticArgs.direction,unit:this._staticArgs.unit,select:this._staticArgs.select,value:C.pageSize||b.cursorConfig.pageSize}),b.model.pushStackElement(),b.setCursorStates(C.source,3,ms.simpleMove(b,b.getCursorStates(),w.direction,w.select,w.value,w.unit)),b.revealPrimaryCursor(C.source,!0)}}n.CursorLeft=Re(new r({args:{direction:0,unit:0,select:!1,value:1},id:"cursorLeft",precondition:void 0,kbOpts:{weight:ni,kbExpr:O.textInputFocus,primary:15,mac:{primary:15,secondary:[288]}}})),n.CursorLeftSelect=Re(new r({args:{direction:0,unit:0,select:!0,value:1},id:"cursorLeftSelect",precondition:void 0,kbOpts:{weight:ni,kbExpr:O.textInputFocus,primary:1039}})),n.CursorRight=Re(new r({args:{direction:1,unit:0,select:!1,value:1},id:"cursorRight",precondition:void 0,kbOpts:{weight:ni,kbExpr:O.textInputFocus,primary:17,mac:{primary:17,secondary:[292]}}})),n.CursorRightSelect=Re(new r({args:{direction:1,unit:0,select:!0,value:1},id:"cursorRightSelect",precondition:void 0,kbOpts:{weight:ni,kbExpr:O.textInputFocus,primary:1041}})),n.CursorUp=Re(new r({args:{direction:2,unit:2,select:!1,value:1},id:"cursorUp",precondition:void 0,kbOpts:{weight:ni,kbExpr:O.textInputFocus,primary:16,mac:{primary:16,secondary:[302]}}})),n.CursorUpSelect=Re(new r({args:{direction:2,unit:2,select:!0,value:1},id:"cursorUpSelect",precondition:void 0,kbOpts:{weight:ni,kbExpr:O.textInputFocus,primary:1040,secondary:[3088],mac:{primary:1040},linux:{primary:1040}}})),n.CursorPageUp=Re(new r({args:{direction:2,unit:2,select:!1,value:-1},id:"cursorPageUp",precondition:void 0,kbOpts:{weight:ni,kbExpr:O.textInputFocus,primary:11}})),n.CursorPageUpSelect=Re(new r({args:{direction:2,unit:2,select:!0,value:-1},id:"cursorPageUpSelect",precondition:void 0,kbOpts:{weight:ni,kbExpr:O.textInputFocus,primary:1035}})),n.CursorDown=Re(new r({args:{direction:3,unit:2,select:!1,value:1},id:"cursorDown",precondition:void 0,kbOpts:{weight:ni,kbExpr:O.textInputFocus,primary:18,mac:{primary:18,secondary:[300]}}})),n.CursorDownSelect=Re(new r({args:{direction:3,unit:2,select:!0,value:1},id:"cursorDownSelect",precondition:void 0,kbOpts:{weight:ni,kbExpr:O.textInputFocus,primary:1042,secondary:[3090],mac:{primary:1042},linux:{primary:1042}}})),n.CursorPageDown=Re(new r({args:{direction:3,unit:2,select:!1,value:-1},id:"cursorPageDown",precondition:void 0,kbOpts:{weight:ni,kbExpr:O.textInputFocus,primary:12}})),n.CursorPageDownSelect=Re(new r({args:{direction:3,unit:2,select:!0,value:-1},id:"cursorPageDownSelect",precondition:void 0,kbOpts:{weight:ni,kbExpr:O.textInputFocus,primary:1036}})),n.CreateCursor=Re(new class extends cn{constructor(){super({id:"createCursor",precondition:void 0})}runCoreEditorCommand(v,b){if(!b.position)return;let C;b.wholeLine?C=ms.line(v,v.getPrimaryCursorState(),!1,b.position,b.viewPosition):C=ms.moveTo(v,v.getPrimaryCursorState(),!1,b.position,b.viewPosition);const w=v.getCursorStates();if(w.length>1){const y=C.modelState?C.modelState.position:null,L=C.viewState?C.viewState.position:null;for(let S=0,k=w.length;SL&&(y=L);const S=new I(y,1,y,v.model.getLineMaxColumn(y));let k=0;if(C.at)switch(C.at){case fv.RawAtArgument.Top:k=3;break;case fv.RawAtArgument.Center:k=1;break;case fv.RawAtArgument.Bottom:k=4;break}const D=v.coordinatesConverter.convertModelRangeToViewRange(S);v.revealRange(b.source,!1,D,k,0)}}),n.SelectAll=new class extends _O{constructor(){super(f0e)}runDOMCommand(v){Ta&&(v.focus(),v.select()),v.ownerDocument.execCommand("selectAll")}runEditorCommand(v,b,C){const w=b._getViewModel();w&&this.runCoreEditorCommand(w,C)}runCoreEditorCommand(v,b){v.model.pushStackElement(),v.setCursorStates("keyboard",3,[ms.selectAll(v,v.getPrimaryCursorState())])}},n.SetSelection=Re(new class extends cn{constructor(){super({id:"setSelection",precondition:void 0})}runCoreEditorCommand(v,b){b.selection&&(v.model.pushStackElement(),v.setCursorStates(b.source,3,[Qt.fromModelSelection(b.selection)]))}})})(rs||(rs={}));const ELe=fe.and(O.textInputFocus,O.columnSelection);function T0(n,e){er.registerKeybindingRule({id:n,primary:e,when:ELe,weight:ni+1})}T0(rs.CursorColumnSelectLeft.id,1039);T0(rs.CursorColumnSelectRight.id,1041);T0(rs.CursorColumnSelectUp.id,1040);T0(rs.CursorColumnSelectPageUp.id,1035);T0(rs.CursorColumnSelectDown.id,1042);T0(rs.CursorColumnSelectPageDown.id,1036);function _$(n){return n.register(),n}var Gv;(function(n){class e extends fs{runEditorCommand(i,s,o){const r=s._getViewModel();r&&this.runCoreEditingCommand(s,r,o||{})}}n.CoreEditingCommand=e,n.LineBreakInsert=Re(new class extends e{constructor(){super({id:"lineBreakInsert",precondition:O.writable,kbOpts:{weight:ni,kbExpr:O.textInputFocus,primary:0,mac:{primary:301}}})}runCoreEditingCommand(t,i,s){t.pushUndoStop(),t.executeCommands(this.id,Qi.lineBreakInsert(i.cursorConfig,i.model,i.getCursorStates().map(o=>o.modelState.selection)))}}),n.Outdent=Re(new class extends e{constructor(){super({id:"outdent",precondition:O.writable,kbOpts:{weight:ni,kbExpr:fe.and(O.editorTextFocus,O.tabDoesNotMoveFocus),primary:1026}})}runCoreEditingCommand(t,i,s){t.pushUndoStop(),t.executeCommands(this.id,Qi.outdent(i.cursorConfig,i.model,i.getCursorStates().map(o=>o.modelState.selection))),t.pushUndoStop()}}),n.Tab=Re(new class extends e{constructor(){super({id:"tab",precondition:O.writable,kbOpts:{weight:ni,kbExpr:fe.and(O.editorTextFocus,O.tabDoesNotMoveFocus),primary:2}})}runCoreEditingCommand(t,i,s){t.pushUndoStop(),t.executeCommands(this.id,Qi.tab(i.cursorConfig,i.model,i.getCursorStates().map(o=>o.modelState.selection))),t.pushUndoStop()}}),n.DeleteLeft=Re(new class extends e{constructor(){super({id:"deleteLeft",precondition:void 0,kbOpts:{weight:ni,kbExpr:O.textInputFocus,primary:1,secondary:[1025],mac:{primary:1,secondary:[1025,294,257]}}})}runCoreEditingCommand(t,i,s){const[o,r]=um.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=Re(new class extends e{constructor(){super({id:"deleteRight",precondition:void 0,kbOpts:{weight:ni,kbExpr:O.textInputFocus,primary:20,mac:{primary:20,secondary:[290,276]}}})}runCoreEditingCommand(t,i,s){const[o,r]=um.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 _O{constructor(){super(oQ)}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 _O{constructor(){super(rQ)}runDOMCommand(t){t.ownerDocument.execCommand("redo")}runEditorCommand(t,i,s){if(!(!i.hasModel()||i.getOption(90)===!0))return i.getModel().redo()}}})(Gv||(Gv={}));class v$ extends ox{constructor(e,t,i){super({id:e,precondition:void 0,description:i}),this._handlerId=t}runCommand(e,t){const i=e.get(ai).getFocusedCodeEditor();i&&i.trigger("keyboard",this._handlerId,t)}}function Xm(n,e){_$(new v$("default:"+n,n)),_$(new v$(n,n,e))}Xm("type",{description:"Type",args:[{name:"args",schema:{type:"object",required:["text"],properties:{text:{type:"string"}}}}]});Xm("replacePreviousChar");Xm("compositionType");Xm("compositionStart");Xm("compositionEnd");Xm("paste");Xm("cut");class ILe{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){rs.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){rs.MoveTo.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_moveToSelect(e,t){rs.MoveToSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_columnSelect(e,t,i){e=this._validateViewColumn(e),rs.ColumnSelect.runCoreEditorCommand(this.viewModel,{source:"mouse",position:this._convertViewToModelPosition(e),viewPosition:e,mouseColumn:t,doColumnSelect:i})}_createCursor(e,t){e=this._validateViewColumn(e),rs.CreateCursor.runCoreEditorCommand(this.viewModel,{source:"mouse",position:this._convertViewToModelPosition(e),viewPosition:e,wholeLine:t})}_lastCursorMoveToSelect(e,t){rs.LastCursorMoveToSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_wordSelect(e,t){rs.WordSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_wordSelectDrag(e,t){rs.WordSelectDrag.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lastCursorWordSelect(e,t){rs.LastCursorWordSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lineSelect(e,t){rs.LineSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lineSelectDrag(e,t){rs.LineSelectDrag.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lastCursorLineSelect(e,t){rs.LastCursorLineSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lastCursorLineSelectDrag(e,t){rs.LastCursorLineSelectDrag.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_selectAll(){rs.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 kx{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 kx.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 Y(e.afterLineNumber,1)).lineNumber}}}class mJ{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 Rn("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 _J{constructor(e){this._host=e,this.domNode=this._createDomNode(),this._linesCollection=new mJ(()=>this._host.createVisibleLine())}_createDomNode(){const e=ci(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");vu._ttPolicy&&(t=vu._ttPolicy.createHTML(t)),s.innerHTML=t;for(let o=0;on});vu._sb=new D0(1e5);class vJ extends Er{constructor(e){super(e),this._visibleLines=new _J(this),this.domNode=this._visibleLines.domNode;const i=this._context.configuration.options.get(50);Vs(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 xLe 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 NLe 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),Vs(this.domNode,t.get(50))}onConfigurationChanged(e){const t=this._context.configuration.options;Vs(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 ALe extends Er{constructor(e,t){super(e),this._viewDomNode=t,this._widgets={},this.domNode=ci(document.createElement("div")),Dd.write(this.domNode,1),this.domNode.setClassName("contentWidgets"),this.domNode.setPosition("absolute"),this.domNode.setTop(0),this.overflowingContentWidgetsDomNode=ci(document.createElement("div")),Dd.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 MLe(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 MLe{constructor(e,t,i){this._primaryAnchor=new c1(null,null),this._secondaryAnchor=new c1(null,null),this._context=e,this._viewDomNode=t,this._actual=i,this.domNode=ci(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 c1(null,null);const l=r.model.validatePosition(o);if(r.coordinatesConverter.modelPositionIsVisible(l)){const c=r.coordinatesConverter.convertModelPositionToViewPosition(l,a!=null?a:void 0);return new c1(o,c)}return new c1(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,w=f+i<=g.height-b;return this._fixedOverflowWidgets?{fitsAbove:C,aboveTop:Math.max(h,v),fitsBelow:w,belowTop:f,left:_}:{fitsAbove:C,aboveTop:a,fitsBelow:w,belowTop:l,left:p}}_prepareRenderWidgetAtExactPositionOverflowing(e){return new d1(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 b$(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"&&IM(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"&&IM(this._actual.afterRender,this._actual,this._renderData.position)}}class c1{constructor(e,t){this.modelPosition=e,this.viewPosition=t}}class d1{constructor(e,t){this.top=e,this.left=t,this._coordinateBrand=void 0}}class b${constructor(e,t,i){this.top=e,this.left=t,this.height=i,this._anchorCoordinateBrand=void 0}}function IM(n,e,...t){try{return n.call(e,...t)}catch{return null}}class bJ extends Zm{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 Je(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),yn(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 RLe extends bJ{_renderOne(e){const t="current-line"+(this._shouldRenderOther()?" current-line-both":"");return'
    ')}_shouldRenderThis(){return this._shouldRenderInContent()}_shouldRenderOther(){return this._shouldRenderInMargin()}}class PLe extends bJ{_renderOne(e){const t="current-line"+(this._shouldRenderInMargin()?" current-line-margin":"")+(this._shouldRenderOther()?" current-line-margin-both":"");return'
    ')}_shouldRenderThis(){return!0}_shouldRenderOther(){return this._shouldRenderInContent()}}bl((n,e)=>{const t=n.getColor(sJ);if(t&&(e.addRule(".monaco-editor .view-overlays .current-line { background-color: ".concat(t,"; }")),e.addRule(".monaco-editor .margin-view-overlays .current-line-margin { background-color: ".concat(t,"; border: none; }"))),!t||t.isTransparent()||n.defines(g$)){const i=n.getColor(g$);i&&(e.addRule(".monaco-editor .view-overlays .current-line { border: 2px solid ".concat(i,"; }")),e.addRule(".monaco-editor .margin-view-overlays .current-line-margin { border: 2px solid ".concat(i,"; }")),ac(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 OLe extends Zm{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:I.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 FLe extends Er{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 "+pO(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 c9(t.domNode,d,this._context.viewLayout.getScrollable())),Dd.write(this.scrollbar.getDomNode(),5),this.scrollbarDomNode=ci(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(ce(i.domNode,"scroll",h=>u(i.domNode,!0,!0))),this._register(ce(t.domNode,"scroll",h=>u(t.domNode,!0,!1))),this._register(ce(s.domNode,"scroll",h=>u(s.domNode,!0,!1))),this._register(ce(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 "+pO(this._context.theme.type)),!0}prepareRender(e){}render(e){this.scrollbar.renderNow()}}class CJ extends te{constructor(){super(...arguments),this._isDisposed=!1}dispose(){super.dispose(),this._isDisposed=!0}assertNotDisposed(){if(this._isDisposed)throw new Error("TextModelPart is disposed!")}}function Dx(n,e){let t=0,i=0;const s=n.length;for(;is)throw new Rn("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=S=>{if(a!==-1&&(a===-2||a>S-1)){a=-1,l=-1;for(let k=S-2;k>=0;k--){const D=this._computeIndentLevel(k);if(D>=0){a=k,l=D;break}}}if(c===-2){c=-1,d=-1;for(let k=S;k=0){c=k,d=D;break}}}};let h=-2,f=-1,g=-2,p=-1;const _=S=>{if(h===-2){h=-1,f=-1;for(let k=S-2;k>=0;k--){const D=this._computeIndentLevel(k);if(D>=0){h=k,f=D;break}}}if(g!==-1&&(g===-2||g=0){g=k,p=D;break}}}};let v=0,b=!0,C=0,w=!0,y=0,L=0;for(let S=0;b||w;S++){const k=e-S,D=e+S;S>1&&(k<1||k1&&(D>s||D>i)&&(w=!1),S>5e4&&(b=!1,w=!1);let x=-1;if(b&&k>=1){const T=this._computeIndentLevel(k-1);T>=0?(c=k-1,d=T,x=Math.ceil(T/this.textModel.getOptions().indentSize)):(u(k),x=this._getIndentLevelForWhitespaceLine(r,l,d))}let A=-1;if(w&&D<=s){const T=this._computeIndentLevel(D-1);T>=0?(h=D-1,f=T,A=Math.ceil(T/this.textModel.getOptions().indentSize)):(_(D),A=this._getIndentLevelForWhitespaceLine(r,f,p))}if(S===0){L=x;continue}if(S===1){if(D<=s&&A>=0&&L+1===A){b=!1,v=D,C=D,y=A;continue}if(k>=1&&x>=0&&x-1===L){w=!1,v=k,C=k,y=x;continue}if(v=e,C=e,y=L,y===0)return{startLineNumber:v,endLineNumber:C,indent:y}}b&&(x>=y?v=k:b=!1),w&&(A>=y?C=D:w=!1)}return{startLineNumber:v,endLineNumber:C,indent:y}}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 I(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(I.fromPositions(i)).toArray()).filter(f=>I.strictContainsPosition(f.range,i));c=(o=EE(h,f=>a))===null||o===void 0?void 0:o.range}const d=this.textModel.getOptions().bracketPairColorizationOptions.independentColorPoolPerBracketType,u=new wJ;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===jp.Enabled||s.horizontalGuides===jp.EnabledForActive&&f;if(h.range.startLineNumber===h.range.endLineNumber){v&&r[h.range.startLineNumber-e].push(new Ap(-1,h.openingBracketRange.getEndPosition().column,g,new yC(!1,_.column),-1,-1));continue}const b=this.getVisibleColumnFromPosition(_),C=this.getVisibleColumnFromPosition(h.openingBracketRange.getStartPosition()),w=Math.min(C,b,h.minVisibleColumnIndentation+1);let y=!1;bo(this.textModel.getLineContent(h.closingBracketRange.startLineNumber))=e&&C>w&&r[p.lineNumber-e].push(new Ap(w,-1,g,new yC(!1,p.column),-1,-1)),_.lineNumber<=t&&b>w&&r[_.lineNumber-e].push(new Ap(w,-1,g,new yC(!y,_.column),-1,-1)))}for(const h of r)h.sort((f,g)=>f.visibleColumn-g.visibleColumn);return r}getVisibleColumnFromPosition(e){return Zn.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&&C>this._maxIndentLeft)break;const w=b.horizontalLine?b.horizontalLine.top?"horizontal-top":"horizontal-bottom":"vertical",y=b.horizontalLine?((o=(s=e.visibleRangeForPosition(new Y(f,b.horizontalLine.endColumn)))===null||s===void 0?void 0:s.left)!==null&&o!==void 0?o:C+this._spaceWidth)-C: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?jp.Enabled:this._bracketPairGuideOptions.bracketPairsHorizontal==="active"?jp.EnabledForActive:jp.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 Ku(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(w=>w.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 k_(n){if(!(n&&n.isTransparent()))return n}bl((n,e)=>{const t=[{bracketColor:aJ,guideColor:YSe,guideColorActive:tLe},{bracketColor:lJ,guideColor:ZSe,guideColorActive:iLe},{bracketColor:cJ,guideColor:XSe,guideColorActive:nLe},{bracketColor:dJ,guideColor:QSe,guideColorActive:sLe},{bracketColor:uJ,guideColor:JSe,guideColorActive:oLe},{bracketColor:hJ,guideColor:eLe,guideColorActive:rLe}],i=new wJ,s=[{indentColor:CS,indentColorActive:wS},{indentColor:NSe,indentColorActive:OSe},{indentColor:ASe,indentColorActive:FSe},{indentColor:MSe,indentColorActive:BSe},{indentColor:RSe,indentColorActive:WSe},{indentColor:PSe,indentColorActive:VSe}],o=t.map(a=>{var l,c;const d=n.getColor(a.bracketColor),u=n.getColor(a.guideColor),h=n.getColor(a.guideColorActive),f=k_((l=k_(u))!==null&&l!==void 0?l:d==null?void 0:d.transparent(.3)),g=k_((c=k_(h))!==null&&c!==void 0?c:d);if(!(!f||!g))return{guideColor:f,guideColorActive:g}}).filter(uw),r=s.map(a=>{const l=n.getColor(a.indentColor),c=n.getColor(a.indentColorActive),d=k_(l),u=k_(c);if(!(!d||!u))return{indentColor:d,indentColorActive:u}}).filter(uw);if(o.length>0){for(let a=0;a<30;a++){const l=o[a%o.length];e.addRule(".monaco-editor .".concat(i.getInlineClassNameOfLevel(a).replace(/ /g,".")," { --guide-color: ").concat(l.guideColor,"; --guide-color-active: ").concat(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.".concat(i.activeClassName," { box-shadow: 1px 0 0 0 var(--guide-color-active) inset; }")),e.addRule(".monaco-editor .horizontal-top.".concat(i.activeClassName," { border-top: 1px solid var(--guide-color-active); }")),e.addRule(".monaco-editor .horizontal-bottom.".concat(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-".concat(a," { --indent-color: ").concat(l.indentColor,"; --indent-color-active: ").concat(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 TM{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 VLe{constructor(){this._currentVisibleRange=new I(1,1,1,1)}getCurrentVisibleRange(){return this._currentVisibleRange}setCurrentVisibleRange(e){this._currentVisibleRange=e}}class HLe{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 $Le{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 Si(()=>{this._checkMonospaceFontAssumptions()},2e3),this._lastRenderedData=new VLe,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 Gc(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,Vs(this.domNode,i),this._onOptionsMaybeChanged(),e.hasChanged(143)&&(this._maxLineWidth=0),!0}_onOptionsMaybeChanged(){const e=this._context.configuration,t=new d$(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 HLe(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 $Le(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 Y(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 TM(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=I.intersectRanges(e,this._lastRenderedData.getCurrentVisibleRange());if(!s)return null;const o=[];let r=0;const a=new TM(this.domNode.domNode,this._textRangeRestingSpot);let l=0;t&&(l=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(new Y(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 TM(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 Qye(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(),Co&&!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 C=1,w=o.length;Cl){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,C=h-l;_=Math.max(C,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-Ex.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}}Ex.HORIZONTAL_EXTRA_PX=30;class vO{constructor(e,t,i,s){this._decorationToRenderBrand=void 0,this.startLineNumber=+e,this.endLineNumber=+t,this.className=String(i),this.zIndex=s!=null?s:0}}class zLe{constructor(e,t){this.className=e,this.zIndex=t}}class ULe{constructor(){this.decorations=[]}add(e){this.decorations.push(e)}getDecorations(){return this.decorations}}class yJ extends Zm{_render(e,t,i){const s=[];for(let a=e;a<=t;a++){const l=a-e;s[l]=new ULe}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 qLe(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 KLe{constructor(e,t,i,s){this.lineNumber=e,this.lane=t,this.zIndex=i,this.className=s,this.type=0}accept(e){return new GLe(this.lineNumber,this.lane,e)}}class qLe{constructor(e,t,i,s){this.lineNumber=e,this.lane=t,this.zIndex=i,this.widget=s,this.type=1}}class GLe{constructor(e,t,i){this.lineNumber=e,this.lane=t,this.combinedClassName=i}}class YLe extends yJ{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 wa{constructor(e,t,i,s){this._rgba8Brand=void 0,this.r=wa._clamp(e),this.g=wa._clamp(t),this.b=wa._clamp(i),this.a=wa._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}}wa.Empty=new wa(0,0,0,0);class SS extends te{static getInstance(){return this._INSTANCE||(this._INSTANCE=new SS),this._INSTANCE}constructor(){super(),this._onDidChange=new j,this.onDidChange=this._onDidChange.event,this._updateColorMap(),this._register(nn.onDidChange(e=>{e.changedColorMap&&this._updateColorMap()}))}_updateColorMap(){const e=nn.getColorMap();if(!e){this._colors=[wa.Empty],this._backgroundIsLight=!0;return}this._colors=[wa.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}}SS._INSTANCE=null;const XLe=(()=>{const n=[];for(let e=32;e<=126;e++)n.push(e);return n.push(65533),n})(),QLe=(n,e)=>(n-=32,n<0||n>96?e<=2?(n+96)%96:96-1:n);class Ww{constructor(e,t){this.scale=t,this._minimapCharRendererBrand=void 0,this.charDataNormal=Ww.soften(e,12/15),this.charDataLight=Ww.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,_=QLe(s,c),v=e.width*4,b=a.r,C=a.g,w=a.b,y=o.r-b,L=o.g-C,S=o.b-w,k=Math.max(r,l),D=e.data;let x=_*h*f,A=i*v+t*4;for(let T=0;Te.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,C=s.b-_,w=g+v*f,y=p+b*f,L=_+C*f,S=Math.max(o,a),k=e.data;let D=i*h+t*4;for(let x=0;x{const e=new Uint8ClampedArray(n.length/2);for(let t=0;t>1]=C$[n[t]]<<4|C$[n[t+1]]&15;return e},y$={1:$f(()=>w$("0000511D6300CF609C709645A78432005642574171487021003C451900274D35D762755E8B629C5BA856AF57BA649530C167D1512A272A3F6038604460398526BCA2A968DB6F8957C768BE5FBE2FB467CF5D8D5B795DC7625B5DFF50DE64C466DB2FC47CD860A65E9A2EB96CB54CE06DA763AB2EA26860524D3763536601005116008177A8705E53AB738E6A982F88BAA35B5F5B626D9C636B449B737E5B7B678598869A662F6B5B8542706C704C80736A607578685B70594A49715A4522E792")),2:$f(()=>w$("000000000000000055394F383D2800008B8B1F210002000081B1CBCBCC820000847AAF6B9AAF2119BE08B8881AD60000A44FD07DCCF107015338130C00000000385972265F390B406E2437634B4B48031B12B8A0847000001E15B29A402F0000000000004B33460B00007A752C2A0000000000004D3900000084394B82013400ABA5CFC7AD9C0302A45A3E5A98AB000089A43382D97900008BA54AA087A70A0248A6A7AE6DBE0000BF6F94987EA40A01A06DCFA7A7A9030496C32F77891D0000A99FB1A0AFA80603B29AB9CA75930D010C0948354D3900000C0948354F37460D0028BE673D8400000000AF9D7B6E00002B007AA8933400007AA642675C2700007984CFB9C3985B768772A8A6B7B20000CAAECAAFC4B700009F94A6009F840009D09F9BA4CA9C0000CC8FC76DC87F0000C991C472A2000000A894A48CA7B501079BA2C9C69BA20000B19A5D3FA89000005CA6009DA2960901B0A7F0669FB200009D009E00B7890000DAD0F5D092820000D294D4C48BD10000B5A7A4A3B1A50402CAB6CBA6A2000000B5A7A4A3B1A8044FCDADD19D9CB00000B7778F7B8AAE0803C9AB5D3F5D3F00009EA09EA0BAB006039EA0989A8C7900009B9EF4D6B7C00000A9A7816CACA80000ABAC84705D3F000096DA635CDC8C00006F486F266F263D4784006124097B00374F6D2D6D2D6D4A3A95872322000000030000000000008D8939130000000000002E22A5C9CBC70600AB25C0B5C9B400061A2DB04CA67001082AA6BEBEBFC606002321DACBC19E03087AA08B6768380000282FBAC0B8CA7A88AD25BBA5A29900004C396C5894A6000040485A6E356E9442A32CD17EADA70000B4237923628600003E2DE9C1D7B500002F25BBA5A2990000231DB6AFB4A804023025C0B5CAB588062B2CBDBEC0C706882435A75CA20000002326BD6A82A908048B4B9A5A668000002423A09CB4BB060025259C9D8A7900001C1FCAB2C7C700002A2A9387ABA200002626A4A47D6E9D14333163A0C87500004B6F9C2D643A257049364936493647358A34438355497F1A0000A24C1D590000D38DFFBDD4CD3126"))};class SC{static create(e,t){if(this.lastCreated&&e===this.lastCreated.scale&&t===this.lastFontFamily)return this.lastCreated;let i;return y$[e]?i=new Ww(y$[e](),e):i=SC.createFromSampleData(SC.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 ".concat(e),i.textBaseline="middle";let s=0;for(const o of XLe)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=SC._downsample(e,t);return new Ww(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;dSC.create(this.fontScale,l.fontFamily)),this.defaultBackgroundColor=i.getColor(2),this.backgroundColor=Vw._getMinimapBackground(t,this.defaultBackgroundColor),this.foregroundAlpha=Vw._getMinimapForegroundOpacity(t)}static _getMinimapBackground(e,t){const i=e.getColor(Pye);return i?new wa(i.rgba.r,i.rgba.g,i.rgba.b,Math.round(255*i.rgba.a)):t}static _getMinimapForegroundOpacity(e){const t=e.getColor(Oye);return t?wa._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 LC{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 S=Math.max(1,Math.floor(o*o/L)),k=Math.max(0,e.minimapHeight-S),D=k/(d-o),x=c*D,A=k>0,T=Math.floor(e.canvasInnerHeight/e.minimapLineHeight),P=Math.floor(e.paddingTop/e.lineHeight);return new LC(c,d,A,D,x,S,P,1,Math.min(a,T))}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 C;if(b>0){const L=o/p;C=(v+a+b-L-1)*f/h}else C=Math.max(0,(v+a)*f/h-_);C=Math.min(e.minimapHeight-_,C);const w=C/(d-o),y=c*w;if(g>=v+a+b){const L=C>0;return new LC(c,d,L,w,y,_,v,1,a)}else{let L;t>1?L=t+v:L=Math.max(1,c/p);let S,k=Math.max(1,Math.floor(L-y*h/f));kc&&(k=Math.min(k,u.startLineNumber),S=Math.max(S,u.topPaddingLineCount)),u.scrollTop=e.paddingTop?A=(t-k+S+x)*f/h:A=c/e.paddingTop*(S+x)*f/h,new LC(c,d,!0,w,A,_,S,k,D)}}}class WE{constructor(e){this.dy=e}onContentChanged(){this.dy=-1}onTokensChanged(){this.dy=-1}}WE.INVALID=new WE(-1);class S${constructor(e,t,i){this.renderedLayout=e,this._imageData=t,this._renderedLines=new mJ(()=>WE.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]=Hw.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=Un(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 I0,this._sliderPointerDownListener=In(this._slider.domNode,Pe.POINTER_DOWN,i=>{i.preventDefault(),i.stopPropagation(),i.button===0&&this._lastRenderData&&this._startSliderDragging(i,i.pageY,this._lastRenderData.renderedLayout)}),this._gestureDisposable=Ii.addTarget(this._domNode.domNode),this._sliderTouchStartListener=ce(this._domNode.domNode,Ti.Start,i=>{i.preventDefault(),i.stopPropagation(),this._lastRenderData&&(this._slider.toggleClassName("active",!0),this._gestureInProgress=!0,this.scrollDueToTouchEvent(i))},{passive:!1}),this._sliderTouchMoveListener=ce(this._domNode.domNode,Ti.Change,i=>{i.preventDefault(),i.stopPropagation(),this._lastRenderData&&this._gestureInProgress&&this.scrollDueToTouchEvent(i)},{passive:!1}),this._sliderTouchEndListener=In(this._domNode.domNode,Ti.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=Un(this._domNode.domNode),c=Math.min(Math.abs(a-s),Math.abs(a-l.left),Math.abs(a-l.left-l.width));if(zs&&c>JLe){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 h9(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(r$),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=LC.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(I.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 L$(e.startLineNumber,e.endLineNumber,!1);this._renderSelectionLineHighlights(c,t,d,e,r),this._renderDecorationsLineHighlights(c,i,d,e,r);const u=new L$(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(Dh,r,e.canvas.width,a-r),r=h),a=f}a>r&&e.fillRect(Dh,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!==yr.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(Dh,_,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 yr.Inline:this.renderDecorationOnLine(e,i,c.range,g,s,p,o,o,r,a,l);continue;case yr.Gutter:{const _=s.getYForLineNumber(p,o),v=2;this.renderDecoration(e,g,v,_,eke,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 Dh;if((i-1)*o>=r)return r;let l=e.get(t);if(!l){const c=this._model.getLineContent(t);l=[Dh];let d=Dh;for(let u=1;u=r){l[u]=r;break}l[u]=g,d=g}e.set(t,l)}return i-1y?Math.floor((s-y)/2):0,S=h.a/255,k=new wa(Math.round((h.r-u.r)*S+u.r),Math.round((h.g-u.g)*S+u.g),Math.round((h.b-u.b)*S+u.b),255);let D=e.topPaddingLineCount*s;const x=[];for(let $=0,X=i-t+1;$=0&&Ab)return;const T=_.charCodeAt(y);if(T===9){const P=h-(y+L)%h;L+=P-1,w+=P*r}else if(T===32)w+=r;else{const P=zf(T)?2:1;for(let W=0;Wb)return}}}}}class L${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 ike extends Er{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=ci(document.createElement("div")),Dd.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=ci(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&&ee.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 ske extends Er{constructor(e){super(e),this._actualShouldRender=0,this._renderedDecorations=[],this._renderedCursorPositions=[],this._domNode=ci(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=nn.onDidChange(t=>{t.changedColorMap&&this._updateSettings(!0)}),this._cursorPositions=[]}dispose(){super.dispose(),this._tokensColorTrackerListener.dispose()}_updateSettings(e){const t=new nke(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=ee.Format.CSS.formatHexA(e),u.fillRect(0,0,i,s)):(u.clearRect(0,0,i,s),u.fillStyle=ee.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,C=0;for(let w=0,y=_.length/3;ws&&(T=s-d),D=T-d,x=T+d}D>C+1||L!==v?(w!==0&&u.fillRect(h[v],b,f[v],C-b),v=L,b=D,C=x):x>C&&(C=x)}u.fillRect(h[v],b,f[v],C-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,C=-100;for(let w=0,y=this._cursorPositions.length;ws&&(S=s-p);const k=S-p,D=k+g;k>C+1?(w!==0&&u.fillRect(_,b,v,C-b),b=k,C=D):D>C&&(C=D)}u.fillRect(_,b,v,C-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 k${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 SJ{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 C=new k$(p-_,p+_,b);d.setColorZone(C),a.push(C)}return this._colorZonesInvalid=!1,a.sort(k$.compare),a}}class rke extends _S{constructor(e,t){super(),this._context=e;const i=this._context.configuration.options;this._domNode=ci(document.createElement("canvas")),this._domNode.setClassName(t),this._domNode.setPosition("absolute"),this._domNode.setLayerHinting(!0),this._domNode.setContain("strict"),this._zoneManager=new oke(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 ake extends Er{constructor(e){super(e),this.domNode=ci(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=ci(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 cke{constructor(e){this.left=e.left,this.width=e.width,this.startStyle=null,this.endStyle=null}}class dke{constructor(e,t){this.lineNumber=e,this.ranges=t}}function uke(n){return new cke(n)}function hke(n){return new dke(n.lineNumber,n.ranges.map(uke))}class _n extends Zm{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;ML(d-g)g&&(h.top=1),ML(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]}}_n.SELECTION_CLASS_NAME="selected-text";_n.SELECTION_TOP_LEFT="top-left-radius";_n.SELECTION_BOTTOM_LEFT="bottom-left-radius";_n.SELECTION_TOP_RIGHT="top-right-radius";_n.SELECTION_BOTTOM_RIGHT="bottom-right-radius";_n.EDITOR_BACKGROUND_CLASS_NAME="monaco-editor-background";_n.ROUNDED_PIECE_WIDTH=10;bl((n,e)=>{const t=n.getColor(Hwe);t&&!t.isTransparent()&&e.addRule(".monaco-editor .view-line span.inline-selected-text { color: ".concat(t,"; }"))});function ML(n){return n<0?-n:n}class D${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 E${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=ci(document.createElement("div")),this._domNode.setClassName("cursor ".concat(Kv)),this._domNode.setHeight(this._lineHeight),this._domNode.setTop(0),this._domNode.setLeft(0),Vs(this._domNode,i),this._domNode.setDisplay("none"),this._position=new Y(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),Vs(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]=Eve(i,t-1);return[new Y(e,s+1),i.substring(s,o)]}_prepareRender(e){let t="",i="";const[s,o]=this._getGraphemeAwarePosition();if(this._cursorStyle===ws.Line||this._cursorStyle===ws.LineThin){const h=e.visibleRangeForPosition(s);if(!h||h.outsideRenderedLine)return null;let f;this._cursorStyle===ws.Line?(f=oH(this._lineCursorWidth>0?this._lineCursorWidth:2),f>2&&(t=o,i=this._getTokenClassName(s))):f=oH(1);let g=h.left,p=0;f>=2&&g>=1&&(p=1,g-=p);const _=e.getVerticalOffsetForLineNumber(s.lineNumber)-e.bigNumbersDelta;return new D$(_,g,p,f,this._lineHeight,t,i)}const r=e.linesVisibleRangesForRange(new I(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===ws.Block&&(t=o,i=this._getTokenClassName(s));let d=e.getVerticalOffsetForLineNumber(s.lineNumber)-e.bigNumbersDelta,u=this._lineHeight;return(this._cursorStyle===ws.Underline||this._cursorStyle===ws.UnderlineThin)&&(d+=this._lineHeight-2,u=2),new D$(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 ".concat(Kv," ").concat(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 $w extends Er{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 E$(this._context),this._secondaryCursors=[],this._renderData=[],this._domNode=ci(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 _l,this._cursorFlatBlinkInterval=new uS,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()},$w.BLINK_INTERVAL):this._startCursorBlinkAnimation.setIfNotSet(()=>{this._blinkingEnabled=!0,this._updateDomClassName()},$w.BLINK_INTERVAL))}_updateDomClassName(){this._domNode.setClassName(this._getClassName())}_getClassName(){let e="cursors-layer";switch(this._selectionIsEmpty||(e+=" has-selection"),this._cursorStyle){case ws.Line:e+=" cursor-line-style";break;case ws.Block:e+=" cursor-block-style";break;case ws.Underline:e+=" cursor-underline-style";break;case ws.LineThin:e+=" cursor-line-thin-style";break;case ws.BlockOutline:e+=" cursor-block-outline-style";break;case ws.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(oJ);if(t){let i=n.getColor(TSe);i||(i=t.opposite()),e.addRule(".monaco-editor .cursors-layer .cursor { background-color: ".concat(t,"; border-color: ").concat(t,"; color: ").concat(i,"; }")),ac(n.type)&&e.addRule(".monaco-editor .cursors-layer.has-selection .cursor { border-left: 1px solid ".concat(i,"; border-right: 1px solid ").concat(i,"; }"))}});const xM=()=>{throw new Error("Invalid change accessor")};class fke extends Er{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=ci(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=ci(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)}};gke(e,s),s.addZone=xM,s.removeZone=xM,s.layoutZone=xM}),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:ci(t.domNode),marginDomNode:t.marginDomNode?ci(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){Dt(i)}}_safeCallOnDomNodeTop(e,t){if(typeof e.onDomNodeTop=="function")try{e.onDomNodeTop(t)}catch(i){Dt(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=x.endOffset&&(D++,x=i&&i[D]),P!==9&&P!==32||h&&!L&&T<=k)continue;if(u&&T>=S&&T<=k&&P===32){const $=T-1>=0?a.charCodeAt(T-1):0,X=T+1=0?a.charCodeAt(T-1):0;if(P===32&&$!==32&&$!==9)continue}if(i&&(!x||x.startOffset>T||x.endOffset<=T))continue;const W=e.visibleRangeForPosition(new Y(t,T+1));W&&(r?(A=Math.max(A,W.left),P===9?y+=this._renderArrow(f,_,W.left):y+='')):P===9?y+='
    ').concat(w?String.fromCharCode(65515):String.fromCharCode(8594),"
    "):y+='
    ').concat(String.fromCharCode(C),"
    "))}return r?(A=Math.round(A+_),'')+y+""):y}_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},C=[l,c,d,u,h,f,g,p,_,v].map(w=>"".concat((a+w.x).toFixed(2)," ").concat((r+w.y).toFixed(2))).join(" L ");return'')}render(e,t){if(!this._renderResult)return"";const i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}}class I${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 Cke=globalThis&&globalThis.__decorate||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},wke=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let bO=class extends _S{constructor(e,t,i,s,o,r,a){super(),this._instantiationService=a,this._shouldRecomputeGlyphMarginLanes=!1,this._selections=[new Je(1,1,1,1)],this._renderAnimationFrame=null;const l=new ILe(t,s,o,e);this._context=new mke(t,i,s),this._context.addEventHandler(this),this._viewParts=[],this._textAreaHandler=this._instantiationService.createInstance(mO,this._context,l,this._createTextAreaHandlerHelper()),this._viewParts.push(this._textAreaHandler),this._linesContent=ci(document.createElement("div")),this._linesContent.setClassName("lines-content monaco-editor-background"),this._linesContent.setPosition("absolute"),this.domNode=ci(document.createElement("div")),this.domNode.setClassName(this._getEditorClassName()),this.domNode.setAttribute("role","code"),this._overflowGuardContainer=ci(document.createElement("div")),Dd.write(this._overflowGuardContainer,3),this._overflowGuardContainer.setClassName("overflow-guard"),this._scrollbar=new FLe(this._context,this._linesContent,this.domNode,this._overflowGuardContainer),this._viewParts.push(this._scrollbar),this._viewLines=new Ex(this._context,this._linesContent),this._viewZones=new fke(this._context),this._viewParts.push(this._viewZones);const c=new ske(this._context);this._viewParts.push(c);const d=new lke(this._context);this._viewParts.push(d);const u=new xLe(this._context);this._viewParts.push(u),u.addDynamicOverlay(new RLe(this._context)),u.addDynamicOverlay(new _n(this._context)),u.addDynamicOverlay(new WLe(this._context)),u.addDynamicOverlay(new OLe(this._context)),u.addDynamicOverlay(new bke(this._context));const h=new NLe(this._context);this._viewParts.push(h),h.addDynamicOverlay(new PLe(this._context)),h.addDynamicOverlay(new ZLe(this._context)),h.addDynamicOverlay(new YLe(this._context)),h.addDynamicOverlay(new yS(this._context)),this._glyphMarginWidgets=new jLe(this._context),this._viewParts.push(this._glyphMarginWidgets);const f=new dm(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 ALe(this._context,this.domNode),this._viewParts.push(this._contentWidgets),this._viewCursors=new $w(this._context),this._viewParts.push(this._viewCursors),this._overlayWidgets=new ike(this._context),this._viewParts.push(this._overlayWidgets);const g=new ake(this._context);this._viewParts.push(g);const p=new vke(this._context);this._viewParts.push(p);const _=new tke(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 DSe(this._context,l,this._createPointerHandlerHelper()))}_flushAccumulatedAndRenderNow(){this._shouldRecomputeGlyphMarginLanes&&(this._shouldRecomputeGlyphMarginLanes=!1,this._context.configuration.setGlyphMarginDecorationLaneCount(this._computeGlyphMarginLaneCount())),nf.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:$v.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)=>I.compareRangesUsingStarts(o.range,r.range));let i=null,s=null;for(const o of t)if(o.lane===$v.Left&&(!i||I.compareRangesUsingEnds(i,o.range)<0)&&(i=o.range),o.lane===$v.Right&&(!s||I.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 nSe(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 Y(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)+" "+pO(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=bE(this._onRenderScheduled.bind(this),100))}_onRenderScheduled(){this._renderAnimationFrame=null,this._flushAccumulatedAndRenderNow()}_renderNow(){yke(()=>this._actualRender())}_getViewPartsToRender(){const e=[];let t=0;for(const i of this._viewParts)i.shouldRender()&&(e[t++]=i);return e}_actualRender(){if(!O8(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 _ke(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 Zye(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 Y(s.lineNumber,s.column));return o?o.left:-1}getTargetAtClientPoint(e,t){const i=this._pointerHandler.getTargetAtClientPoint(e,t);return i?kx.convertViewToModelMouseTarget(i,this._context.viewModel.coordinatesConverter):null}createOverviewRuler(e){return new rke(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()}};bO=Cke([wke(6,_t)],bO);function yke(n){try{return n()}catch(e){Dt(e)}}class LJ{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 Xf(n){let e=0,t=0,i=0,s=0;for(let o=0,r=n.length;o=jr&&(t=t-n%jr),t}function Eke(n,e){return n.reduce((t,i)=>on(t,e(i)),No)}function kJ(n,e){return n===e}function Uw(n,e){const t=n,i=e;if(i-t<=0)return No;const o=Math.floor(t/jr),r=Math.floor(i/jr),a=i-r*jr;if(o===r){const l=t-o*jr;return kn(0,a-l)}else return kn(r-o,a)}function Yv(n,e){return n=e}function gv(n){return kn(n.lineNumber-1,n.column-1)}function Kp(n,e){const t=n,i=Math.floor(t/jr),s=t-i*jr,o=e,r=Math.floor(o/jr),a=o-r*jr;return new I(i+1,s+1,r+1,a+1)}function Ike(n){const e=Sd(n);return kn(e.length-1,e[e.length-1].length)}class Tu{static fromModelContentChanges(e){return e.map(i=>{const s=I.lift(i.range);return new Tu(gv(s.getStartPosition()),gv(s.getEndPosition()),Ike(i.text))}).reverse()}constructor(e,t,i){this.startOffset=e,this.endOffset=t,this.newLength=i}toString(){return"[".concat(ka(this.startOffset),"...").concat(ka(this.endOffset),") -> ").concat(ka(this.newLength))}}class Tke{constructor(e){this.nextEditIdx=0,this.deltaOldToNewLineCount=0,this.deltaOldToNewColumnCount=0,this.deltaLineIdxInOld=-1,this.edits=e.map(t=>f9.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:Uw(e,i)}translateOldToCur(e){return e.lineCount===this.deltaLineIdxInOld?kn(e.lineCount+this.deltaOldToNewLineCount,e.columnCount+this.deltaOldToNewColumnCount):kn(e.lineCount+this.deltaOldToNewLineCount,e.columnCount)}translateCurToOld(e){const t=ka(e);return t.lineCount-this.deltaOldToNewLineCount===this.deltaLineIdxInOld?kn(t.lineCount-this.deltaOldToNewLineCount,t.columnCount-this.deltaOldToNewColumnCount):kn(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=kke(e,t,this.lineIdx,this.lineCharOffset);return new jh(s,0,-1,$n.getEmpty(),new bp(s))}}class Pke{constructor(e,t){this.text=e,this._offset=No,this.idx=0;const i=t.getRegExpStr(),s=i?new RegExp(i+"|\n","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 jh(kn(0,g),0,-1,$n.getEmpty(),new bp(kn(0,g))));const h=[];for(let g=0;g<60;g++)h.push(new jh(kn(1,g),0,-1,$n.getEmpty(),new bp(kn(1,g))));if(s)for(s.lastIndex=0;(r=s.exec(e))!==null;){const g=r.index,p=r[0];if(p==="\n")a++,l=g+1;else{if(c!==g){let _;if(d===a){const v=g-c;if(vOke(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 Oke(n){let e=Xr(n);return/^[\w ]+/.test(n)&&(e="\\b".concat(e)),/[\w ]+$/.test(n)&&(e="".concat(e,"\\b")),e}class IJ{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=m9.createFromLanguage(this.getLanguageConfiguration(e),this.denseKeyProvider),this.languageIdToBracketTokens.set(e,t)),t}}function Fke(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())N$(i,s)<=N$(s,r)?(i=NM(i,s),s=r):s=NM(s,r);return NM(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 N$(n,e){return Math.abs(n.listHeight-e.listHeight)}function NM(n,e){return n.listHeight===e.listHeight?Ed.create23(n,e,null,!1):n.listHeight>e.listHeight?Bke(n,e):Wke(e,n)}function Bke(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=Ed.create23(r.unappendChild(),s,null,!1):(r.appendChildOfSameHeight(s),s=void 0):r.handleChildrenChanged()}return s?Ed.create23(n,s,null,!1):n}function Wke(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=Ed.create23(s,r.unprependChild(),null,!1):(r.prependChildOfSameHeight(s),s=void 0):r.handleChildrenChanged()}return s?Ed.create23(s,n,null,!1):n}class Vke{constructor(e){this.lastOffset=No,this.nextNodes=[e],this.offsets=[No],this.idxs=[]}readLongestNodeAt(e,t){if(Yv(e,this.lastOffset))throw new Error("Invalid offset");for(this.lastOffset=e;;){const i=u1(this.nextNodes);if(!i)return;const s=u1(this.offsets);if(Yv(e,s))return;if(Yv(s,e))if(on(s,i.length)<=e)this.nextNodeAfterCurrent();else{const o=AM(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=AM(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=u1(this.offsets),t=u1(this.nextNodes);if(this.nextNodes.pop(),this.offsets.pop(),this.idxs.length===0)break;const i=u1(this.nextNodes),s=AM(i,this.idxs[this.idxs.length-1]);if(s!==-1){this.nextNodes.push(i.getChild(s)),this.offsets.push(on(e,t.length)),this.idxs[this.idxs.length-1]=s;break}else this.idxs.pop()}}}function AM(n,e=-1){for(;;){if(e++,e>=n.childrenLength)return-1;if(n.getChild(e))return e}}function u1(n){return n.length>0?n[n.length-1]:void 0}function CO(n,e,t,i){return new Hke(n,e,t,i).parseDocument()}class Hke{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 Vke(i):void 0,this.positionMapper=new Tke(t)}parseDocument(){this._itemsConstructed=0,this._itemsFromCache=0;let e=this.parseList($n.getEmpty(),0);return e||(e=Ed.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?Fke(i):TJ(i,this.createImmutableLists)}tryReadChildFromCache(e){if(this.oldNodeReader){const t=this.positionMapper.getDistanceToNextChange(this.tokenizer.offset);if(t===null||!HE(t)){const i=this.oldNodeReader.readLongestNodeAt(this.positionMapper.getOffsetBeforeChange(this.tokenizer.offset),s=>t!==null&&!Yv(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 Mke(i.bracketIds,i.length);case 0:return i.astNode;case 1:{if(t>300)return new bp(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(),jw.create(i.astNode,o,r.astNode)):jw.create(i.astNode,o,null)}default:throw new Error("unexpected")}}}function UE(n,e){if(n.length===0)return e;if(e.length===0)return n;const t=new Ku(A$(n)),i=A$(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&&!HE(c);){const[u,h]=s.splitAt(c);d.push(u),c=Uw(u.lengthAfter,c),s=h!=null?h:t.dequeue()}return HE(c)||d.push(new sf(!1,c,c)),d}const r=[];function a(c,d,u){if(r.length>0&&kJ(r[r.length-1].endOffset,c)){const h=r[r.length-1];r[r.length-1]=new Tu(h.startOffset,d,on(h.newLength,u))}else r.push({startOffset:c,endOffset:d,newLength:u})}let l=No;for(const c of i){const d=o(c.lengthBefore);if(c.modified){const u=Eke(d,f=>f.lengthBefore),h=on(l,u);a(l,h,c.lengthAfter),l=h}else for(const u of d){const h=l;l=on(l,u.lengthBefore),u.modified&&a(h,l,u.lengthAfter)}}return r}class sf{constructor(e,t,i){this.modified=e,this.lengthBefore=t,this.lengthAfter=i}splitAt(e){const t=Uw(e,this.lengthAfter);return kJ(t,No)?[this,void 0]:this.modified?[new sf(this.modified,this.lengthBefore,e),new sf(this.modified,No,t)]:[new sf(this.modified,e,e),new sf(this.modified,t,t)]}toString(){return"".concat(this.modified?"M":"U",":").concat(ka(this.lengthBefore)," -> ").concat(ka(this.lengthAfter))}}function A$(n){const e=[];let t=No;for(const i of n){const s=Uw(t,i.startOffset);HE(s)||e.push(new sf(!1,s,s));const o=Uw(i.startOffset,i.endOffset);e.push(new sf(!0,o,i.newLength)),t=i.endOffset}return e}class $ke extends te{didLanguageChange(e){return this.brackets.didLanguageChange(e)}constructor(e,t){if(super(),this.textModel=e,this.getLanguageConfiguration=t,this.didChangeEmitter=new j,this.denseKeyProvider=new DJ,this.brackets=new IJ(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 Pke(this.textModel.getValue(),i);this.initialAstWithoutTokens=CO(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 Tu(kn(i.fromLineNumber-1,0),kn(i.toLineNumber,0),kn(i.toLineNumber-i.fromLineNumber+1,0)));this.handleEdits(t,!0),this.initialAstWithoutTokens||this.didChangeEmitter.fire()}handleContentChanged(e){const t=Tu.fromModelContentChanges(e.changes);this.handleEdits(t,!1)}handleEdits(e,t){const i=UE(this.queuedTextEdits,e);this.queuedTextEdits=i,this.initialAstWithoutTokens&&!t&&(this.queuedTextEditsForInitialAstWithoutTokens=UE(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 EJ(this.textModel,this.brackets);return CO(o,e,s,i)}getBracketsInRange(e,t){this.flushQueue();const i=kn(e.startLineNumber-1,e.startColumn-1),s=kn(e.endLineNumber-1,e.endColumn-1);return new fd(o=>{const r=this.initialAstWithoutTokens||this.astWithTokens;wO(r,No,r.length,i,s,o,0,0,new Map,t)})}getBracketPairsInRange(e,t){this.flushQueue();const i=gv(e.getStartPosition()),s=gv(e.getEndPosition());return new fd(o=>{const r=this.initialAstWithoutTokens||this.astWithTokens,a=new zke(o,t,this.textModel);yO(r,No,r.length,i,s,a,0,new Map)})}getFirstBracketAfter(e){this.flushQueue();const t=this.initialAstWithoutTokens||this.astWithTokens;return NJ(t,No,t.length,gv(e))}getFirstBracketBefore(e){this.flushQueue();const t=this.initialAstWithoutTokens||this.astWithTokens;return xJ(t,No,t.length,gv(e))}}function xJ(n,e,t,i){if(n.kind===4||n.kind===2){const s=[];for(const o of n.children)t=on(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(Yv(r,i)){const l=xJ(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=Kp(e,t);return{bracketInfo:n.bracketInfo,range:s}}}return null}function NJ(n,e,t,i){if(n.kind===4||n.kind===2){for(const s of n.children){if(t=on(e,s.length),Yv(i,t)){const o=NJ(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=Kp(e,t);return{bracketInfo:n.bracketInfo,range:s}}}return null}function wO(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=on(e,n.openingBracket.length);let h=-1;if(o.includeMinIndentation&&(h=n.computeMinIndentation(e,o.textModel)),c=o.push(new Lke(Kp(e,t),Kp(e,u),n.closingBracket?Kp(on(u,((l=n.child)===null||l===void 0?void 0:l.length)||No),t):void 0,r,d,n,h)),e=u,c&&n.child){const f=n.child;if(t=on(e,f.length),Zv(e,s)&&K1(t,i)&&(c=yO(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=on(d,u.length),Zv(h,s)&&Zv(i,d)&&(c=yO(u,h,d,i,s,o,r,a),!c))return!1}}return c}class Uke extends te{get canBuildAST(){return this.textModel.getValueLength()<=5e6}constructor(e,t){super(),this.textModel=e,this.languageConfigurationService=t,this.bracketPairsTree=this._register(new Ts),this.onDidChangeEmitter=new j,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 be;this.bracketPairsTree.value=jke(e.add(new $ke(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))||fd.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))||fd.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))||fd.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(I.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?RL(this._findMatchingBracketUp(l,s,MM(i))):null}}matchBracket(e,t){if(this.canBuildAST){const i=this.getBracketPairsInRange(I.fromPositions(e,e)).filter(s=>s.closingBracketRange!==void 0&&(s.openingBracketRange.containsPosition(e)||s.closingBracketRange.containsPosition(e))).findLastMaxBy(Sa(s=>s.openingBracketRange.containsPosition(e)?s.openingBracketRange:s.closingBracketRange,I.compareRangesUsingStarts));return i?[i.openingBracketRange,i.closingBracketRange]:null}else{const i=MM(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(Nc(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(Nc(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&&!Nc(s.getStandardTokenType(r))){let{searchStartOffset:l,searchEndOffset:c}=this._establishBracketSearchOffsets(e,s,a,r),d=null;for(;;){const u=Ga.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 uu)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&&!Nc(s.getStandardTokenType(l))){const{searchStartOffset:d,searchEndOffset:u}=this._establishBracketSearchOffsets(e,s,c,l),h=Ga.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 uu?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 uu?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 uu.INSTANCE;const f=Ga.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&&!Nc(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 uu.INSTANCE;const g=Ga.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=Ga.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&&!Nc(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=Ga.findPrevBracketInRange(o.reversedRegex,a,d,h,f);if(v)return this._toFoundBracket(r,v)}g=_}if(r&&o&&g&&h!==f){const p=Ga.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=MM(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 uu.INSTANCE;const b=Ga.findNextBracketInRange(f.forwardRegex,g,p,_,v);if(!b)break;const C=p.substring(b.startColumn-1,b.endColumn-1).toLowerCase(),w=f.textIsBracket[C];if(w&&(w.isOpen(C)?a[w.index]++:w.isClose(C)&&a[w.index]--,a[w.index]===-1))return this._matchFoundBracket(b,w,!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,C=0;if(f===i.lineNumber){v=g.findTokenIndexAtOffset(i.column-1),b=i.column-1,C=i.column-1;const y=g.getLanguageId(v);u!==y&&(u=y,h=this.languageConfigurationService.getLanguageConfiguration(u).brackets,l(u,h))}let w=!0;for(;ve==null?void 0:e.dispose()}}function MM(n){if(typeof n>"u")return()=>!0;{const e=Date.now();return()=>Date.now()-e<=n}}class uu{constructor(){this._searchCanceledBrand=void 0}}uu.INSTANCE=new uu;function RL(n){return n instanceof uu?null:n}class Kke extends te{constructor(e){super(),this.textModel=e,this.colorProvider=new AJ,this.onDidChangeEmitter=new j,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".concat(r.range.toString(),"-").concat(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 I(1,1,this.textModel.getLineCount(),1),e,t):[]}}class AJ{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-".concat(e%30)}}bl((n,e)=>{const t=[aJ,lJ,cJ,dJ,uJ,hJ],i=new AJ;e.addRule(".monaco-editor .".concat(i.unexpectedClosingBracketClassName," { color: ").concat(n.getColor(GSe),"; }"));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 .".concat(i.getInlineClassNameOfLevel(o)," { color: ").concat(r,"; }"))}});function PL(n){return n.replace(/\n/g,"\\n").replace(/\r/g,"\\r")}class Ps{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@".concat(this.oldPosition,' "').concat(PL(this.newText),'")'):this.newText.length===0?"(delete@".concat(this.oldPosition,' "').concat(PL(this.oldText),'")'):"(replace@".concat(this.oldPosition,' "').concat(PL(this.oldText),'" with "').concat(PL(this.newText),'")')}static _writeStringSize(e){return 4+2*e.length}static _writeString(e,t,i){const s=t.length;Fl(e,s,i),i+=4;for(let o=0;on.length)return!1;if(t){if(!k8(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 RJ(n){return n>=65&&n<=90||n>=97&&n<=122}function Yke(n,e=zs){return e?RJ(n.charCodeAt(0))&&n.charCodeAt(1)===58:!1}function Ac(n){return hE(n,!0)}class Zke{constructor(e){this._ignorePathCasing=e}compare(e,t,i=!1){return e===t?0:_w(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===Nt.file)return SO(Ac(e),Ac(t),this._ignorePathCasing(e))&&e.query===t.query&&(i||e.fragment===t.fragment);if(P$(e.authority,t.authority))return SO(e.path,t.path,this._ignorePathCasing(e),"/")&&e.query===t.query&&(i||e.fragment===t.fragment)}return!1}joinPath(e,...t){return ct.joinPath(e,...t)}basenameOrAuthority(e){return Ra(e)||e.authority}basename(e){return zn.basename(e.path)}extname(e){return zn.extname(e.path)}dirname(e){if(e.path.length===0)return e;let t;return e.scheme===Nt.file?t=ct.file(mX(Ac(e))).path:(t=zn.dirname(e.path),e.authority&&t.length&&t.charCodeAt(0)!==47&&(console.error('dirname("'.concat(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===Nt.file?t=ct.file(pX(Ac(e))).path:t=zn.normalize(e.path),e.with({path:t})}relativePath(e,t){if(e.scheme!==t.scheme||!P$(e.authority,t.authority))return;if(e.scheme===Nt.file){const o=sve(Ac(e),Ac(t));return zs?MJ(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);oM$(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=sc){return O$(e,t)?e.with({path:e.path.substr(0,e.path.length-1)}):e}addTrailingPathSeparator(e,t=sc){let i=!1;if(e.scheme===Nt.file){const s=Ac(e);i=s!==void 0&&s.length===M$(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&&!O$(e,t)?e.with({path:e.path+"/"}):e}}const zi=new Zke(()=>!1),_9=zi.isEqual.bind(zi);zi.isEqualOrParent.bind(zi);zi.getComparisonKey.bind(zi);const Xke=zi.basenameOrAuthority.bind(zi),Ra=zi.basename.bind(zi),Qke=zi.extname.bind(zi),Ix=zi.dirname.bind(zi),Jke=zi.joinPath.bind(zi),eDe=zi.normalizePath.bind(zi),tDe=zi.relativePath.bind(zi),R$=zi.resolvePath.bind(zi);zi.isAbsolutePath.bind(zi);const P$=zi.isEqualAuthority.bind(zi),O$=zi.hasTrailingPathSeparator.bind(zi);zi.removeTrailingPathSeparator.bind(zi);zi.addTrailingPathSeparator.bind(zi);var Qf;(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})(Qf||(Qf={}));function D_(n){return n.toString()}class as{static create(e,t){const i=e.getAlternativeVersionId(),s=LO(e);return new as(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=qke(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(Fl(e,t?t.length:0,i),i+=4,t)for(const s of t)Fl(e,s.selectionStartLineNumber,i),i+=4,Fl(e,s.selectionStartColumn,i),i+=4,Fl(e,s.positionLineNumber,i),i+=4,Fl(e,s.positionColumn,i),i+=4;return i}static _readSelections(e,t,i){const s=Ol(e,t);t+=4;for(let o=0;ot.toString()).join(", ")}matchesResource(e){return(ct.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 as}append(e,t,i,s,o){this._data instanceof as&&this._data.append(e,t,i,s,o)}close(){this._data instanceof as&&(this._data=this._data.serialize())}open(){this._data instanceof as||(this._data=as.deserialize(this._data))}undo(){if(ct.isUri(this.model))throw new Error("Invalid SingleModelEditStackElement");this._data instanceof as&&(this._data=this._data.serialize());const e=as.deserialize(this._data);this.model._applyUndo(e.changes,e.beforeEOL,e.beforeVersionId,e.beforeCursorState)}redo(){if(ct.isUri(this.model))throw new Error("Invalid SingleModelEditStackElement");this._data instanceof as&&(this._data=this._data.serialize());const e=as.deserialize(this._data);this.model._applyRedo(e.changes,e.afterEOL,e.afterVersionId,e.afterCursorState)}heapSize(){return this._data instanceof as&&(this._data=this._data.serialize()),this._data.byteLength+168}}class iDe{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=D_(s.resource);this._editStackElementsMap.set(o,s)}this._delegate=null}prepareUndoRedo(){if(this._delegate)return this._delegate.prepareUndoRedo(this)}matchesResource(e){const t=D_(e);return this._editStackElementsMap.has(t)}setModel(e){const t=D_(ct.isUri(e)?e:e.uri);this._editStackElementsMap.has(t)&&this._editStackElementsMap.get(t).setModel(e)}canAppend(e){if(!this._isOpen)return!1;const t=D_(e.uri);return this._editStackElementsMap.has(t)?this._editStackElementsMap.get(t).canAppend(e):!1}append(e,t,i,s,o){const r=D_(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=D_(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("".concat(Ra(t.resource),": ").concat(t));return"{".concat(e.join(", "),"}")}}function LO(n){return n.getEOL()==="\n"?0:1}function hu(n){return n?n instanceof PJ||n instanceof iDe:!1}class v9{constructor(e,t){this._model=e,this._undoRedoService=t}pushStackElement(){const e=this._undoRedoService.getLastElement(this._model.uri);hu(e)&&e.close()}popStackElement(){const e=this._undoRedoService.getLastElement(this._model.uri);hu(e)&&e.open()}clear(){this._undoRedoService.removeElements(this._model.uri)}_getOrCreateEditStackElement(e,t){const i=this._undoRedoService.getLastElement(this._model.uri);if(hu(i)&&i.canAppend(this._model))return i;const s=new PJ(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,[],LO(this._model),this._model.getAlternativeVersionId(),null)}pushEditOperation(e,t,i,s){const o=this._getOrCreateEditStackElement(e,s),r=this._model.applyEdits(t,!0),a=v9._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),LO(this._model),this._model.getAlternativeVersionId(),a),a}static _computeCursorState(e,t){try{return e?e(t):null}catch(i){return Dt(i),null}}}class nDe{constructor(){this.spacesDiff=0,this.looksLikeAlignment=!1}}function sDe(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++:w>1&&o++,sDe(r,a,_,C,u),u.looksLikeAlignment&&!(t&&e===u.spacesDiff)))continue;const L=u.spacesDiff;L<=c&&d[L]++,r=_,a=C}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 jo(n){return(n.metadata&1)>>>0}function Bi(n,e){n.metadata=n.metadata&254|e<<0}function Hs(n){return(n.metadata&2)>>>1===1}function Ri(n,e){n.metadata=n.metadata&253|(e?1:0)<<1}function OJ(n){return(n.metadata&4)>>>2===1}function B$(n,e){n.metadata=n.metadata&251|(e?1:0)<<2}function FJ(n){return(n.metadata&64)>>>6===1}function W$(n,e){n.metadata=n.metadata&191|(e?1:0)<<6}function oDe(n){return(n.metadata&24)>>>3}function V$(n,e){n.metadata=n.metadata&231|e<<3}function rDe(n){return(n.metadata&32)>>>5===1}function H$(n,e){n.metadata=n.metadata&223|(e?1:0)<<5}class BJ{constructor(e,t,i){this.metadata=0,this.parent=this,this.left=this,this.right=this,Bi(this,1),this.start=t,this.end=i,this.delta=0,this.maxEnd=i,this.id=e,this.ownerId=0,this.options=null,B$(this,!1),W$(this,!1),V$(this,1),H$(this,!1),this.cachedVersionId=0,this.cachedAbsoluteStart=t,this.cachedAbsoluteEnd=i,this.range=null,Ri(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;B$(this,t==="squiggly-error"||t==="squiggly-warning"||t==="squiggly-info"),W$(this,this.options.glyphMarginClassName!==null),V$(this,this.options.stickiness),H$(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 Mt=new BJ(null,0,0);Mt.parent=Mt;Mt.left=Mt;Mt.right=Mt;Bi(Mt,0);class RM{constructor(){this.root=Mt,this.requestNormalizeDelta=!1}intervalSearch(e,t,i,s,o,r){return this.root===Mt?[]:gDe(this,e,t,i,s,o,r)}search(e,t,i,s){return this.root===Mt?[]:fDe(this,e,t,i,s)}collectNodesFromOwner(e){return uDe(this,e)}collectNodesPostOrder(){return hDe(this)}insert(e){$$(this,e),this._normalizeDeltaIfNecessary()}delete(e){z$(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=cDe(this,e,e+t);for(let r=0,a=o.length;rt||i===1?!1:i===2?!0:e}function lDe(n,e,t,i,s){const o=oDe(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&&rDe(n)&&(n.start=e,h=!0,n.end=e,g=!0);{const _=s?1:l>0?2:0;!h&&E_(u,r,e,_)&&(h=!0),!g&&E_(f,a,e,_)&&(g=!0)}if(d>0&&!s){const _=l>c?2:0;!h&&E_(u,r,e+d,_)&&(h=!0),!g&&E_(f,a,e+d,_)&&(g=!0)}{const _=s?1:0;!h&&E_(u,r,t,_)&&(n.start=e+c,h=!0),!g&&E_(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 cDe(n,e,t){let i=n.root,s=0,o=0,r=0,a=0;const l=[];let c=0;for(;i!==Mt;){if(Hs(i)){Ri(i.left,!1),Ri(i.right,!1),i===i.parent.right&&(s-=i.parent.delta),i=i.parent;continue}if(!Hs(i.left)){if(o=s+i.maxEnd,ot){Ri(i,!0);continue}if(a=s+i.end,a>=e&&(i.setCachedOffsets(r,a,0),l[c++]=i),Ri(i,!0),i.right!==Mt&&!Hs(i.right)){s+=i.delta,i=i.right;continue}}return Ri(n.root,!1),l}function dDe(n,e,t,i){let s=n.root,o=0,r=0,a=0;const l=i-(t-e);for(;s!==Mt;){if(Hs(s)){Ri(s.left,!1),Ri(s.right,!1),s===s.parent.right&&(o-=s.parent.delta),Jf(s),s=s.parent;continue}if(!Hs(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),Ri(s,!0);continue}if(Ri(s,!0),s.right!==Mt&&!Hs(s.right)){o+=s.delta,s=s.right;continue}}Ri(n.root,!1)}function uDe(n,e){let t=n.root;const i=[];let s=0;for(;t!==Mt;){if(Hs(t)){Ri(t.left,!1),Ri(t.right,!1),t=t.parent;continue}if(t.left!==Mt&&!Hs(t.left)){t=t.left;continue}if(t.ownerId===e&&(i[s++]=t),Ri(t,!0),t.right!==Mt&&!Hs(t.right)){t=t.right;continue}}return Ri(n.root,!1),i}function hDe(n){let e=n.root;const t=[];let i=0;for(;e!==Mt;){if(Hs(e)){Ri(e.left,!1),Ri(e.right,!1),e=e.parent;continue}if(e.left!==Mt&&!Hs(e.left)){e=e.left;continue}if(e.right!==Mt&&!Hs(e.right)){e=e.right;continue}t[i++]=e,Ri(e,!0)}return Ri(n.root,!1),t}function fDe(n,e,t,i,s){let o=n.root,r=0,a=0,l=0;const c=[];let d=0;for(;o!==Mt;){if(Hs(o)){Ri(o.left,!1),Ri(o.right,!1),o===o.parent.right&&(r-=o.parent.delta),o=o.parent;continue}if(o.left!==Mt&&!Hs(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&&OJ(o)&&(u=!1),s&&!FJ(o)&&(u=!1),u&&(c[d++]=o),Ri(o,!0),o.right!==Mt&&!Hs(o.right)){r+=o.delta,o=o.right;continue}}return Ri(n.root,!1),c}function gDe(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!==Mt;){if(Hs(a)){Ri(a.left,!1),Ri(a.right,!1),a===a.parent.right&&(l-=a.parent.delta),a=a.parent;continue}if(!Hs(a.left)){if(c=l+a.maxEnd,ct){Ri(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&&OJ(a)&&(g=!1),r&&!FJ(a)&&(g=!1),g&&(h[f++]=a)}if(Ri(a,!0),a.right!==Mt&&!Hs(a.right)){l+=a.delta,a=a.right;continue}}return Ri(n.root,!1),h}function $$(n,e){if(n.root===Mt)return e.parent=Mt,e.left=Mt,e.right=Mt,Bi(e,0),n.root=e,n.root;pDe(n,e),Nh(e.parent);let t=e;for(;t!==n.root&&jo(t.parent)===1;)if(t.parent===t.parent.parent.left){const i=t.parent.parent.right;jo(i)===1?(Bi(t.parent,0),Bi(i,0),Bi(t.parent.parent,1),t=t.parent.parent):(t===t.parent.right&&(t=t.parent,kC(n,t)),Bi(t.parent,0),Bi(t.parent.parent,1),DC(n,t.parent.parent))}else{const i=t.parent.parent.left;jo(i)===1?(Bi(t.parent,0),Bi(i,0),Bi(t.parent.parent,1),t=t.parent.parent):(t===t.parent.left&&(t=t.parent,DC(n,t)),Bi(t.parent,0),Bi(t.parent.parent,1),kC(n,t.parent.parent))}return Bi(n.root,0),e}function pDe(n,e){let t=0,i=n.root;const s=e.start,o=e.end;for(;;)if(_De(s,o,i.start+t,i.end+t)<0)if(i.left===Mt){e.start-=t,e.end-=t,e.maxEnd-=t,i.left=e;break}else i=i.left;else if(i.right===Mt){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=Mt,e.right=Mt,Bi(e,1)}function z$(n,e){let t,i;if(e.left===Mt?(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===Mt?(t=e.left,i=e):(i=mDe(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,Bi(t,0),e.detach(),PM(),Jf(t),n.root.parent=Mt;return}const s=jo(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,Bi(i,jo(e)),e===n.root?n.root=i:e===e.parent.left?e.parent.left=i:e.parent.right=i,i.left!==Mt&&(i.left.parent=i),i.right!==Mt&&(i.right.parent=i)),e.detach(),s){Nh(t.parent),i!==e&&(Nh(i),Nh(i.parent)),PM();return}Nh(t),Nh(t.parent),i!==e&&(Nh(i),Nh(i.parent));let o;for(;t!==n.root&&jo(t)===0;)t===t.parent.left?(o=t.parent.right,jo(o)===1&&(Bi(o,0),Bi(t.parent,1),kC(n,t.parent),o=t.parent.right),jo(o.left)===0&&jo(o.right)===0?(Bi(o,1),t=t.parent):(jo(o.right)===0&&(Bi(o.left,0),Bi(o,1),DC(n,o),o=t.parent.right),Bi(o,jo(t.parent)),Bi(t.parent,0),Bi(o.right,0),kC(n,t.parent),t=n.root)):(o=t.parent.left,jo(o)===1&&(Bi(o,0),Bi(t.parent,1),DC(n,t.parent),o=t.parent.left),jo(o.left)===0&&jo(o.right)===0?(Bi(o,1),t=t.parent):(jo(o.left)===0&&(Bi(o.right,0),Bi(o,1),kC(n,o),o=t.parent.left),Bi(o,jo(t.parent)),Bi(t.parent,0),Bi(o.left,0),DC(n,t.parent),t=n.root));Bi(t,0),PM()}function mDe(n){for(;n.left!==Mt;)n=n.left;return n}function PM(){Mt.parent=Mt,Mt.delta=0,Mt.start=0,Mt.end=0}function kC(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!==Mt&&(t.left.parent=e),t.parent=e.parent,e.parent===Mt?n.root=t:e===e.parent.left?e.parent.left=t:e.parent.right=t,t.left=e,e.parent=t,Jf(e),Jf(t)}function DC(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!==Mt&&(t.right.parent=e),t.parent=e.parent,e.parent===Mt?n.root=t:e===e.parent.right?e.parent.right=t:e.parent.left=t,t.right=e,e.parent=t,Jf(e),Jf(t)}function WJ(n){let e=n.end;if(n.left!==Mt){const t=n.left.maxEnd;t>e&&(e=t)}if(n.right!==Mt){const t=n.right.maxEnd+n.delta;t>e&&(e=t)}return e}function Jf(n){n.maxEnd=WJ(n)}function Nh(n){for(;n!==Mt;){const e=WJ(n);if(n.maxEnd===e)return;n.maxEnd=e,n=n.parent}}function _De(n,e,t,i){return n===t?e-i:n-t}class kO{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!==St)return b9(this.right);let e=this;for(;e.parent!==St&&e.parent.left!==e;)e=e.parent;return e.parent===St?St:e.parent}prev(){if(this.left!==St)return VJ(this.left);let e=this;for(;e.parent!==St&&e.parent.right!==e;)e=e.parent;return e.parent===St?St:e.parent}detach(){this.parent=null,this.left=null,this.right=null}}const St=new kO(null,0);St.parent=St;St.left=St;St.right=St;St.color=0;function b9(n){for(;n.left!==St;)n=n.left;return n}function VJ(n){for(;n.right!==St;)n=n.right;return n}function C9(n){return n===St?0:n.size_left+n.piece.length+C9(n.right)}function w9(n){return n===St?0:n.lf_left+n.piece.lineFeedCnt+w9(n.right)}function OM(){St.parent=St}function EC(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!==St&&(t.left.parent=e),t.parent=e.parent,e.parent===St?n.root=t:e.parent.left===e?e.parent.left=t:e.parent.right=t,t.left=e,e.parent=t}function IC(n,e){const t=e.left;e.left=t.right,t.right!==St&&(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===St?n.root=t:e===e.parent.right?e.parent.right=t:e.parent.left=t,t.right=e,e.parent=t}function OL(n,e){let t,i;if(e.left===St?(i=e,t=i.right):e.right===St?(i=e,t=i.left):(i=b9(e.right),t=i.right),i===n.root){n.root=t,t.color=0,e.detach(),OM(),n.root.parent=St;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,q1(n,t)):(i.parent===e?t.parent=i:t.parent=i.parent,q1(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!==St&&(i.left.parent=i),i.right!==St&&(i.right.parent=i),i.size_left=e.size_left,i.lf_left=e.lf_left,q1(n,i)),e.detach(),t.parent.left===t){const r=C9(t),a=w9(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,iu(n,t.parent,l,c)}}if(q1(n,t.parent),s){OM();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,EC(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,IC(n,o),o=t.parent.right),o.color=t.parent.color,t.parent.color=0,o.right.color=0,EC(n,t.parent),t=n.root)):(o=t.parent.left,o.color===1&&(o.color=0,t.parent.color=1,IC(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,EC(n,o),o=t.parent.left),o.color=t.parent.color,t.parent.color=0,o.left.color=0,IC(n,t.parent),t=n.root));t.color=0,OM()}function U$(n,e){for(q1(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,EC(n,e)),e.parent.color=0,e.parent.parent.color=1,IC(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,IC(n,e)),e.parent.color=0,e.parent.parent.color=1,EC(n,e.parent.parent))}n.root.color=0}function iu(n,e,t,i){for(;e!==n.root&&e!==St;)e.parent.left===e&&(e.parent.size_left+=t,e.parent.lf_left+=i),e=e.parent}function q1(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=C9(e.left)-e.size_left,i=w9(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 Kd=65535;function HJ(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 vDe{constructor(e,t,i,s,o){this.lineStarts=e,this.cr=t,this.lf=i,this.crlf=s,this.isBasicASCII=o}}function ou(n,e=!0){const t=[0];let i=1;for(let s=0,o=n.length;s126)&&(r=!1)}const a=new vDe(HJ(n),i,s,o,r);return n.length=0,a}class rr{constructor(e,t,i,s,o){this.bufferIndex=e,this.start=t,this.end=i,this.lineFeedCnt=s,this.length=o}}class Cp{constructor(e,t){this.buffer=e,this.lineStarts=t}}class CDe{constructor(e,t){this._pieces=[],this._tree=e,this._BOM=t,this._index=0,e.root!==St&&e.iterate(e.root,i=>(i!==St&&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 wDe{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 yDe{constructor(e,t,i){this.create(e,t,i)}create(e,t,i){this._buffers=[new Cp("",[0])],this._lastChangeBufferPos={line:0,column:0},this.root=St,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=ou(e[o].buffer));const a=new rr(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 wDe(1),this._lastVisitedLine={lineNumber:0,value:""},this.computeBufferMetadata()}normalizeEOL(e){const t=Kd,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 Cp(l,ou(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 CDe(this,e)}getOffsetAt(e,t){let i=0,s=this.root;for(;s!==St;)if(s.left!==St&&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!==St;)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 Y(i+1,a+1)}return new Y(i+1,o.remainder+1)}else if(e-=t.size_left+t.piece.length,i+=t.lf_left+t.piece.lineFeedCnt,t.right===St){const o=this.getOffsetAt(i+1,1),r=s-e-o;return new Y(i+1,r+1)}else t=t.right;return new Y(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!==St;){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===St)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;fw+g,t.reset(0)):(b=h.buffer,C=w=>w,t.reset(g));do if(_=t.next(b),_){if(C(_.index)>=p)return d;this.positionInBuffer(e,C(_.index)-f,v);const w=this.getLineFeedCnt(e.piece.bufferIndex,o,v),y=v.line===o.line?v.column-o.column+s:v.column+1,L=y+_[0].length;if(u[d++]=gp(new I(i+w,y,i+w,L),_,l),C(_.index)+_[0].length>=p||d>=c)return d}while(_);return d}findMatchesLineByLine(e,t,i,s){const o=[];let r=0;const a=new sv(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),C=v[d.line+p],w=h===e.startLineNumber?e.startColumn:1;if(r=this.findMatchesInNode(f,a,h,w,d,this.positionInBuffer(f,C-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||V8(d,i,g,p,f))&&(a[r++]=new Lw(new I(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++]=gp(new I(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!==St){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 rr(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 rr(u.bufferIndex,p,u.end,this.getLineFeedCnt(u.bufferIndex,p,u.end),u.length-1),t+="\n"}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+="\n");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;tKd){const d=[];for(;e.length>Kd;){const h=e.charCodeAt(Kd-1);let f;h===13||h>=55296&&h<=56319?(f=e.substring(0,Kd-1),e=e.substring(Kd-1)):(f=e.substring(0,Kd),e=e.substring(Kd));const g=ou(f);d.push(new rr(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 Cp(f,g))}const u=ou(e);return d.push(new rr(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 Cp(e,u)),d}let t=this._buffers[0].buffer.length;const i=ou(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!==St;){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!==St;)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 rr(i.bufferIndex,i.start,r,l,u),iu(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 rr(i.bufferIndex,r,i.end,a,u),iu(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 rr(s.bufferIndex,s.start,c,d,u),iu(this,e,u-a,d-l);const h=new rr(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+="\n");const i=this.shouldCheckCRLF()&&this.startWithLF(t)&&this.endWithCR(e),s=this._buffers[0].buffer.length;this._buffers[0].buffer+=t;const o=ou(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!==St;)if(i.left!==St&&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!==St;){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==="\n")}startWithLF(e){if(typeof e=="string")return e.charCodeAt(0)===10;if(e===St||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===St||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 rr(e.piece.bufferIndex,e.piece.start,o,a,r),iu(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 rr(t.piece.bufferIndex,l,t.piece.end,d,c),iu(this,t,-1,-1),t.piece.length===0&&i.push(t);const u=this.createNewPieces("\r\n");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,C=this.getLineContent(v);C.length===0||C===b||bo(C)!==-1||g.push(v)}}return this._onDidChangeContent.fire(),new T1e(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 I(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]=Xf(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(Xv._sortOpsDescending);const t=[];for(let i=0;i0){const h=l.eolCount+1;h===1?u=new I(c,d,c,d+l.firstLineLength):u=new I(c,d,c+h-1,l.lastLineLength+1)}else u=new I(c,d,c,d);i=u.endLineNumber,s=u.endColumn,t.push(u),o=l}return t}static _sortOpsAscending(e,t){const i=I.compareRangesUsingEnds(e.range,t.range);return i===0?e.sortIndex-t.sortIndex:i}static _sortOpsDescending(e,t){const i=I.compareRangesUsingEnds(e.range,t.range);return i===0?t.sortIndex-e.sortIndex:-i}}class SDe{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?"\n":"\r\n":i>t/2?"\r\n":"\n"}create(e){const t=this._getEOL(e),i=this._chunks;if(this._normalizeEOL&&(t==="\r\n"&&(this._cr>0||this._lf>0)||t==="\n"&&(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=bDe(this._tmpLineStarts,e);this.chunks.push(new Cp(e,t.lineStarts)),this.cr+=t.cr,this.lf+=t.lf,this.crlf+=t.crlf,t.isBasicASCII||(this.isBasicASCII=!1,this.containsRTL||(this.containsRTL=Cb(e)),this.containsUnusualLineTerminators||(this.containsUnusualLineTerminators=IX(e)))}finish(e=!0){return this._finish(),new SDe(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=ou(e.buffer);e.lineStarts=t,this._previousChar===13&&this.cr++}}}class LDe{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=kDe(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 DDe(e,[t]))}finalize(){return this._tokens}}class EDe{constructor(e,t){this.tokenizationSupport=t,this.initialState=this.tokenizationSupport.getInitialState(),this.store=new EO(e)}getStartState(e){return this.store.getStartState(e,this.initialState)}getFirstInvalidLine(){return this.store.getFirstInvalidLine(this.initialState)}}class IDe extends EDe{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=h1(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=h1(this._languageIdCodec,s,this.tokenizationSupport,r,!0,i),l=new ts(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=h1(this._languageIdCodec,c,this.tokenizationSupport,l,!0,r);return new ts(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 xDe{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 Bt(e+1,i.endExclusive):i.endExclusive===e+1?this._ranges[t]=new Bt(i.start,e):this._ranges.splice(t,1,new Bt(i.start,e),new Bt(e+1,i.endExclusive))}}addRange(e){Bt.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 h1(n,e,t,i,s,o){let r=null;if(t)try{r=t.tokenizeEncoded(i,s,o.clone())}catch(a){Dt(a)}return r||(r=mx(n.encodeLanguageId(e),o)),ts.convertToEndOffset(r.tokens,i.length),r}class NDe{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,yu(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 Ht(e,t))}}const ru=new Uint32Array(0).buffer;class Oc{static deleteBeginning(e,t){return e===null||e===ru?e:Oc.delete(e,0,t)}static deleteEnding(e,t){if(e===null||e===ru)return e;const i=bu(e),s=i[i.length-2];return Oc.delete(e,t,s)}static delete(e,t,i){if(e===null||e===ru||t===i)return e;const s=bu(e),o=s.length>>>1;if(t===0&&s[s.length-2]===i)return ru;const r=ts.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===ru)return e;if(e===ru)return t;if(e===null)return e;if(t===null)return null;const i=bu(e),s=bu(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=ts.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=Fs.getLanguageId(s[1])!==e),!o)return ru}if(!s||s.length===0){const o=new Uint32Array(2);return o[0]=t,o[1]=j$(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]=Oc.delete(this._lineTokens[t],e.startColumn-1,e.endColumn-1);return}this._lineTokens[t]=Oc.deleteEnding(this._lineTokens[t],e.startColumn-1);const i=e.endLineNumber-1;let s=null;i=this._len)){if(t===0){this._lineTokens[s]=Oc.insert(this._lineTokens[s],e.column-1,i);return}this._lineTokens[s]=Oc.deleteEnding(this._lineTokens[s],e.column-1),this._lineTokens[s]=Oc.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 y9{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=zT(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=y9._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 jE extends CJ{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 y9(this._languageService.languageIdCodec),this._onDidChangeLanguage=this._register(new j),this.onDidChangeLanguage=this._onDidChangeLanguage.event,this._onDidChangeLanguageConfiguration=this._register(new j),this.onDidChangeLanguageConfiguration=this._onDidChangeLanguageConfiguration.event,this._onDidChangeTokens=this._register(new j),this.onDidChangeTokens=this._onDidChangeTokens.event,this.grammarTokens=this._register(new ADe(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]=Xf(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 Rn("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]=jE._findLanguageBoundaries(s,o),l=fw(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]=jE._findLanguageBoundaries(s,o-1),u=fw(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 MDe(()=>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 EO(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=nn.get(this.getLanguageId());if(!r)return[null,null];let a;try{a=r.getInitialState()}catch(l){return Dt(l),[null,null]}return[r,a]},[s,o]=i();if(s&&o?this._tokenizer=new IDe(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 NDe(this._tokenizer,r),this._defaultBackgroundTokenizer.handleChanges()),s!=null&&s.backgroundTokenizerShouldOnlyVerifyTokens&&s.createBackgroundTokenizer?(this._debugBackgroundTokens=new qw(this._languageIdCodec),this._debugBackgroundStates=new EO(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]=Xf(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=Ht.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 DO,{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 DO;(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 Y(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 MDe extends te{get lineRanges(){return this._lineRanges}constructor(e){super(),this._refreshTokens=e,this.runner=this._register(new Si(()=>this.update(),50)),this._computedLineRanges=[],this._lineRanges=[]}update(){yn(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 RDe{constructor(){this.changeType=1}}class fc{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 fc(i.ownerId,i.range.startLineNumber,i.range.startColumn,i.options.before,0)),i.options.after&&i.options.after.content.length>0&&t.push(new fc(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 K${constructor(e,t,i){this.changeType=2,this.lineNumber=e,this.detail=t,this.injectedText=i}}class PDe{constructor(e,t){this.changeType=3,this.fromLineNumber=e,this.toLineNumber=t}}class ODe{constructor(e,t,i,s){this.changeType=4,this.injectedTexts=s,this.fromLineNumber=e,this.toLineNumber=t,this.detail=i}}class FDe{constructor(){this.changeType=5}}class Qv{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},FM=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},np;function WDe(n){const e=new $J;return e.acceptChunk(n),e.finish()}function VDe(n){const e=new $J;let t;for(;typeof(t=n.read())=="string";)e.acceptChunk(t);return e.finish()}function q$(n,e){let t;return typeof n=="string"?t=WDe(n):E1e(n)?t=VDe(n):t=n,t.create(e)}let FL=0;const HDe=999,$De=1e4;class zDe{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 f1=()=>{throw new Error("Invalid change accessor")};let Id=np=class extends te{static resolveOptions(e,t){if(t.detectIndentation){const i=F$(e,t.tabSize,t.insertSpaces);return new cD({tabSize:i.tabSize,indentSize:"tabSize",insertSpaces:i.insertSpaces,trimAutoWhitespace:t.trimAutoWhitespace,defaultEOL:t.defaultEOL,bracketPairColorizationOptions:t.bracketPairColorizationOptions})}return new cD(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 rl(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 j),this.onWillDispose=this._onWillDispose.event,this._onDidChangeDecorations=this._register(new GDe(f=>this.handleBeforeFireDecorationsChangedEvent(f))),this.onDidChangeDecorations=this._onDidChangeDecorations.event,this._onDidChangeOptions=this._register(new j),this.onDidChangeOptions=this._onDidChangeOptions.event,this._onDidChangeAttached=this._register(new j),this.onDidChangeAttached=this._onDidChangeAttached.event,this._onDidChangeInjectedText=this._register(new j),this._eventEmitter=this._register(new YDe),this._languageSelectionListener=this._register(new Ts),this._deltaDecorationCallCnt=0,this._attachedViews=new ZDe,FL++,this.id="$model"+FL,this.isForSimpleWidget=i.isForSimpleWidget,typeof s>"u"||s===null?this._associatedResource=ct.parse("inmemory://model/"+FL):this._associatedResource=s,this._attachedEditorCount=0;const{textBuffer:l,disposable:c}=q$(e,i.defaultEOL);this._buffer=l,this._bufferDisposable=c,this._options=np.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 Uke(this,this._languageConfigurationService)),this._guidesTextModelPart=this._register(new BLe(this,this._languageConfigurationService)),this._decorationProvider=this._register(new Kke(this)),this._tokenizationTextModelPart=new jE(this._languageService,this._languageConfigurationService,this,this._bracketPairs,d,this._attachedViews);const u=this._buffer.getLineCount(),h=this._buffer.getValueLengthInRange(new I(1,1,u,this._buffer.getLineLength(u)+1),0);i.largeFileOptimizations?(this._isTooLargeForTokenization=h>np.LARGE_FILE_SIZE_THRESHOLD||u>np.LARGE_FILE_LINE_COUNT_THRESHOLD,this._isTooLargeForHeapOperation=h>np.LARGE_FILE_HEAP_OPERATION_THRESHOLD):(this._isTooLargeForTokenization=!1,this._isTooLargeForHeapOperation=!1),this._isTooLargeForSyncing=h>np._MODEL_SYNC_LIMIT,this._versionId=1,this._alternativeVersionId=1,this._initialUndoRedoSnapshot=null,this._isDisposed=!1,this.__isDisposing=!1,this._instanceId=TX(FL),this._lastDecorationId=0,this._decorations=Object.create(null),this._decorationsTree=new G$,this._commandManager=new v9(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 Xv([],"","\n",!1,!1,!0,!0);e.dispose(),this._buffer=e,this._bufferDisposable=te.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 qp(e,t)))}setValue(e){if(this._assertNotDisposed(),e==null)throw La();const{textBuffer:t,disposable:i}=q$(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 G$,this._commandManager.clear(),this._trimAutoWhitespaceLines=null,this._emitContentChangedEvent(new Qv([new RDe],this._versionId,!1,!1),this._createContentChanged2(new I(1,1,o,r),0,s,this.getValue(),!1,!1,!0,!1))}setEOL(e){this._assertNotDisposed();const t=e===1?"\r\n":"\n";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 Qv([new FDe],this._versionId,!1,!1),this._createContentChanged2(new I(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>=$De?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 cD({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=F$(this._buffer,t,e);this.updateOptions({insertSpaces:i.insertSpaces,tabSize:i.tabSize,indentSize:i.tabSize})}normalizeIndentation(e){return this._assertNotDisposed(),FE(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(EX.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 Rn("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 zDe(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 Rn("Illegal value for lineNumber");return this._buffer.getLineContent(e)}getLineLength(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new Rn("Illegal value for lineNumber");return this._buffer.getLineLength(e)}getLinesContent(){if(this._assertNotDisposed(),this.isTooLargeForHeapOperation())throw new Rn("Operation would exceed heap memory limits");return this._buffer.getLinesContent()}getEOL(){return this._assertNotDisposed(),this._buffer.getEOL()}getEndOfLineSequence(){return this._assertNotDisposed(),this._buffer.getEOL()==="\n"?0:1}getLineMinColumn(e){return this._assertNotDisposed(),1}getLineMaxColumn(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new Rn("Illegal value for lineNumber");return this._buffer.getLineLength(e)+1}getLineFirstNonWhitespaceColumn(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new Rn("Illegal value for lineNumber");return this._buffer.getLineFirstNonWhitespaceColumn(e)}getLineLastNonWhitespaceColumn(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new Rn("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 I&&!(e instanceof Je)?e:new I(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(es(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 Y(1,1);if(s>r)return new Y(r,this.getLineMaxColumn(r));if(o<=1)return new Y(s,1);const a=this.getLineMaxColumn(s);if(o>=a)return new Y(s,a);if(i===1){const l=this._buffer.getLineCharCode(s,o-2);if(es(l))return new Y(s,o-1)}return new Y(s,o)}validatePosition(e){return this._assertNotDisposed(),e instanceof Y&&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=es(a),d=es(l);return!c&&!d}return!0}validateRange(e){if(this._assertNotDisposed(),e instanceof I&&!(e instanceof Je)&&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=es(c),h=es(d);return!u&&!h?new I(o,r,a,l):o===a&&r===l?new I(o,r-1,a,l-1):u&&h?new I(o,r-1,a,l+1):u?new I(o,r-1,a,l):new I(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 I(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=HDe){this._assertNotDisposed();let l=null;t!==null&&(Array.isArray(t)||(t=[t]),t.every(u=>I.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)=>I.areIntersecting(u,h)?u.plusRange(h):(c.push(u),h)));let d;if(!i&&e.indexOf("\n")<0){const h=new ip(e,i,s,o).parseSearchRequest();if(!h)return[];d=f=>this.findMatchesLineByLine(f,h,r,a)}else d=u=>yL.findMatches(this,new ip(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("\n")<0){const c=new ip(e,i,s,o).parseSearchRequest();if(!c)return null;const d=this.getLineCount();let u=new I(a.lineNumber,a.column,d,this.getLineMaxColumn(d)),h=this.findMatchesLineByLine(u,c,r,1);return yL.findNextMatch(this,new ip(e,i,s,o),a,r),h.length>0||(u=new I(1,1,a.lineNumber,this.getLineMaxColumn(a.lineNumber)),h=this.findMatchesLineByLine(u,c,r,1),h.length>0)?h[0]:null}return yL.findNextMatch(this,new ip(e,i,s,o),a,r)}findPreviousMatch(e,t,i,s,o,r){this._assertNotDisposed();const a=this.validatePosition(t);return yL.findPreviousMatch(this,new ip(e,i,s,o),a,r)}pushStackElement(){this._commandManager.pushStackElement()}popStackElement(){this._commandManager.popStackElement()}pushEOL(e){if((this.getEOL()==="\n"?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 _M?e:new _M(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)==="\n")&&!(c===g.startLineNumber&&g.startColumn===1&&g.isEmpty()&&p&&p.length>0&&p.charAt(p.length-1)==="\n")){u=!1;break}}if(u){const h=new I(c,1,c,d);t.push(new _M(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 I(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 I(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;D--){const x=f+D,A=C+D;k.takeFromEndWhile(P=>P.lineNumber>A);const T=k.takeFromEndWhile(P=>P.lineNumber===A);a.push(new K$(x,this.getLineContent(A),T))}if(vJ.lineNumberJ.lineNumber===X)}a.push(new ODe(x+1,f+_,W,P))}l+=b}this._emitContentChangedEvent(new Qv(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 K$(s,this.getLineContent(s),this._getInjectedTextInLine(s)));this._onDidChangeInjectedText.fire(new zJ(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,Z$(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){Dt(o)}return i.addDecoration=f1,i.changeDecoration=f1,i.changeDecorationOptions=f1,i.removeDecoration=f1,i.deltaDecorations=f1,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."),Dt(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:Y$[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(Y$[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 I(a,1,l,c),u=this._getDecorationsInRange(d,i,s,o);return V2(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 V2(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 fc.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 UDe(this.getLineContent(e))+1}};Id._MODEL_SYNC_LIMIT=50*1024*1024;Id.LARGE_FILE_SIZE_THRESHOLD=20*1024*1024;Id.LARGE_FILE_LINE_COUNT_THRESHOLD=300*1e3;Id.LARGE_FILE_HEAP_OPERATION_THRESHOLD=256*1024*1024;Id.DEFAULT_CREATION_OPTIONS={isForSimpleWidget:!1,tabSize:Qs.tabSize,indentSize:Qs.indentSize,insertSpaces:Qs.insertSpaces,detectIndentation:!1,defaultEOL:1,trimAutoWhitespace:Qs.trimAutoWhitespace,largeFileOptimizations:Qs.largeFileOptimizations,bracketPairColorizationOptions:Qs.bracketPairColorizationOptions};Id=np=BDe([FM(4,Tx),FM(5,qi),FM(6,Ni)],Id);function UDe(n){let e=0;for(const t of n)if(t===" "||t===" ")e++;else break;return e}function BM(n){return!!(n.options.overviewRuler&&n.options.overviewRuler.color)}function WM(n){return!!n.options.after||!!n.options.before}class G${constructor(){this._decorationsTree0=new RM,this._decorationsTree1=new RM,this._injectedTextDecorationsTree=new RM}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){WM(e)?this._injectedTextDecorationsTree.insert(e):BM(e)?this._decorationsTree1.insert(e):this._decorationsTree0.insert(e)}delete(e){WM(e)?this._injectedTextDecorationsTree.delete(e):BM(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){WM(e)?this._injectedTextDecorationsTree.resolveNode(e,t):BM(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 qd(n){return n.replace(/[^a-z0-9\-_]/gi," ")}class jJ{constructor(e){this.color=e.color||"",this.darkColor=e.darkColor||""}}class jDe extends jJ{constructor(e){super(e),this._resolvedColor=null,this.position=typeof e.position=="number"?e.position:Qr.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 KDe{constructor(e){var t;this.position=(t=e==null?void 0:e.position)!==null&&t!==void 0?t:$v.Left}}class qDe extends jJ{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"?ee.fromHex(e):t.getColor(e.id)}}class eg{static from(e){return e instanceof eg?e:new eg(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 kt{static register(e){return new kt(e)}static createDynamic(e){return new kt(e)}constructor(e){var t,i,s,o,r,a;this.description=e.description,this.blockClassName=e.blockClassName?qd(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?qd(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 jDe(e.overviewRuler):null,this.minimap=e.minimap?new qDe(e.minimap):null,this.glyphMargin=e.glyphMarginClassName?new KDe(e.glyphMargin):null,this.glyphMarginClassName=e.glyphMarginClassName?qd(e.glyphMarginClassName):null,this.linesDecorationsClassName=e.linesDecorationsClassName?qd(e.linesDecorationsClassName):null,this.firstLineDecorationClassName=e.firstLineDecorationClassName?qd(e.firstLineDecorationClassName):null,this.marginClassName=e.marginClassName?qd(e.marginClassName):null,this.inlineClassName=e.inlineClassName?qd(e.inlineClassName):null,this.inlineClassNameAffectsLetterSpacing=e.inlineClassNameAffectsLetterSpacing||!1,this.beforeContentClassName=e.beforeContentClassName?qd(e.beforeContentClassName):null,this.afterContentClassName=e.afterContentClassName?qd(e.afterContentClassName):null,this.after=e.after?eg.from(e.after):null,this.before=e.before?eg.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}}kt.EMPTY=kt.register({description:"empty"});const Y$=[kt.register({description:"tracked-range-always-grows-when-typing-at-edges",stickiness:0}),kt.register({description:"tracked-range-never-grows-when-typing-at-edges",stickiness:1}),kt.register({description:"tracked-range-grows-only-when-typing-before",stickiness:2}),kt.register({description:"tracked-range-grows-only-when-typing-after",stickiness:3})];function Z$(n){return n instanceof kt?n:kt.createDynamic(n)}class GDe extends te{constructor(e){super(),this.handleBeforeFire=e,this._actual=this._register(new j),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 YDe extends te{constructor(){super(),this._fastEmitter=this._register(new j),this.fastEvent=this._fastEmitter.event,this._slowEmitter=this._register(new j),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 ZDe{constructor(){this._onDidChangeVisibleRanges=new j,this.onDidChangeVisibleRanges=this._onDidChangeVisibleRanges.event,this._views=new Set}attachView(){const e=new XDe(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 XDe{constructor(e){this.handleStateChange=e}setVisibleLines(e,t){const i=e.map(s=>new Ht(s.startLineNumber,s.endLineNumber+1));this.handleStateChange({visibleLineRanges:i,stabilized:t})}}class KE{constructor(e){this._selTrackedRange=null,this._trackSelection=!0,this._setState(e,new Cs(new I(1,1,1,1),0,0,new Y(1,1),0),new Cs(new I(1,1,1,1),0,0,new Y(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 Qt(this.modelState,this.viewState)}readSelectionFromMarkers(e){const t=e.model._getTrackedRange(this._selTrackedRange);return this.modelState.selection.isEmpty()&&!t.isEmpty()?Je.fromRange(t.collapseToEnd(),this.modelState.selection.getDirection()):Je.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 Cs(I.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=KE._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 Cs(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 Cs(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 Cs(s,t.selectionStartKind,t.selectionStartLeftoverVisibleColumns,o,t.leftoverVisibleColumns)}else{const s=e.coordinatesConverter.convertModelPositionToViewPosition(new Y(t.selectionStart.startLineNumber,t.selectionStart.startColumn)),o=e.coordinatesConverter.convertModelPositionToViewPosition(new Y(t.selectionStart.endLineNumber,t.selectionStart.endColumn)),r=new I(s.lineNumber,s.column,o.lineNumber,o.column),a=e.coordinatesConverter.convertModelPositionToViewPosition(t.position);i=new Cs(r,t.selectionStartKind,t.selectionStartLeftoverVisibleColumns,a,t.leftoverVisibleColumns)}this.modelState=t,this.viewState=i,this._updateTrackedRange(e)}}class X${constructor(e){this.context=e,this.cursors=[new KE(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 W1e(this.cursors,Sa(e=>e.viewState.position,Y.compare)).viewState.position}getBottomMostViewPosition(){return B1e(this.cursors,Sa(e=>e.viewState.position,Y.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(Qt.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,I.compareRangesUsingStarts));for(let i=0;iu&&p.index--;e.splice(u,1),t.splice(d,1),this._removeSecondaryCursor(u-1),i--}}}}class Q${constructor(e,t,i,s){this._cursorContextBrand=void 0,this.model=e,this.viewModel=t,this.coordinatesConverter=i,this.cursorConfig=s}}class QDe{constructor(){this.type=0}}class JDe{constructor(){this.type=1}}class eEe{constructor(e){this.type=2,this._source=e}hasChanged(e){return this._source.hasChanged(e)}}class tEe{constructor(e,t,i){this.selections=e,this.modelSelections=t,this.reason=i,this.type=3}}class I_{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 BL{constructor(){this.type=5}}class iEe{constructor(e){this.type=6,this.isFocused=e}}class nEe{constructor(){this.type=7}}class WL{constructor(){this.type=8}}class KJ{constructor(e,t){this.fromLineNumber=e,this.count=t,this.type=9}}class IO{constructor(e,t){this.type=10,this.fromLineNumber=e,this.toLineNumber=t}}class TO{constructor(e,t){this.type=11,this.fromLineNumber=e,this.toLineNumber=t}}class vD{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 sEe{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 oEe{constructor(e){this.theme=e,this.type=14}}class rEe{constructor(e){this.type=15,this.ranges=e}}class aEe{constructor(){this.type=16}}let lEe=class{constructor(){this.type=17}};class cEe extends te{constructor(){super(),this._onEvent=this._register(new j),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 dEe{constructor(){this.viewEvents=[],this.outgoingEvents=[]}emitViewEvent(e){this.viewEvents.push(e)}emitOutgoingEvent(e){this.outgoingEvents.push(e)}}class S9{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 S9(this._oldContentWidth,this._oldContentHeight,e.contentWidth,e.contentHeight)}}class L9{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 L9(this.oldHasFocus,e.hasFocus)}}class k9{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 k9(this._oldScrollWidth,this._oldScrollLeft,this._oldScrollHeight,this._oldScrollTop,e.scrollWidth,e.scrollLeft,e.scrollHeight,e.scrollTop)}}class uEe{constructor(){this.kind=3}isNoOp(){return!1}attemptToMerge(e){return e.kind!==this.kind?null:this}}class hEe{constructor(){this.kind=4}isNoOp(){return!1}attemptToMerge(e){return e.kind!==this.kind?null:this}}class qE{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=TC.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=I.fromPositions(a[0],a[0]),e.emitViewEvent(new vD(t,i,l,c,s,o,r))}saveState(){const e=[],t=this._cursors.getSelections();for(let i=0,s=t.length;i0){const o=Qt.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,Qt.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,Qt.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=TC.from(this._model,this);if(r.equals(s))return!1;const a=this._cursors.getSelections(),l=this._cursors.getViewSelections();if(e.emitViewEvent(new tEe(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 qE(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=TC.from(this._model,this);this._cursors.stopTrackingSelections(),this._isHandling=!0;try{this._cursors.ensureValidState(),e()}catch(r){Dt(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 J$.getAllAutoClosedCharacters(this._autoClosedActions)}startComposition(e){this._compositionState=new xC(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(Qi.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 Je(c.lineNumber,c.column+o,c.lineNumber,c.column+o)});this.setSelections(e,r,a,0)}return}this._executeEdit(()=>{this._executeEditOperation(Qi.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(Qi.paste(this.context.cursorConfig,this._model,this.getSelections(),t,i,s||[]))},e,o,4)}cut(e,t){this._executeEdit(()=>{this._executeEditOperation(um.cut(this.context.cursorConfig,this._model,this.getSelections()))},e,t)}executeCommand(e,t,i){this._executeEdit(()=>{this._cursors.killSecondaryCursors(),this._executeEditOperation(new Uo(0,[t],{shouldPushStackElementBefore:!1,shouldPushStackElementAfter:!1}))},e,i)}executeCommands(e,t,i){this._executeEdit(()=>{this._executeEditOperation(new Uo(0,t,{shouldPushStackElementBefore:!1,shouldPushStackElementAfter:!1}))},e,i)}}class TC{static from(e,t){return new TC(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 wEe{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 Je(_.startLineNumber,_.startColumn,_.endLineNumber,_.endColumn):new Je(_.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{I.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=Je.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 Dt(u),{operations:[],hadTrackedEditOperation:!1}}return{operations:s,hadTrackedEditOperation:a}}static _getLoserCursorMap(e){e=e.slice(0),e.sort((i,s)=>-I.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 yEe{constructor(e,t,i){this.text=e,this.startSelection=t,this.endSelection=i}}class xC{static _capture(e,t){const i=[];for(const s of t){if(s.startLineNumber!==s.endLineNumber)return null;i.push(new yEe(e.getLineContent(s.startLineNumber),s.startColumn-1,s.endColumn-1))}return i}constructor(e,t){this._original=xC._capture(e,t)}deduceOutcome(e,t){if(!this._original)return null;const i=xC._capture(e,t);if(!i||this._original.length!==i.length)return null;const s=[];for(let o=0,r=this._original.length;oEb,tokenizeEncoded:(n,e,t)=>mx(0,t)};function LEe(n,e,t){return SEe(this,void 0,void 0,function*(){if(!t)return tz(e,n.languageIdCodec,ez);const i=yield nn.getOrCreate(t);return tz(e,n.languageIdCodec,i||ez)})}function kEe(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+='').concat(g,""),f>s||l>=s)break}return a+="
    ",a}function tz(n,e,t){let i='
    ';const s=Sd(n);let o=t.getInitialState();for(let r=0,a=s.length;r0&&(i+="
    ");const c=t.tokenizeEncoded(l,!0,o);ts.convertToEndOffset(c.tokens,l.length);const u=new ts(c.tokens,l,e).inflate();let h=0;for(let f=0,g=u.getCount();f').concat(pE(l.substring(h,_)),""),h=_}o=c.endState}return i+="
    ",i}class DEe{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 EEe{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 qJ=class xO{constructor(e,t,i,s){this._instanceId=TX(++xO.INSTANCE_COUNT),this._pendingChanges=new DEe,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 EEe(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=xO.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 y=s;y<=r;y++){if(v===-1){const L=u,S=u+i;(L<=_&&__)&&(v=y)}for(u+=i,p[y-s]=h,h+=i;d===y;)h+=c,u+=c,a++,a>=l?d=r+1:(d=this.getAfterLineNumberForWhitespaceIndex(a)|0,c=this.getHeightForWhitespaceIndex(a)|0);if(u>=t){r=y;break}}v===-1&&(v=r);const b=this.getVerticalOffsetForLineNumber(r)|0;let C=s,w=r;return Ct&&w--,{bigNumbersDelta:g,startLineNumber:s,endLineNumber:r,relativeVerticalOffset:p,centeredLineNumber:v,completelyVisibleStartLineNumber:C,completelyVisibleEndLineNumber:w}}getVerticalOffsetForWhitespaceIndex(e){this._checkPendingChanges(),e=e|0;const t=this.getAfterLineNumberForWhitespaceIndex(e);let i;t>=1?i=this._lineHeight*t:i=0;let 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}};qJ.INSTANCE_COUNT=0;const IEe=125;class G1{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 TEe extends te{constructor(e,t){super(),this._onDidContentSizeChange=this._register(new j),this.onDidContentSizeChange=this._onDidContentSizeChange.event,this._dimensions=new G1(0,0,0,0),this._scrollable=this._register(new vS({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 S9(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 xEe extends te{constructor(e,t,i){super(),this._configuration=e;const s=this._configuration.options,o=s.get(143),r=s.get(83);this._linesLayout=new qJ(t,s.get(66),r.top,r.bottom),this._maxLineWidth=0,this._overlayWidgetsMinWidth=0,this._scrollable=this._register(new TEe(0,i)),this._configureSmoothScrollDuration(),this._scrollable.setScrollDimensions(new G1(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)?IEe: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 G1(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 G1(t,e.contentWidth,i,this._getContentHeight(t,i,s)))}getCurrentViewport(){const e=this._scrollable.getScrollDimensions(),t=this._scrollable.getCurrentScrollPosition();return new GH(t.scrollTop,t.scrollLeft,e.width,e.height)}getFutureViewport(){const e=this._scrollable.getScrollDimensions(),t=this._scrollable.getFutureScrollPosition();return new GH(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 G1(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 NEe{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 Y(s.startLineNumber,1),0,!1,!0),l=this._coordinatesConverter.convertModelPositionToViewPosition(new Y(s.endLineNumber,this.model.getLineMaxColumn(s.endLineNumber)),1);r=new I(a.lineNumber,a.column,l.lineNumber,l.column)}else r=this._coordinatesConverter.convertModelRangeToViewRange(s,1);i=new PQ(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 I(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,lE(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 I9(n,e){return GJ(n,e.range,t=>t===2)}function GJ(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 VM(n,e){return n===null?e?GE.INSTANCE:YE.INSTANCE:new AEe(n,e)}class AEe{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 fc(0,0,c+1,this._projectionData.injectionOptions[d],0));r=fc.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=iz(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,k=S+Math.max(w-v,0),D=S+Math.min(y-v,b-v);k!==D&&_.push(new BCe(k,D,L.inlineClassName,L.inlineClassNameAffectsLetterSpacing))}}if(y<=b)f+=C,g++;else break}}}let h;c?h=e.tokenization.getLineTokens(t).withInserted(c.map((f,g)=>({offset:f,text:d[g].content,tokenMetadata:ts.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=iz(s.wrappedTextIndentLength)+c);const d=this._projectionData.getMinOutputOffset(i)+1,u=c.length+1,h=i+1=HM.length)for(let e=1;e<=n;e++)HM[e]=MEe(e);return HM[n]}function MEe(n){return new Array(n+1).join(" ")}class REe{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 OEe(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 Ku(fc.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(I.compareRangesUsingStarts);let u=1,h=0,f=-1,g=f+1=u&&_<=h,b=VM(l[p],!v);c[p]=b.getViewLineCount(),this.modelLineProjections[p]=b}this._validModelVersionId=this.model.getVersionId(),this.projectedModelLineLineCounts=new v1e(c)}getHiddenAreas(){return this.hiddenAreasDecorationIds.map(e=>this.model.getDecorationRange(e))}setHiddenAreas(e){const t=e.map(h=>this.model.validateRange(h)),i=PEe(t),s=this.hiddenAreasDecorationIds.map(h=>this.model.getDecorationRange(h)).sort(I.compareRangesUsingStarts);if(i.length===s.length){let h=!1;for(let f=0;f({range:h,options:kt.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 nz(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 Y(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 Y(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 Ap(f.visibleColumn,g,f.className,new yC(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 C=0;b>1&&p.getViewLineMinColumn(this.model,g+1,v)===1&&(C=_===0?1:2),r.push(b),a.push(C),d===null&&(d=new Y(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 Y(o+1,d)).equals(i)?new Y(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 I(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 Y(i.modelLineNumber,s))}convertViewRangeToModelRange(e){const t=this.convertViewPositionToModelPosition(e.startLineNumber,e.startColumn),i=this.convertViewPositionToModelPosition(e.endLineNumber,e.endColumn);return new I(t.lineNumber,t.column,i.lineNumber,i.column)}convertModelPositionToViewPosition(e,t,i=2,s=!1,o=!1){const r=this.model.validatePosition(new Y(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 Y(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 I.fromPositions(i)}else{const i=this.convertModelPositionToViewPosition(e.startLineNumber,e.startColumn,1),s=this.convertModelPositionToViewPosition(e.endLineNumber,e.endColumn,0);return new I(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 I(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 Y(p+1,p===c?r.column:1));else if(u!==null){const v=this.model.getLineMaxColumn(p);l=l.concat(this.model.getDecorationsInRange(new I(u.lineNumber,u.column,p,v),t,i,s)),u=null}u!==null&&(l=l.concat(this.model.getDecorationsInRange(new I(u.lineNumber,u.column,a.lineNumber,a.column),t,i,s)),u=null),l.sort((p,_)=>{const v=I.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 PEe(n){if(n.length===0)return[];const e=n.slice();e.sort(I.compareRangesUsingStarts);const t=[];let i=e[0].startLineNumber,s=e[0].endLineNumber;for(let o=1,r=e.length;os+1?(t.push(new I(i,1,s,1)),i=a.startLineNumber,s=a.endLineNumber):a.endLineNumber>s&&(s=a.endLineNumber)}return t.push(new I(i,1,s,1)),t}class nz{constructor(e,t){this.modelLineNumber=e,this.modelLineWrappedLineIdx=t}}class sz{constructor(e,t){this.modelRange=e,this.viewLines=t}}class OEe{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 FEe{constructor(e){this.model=e}dispose(){}createCoordinatesConverter(){return new BEe(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 IO(t,i)}onModelLinesInserted(e,t,i,s){return new TO(t,i)}onModelLineChanged(e,t,i){return[!1,new KJ(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 WEe=class extends te{constructor(e,t,i,s,o,r,a,l,c){if(super(),this.languageConfigurationService=a,this._themeService=l,this._attachedView=c,this.hiddenAreasModel=new HEe,this.previousHiddenAreas=[],this._editorId=e,this._configuration=t,this.model=i,this._eventDispatcher=new cEe,this.onEvent=this._eventDispatcher.onEvent,this.cursorConfig=new L_(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._updateConfigurationViewLineCount=this._register(new Si(()=>this._updateConfigurationViewLineCountNow(),0)),this._hasFocus=!1,this._viewportStart=T9.create(this.model),this.model.isTooLargeForTokenization())this._lines=new FEe(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 REe(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 CEe(i,this,this.coordinatesConverter,this.cursorConfig)),this.viewLayout=this._register(new xEe(this._configuration,this.getLineCount(),r)),this._register(this.viewLayout.onDidScroll(d=>{d.scrollTopChanged&&this._handleVisibleLinesChanged(),d.scrollTopChanged&&this._viewportStart.invalidate(),this._eventDispatcher.emitSingleViewEvent(new sEe(d)),this._eventDispatcher.emitOutgoingEvent(new k9(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 NEe(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(SS.getInstance().onDidChange(()=>{this._eventDispatcher.emitSingleViewEvent(new aEe)})),this._register(this._themeService.onDidColorThemeChange(d=>{this._invalidateDecorationsColorCache(),this._eventDispatcher.emitSingleViewEvent(new oEe(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 I(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 iEe(e)),this._eventDispatcher.emitOutgoingEvent(new L9(!e,e))}onCompositionStart(){this._eventDispatcher.emitSingleViewEvent(new QDe)}onCompositionEnd(){this._eventDispatcher.emitSingleViewEvent(new JDe)}_captureStableViewport(){if(this._viewportStart.isValid&&this.viewLayout.getCurrentScrollTop()>0){const e=new Y(this._viewportStart.viewLineNumber,this.getLineMinColumn(this._viewportStart.viewLineNumber)),t=this.coordinatesConverter.convertViewPositionToModelPosition(e);return new rz(t,this._viewportStart.startLineDelta)}return new rz(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 BL),e.emitViewEvent(new WL),e.emitViewEvent(new I_(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 I_(null))),e.emitViewEvent(new eEe(t)),this.viewLayout.onConfigurationChanged(t),i.recoverViewportStart(this.coordinatesConverter,this.viewLayout),L_.shouldRecreate(t)&&(this.cursorConfig=new L_(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 qp?e.rawContentChangedEvent.changes:e.changes,a=e instanceof qp?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 Ku(c);for(const u of r)switch(u.changeType){case 1:{this._lines.onModelFlushed(),i.emitViewEvent(new BL),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 WL),i.emitViewEvent(new I_(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 qp&&i.emitOutgoingEvent(new _Ee(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 nEe),this.cursorConfig=new L_(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._cursor.updateConfiguration(this.cursorConfig),this._eventDispatcher.emitOutgoingEvent(new mEe(e))})),this._register(this.model.onDidChangeLanguage(e=>{this.cursorConfig=new L_(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._cursor.updateConfiguration(this.cursorConfig),this._eventDispatcher.emitOutgoingEvent(new pEe(e))})),this._register(this.model.onDidChangeOptions(e=>{if(this._lines.setTabSize(this.model.getOptions().tabSize)){try{const t=this._eventDispatcher.beginEmitViewEvents();t.emitViewEvent(new BL),t.emitViewEvent(new WL),t.emitViewEvent(new I_(null)),this._cursor.onLineMappingChanged(t),this._decorations.onLineMappingChanged(),this.viewLayout.onFlushed(this.getLineCount())}finally{this._eventDispatcher.endEmitViewEvents()}this._updateConfigurationViewLineCount.schedule()}this.cursorConfig=new L_(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._cursor.updateConfiguration(this.cursorConfig),this._eventDispatcher.emitOutgoingEvent(new vEe(e))})),this._register(this.model.onDidChangeDecorations(e=>{this._decorations.onModelDecorationsChanged(),this._eventDispatcher.emitSingleViewEvent(new I_(e)),this._eventDispatcher.emitOutgoingEvent(new gEe(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 BL),r.emitViewEvent(new WL),r.emitViewEvent(new I_(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 hEe)}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 I(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=bo(this.getLineContent(e));return t===-1?0:t+1}getLineLastNonWhitespaceColumn(e){const t=oc(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 Jr(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 FCe(this.getTabSize(),s)}getAllOverviewRulerDecorations(e){const t=this.model.getOverviewRulerDecorations(this._editorId,lE(this._configuration.options)),i=new VEe;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\n":this.model.getEOL();e=e.slice(0),e.sort(I.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===Yr||e.length!==1)return null;let s=e[0];if(s.isEmpty()){if(!t)return null;const d=s.startLineNumber;s=new I(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===wr.fontFamily;let c;return l?c=wr.fontFamily:(c=o.fontFamily,c=c.replace(/"/g,"'"),/[,']/.test(c)||/[+ ]/.test(c)&&(c="'".concat(c,"'")),c="".concat(c,", ").concat(wr.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+=kEe(u,d.inflate(),t,h,f,a,zs)}return l}_getColorMap(){const e=nn.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 fEe);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 I(t.lineNumber,t.column,t.lineNumber,t.column);this._withViewEventsCollector(s=>s.emitViewEvent(new vD(e,!1,i,null,0,!0,0)))}revealBottomMostCursor(e){const t=this._cursor.getBottomMostViewPosition(),i=new I(t.lineNumber,t.column,t.lineNumber,t.column);this._withViewEventsCollector(s=>s.emitViewEvent(new vD(e,!1,i,null,0,!0,0)))}revealRange(e,t,i,s,o){this._withViewEventsCollector(r=>r.emitViewEvent(new vD(e,!1,i,null,s,t,o)))}changeWhitespace(e){this.viewLayout.changeWhitespace(e)&&(this._eventDispatcher.emitSingleViewEvent(new lEe),this._eventDispatcher.emitOutgoingEvent(new uEe))}_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 T9{static create(e){const t=e._setTrackedRange(null,new I(1,1,1,1),1);return new T9(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 Y(t,e.getLineMinColumn(t))),s=e.model._setTrackedRange(this._modelTrackedRange,new I(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 VEe{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 Tw(e,t,[o,i,s]);this._asMap[e]=a,this.asArray.push(a)}}}class HEe{constructor(){this.hiddenAreas=new Map,this.shouldRecompute=!1,this.ranges=[]}setHiddenAreas(e,t){const i=this.hiddenAreas.get(e);i&&oz(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)=>$Ee(t,i),[]);return oz(this.ranges,e)?this.ranges:(this.ranges=e,this.ranges)}}function $Ee(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 VL(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 VL(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&&az(this.injectionOptions[i.injectedTextIndex].cursorStops))return i.offsetInInputWithInjections+i.length;{let s=i.offsetInInputWithInjections;if(lz(this.injectionOptions[i.injectedTextIndex].cursorStops))return s;let o=i.injectedTextIndex-1;for(;o>=0&&this.injectionOffsets[o]===this.injectionOffsets[i.injectedTextIndex]&&!(az(this.injectionOptions[o].cursorStops)||(s-=this.injectionOptions[o].content.length,lz(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}ix()}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 az(n){return n==null?!0:n===Jl.Right||n===Jl.Both}function lz(n){return n==null?!0:n===Jl.Left||n===Jl.Both}class VL{constructor(e,t){this.outputLineIndex=e,this.outputOffset=t}toString(){return"".concat(this.outputLineIndex,":").concat(this.outputOffset)}toPosition(e){return new Y(e+this.outputLineIndex,this.outputOffset+1)}}class x9{static create(e){return new x9(e.get(132),e.get(131))}constructor(e,t){this.classifier=new UEe(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 NO=[],AO=[];function jEe(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=YJ(t,i,s,o,r),f=s-h,g=NO,p=AO;let _=0,v=0,b=0,C=s;const w=d.length;let y=0;if(y>=0){let L=Math.abs(u[y]-C);for(;y+1=L)break;L=S,y++}}for(;yL&&(L=v,S=b);let k=0,D=0,x=0,A=0;if(S<=C){let P=S,W=L===0?0:t.charCodeAt(L-1),$=L===0?0:n.get(W),X=!0;for(let J=L;Jv&&MO(W,$,le,de,c)&&(k=Q,D=P),P+=_e,P>C){Q>v?(x=Q,A=P-_e):(x=J+1,A=P),P-D>f&&(k=0),X=!1;break}W=le,$=de}if(X){_>0&&(g[_]=d[d.length-1],p[_]=u[d.length-1],_++);break}}if(k===0){let P=S,W=t.charCodeAt(L),$=n.get(W),X=!1;for(let J=L-1;J>=v;J--){const Q=J+1,le=t.charCodeAt(J);if(le===9){X=!0;break}let de,_e;if(rm(le)?(J--,de=0,_e=2):(de=n.get(le),_e=zf(le)?o:1),P<=C){if(x===0&&(x=Q,A=P),P<=C-f)break;if(MO(le,de,W,$,c)){k=Q,D=P;break}}P-=_e,W=le,$=de}if(k!==0){const J=f-(A-D);if(J<=i){const Q=t.charCodeAt(x);let le;es(Q)?le=2:le=AC(Q,A,i,o),J-le<0&&(k=0)}}if(X){y--;continue}}if(k===0&&(k=x,D=A),k<=v){const P=t.charCodeAt(v);es(P)?(k=v+2,D=b+2):(k=v+1,D=b+AC(P,b,i,o))}for(v=k,g[_]=k,b=D,p[_]=D,_++,C=D+f;y<0||y=T)break;T=P,y++}}return _===0?null:(g.length=_,p.length=_,NO=e.breakOffsets,AO=e.breakOffsetsVisibleColumn,e.breakOffsets=g,e.breakOffsetsVisibleColumn=p,e.wrappedTextIndentLength=h,e)}function KEe(n,e,t,i,s,o,r,a){const l=fc.applyInjectedText(e,t);let c,d;if(t&&t.length>0?(c=t.map(D=>D.options),d=t.map(D=>D.column-1)):(c=null,d=null),s===-1)return c?new NC(d,c,[l.length],[],0):null;const u=l.length;if(u<=1)return c?new NC(d,c,[l.length],[],0):null;const h=a==="keepAll",f=YJ(l,i,s,o,r),g=s-f,p=[],_=[];let v=0,b=0,C=0,w=s,y=l.charCodeAt(0),L=n.get(y),S=AC(y,0,i,o),k=1;es(y)&&(S+=1,y=l.charCodeAt(1),L=n.get(y),k++);for(let D=k;Dw&&((b===0||S-C>g)&&(b=x,C=S-P),p[v]=b,_[v]=C,v++,w=C+g,b=0),y=A,L=T}return v===0&&(!t||t.length===0)?null:(p[v]=u,_[v]=S,new NC(d,c,p,_,f))}function AC(n,e,t,i){return n===9?t-e%t:zf(n)||n<32?i:1}function cz(n,e){return e-n%e}function MO(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 YJ(n,e,t,i,s){let o=0;if(s!==0){const r=bo(n);if(r!==-1){for(let l=0;lt&&(o=0)}}return o}const $M=sh("domLineBreaksComputer",{createHTML:n=>n});class N9{static create(){return new N9}constructor(){}createLineBreaksComputer(e,t,i,s,o){const r=[],a=[];return{addRequest:(l,c,d)=>{r.push(l),a.push(c)},finalize:()=>qEe(r,e,t,i,s,o,a)}}}function qEe(n,e,t,i,s,o,r){var a;function l(D){const x=r[D];if(x){const A=fc.applyInjectedText(n[D],x),T=x.map(W=>W.options),P=x.map(W=>W.column-1);return new NC(P,T,[A.length],[],0)}else return null}if(i===-1){const D=[];for(let x=0,A=n.length;xc?(A=0,T=0):P=c-X}const W=x.substr(A),$=GEe(W,T,t,P,g,h);p[D]=A,_[D]=T,v[D]=W,b[D]=$[0],C[D]=$[1]}const w=g.build(),y=(a=$M==null?void 0:$M.createHTML(w))!==null&&a!==void 0?a:w;f.innerHTML=y,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(),S=Array.prototype.slice.call(f.children,0),k=[];for(let D=0;Dle.options),J=Q.map(le=>le.column-1)):(X=null,J=null),k[D]=new NC(J,X,A,$,P)}return document.body.removeChild(f),k}function GEe(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 YEe(n,e,t,i){if(t.length<=1)return null;const s=Array.prototype.slice.call(e.children,0),o=[];try{RO(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 RO(n,e,t,i,s,o,r,a){if(i===o||(s=s||zM(n,e,t[i],t[i+1]),r=r||zM(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=zM(n,e,t[l],t[l+1]);RO(n,e,t,i,s,l,c,a),RO(n,e,t,l,c,o,r,a)}function zM(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 ZEe extends te{constructor(){super(),this._editor=null,this._instantiationService=null,this._instances=this._register(new v8),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)){Dt(new Error("Cannot have two contributions with the same id ".concat(s.id)));continue}this._pending.set(s.id,s)}this._instantiateSome(0),this._register(yu(()=>{this._instantiateSome(1)})),this._register(yu(()=>{this._instantiateSome(2)})),this._register(yu(()=>{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(yu(()=>{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 '".concat(t.id,"' should be eager instantiated because it uses saveViewState / restoreViewState."))}catch(i){Dt(i)}}}}var XEe=globalThis&&globalThis.__decorate||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},Gd=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},QEe=globalThis&&globalThis.__awaiter||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())})},sp;let JEe=0,eIe=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(){fi(this.listenersToRemove),this.model.onBeforeDetached(this.attachedView),this.hasRealView&&this.view.dispose(),this.viewModel.dispose()}},Ob=sp=class extends te{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=U_e(),this._contributions=this._register(new ZEe),this._onDidDispose=this._register(new j),this.onDidDispose=this._onDidDispose.event,this._onDidChangeModelContent=this._register(new j({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelContent=this._onDidChangeModelContent.event,this._onDidChangeModelLanguage=this._register(new j({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelLanguage=this._onDidChangeModelLanguage.event,this._onDidChangeModelLanguageConfiguration=this._register(new j({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelLanguageConfiguration=this._onDidChangeModelLanguageConfiguration.event,this._onDidChangeModelOptions=this._register(new j({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelOptions=this._onDidChangeModelOptions.event,this._onDidChangeModelDecorations=this._register(new j({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelDecorations=this._onDidChangeModelDecorations.event,this._onDidChangeModelTokens=this._register(new j({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelTokens=this._onDidChangeModelTokens.event,this._onDidChangeConfiguration=this._register(new j({deliveryQueue:this._deliveryQueue})),this.onDidChangeConfiguration=this._onDidChangeConfiguration.event,this._onDidChangeModel=this._register(new j({deliveryQueue:this._deliveryQueue})),this.onDidChangeModel=this._onDidChangeModel.event,this._onDidChangeCursorPosition=this._register(new j({deliveryQueue:this._deliveryQueue})),this.onDidChangeCursorPosition=this._onDidChangeCursorPosition.event,this._onDidChangeCursorSelection=this._register(new j({deliveryQueue:this._deliveryQueue})),this.onDidChangeCursorSelection=this._onDidChangeCursorSelection.event,this._onDidAttemptReadOnlyEdit=this._register(new lo(this._contributions,this._deliveryQueue)),this.onDidAttemptReadOnlyEdit=this._onDidAttemptReadOnlyEdit.event,this._onDidLayoutChange=this._register(new j({deliveryQueue:this._deliveryQueue})),this.onDidLayoutChange=this._onDidLayoutChange.event,this._editorTextFocus=this._register(new dz({deliveryQueue:this._deliveryQueue})),this.onDidFocusEditorText=this._editorTextFocus.onDidChangeToTrue,this.onDidBlurEditorText=this._editorTextFocus.onDidChangeToFalse,this._editorWidgetFocus=this._register(new dz({deliveryQueue:this._deliveryQueue})),this.onDidFocusEditorWidget=this._editorWidgetFocus.onDidChangeToTrue,this.onDidBlurEditorWidget=this._editorWidgetFocus.onDidChangeToFalse,this._onWillType=this._register(new lo(this._contributions,this._deliveryQueue)),this.onWillType=this._onWillType.event,this._onDidType=this._register(new lo(this._contributions,this._deliveryQueue)),this.onDidType=this._onDidType.event,this._onDidCompositionStart=this._register(new lo(this._contributions,this._deliveryQueue)),this.onDidCompositionStart=this._onDidCompositionStart.event,this._onDidCompositionEnd=this._register(new lo(this._contributions,this._deliveryQueue)),this.onDidCompositionEnd=this._onDidCompositionEnd.event,this._onDidPaste=this._register(new lo(this._contributions,this._deliveryQueue)),this.onDidPaste=this._onDidPaste.event,this._onMouseUp=this._register(new lo(this._contributions,this._deliveryQueue)),this.onMouseUp=this._onMouseUp.event,this._onMouseDown=this._register(new lo(this._contributions,this._deliveryQueue)),this.onMouseDown=this._onMouseDown.event,this._onMouseDrag=this._register(new lo(this._contributions,this._deliveryQueue)),this.onMouseDrag=this._onMouseDrag.event,this._onMouseDrop=this._register(new lo(this._contributions,this._deliveryQueue)),this.onMouseDrop=this._onMouseDrop.event,this._onMouseDropCanceled=this._register(new lo(this._contributions,this._deliveryQueue)),this.onMouseDropCanceled=this._onMouseDropCanceled.event,this._onDropIntoEditor=this._register(new lo(this._contributions,this._deliveryQueue)),this.onDropIntoEditor=this._onDropIntoEditor.event,this._onContextMenu=this._register(new lo(this._contributions,this._deliveryQueue)),this.onContextMenu=this._onContextMenu.event,this._onMouseMove=this._register(new lo(this._contributions,this._deliveryQueue)),this.onMouseMove=this._onMouseMove.event,this._onMouseLeave=this._register(new lo(this._contributions,this._deliveryQueue)),this.onMouseLeave=this._onMouseLeave.event,this._onMouseWheel=this._register(new lo(this._contributions,this._deliveryQueue)),this.onMouseWheel=this._onMouseWheel.event,this._onKeyUp=this._register(new lo(this._contributions,this._deliveryQueue)),this.onKeyUp=this._onKeyUp.event,this._onKeyDown=this._register(new lo(this._contributions,this._deliveryQueue)),this.onKeyDown=this._onKeyDown.event,this._onDidContentSizeChange=this._register(new j({deliveryQueue:this._deliveryQueue})),this.onDidContentSizeChange=this._onDidContentSizeChange.event,this._onDidScrollChange=this._register(new j({deliveryQueue:this._deliveryQueue})),this.onDidScrollChange=this._onDidScrollChange.event,this._onDidChangeViewZones=this._register(new j({deliveryQueue:this._deliveryQueue})),this.onDidChangeViewZones=this._onDidChangeViewZones.event,this._onDidChangeHiddenAreas=this._register(new j({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=++JEe,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 C=b.get(143);this._onDidLayoutChange.fire(C)}})),this._contextKeyService=this._register(a.createScoped(this._domElement)),this._notificationService=c,this._codeEditorService=o,this._commandService=r,this._themeService=l,this._register(new tIe(this,this._contextKeyService)),this._register(new iIe(this,this._contextKeyService,h)),this._instantiationService=s.createChild(new xx([bt,this._contextKeyService])),this._modelData=null,this._focusTracker=new nIe(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=Wv.getEditorContributions(),this._contributions.initialize(this,p,this._instantiationService);for(const v of Wv.getEditorActions()){if(this._actions.has(v.id)){Dt(new Error("Cannot have two actions with the same id ".concat(v.id)));continue}const b=new LJ(v.id,v.label,v.alias,(f=v.precondition)!==null&&f!==void 0?f:void 0,()=>this._instantiationService.invokeFunction(C=>Promise.resolve(v.runEditorCommand(C,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 c0e(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=>QEe(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 lO(e,t,this._domElement,i)}getId(){return this.getEditorType()+":"+this._id}getEditorType(){return fS.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?oi.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==="\n"?i=1:e&&e.lineEnding&&e.lineEnding==="\r\n"&&(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?sp._getVerticalOffsetForPosition(this._modelData,e,1,t):-1}getTopForPosition(e,t){return this._modelData?sp._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?sp._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=>I.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 Zn.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(!Y.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(!I.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 I(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(!Y.isIPosition(e))throw new Error("Invalid arguments");this._sendRevealRange(new I(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=Je.isISelection(e),s=I.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 Je(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 I(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(!I.isIRange(e))throw new Error("Invalid arguments");this._sendRevealRange(I.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,Dt);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 I(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=Wv.getEditorCommand(t);return s?(i=i||{},i.source=e,this._instantiationService.invokeFunction(o=>{Promise.resolve(s.runEditorCommand(o,this,i)).then(void 0,Dt)}),!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 sIe(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,lE(this._configuration.options)):null}getDecorationsInRange(e){return this._modelData?this._modelData.model.getDecorationsInRange(e,this._id,lE(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=sp._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){Vs(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 WEe(this._id,this._configuration,e,N9.create(),x9.create(this._configuration.options),a=>xa(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(Nx.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 kx(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 bO(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 I(e.lineNumber,e.column,e.lineNumber,e.column),options:sp.dropIntoEditorDecorationOptions}];this._dropIntoEditorDecorations.set(t),this.revealPosition(e,1)}removeDropIndicator(){this._dropIntoEditorDecorations.clear()}setContextValue(e,t){this._contextKeyService.createKey(e,t)}};Ob.dropIntoEditorDecorationOptions=kt.register({description:"workbench-dnd-target",className:"dnd-target"});Ob=sp=XEe([Gd(3,_t),Gd(4,ai),Gd(5,gn),Gd(6,bt),Gd(7,os),Gd(8,Nn),Gd(9,oh),Gd(10,Ni),Gd(11,Ze)],Ob);class dz extends te{constructor(e){super(),this._emitterOptions=e,this._onDidChangeToTrue=this._register(new j(this._emitterOptions)),this.onDidChangeToTrue=this._onDidChangeToTrue.event,this._onDidChangeToFalse=this._register(new j(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 lo extends j{constructor(e,t){super({deliveryQueue:t}),this._contributions=e}fire(e){this._contributions.onBeforeInteractionEvent(),super.fire(e)}}class tIe extends te{constructor(e,t){super(),this._editor=e,t.createKey("editorId",e.getId()),this._editorSimpleInput=O.editorSimpleInput.bindTo(t),this._editorFocus=O.focus.bindTo(t),this._textInputFocus=O.textInputFocus.bindTo(t),this._editorTextFocus=O.editorTextFocus.bindTo(t),this._tabMovesFocus=O.tabMovesFocus.bindTo(t),this._editorReadonly=O.readOnly.bindTo(t),this._inDiffEditor=O.inDiffEditor.bindTo(t),this._editorColumnSelection=O.columnSelection.bindTo(t),this._hasMultipleSelections=O.hasMultipleSelections.bindTo(t),this._hasNonEmptySelection=O.hasNonEmptySelection.bindTo(t),this._canUndo=O.canUndo.bindTo(t),this._canRedo=O.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(Ib.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(Ib.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 iIe extends te{constructor(e,t,i){super(),this._editor=e,this._contextKeyService=t,this._languageFeaturesService=i,this._langId=O.languageId.bindTo(t),this._hasCompletionItemProvider=O.hasCompletionItemProvider.bindTo(t),this._hasCodeActionsProvider=O.hasCodeActionsProvider.bindTo(t),this._hasCodeLensProvider=O.hasCodeLensProvider.bindTo(t),this._hasDefinitionProvider=O.hasDefinitionProvider.bindTo(t),this._hasDeclarationProvider=O.hasDeclarationProvider.bindTo(t),this._hasImplementationProvider=O.hasImplementationProvider.bindTo(t),this._hasTypeDefinitionProvider=O.hasTypeDefinitionProvider.bindTo(t),this._hasHoverProvider=O.hasHoverProvider.bindTo(t),this._hasDocumentHighlightProvider=O.hasDocumentHighlightProvider.bindTo(t),this._hasDocumentSymbolProvider=O.hasDocumentSymbolProvider.bindTo(t),this._hasReferenceProvider=O.hasReferenceProvider.bindTo(t),this._hasRenameProvider=O.hasRenameProvider.bindTo(t),this._hasSignatureHelpProvider=O.hasSignatureHelpProvider.bindTo(t),this._hasInlayHintsProvider=O.hasInlayHintsProvider.bindTo(t),this._hasDocumentFormattingProvider=O.hasDocumentFormattingProvider.bindTo(t),this._hasDocumentSelectionFormattingProvider=O.hasDocumentSelectionFormattingProvider.bindTo(t),this._hasMultipleDocumentFormattingProvider=O.hasMultipleDocumentFormattingProvider.bindTo(t),this._hasMultipleDocumentSelectionFormattingProvider=O.hasMultipleDocumentSelectionFormattingProvider.bindTo(t),this._isInWalkThrough=O.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===Nt.walkThroughSnippet)})}}class nIe extends te{constructor(e){super(),this._onChange=this._register(new j),this.onChange=this._onChange.event,this._hasFocus=!1,this._domFocusTracker=this._register(Ld(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 sIe{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 oIe=encodeURIComponent("");function UM(n){return oIe+encodeURIComponent(n.toString())+rIe}const aIe=encodeURIComponent('');function cIe(n){return aIe+encodeURIComponent(n.toString())+lIe}bl((n,e)=>{const t=n.getColor(od);t&&e.addRule('.monaco-editor .squiggly-error { background: url("data:image/svg+xml,'.concat(UM(t),'") repeat-x bottom left; }'));const i=n.getColor(Ur);i&&e.addRule('.monaco-editor .squiggly-warning { background: url("data:image/svg+xml,'.concat(UM(i),'") repeat-x bottom left; }'));const s=n.getColor(Xo);s&&e.addRule('.monaco-editor .squiggly-info { background: url("data:image/svg+xml,'.concat(UM(s),'") repeat-x bottom left; }'));const o=n.getColor(Awe);o&&e.addRule('.monaco-editor .squiggly-hint { background: url("data:image/svg+xml,'.concat(cIe(o),'") no-repeat bottom left; }'));const r=n.getColor(USe);r&&e.addRule(".monaco-editor.showUnused .squiggly-inline-unnecessary { opacity: ".concat(r.rgba.a,"; }"))});var dIe=globalThis&&globalThis.__decorate||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},uIe=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},hIe=globalThis&&globalThis.__awaiter||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 PO=class extends te{constructor(e){super(),this._themeService=e,this._onWillCreateCodeEditor=this._register(new j),this._onCodeEditorAdd=this._register(new j),this.onCodeEditorAdd=this._onCodeEditorAdd.event,this._onCodeEditorRemove=this._register(new j),this.onCodeEditorRemove=this._onCodeEditorRemove.event,this._onWillCreateDiffEditor=this._register(new j),this._onDiffEditorAdd=this._register(new j),this.onDiffEditorAdd=this._onDiffEditorAdd.event,this._onDiffEditorRemove=this._register(new j),this.onDiffEditorRemove=this._onDiffEditorRemove.event,this._decorationOptionProviders=new Map,this._codeEditorOpenHandlers=new To,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 hIe(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 vt(t)}};PO=dIe([uIe(0,os)],PO);var fIe=globalThis&&globalThis.__decorate||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},uz=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},gIe=globalThis&&globalThis.__awaiter||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 ZE=class extends PO{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)=>gIe(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===Nt.http||o===Nt.https)return tQ(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}};ZE=fIe([uz(0,bt),uz(1,os)],ZE);Gt(ai,ZE,0);const x0=Wt("layoutService");var ZJ=globalThis&&globalThis.__decorate||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},XJ=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let XE=class{get dimension(){return this._dimension||(this._dimension=L0(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=We.None,this.offset={top:0,quickPickTop:0}}};XE=ZJ([XJ(0,ai)],XE);let OO=class extends XE{get hasContainer(){return!1}get container(){return this._container}constructor(e,t){super(t),this._container=e}};OO=ZJ([XJ(1,ai)],OO);Gt(x0,XE,1);const LS=Wt("dialogService");var pIe=globalThis&&globalThis.__decorate||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},hz=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},HL=globalThis&&globalThis.__awaiter||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 $L(n){return n.scheme===Nt.file?n.fsPath:n.path}let QJ=0;class zL{constructor(e,t,i,s,o,r,a){this.id=++QJ,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:".concat(this.id,"] [group:").concat(this.groupId,"] [").concat(this.isValid?" VALID":"INVALID","] ").concat(this.actual.constructor.name," - ").concat(this.actual)}}class fz{constructor(e,t){this.resourceLabel=e,this.reason=t}}class gz{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("\n")}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 mIe{constructor(e,t,i,s,o,r,a){this.id=++QJ,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 gz),this.removedResources.has(t)||this.removedResources.set(t,new fz(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 gz),this.invalidatedResources.has(t)||this.invalidatedResources.set(t,new fz(e,0)))}toString(){return"[id:".concat(this.id,"] [group:").concat(this.groupId,"] [").concat(this.invalidatedResources?"INVALID":" VALID","] ").concat(this.actual.constructor.name," - ").concat(this.actual)}}class JJ{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("* ".concat(this.strResource,":"));for(let t=0;t=0;t--)e.push(" * [REDO] ".concat(this._future[t]));return e.join("\n")}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 UJ(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 jM{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 Yc){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){Dt(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 HL(this,void 0,void 0,function*(){if(typeof e.actual.prepareUndoRedo>"u")return te.None;const t=e.actual.prepareUndoRedo();return typeof t>"u"?te.None:t})}_invokeResourcePrepare(e,t){if(e.actual.type!==1||typeof e.actual.prepareUndoRedo>"u")return t(te.None);const i=e.actual.prepareUndoRedo();return i?_8(i)?t(i):i.then(s=>t(s)):t(te.None)}_getAffectedEditStacks(e){const t=[];for(const i of e.strResources)t.push(this._editStacks.get(i)||eee);return new jM(t)}_tryToSplitAndUndo(e,t,i,s){if(t.canSplit())return this._splitPastWorkspaceElement(t,i),this._notificationService.warn(s),new UL(this._undo(e,0,!0));for(const o of t.strResources)this.removeElements(o);return this._notificationService.warn(s),new UL}_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 HL(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:bn.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 jM([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 Yc){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 HL(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 HL(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 jM([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.groupOrderM9(n,t))}function vIe(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 bIe=globalThis&&globalThis.__decorate||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},mz=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};const Va=Wt("ILanguageFeatureDebounceService");var QE;(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})(QE||(QE={}));class CIe{constructor(e){this._default=e}get(e){return this._default}update(e,t){return this._default}default(){return this._default}}class wIe{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 Dg(50,.7)}_key(e){return e.id+this._registry.all(e).reduce((t,i)=>gx(QE.of(i),t),0)}get(e){const t=this._key(e),i=this._cache.get(t);return i?fr(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 _Ie(6),this._cache.set(i,s));const o=fr(s.update(t),this._min,this._max);return M9(e.uri,"output")||this._logService.trace("[DEBOUNCE: ".concat(this._name,"] for ").concat(e.uri.toString()," is ").concat(o,"ms")),o}_overall(){const e=new tee;for(const[,t]of this._cache)e.update(t.value);return e.value}default(){const e=this._overall()|0||this._default;return fr(e,this._min,this._max)}}let BO=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="".concat(QE.of(e),",").concat(a).concat(c?","+c:"");let u=this._data.get(d);return u||(this._isDev?u=new wIe(this._logService,t,e,this._overallAverage()|0||a*1.5,a,l):(this._logService.debug("[DEBOUNCE: ".concat(t,"] is disabled in developed mode")),u=new CIe(a*1.5)),this._data.set(d,u)),u}_overallAverage(){const e=new tee;for(const t of this._data.values())e.update(t.default());return e.value}};BO=bIe([mz(0,aa),mz(1,A9)],BO);Gt(Va,BO,1);class MC{static create(e,t){return new MC(e,new JE(t))}get startLineNumber(){return this._startLineNumber}get endLineNumber(){return this._endLineNumber}constructor(e,t){this._startLineNumber=e,this._tokens=t,this._endLineNumber=this._startLineNumber+this._tokens.getMaxDeltaLine()}toString(){return this._tokens.toString(this._startLineNumber)}_updateEndLineNumber(){this._endLineNumber=this._startLineNumber+this._tokens.getMaxDeltaLine()}isEmpty(){return this._tokens.isEmpty()}getLineTokens(e){return this._startLineNumber<=e&&e<=this._endLineNumber?this._tokens.getLineTokens(e-this._startLineNumber):null}getRange(){const e=this._tokens.getRange();return e&&new I(this._startLineNumber+e.startLineNumber,e.startColumn,this._startLineNumber+e.endLineNumber,e.endColumn)}removeTokens(e){const t=e.startLineNumber-this._startLineNumber,i=e.endLineNumber-this._startLineNumber;this._startLineNumber+=this._tokens.removeTokens(t,e.startColumn-1,i,e.endColumn-1),this._updateEndLineNumber()}split(e){const t=e.startLineNumber-this._startLineNumber,i=e.endLineNumber-this._startLineNumber,[s,o,r]=this._tokens.split(t,e.startColumn-1,i,e.endColumn-1);return[new MC(this._startLineNumber,s),new MC(this._startLineNumber+r,o)]}applyEdit(e,t){const[i,s,o]=Xf(t);this.acceptEdit(e,i,s,o,t.length>0?t.charCodeAt(0):0)}acceptEdit(e,t,i,s,o){this._acceptDeleteRange(e),this._acceptInsertText(new Y(e.startLineNumber,e.startColumn),t,i,s,o),this._updateEndLineNumber()}_acceptDeleteRange(e){if(e.startLineNumber===e.endLineNumber&&e.startColumn===e.endColumn)return;const t=e.startLineNumber-this._startLineNumber,i=e.endLineNumber-this._startLineNumber;if(i<0){const o=i-t;this._startLineNumber-=o;return}const s=this._tokens.getMaxDeltaLine();if(!(t>=s+1)){if(t<0&&i>=s+1){this._startLineNumber=0,this._tokens.clear();return}if(t<0){const o=-t;this._startLineNumber-=o,this._tokens.acceptDeleteRange(e.startColumn-1,0,0,i,e.endColumn-1)}else this._tokens.acceptDeleteRange(0,t,e.startColumn-1,i,e.endColumn-1)}}_acceptInsertText(e,t,i,s,o){if(t===0&&i===0)return;const r=e.lineNumber-this._startLineNumber;if(r<0){this._startLineNumber+=t;return}const a=this._tokens.getMaxDeltaLine();r>=a+1||this._tokens.acceptInsertText(r,e.column-1,t,i,s,o)}}class JE{constructor(e){this._tokens=e,this._tokenCount=e.length/4}toString(e){const t=[];for(let i=0;ie)i=s-1;else{let r=s;for(;r>t&&this._getDeltaLine(r-1)===e;)r--;let a=s;for(;ae||h===e&&g>=t)&&(he||g===e&&_>=t){if(go?p-=o-i:p=i;else if(f===t&&g===i)if(f===s&&p>o)p-=o-i;else{d=!0;continue}else if(fo)f=t,g=i,p=g+(p-o);else{d=!0;continue}else if(f>s){if(l===0&&!d){c=a;break}f-=l}else if(f===s&&g>=o)e&&f===0&&(g+=e,p+=e),f-=l,g-=o-i,p-=o-i;else throw new Error("Not possible!");const v=4*c;r[v]=f,r[v+1]=g,r[v+2]=p,r[v+3]=_,c++}this._tokenCount=c}acceptInsertText(e,t,i,s,o,r){const a=i===0&&s===1&&(r>=48&&r<=57||r>=65&&r<=90||r>=97&&r<=122),l=this._tokens,c=this._tokenCount;for(let d=0;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},KM=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let WO=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 fu}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()===Os.Trace&&this._logService.trace("SemanticTokensProviderStyling [CACHED] ".concat(e," / ").concat(t,": foreground ").concat(Fs.getForeground(r),", fontStyle ").concat(Fs.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()===Os.Trace&&(this._logService.trace("SemanticTokensProviderStyling: unknown token modifier index: ".concat(t.toString(2)," for legend: ").concat(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()===Os.Trace&&this._logService.trace("SemanticTokensProviderStyling: unknown token type index: ".concat(e," for legend: ").concat(JSON.stringify(this._legend.tokenTypes))),r=2147483647,a="not-in-legend";this._hashTable.add(e,t,s,r),this._logService.getLevel()===Os.Trace&&this._logService.trace("SemanticTokensProviderStyling ".concat(e," (").concat(a,") / ").concat(t," (").concat(l.join(" "),"): foreground ").concat(Fs.getForeground(r),", fontStyle ").concat(Fs.getFontStyle(r).toString(2)))}return r}warnOverlappingSemanticTokens(e,t){this._hasWarnedOverlappingTokens||(this._hasWarnedOverlappingTokens=!0,console.warn("Overlapping semantic tokens detected at lineNumber ".concat(e,", column ").concat(t)))}warnInvalidLengthSemanticTokens(e,t){this._hasWarnedInvalidLengthTokens||(this._hasWarnedInvalidLengthTokens=!0,console.warn("Semantic token with invalid length detected at lineNumber ".concat(e,", column ").concat(t)))}warnInvalidEditStart(e,t,i,s,o){this._hasWarnedInvalidEditStart||(this._hasWarnedInvalidEditStart=!0,console.warn("Invalid semantic tokens edit detected (previousResultId: ".concat(e,", resultId: ").concat(t,") at edit #").concat(i,": The provided start offset ").concat(s," is outside the previous data (length ").concat(o,").")))}};WO=yIe([KM(1,os),KM(2,qi),KM(3,aa)],WO);function iee(n,e,t){const i=n.data,s=n.data.length/5|0,o=Math.max(Math.ceil(s/1024),400),r=[];let a=0,l=1,c=0;for(;ad&&i[5*b]===0;)b--;if(b-1===d){let C=u;for(;C+1L)e.warnOverlappingSemanticTokens(y,L+1);else{const A=e.getMetadata(D,x,t);A!==2147483647&&(g===0&&(g=y),h[f]=y-g,h[f+1]=L,h[f+2]=k,h[f+3]=A,f+=4,p=y,_=k)}l=y,c=L,a++}f!==h.length&&(h=h.subarray(0,f));const v=MC.create(g,h);r.push(v)}return r}class SIe{constructor(e,t,i,s){this.tokenTypeIndex=e,this.tokenModifierSet=t,this.languageId=i,this.metadata=s,this.next=null}}class fu{constructor(){this._elementsCount=0,this._currentLengthIndex=0,this._currentLength=fu._SIZES[this._currentLengthIndex],this._growCount=Math.round(this._currentLengthIndex+1=this._growCount){const o=this._elements;this._currentLengthIndex++,this._currentLength=fu._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},qM=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let VO=class extends te{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 WO(e.getLegend(),this._themeService,this._languageService,this._logService)),this._caches.get(e)}};VO=LIe([qM(0,os),qM(1,aa),qM(2,qi)],VO);Gt(Ax,VO,1);var vz=globalThis&&globalThis.__awaiter||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 jL="**",bz="/",bD="[/\\\\]",CD="[^/\\\\]",kIe=/\//g;function Cz(n,e){switch(n){case 0:return"";case 1:return"".concat(CD,"*?");default:return"(?:".concat(bD,"|").concat(CD,"+").concat(bD).concat(e?"|".concat(bD).concat(CD,"+"):"",")*?")}}function wz(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 nee(n){if(!n)return"";let e="";const t=wz(n,bz);if(t.every(i=>i===jL))e=".*";else{let i=!1;t.forEach((s,o)=>{if(s===jL){if(i)return;e+=Cz(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===bz?u="":u=Xr(d),c+=u;continue}switch(d){case"{":r=!0;continue;case"[":l=!0;continue;case"}":{const u=wz(a,","),h="(?:".concat(u.map(f=>nee(f)).join("|"),")");e+=h,r=!1,a="";break}case"]":{e+="["+c+"]",l=!1,c="";break}case"?":e+=CD;continue;case"*":e+=Cz(1);continue;default:e+=Xr(d)}}oR9(a,e)).filter(a=>a!==md),n),i=t.length;if(!i)return md;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 kz(n,e,t){const i=sc===zn.sep,s=i?n:n.replace(kIe,sc),o=sc+s,r=zn.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 PIe(n){try{const e=new RegExp("^".concat(nee(n),"$"));return function(t){return e.lastIndex=0,typeof t=="string"&&e.test(t)?n:null}}catch{return md}}function OIe(n,e,t){return!n||typeof e!="string"?!1:see(n)(e,void 0,t)}function see(n,e={}){if(!n)return Sz;if(typeof n=="string"||FIe(n)){const t=R9(n,e);if(t===md)return Sz;const i=function(s,o){return!!t(s,o)};return t.allBasenames&&(i.allBasenames=t.allBasenames),t.allPaths&&(i.allPaths=t.allPaths),i}return BIe(n,e)}function FIe(n){const e=n;return e?typeof e.base=="string"&&typeof e.pattern=="string":!1}function BIe(n,e){const t=oee(Object.getOwnPropertyNames(n).map(a=>WIe(a,n[a],e)).filter(a=>a!==md)),i=t.length;if(!i)return md;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;fvz(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;hvz(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 WIe(n,e,t){if(e===!1)return md;const i=R9(n,t);if(i===md)return md;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 KP(u)?u.then(h=>h?n:null):u?n:null};return o.requiresSiblings=!0,o}}return i}function oee(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 ree(n,e,t,i,s,o){if(Array.isArray(n)){let r=0;for(const a of n){const l=ree(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:pX(a.base)}),h===e.fsPath||OIe(h,e.fsPath))u=10;else return 0}return u}else return 0}}function aee(n){return typeof n=="string"?!1:Array.isArray(n)?n.every(aee):!!n.exclusive}class Dz{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 dn{constructor(e){this._notebookInfoResolver=e,this._clock=0,this._entries=[],this._onDidChange=new j,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),vt(()=>{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 Dz(e.uri,e.getLanguageId(),s.uri,s.type):new Dz(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=ree(r.selector,o.uri,o.languageId,x1e(e),o.notebookUri,o.notebookType),aee(r.selector)&&r._score>0){for(const a of this._entries)a._score=0;r._score=1e3;break}this._entries.sort(dn._compareByScoreAndTime)}}static _compareByScoreAndTime(e,t){return e._scoret._score?-1:Y1(e.selector)&&!Y1(t.selector)?1:!Y1(e.selector)&&Y1(t.selector)?-1:e._timet._time?-1:0}}function Y1(n){return typeof n=="string"?!1:Array.isArray(n)?n.some(Y1):!!n.isBuiltin}class VIe{constructor(){this.referenceProvider=new dn(this._score.bind(this)),this.renameProvider=new dn(this._score.bind(this)),this.codeActionProvider=new dn(this._score.bind(this)),this.definitionProvider=new dn(this._score.bind(this)),this.typeDefinitionProvider=new dn(this._score.bind(this)),this.declarationProvider=new dn(this._score.bind(this)),this.implementationProvider=new dn(this._score.bind(this)),this.documentSymbolProvider=new dn(this._score.bind(this)),this.inlayHintsProvider=new dn(this._score.bind(this)),this.colorProvider=new dn(this._score.bind(this)),this.codeLensProvider=new dn(this._score.bind(this)),this.documentFormattingEditProvider=new dn(this._score.bind(this)),this.documentRangeFormattingEditProvider=new dn(this._score.bind(this)),this.onTypeFormattingEditProvider=new dn(this._score.bind(this)),this.signatureHelpProvider=new dn(this._score.bind(this)),this.hoverProvider=new dn(this._score.bind(this)),this.documentHighlightProvider=new dn(this._score.bind(this)),this.selectionRangeProvider=new dn(this._score.bind(this)),this.foldingRangeProvider=new dn(this._score.bind(this)),this.linkProvider=new dn(this._score.bind(this)),this.inlineCompletionsProvider=new dn(this._score.bind(this)),this.completionProvider=new dn(this._score.bind(this)),this.linkedEditingRangeProvider=new dn(this._score.bind(this)),this.documentRangeSemanticTokensProvider=new dn(this._score.bind(this)),this.documentSemanticTokensProvider=new dn(this._score.bind(this)),this.documentOnDropEditProvider=new dn(this._score.bind(this)),this.documentPasteEditProvider=new dn(this._score.bind(this))}_score(e){var t;return(t=this._notebookTypeResolver)===null||t===void 0?void 0:t.call(this,e)}}Gt(Ze,VIe,1);const kS=Wt("IWorkspaceEditService");class P9{constructor(e){this.metadata=e}static convert(e){return e.edits.map(t=>{if(Ou.is(t))return Ou.lift(t);if(Jv.is(t))return Jv.lift(t);throw new Error("Unsupported edit")})}}class Ou extends P9{static is(e){return e instanceof Ou?!0:Io(e)&&ct.isUri(e.resource)&&Io(e.textEdit)}static lift(e){return e instanceof Ou?e:new Ou(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 Jv extends P9{static is(e){return e instanceof Jv?!0:Io(e)&&(!!e.newResource||!!e.oldResource)}static lift(e){return e instanceof Jv?e:new Jv(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 co={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},Mx=Object.freeze({id:"editor",order:5,type:"object",title:m("editorConfigurationTitle","Editor"),scope:5}),eI=Object.assign(Object.assign({},Mx),{properties:{"editor.tabSize":{type:"number",default:Qs.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:Qs.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:Qs.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:Qs.trimAutoWhitespace,description:m("trimAutoWhitespace","Remove trailing auto inserted whitespace.")},"editor.largeFileOptimizations":{type:"boolean",default:Qs.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:co.maxComputationTime,description:m("maxComputationTime","Timeout in milliseconds after which diff computation is cancelled. Use 0 for no timeout.")},"diffEditor.maxFileSize":{type:"number",default:co.maxFileSize,description:m("maxFileSize","Maximum file size in MB for which to compute diffs. Use 0 for no limit.")},"diffEditor.renderSideBySide":{type:"boolean",default:co.renderSideBySide,description:m("sideBySide","Controls whether the diff editor shows the diff side by side or inline.")},"diffEditor.renderSideBySideInlineBreakpoint":{type:"number",default:co.renderSideBySideInlineBreakpoint,description:m("renderSideBySideInlineBreakpoint","If the diff editor width is smaller than this value, the inline view is used.")},"diffEditor.useInlineViewWhenSpaceIsLimited":{type:"boolean",default:co.useInlineViewWhenSpaceIsLimited,description:m("useInlineViewWhenSpaceIsLimited","If enabled and the editor width is too small, the inline view is used.")},"diffEditor.renderMarginRevertIcon":{type:"boolean",default:co.renderMarginRevertIcon,description:m("renderMarginRevertIcon","When enabled, the diff editor shows arrows in its glyph margin to revert changes.")},"diffEditor.ignoreTrimWhitespace":{type:"boolean",default:co.ignoreTrimWhitespace,description:m("ignoreTrimWhitespace","When enabled, the diff editor ignores changes in leading or trailing whitespace.")},"diffEditor.renderIndicators":{type:"boolean",default:co.renderIndicators,description:m("renderIndicators","Controls whether the diff editor shows +/- indicators for added/removed changes.")},"diffEditor.codeLens":{type:"boolean",default:co.diffCodeLens,description:m("codeLens","Controls whether the editor shows CodeLens.")},"diffEditor.wordWrap":{type:"string",enum:["off","on","inherit"],default:co.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:co.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:co.hideUnchangedRegions.enabled,markdownDescription:m("hideUnchangedRegions.enabled","Controls whether the diff editor shows unchanged regions.")},"diffEditor.hideUnchangedRegions.revealLineCount":{type:"integer",default:co.hideUnchangedRegions.revealLineCount,markdownDescription:m("hideUnchangedRegions.revealLineCount","Controls how many lines are used for unchanged regions."),minimum:1},"diffEditor.hideUnchangedRegions.minimumLineCount":{type:"integer",default:co.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:co.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:co.experimental.showMoves,markdownDescription:m("showMoves","Controls whether the diff editor should show detected code moves.")},"diffEditor.experimental.showEmptyDecorations":{type:"boolean",default:co.experimental.showEmptyDecorations,description:m("showEmptyDecorations","Controls whether the diff editor shows empty decorations to see where characters got inserted or deleted.")}}});function HIe(n){return typeof n.type<"u"||typeof n.anyOf<"u"}for(const n of ev){const e=n.schema;if(typeof e<"u")if(HIe(e))eI.properties["editor.".concat(n.name)]=e;else for(const t in e)Object.hasOwnProperty.call(e,t)&&(eI.properties[t]=e[t])}let KL=null;function lee(){return KL===null&&(KL=Object.create(null),Object.keys(eI.properties).forEach(n=>{KL[n]=!0})),KL}function $Ie(n){return lee()["editor.".concat(n)]||!1}function zIe(n){return lee()["diffEditor.".concat(n)]||!1}const UIe=en.as(wc.Configuration);UIe.registerConfiguration(eI);class Yi{static insert(e,t){return{range:new I(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 YM(n){return Object.isFrozen(n)?n:xme(n)}class Ys{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 Ys)return i;const s=new jIe("");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?gH(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?gH(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=du(this.contents),o=du(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=>yn(u.identifiers,c.identifiers));d?(this.mergeContents(d.contents,c.contents),d.keys.push(...c.keys),d.keys=Vf(d.keys)):o.push(du(c))}for(const c of l.keys)r.indexOf(c)===-1&&r.push(c)}return new Ys(s,r,o,a.every(l=>l instanceof Ys)?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 Vf([...Object.keys(this.contents),...Object.keys(t)])){let o=this.contents[s];const r=t[s];r&&(typeof o=="object"&&typeof r=="object"?(o=du(o),this.mergeContents(o,r)):o=r),i[s]=o}return new Ys(i,this.keys,this.overrides)}mergeContents(e,t){for(const i of Object.keys(t)){if(i in e&&Io(e[i])&&Io(t[i])){this.mergeContents(e[i],t[i]);continue}e[i]=du(t[i])}}getContentsForOverrideIdentifer(e){let t=null,i=null;const s=o=>{o&&(i?this.mergeContents(i,o):i=du(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),K0e(this.contents,e),qf.test(e)&&this.overrides.splice(this.overrides.findIndex(i=>yn(i.identifiers,SE(e))),1))}updateValue(e,t,i){mQ(this.contents,e,t,s=>console.error(s)),i=i||this.keys.indexOf(e)===-1,i&&this.keys.push(e),qf.test(e)&&this.overrides.push({identifiers:SE(e),keys:Object.keys(this.contents[e]),contents:YP(this.contents[e],s=>console.error(s))})}}class jIe{constructor(e){this._name=e,this._raw=null,this._configurationModel=null,this._restrictedConfigurations=[]}get configurationModel(){return this._configurationModel||new Ys}parseRaw(e,t){this._raw=e;const{contents:i,keys:s,overrides:o,restricted:r,hasExcludedProperties:a}=this.doParseRaw(e,t);this._configurationModel=new Ys(i,s,o,a?[e]:void 0),this._restrictedConfigurations=r||[]}doParseRaw(e,t){const i=en.as(wc.Configuration).getConfigurationProperties(),s=this.filter(e,i,!0,t);e=s.raw;const o=YP(e,l=>console.error("Conflict in settings file ".concat(this._name,": ").concat(l))),r=Object.keys(e),a=this.toOverrides(e,l=>console.error("Conflict in settings file ".concat(this._name,": ").concat(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(qf.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(qf.test(s)){const o={};for(const r in e[s])o[r]=e[s][r];i.push({identifiers:SE(s),keys:Object.keys(o),contents:YP(o,t)})}return i}}class KIe{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 YM(s.value)},get override(){return YM(s.override)},get merged(){return YM(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 Rx{constructor(e,t,i,s,o=new Ys,r=new Ys,a=new Js,l=new Ys,c=new Js){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 Js,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 Ys,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 KIe(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(ct.revive(c[0]),this.parseConfigurationModel(c[1])),l),new Js);return new Rx(t,i,s,o,new Ys,r,a,new Ys,new Js)}static parseConfigurationModel(e){return new Ys(e.contents,e.keys,e.overrides)}}class qIe{constructor(e,t,i,s){this.change=e,this.previous=t,this.currentConfiguraiton=i,this.currentWorkspace=s,this._marker="\n",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=Rx.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!Gr(l,c)}return!0}}const tI={kind:0},GIe={kind:1};function YIe(n,e,t){return{kind:2,commandId:n,commandArgs:e,isBubble:t}}class RC{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=RC.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 ".concat(s));const o=this._map.get(s[0]);if(o===void 0)return this._log("\\ No keybinding entries."),tI;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(RC._contextMatchesRules(e,s.when))return s}return null}static _contextMatchesRules(e,t){return t?t.evaluate(e):!0}}function Ez(n){return n?"".concat(n.serialize()):"no when condition"}function Iz(n){return n.extensionId?n.isBuiltinExtension?"built-in extension ".concat(n.extensionId):"user extension ".concat(n.extensionId):n.isDefault?"built-in":"user"}const ZIe=/^(cursor|delete|undo|redo|tab|editor\.action\.clipboard)/;class XIe extends te{get onDidUpdateKeybindings(){return this._onDidUpdateKeybindings?this._onDidUpdateKeybindings.event:We.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 j),this._currentChords=[],this._currentChordChecker=new uS,this._currentChordStatusMessage=null,this._ignoreSingleModifiers=pv.EMPTY,this._currentSingleModifier=null,this._currentSingleModifierClearTimeout=new _l,this._logging=!1}dispose(){super.dispose()}_log(e){this._logging&&this._logService.info("[KeybindingService]: ".concat(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"),tI;const[s]=i.getDispatchChords();if(s===null)return this._log("\\ Keyboard event cannot be dispatched"),tI;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 m8("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(),CC.enabled&&CC.disable()}_leaveChordMode(){this._currentChordStatusMessage&&(this._currentChordStatusMessage.dispose(),this._currentChordStatusMessage=null),this._currentChordChecker.cancel(),this._currentChords=[],CC.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 ".concat(s," due to it being pressed together with other keys.")),this._ignoreSingleModifiers=pv.EMPTY,this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,!1):(this._ignoreSingleModifiers=pv.EMPTY,this._currentSingleModifier===null?(this._log("+ Storing single modifier for possible chord ".concat(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 ".concat(s," ").concat(s)),this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,this._doDispatch(i,t,!0)):(this._log("+ Clearing single modifier due to modifier mismatch: ".concat(this._currentSingleModifier," ").concat(s)),this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,!1));const[o]=i.getChords();return this._ignoreSingleModifiers=new pv(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 "'.concat(u,", ").concat(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 ".concat(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 "'.concat(u,", ").concat(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 ".concat(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)),ZIe.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 pv{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}}}pv.EMPTY=new pv(null);class Tz{constructor(e,t,i,s,o,r,a){this._resolvedKeybindingItemBrand=void 0,this.resolvedKeybinding=e,this.chords=e?HO(e.getDispatchChords()):[],e&&this.chords.length===0&&(this.chords=HO(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 HO(n){const e=[];for(let t=0,i=n.length;tthis._getLabel(e))}getAriaLabel(){return QIe.toLabel(this._os,this._chords,e=>this._getAriaLabel(e))}getElectronAccelerator(){return this._chords.length>1||this._chords[0].isDuplicateModifierCase()?null:JIe.toLabel(this._os,this._chords,e=>this._getElectronAccelerator(e))}getUserSettingsLabel(){return eTe.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 obe(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 Yw extends iTe{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 pu.toString(e)}_getLabel(e){return e.isDuplicateModifierCase()?"":this._keyCodeToUILabel(e.keyCode)}_getAriaLabel(e){return e.isDuplicateModifierCase()?"":pu.toString(e.keyCode)}_getElectronAccelerator(e){return pu.toElectronAccelerator(e.keyCode)}_getUserSettingsLabel(e){if(e.isDuplicateModifierCase())return"";const t=pu.toUserSettingsUS(e.keyCode);return t&&t.toLowerCase()}_getChordDispatch(e){return Yw.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+=pu.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=y8[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 Gu)return e;const t=this._scanCodeToKeyCode(e.scanCode);return t===0?null:new Gu(e.ctrlKey,e.shiftKey,e.altKey,e.metaKey,t)}static resolveKeybinding(e,t){const i=HO(e.chords.map(s=>this._toKeyCodeChord(s)));return i.length>0?[new Yw(i,t)]:[]}}const Fb=Wt("labelService"),cee=Wt("progressService");class Fu{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)})}}Fu.None=Object.freeze({report(){}});const Tg=Wt("editorProgressService");class nTe{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 eb(new rTe(e,t))}static forStrings(){return new eb(new nTe)}static forConfigKeys(){return new eb(new sTe)}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 qL,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 qL,s.left.segment=i.value()),o.push([-1,s]),s=s.left;else if(a<0)s.right||(s.right=new qL,s.right.segment=i.value()),o.push([1,s]),s=s.right;else if(i.hasNext())i.next(),s.mid||(s.mid=new qL,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 hm=Wt("contextService");function $O(n){const e=n;return typeof(e==null?void 0:e.id)=="string"&&ct.isUri(e.uri)}function aTe(n){const e=n;return typeof(e==null?void 0:e.id)=="string"&&!$O(n)&&!uTe(n)}const lTe={id:"ext-dev"},cTe={id:"empty-window"};function dTe(n,e){if(typeof n=="string"||typeof n>"u")return typeof n=="string"?{id:bf(n)}:e?lTe:cTe;const t=n;return t.configuration?{id:t.id,configPath:t.configuration}:t.folders.length===1?{id:t.id,uri:t.folders[0].uri}:{id:t.id}}function uTe(n){const e=n;return typeof(e==null?void 0:e.id)=="string"&&ct.isUri(e.configPath)}class hTe{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 zO="code-workspace";m("codeWorkspace","Code Workspace");const dee="4064f6ec-cb38-4ad0-af64-ee6467e63c82";function fTe(n){return n.id===dee}var UO;(function(n){n.inspectTokensAction=m("inspectTokens","Developer: Inspect Tokens")})(UO||(UO={}));var iI;(function(n){n.gotoLineActionLabel=m("gotoLineActionLabel","Go to Line/Column...")})(iI||(iI={}));var jO;(function(n){n.helpQuickAccessActionLabel=m("helpQuickAccess","Show all Quick Access Providers")})(jO||(jO={}));var nI;(function(n){n.quickCommandActionLabel=m("quickCommandActionLabel","Command Palette"),n.quickCommandHelp=m("quickCommandActionHelp","Show And Run Commands")})(nI||(nI={}));var Zw;(function(n){n.quickOutlineActionLabel=m("quickOutlineActionLabel","Go to Symbol..."),n.quickOutlineByCategoryActionLabel=m("quickOutlineByCategoryActionLabel","Go to Symbol by Category...")})(Zw||(Zw={}));var sI;(function(n){n.editorViewAccessibleLabel=m("editorViewAccessibleLabel","Editor content"),n.accessibilityHelpMessage=m("accessibilityHelpMessage","Press Alt+F1 for Accessibility Options.")})(sI||(sI={}));var KO;(function(n){n.toggleHighContrast=m("toggleHighContrast","Toggle High Contrast Theme")})(KO||(KO={}));var qO;(function(n){n.bulkEditServiceSummary=m("bulkEditServiceSummary","Made {0} edits in {1} files")})(qO||(qO={}));const uee=Wt("workspaceTrustManagementService"),rh=Wt("contextViewService"),Cl=Wt("contextMenuService");var js;(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})(js||(js={}));function gTe(n){const e=n;return!!e&&typeof e.x=="number"&&typeof e.y=="number"}var of;(function(n){n[n.AVOID=0]="AVOID",n[n.ALIGN=1]="ALIGN"})(of||(of={}));function mv(n,e,t){const i=t.mode===of.ALIGN?t.offset:t.offset+t.size,s=t.mode===of.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 Bb extends te{constructor(e,t){super(),this.container=null,this.delegate=null,this.toDisposeOnClean=te.None,this.toDisposeOnSetContainer=te.None,this.shadowRoot=null,this.shadowRootHostElement=null,this.view=ye(".context-view"),this.useFixedPosition=!1,this.useShadowDOM=!1,Lo(this.view),this.setContainer(e,t),this._register(vt(()=>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=ye(".shadow-root-host"),this.container.appendChild(this.shadowRootHostElement),this.shadowRoot=this.shadowRootHostElement.attachShadow({mode:"open"});const o=document.createElement("style");o.textContent=pTe,this.shadowRoot.appendChild(o),this.shadowRoot.appendChild(this.view),this.shadowRoot.appendChild(ye("slot"))}else this.container.appendChild(this.view);const s=new be;Bb.BUBBLE_UP_EVENTS.forEach(o=>{s.add(In(this.container,o,r=>{this.onDOMEvent(r,!1)}))}),Bb.BUBBLE_DOWN_EVENTS.forEach(o=>{s.add(In(this.container,o,r=>{this.onDOMEvent(r,!0)},!0))}),this.toDisposeOnSetContainer=s}}show(e){var t,i;this.isVisible()&&this.hide(),Ds(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",mr(this.view),this.toDisposeOnClean=e.render(this.view)||te.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&&!(uc&&P8.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(F8(e)){const u=Un(e),h=Xbe(e);t={top:u.top*h,left:u.left*h,width:u.width*h,height:u.height*h}}else gTe(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=Ko(this.view),s=Ep(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:of.ALIGN};l=mv(window.innerHeight,s,u)+window.pageYOffset,js.intersects({start:l,end:l+s},{start:u.offset,end:u.offset+u.size})&&(h.mode=of.AVOID),c=mv(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:of.ALIGN};c=mv(window.innerWidth,i,u),js.intersects({start:c,end:c+i},{start:u.offset,end:u.offset+u.size})&&(h.mode=of.AVOID),l=mv(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=Un(this.container);this.view.style.top="".concat(l-(this.useFixedPosition?Un(this.view).top:d.top),"px"),this.view.style.left="".concat(c-(this.useFixedPosition?Un(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(),Lo(this.view)}isVisible(){return!!this.delegate}onDOMEvent(e,t){this.delegate&&(this.delegate.onDOMEvent?this.delegate.onDOMEvent(e,document.activeElement):t&&!Ws(e.target,this.container)&&this.hide())}dispose(){this.hide(),super.dispose()}}Bb.BUBBLE_UP_EVENTS=["click","keydown","focus","blur"];Bb.BUBBLE_DOWN_EVENTS=["click"];const pTe='\n :host {\n all: initial; /* 1st rule so subsequent properties are reset. */\n }\n\n .codicon[class*=\'codicon-\'] {\n font: normal normal normal 16px/1 codicon;\n display: inline-block;\n text-decoration: none;\n text-rendering: auto;\n text-align: center;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n user-select: none;\n -webkit-user-select: none;\n -ms-user-select: none;\n }\n\n :host {\n font-family: -apple-system, BlinkMacSystemFont, "Segoe WPC", "Segoe UI", "HelveticaNeue-Light", system-ui, "Ubuntu", "Droid Sans", sans-serif;\n }\n\n :host-context(.mac) { font-family: -apple-system, BlinkMacSystemFont, sans-serif; }\n :host-context(.mac:lang(zh-Hans)) { font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", sans-serif; }\n :host-context(.mac:lang(zh-Hant)) { font-family: -apple-system, BlinkMacSystemFont, "PingFang TC", sans-serif; }\n :host-context(.mac:lang(ja)) { font-family: -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic Pro", sans-serif; }\n :host-context(.mac:lang(ko)) { font-family: -apple-system, BlinkMacSystemFont, "Nanum Gothic", "Apple SD Gothic Neo", "AppleGothic", sans-serif; }\n\n :host-context(.windows) { font-family: "Segoe WPC", "Segoe UI", sans-serif; }\n :host-context(.windows:lang(zh-Hans)) { font-family: "Segoe WPC", "Segoe UI", "Microsoft YaHei", sans-serif; }\n :host-context(.windows:lang(zh-Hant)) { font-family: "Segoe WPC", "Segoe UI", "Microsoft Jhenghei", sans-serif; }\n :host-context(.windows:lang(ja)) { font-family: "Segoe WPC", "Segoe UI", "Yu Gothic UI", "Meiryo UI", sans-serif; }\n :host-context(.windows:lang(ko)) { font-family: "Segoe WPC", "Segoe UI", "Malgun Gothic", "Dotom", sans-serif; }\n\n :host-context(.linux) { font-family: system-ui, "Ubuntu", "Droid Sans", sans-serif; }\n :host-context(.linux:lang(zh-Hans)) { font-family: system-ui, "Ubuntu", "Droid Sans", "Source Han Sans SC", "Source Han Sans CN", "Source Han Sans", sans-serif; }\n :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; }\n :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; }\n :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; }\n';var mTe=globalThis&&globalThis.__decorate||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=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let GO=class extends te{constructor(e){super(),this.layoutService=e,this.currentViewDisposable=te.None,this.container=e.hasContainer?e.container:null,this.contextView=this._register(new Bb(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=vt(()=>{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)}};GO=mTe([_Te(0,x0)],GO);let Wb=[],F9=[],hee=[];function GL(n,e=!1){vTe(n,!1,e)}function vTe(n,e,t){const i=bTe(n,e);Wb.push(i),i.userConfigured?hee.push(i):F9.push(i),t&&!i.userConfigured&&Wb.forEach(s=>{s.mime===i.mime||s.userConfigured||(i.extension&&s.extension===i.extension&&console.warn("Overwriting extension <<".concat(i.extension,">> to now point to mime <<").concat(i.mime,">>")),i.filename&&s.filename===i.filename&&console.warn("Overwriting filename <<".concat(i.filename,">> to now point to mime <<").concat(i.mime,">>")),i.filepattern&&s.filepattern===i.filepattern&&console.warn("Overwriting filepattern <<".concat(i.filepattern,">> to now point to mime <<").concat(i.mime,">>")),i.firstline&&s.firstline===i.firstline&&console.warn("Overwriting firstline <<".concat(i.firstline,">> to now point to mime <<").concat(i.mime,">>")))})}function bTe(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?see(n.filepattern.toLowerCase()):void 0,filepatternOnPath:n.filepattern?n.filepattern.indexOf(zn.sep)>=0:!1}}function CTe(){Wb=Wb.filter(n=>n.userConfigured),F9=[]}function wTe(n,e){return yTe(n,e).map(t=>t.id)}function yTe(n,e){let t;if(n)switch(n.scheme){case Nt.file:t=n.fsPath;break;case Nt.data:{t=Qf.parseMetaData(n).get(Qf.META_DATA_LABEL);break}case Nt.vscodeNotebookCell:t=void 0;break;default:t=n.path}if(!t)return[{id:"unknown",mime:wn.unknown}];t=t.toLowerCase();const i=bf(t),s=xz(t,i,hee);if(s)return[s,{id:Yr,mime:wn.text}];const o=xz(t,i,F9);if(o)return[o,{id:Yr,mime:wn.text}];if(e){const r=STe(e);if(r)return[r,{id:Yr,mime:wn.text}]}return[{id:"unknown",mime:wn.unknown}]}function xz(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 STe(n){if(x8(n)&&(n=n.substr(1)),n.length>0)for(let e=Wb.length-1;e>=0;e--){const t=Wb[e];if(!t.firstline)continue;const i=n.match(t.firstline);if(i&&i.length>0)return t}}const YL=Object.prototype.hasOwnProperty,Nz="vs.editor.nullLanguage";class LTe{constructor(){this._languageIdToLanguage=[],this._languageToLanguageId=new Map,this._register(Nz,0),this._register(Yr,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]||Nz}}class Xw extends te{constructor(e=!0,t=!1){super(),this._onDidChange=this._register(new j),this.onDidChange=this._onDidChange.event,Xw.instanceCount++,this._warnOnOverwrite=t,this.languageIdCodec=new LTe,this._dynamicLanguages=[],this._languages={},this._mimeTypesMap={},this._nameMap={},this._lowercaseNameMap={},e&&(this._initializeFromRegistry(),this._register(kb.onDidChangeLanguages(i=>{this._initializeFromRegistry()})))}dispose(){Xw.instanceCount--,super.dispose()}_initializeFromRegistry(){this._languages={},this._mimeTypesMap={},this._nameMap={},this._lowercaseNameMap={},CTe();const e=[].concat(kb.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})}),en.as(wc.Configuration).registerOverrideIdentifiers(this.getRegisteredLanguageIds()),this._onDidChange.fire()}_registerLanguage(e){const t=e.id;let i;YL.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-".concat(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)GL({id:i,mime:s,extension:a},this._warnOnOverwrite)}if(Array.isArray(t.filenames))for(const a of t.filenames)GL({id:i,mime:s,filename:a},this._warnOnOverwrite),e.filenames.push(a);if(Array.isArray(t.filenamePatterns))for(const a of t.filenamePatterns)GL({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);kve(l)||GL({id:i,mime:s,firstline:l},this._warnOnOverwrite)}catch(l){console.warn("[".concat(t.id,"]: Invalid regular expression `").concat(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?YL.call(this._languages,e):!1}getRegisteredLanguageIds(){return Object.keys(this._languages)}getLanguageIdByLanguageName(e){const t=e.toLowerCase();return YL.call(this._lowercaseNameMap,t)?this._lowercaseNameMap[t]:null}getLanguageIdByMimeType(e){return e&&YL.call(this._mimeTypesMap,e)?this._mimeTypesMap[e]:null}guessLanguageIdByFilepathOrFirstLine(e,t){return!e&&!t?[]:wTe(e,t)}}Xw.instanceCount=0;class Qw extends te{constructor(e=!1){super(),this._onDidRequestBasicLanguageFeatures=this._register(new j),this.onDidRequestBasicLanguageFeatures=this._onDidRequestBasicLanguageFeatures.event,this._onDidRequestRichLanguageFeatures=this._register(new j),this.onDidRequestRichLanguageFeatures=this._onDidRequestRichLanguageFeatures.event,this._onDidChange=this._register(new j({leakWarningThreshold:200})),this.onDidChange=this._onDidChange.event,this._requestedBasicLanguages=new Set,this._requestedRichLanguages=new Set,Qw.instanceCount++,this._registry=this._register(new Xw(!0,e)),this.languageIdCodec=this._registry.languageIdCodec,this._register(this._registry.onDidChange(()=>this._onDidChange.fire()))}dispose(){Qw.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 jZ(i,null)}createById(e){return new Az(this.onDidChange,()=>this._createAndGetLanguageIdentifier(e))}createByFilepathOrFirstLine(e,t){return new Az(this.onDidChange,()=>{const i=this.guessLanguageIdByFilepathOrFirstLine(e,t);return this._createAndGetLanguageIdentifier(i)})}_createAndGetLanguageIdentifier(e){return(!e||!this.isRegisteredLanguageId(e))&&(e=Yr),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),nn.getOrCreate(e),this._onDidRequestRichLanguageFeatures.fire(e))}}Qw.instanceCount=0;class Az{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 j({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 Jw={RESOURCES:"ResourceURLs",DOWNLOAD_URL:"DownloadURL",FILES:"Files",TEXT:wn.text,INTERNAL_URI_LIST:"application/vnd.code.uri-list"};function B9(...n){return function(e,t){for(let i=0,s=n.length;i0?[{start:0,end:e.length}]:[]:null}function gee(n,e){const t=e.toLowerCase().indexOf(n.toLowerCase());return t===-1?null:[{start:t,end:t+n.length}]}function pee(n,e){return YO(n.toLowerCase(),e.toLowerCase(),0,0)}function YO(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=YO(n,e,t+1,i+1))?H9({start:i,end:i+1},s):null}return YO(n,e,t,i+1)}function W9(n){return 97<=n&&n<=122}function Ox(n){return 65<=n&&n<=90}function V9(n){return 48<=n&&n<=57}function mee(n){return n===32||n===9||n===10||n===13}const _ee=new Set;"()[]{}<>`'\"-/;:,.?!".split("").forEach(n=>_ee.add(n.charCodeAt(0)));function oI(n){return mee(n)||_ee.has(n)}function kTe(n,e){return n===e||oI(n)&&oI(e)}function vee(n){return W9(n)||Ox(n)||V9(n)}function H9(n,e){return e.length===0?e=[n]:n.end===e[0].start?e[0].start=n.start:e.unshift(n),e}function bee(n,e){for(let t=e;t0&&!vee(n.charCodeAt(t-1)))return t}return n.length}function ZO(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=ZO(n,e,t+1,i+1);!s&&(o=bee(e,o)).6}function ITe(n){const{upperPercent:e,lowerPercent:t,alphaPercent:i,numericPercent:s}=n;return t>.2&&e<.8&&i>.6&&s<.2}function TTe(n){let e=0,t=0,i=0,s=0;for(let o=0;o60)return null;const t=DTe(e);if(!ITe(t)){if(!ETe(t))return null;e=e.toLowerCase()}let i=null,s=0;for(n=n.toLowerCase();s0&&oI(n.charCodeAt(t-1)))return t;return n.length}const NTe=B9(ey,Cee,gee),ATe=B9(ey,Cee,pee),Mz=new Dg(1e4);function Rz(n,e,t=!1){if(typeof n!="string"||typeof e!="string")return null;let i=Mz.get(n);i||(i=new RegExp(Sve(n),"i"),Mz.set(n,i));const s=i.exec(e);return s?[{start:s.index,end:s.index+s[0].length}]:t?ATe(n,e):NTe(n,e)}function MTe(n,e){const t=fm(n,n.toLowerCase(),0,e,e.toLowerCase(),0,{firstMatchCanBeWeak:!0,boostFullMatch:!0});return t?DS(t):null}function RTe(n,e,t,i,s,o){const r=Math.min(13,n.length);for(;t"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 rf=128;function $9(){const n=[],e=[];for(let t=0;t<=rf;t++)e[t]=0;for(let t=0;t<=rf;t++)n.push(e.slice(0));return n}function yee(n){const e=[];for(let t=0;t<=n;t++)e[t]=0;return e}const See=yee(2*rf),QO=yee(2*rf),Yd=$9(),qg=$9(),ZL=$9();function XL(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!!T8(t)}}function Pz(n,e){if(e<0||e>=n.length)return!1;switch(n.charCodeAt(e)){case 32:case 9:return!0;default:return!1}}function wD(n,e,t){return e[n]!==t[n]}function PTe(n,e,t,i,s,o,r=!1){for(;erf?rf:n.length,l=i.length>rf?rf:i.length;if(t>=a||o>=l||a-t>l-o||!PTe(e,t,a,s,o,l,!0))return;OTe(a,l,t,o,e,s);let c=1,d=1,u=t,h=o;const f=[!1];for(c=1,u=t;ub,D=k?qg[c][d-1]+(Yd[c][d-1]>0?-5:0):0,x=h>b+1&&Yd[c][d-1]>0,A=x?qg[c][d-2]+(Yd[c][d-2]>0?-5:0):0;if(x&&(!k||A>=D)&&(!L||A>=S))qg[c][d]=A,ZL[c][d]=3,Yd[c][d]=0;else if(k&&(!L||D>=S))qg[c][d]=D,ZL[c][d]=2,Yd[c][d]=0;else if(L)qg[c][d]=S,ZL[c][d]=1,Yd[c][d]=Yd[c-1][d-1]+1;else throw new Error("not possible")}}if(!f[0]&&!r.firstMatchCanBeWeak)return;c--,d--;const g=[qg[c][d],o];let p=0,_=0;for(;c>=1;){let b=d;do{const C=ZL[c][b];if(C===3)b=b-2;else if(C===2)b=b-1;else break}while(b>=1);p>1&&e[t+c-1]===s[o+d-1]&&!wD(b+o-1,i,s)&&p+1>Yd[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 OTe(n,e,t,i,s,o){let r=n-1,a=e-1;for(;r>=t&&a>=i;)s[r]===o[a]&&(QO[r]=a,r--),a--}function FTe(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:wD(r,s,o)&&(r===0||!wD(r-1,s,o))?(u=n[t]===s[r]?7:5,h=!0):XL(o,r)&&(r===0||!XL(o,r-1))?u=5:(XL(o,r-1)||Pz(o,r-1))&&(u=5,h=!0),u>1&&t===i&&(d[0]=!0),h||(h=wD(r,s,o)||XL(o,r-1)||Pz(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}function BTe(n,e,t,i,s,o,r){return WTe(n,e,t,i,s,o,!0,r)}function WTe(n,e,t,i,s,o,r,a){let l=fm(n,e,t,i,s,o,a);if(l&&!r)return l;if(n.length>=3){const c=Math.min(7,n.length-1);for(let d=t+1;dl[0])&&(l=h))}}}return l}function VTe(n,e){if(e+1>=n.length)return;const t=n[e],i=n[e+1];if(t!==i)return n.slice(0,e)+i+t+n.slice(e+2)}const HTe="$(",z9=new RegExp("\\$\\(".concat(dt.iconNameExpression,"(?:").concat(dt.iconModifierExpression,")?\\)"),"g"),$Te=new RegExp("(\\\\)?".concat(z9.source),"g");function zTe(n){return n.replace($Te,(e,t)=>t?e:"\\".concat(e))}const UTe=new RegExp("\\\\".concat(z9.source),"g");function jTe(n){return n.replace(UTe,e=>"\\".concat(e))}const KTe=new RegExp("(\\s)?(\\\\)?".concat(z9.source,"(\\s)?"),"g");function U9(n){return n.indexOf(HTe)===-1?n:n.replace(KTe,(e,t,i,s)=>i?e:t||s||"")}function qTe(n){return n?n.replace(/\$\((.*?)\)/g,(e,t)=>" ".concat(t," ")).trim():""}const ZM=new RegExp("\\$\\(".concat(dt.iconNameCharacter,"+\\)"),"g");function Z1(n){ZM.lastIndex=0;let e="";const t=[];let i=0;for(;;){const s=ZM.lastIndex,o=ZM.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?"\\\n":"\n\n"),this}appendMarkdown(e){return this.value+=e,this}appendCodeblock(e,t){return this.value+="\n```",this.value+=e,this.value+="\n",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+=' "'.concat(this._escape(this._escape(i,'"'),")"),'"')),this.value+=")",this}_escape(e,t){const i=new RegExp(Xr(t),"g");return e.replace(i,(s,o)=>e.charAt(o-1)!=="\\"?"\\".concat(s):s)}}function Vb(n){return Lf(n)?!n.value:Array.isArray(n)?n.every(Vb):!0}function Lf(n){return n instanceof Bs?!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 GTe(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&&_9(ct.from(n.baseUri),ct.from(e.baseUri)))}function YTe(n){return n.replace(/[\\`*_{}[\]()#+\-!~]/g,"\\$&")}function QL(n){return n.replace(/"/g,""")}function QM(n){return n&&n.replace(/\\([\\`*_{}[\]()#+\-.!~])/g,"$1")}function ZTe(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="'.concat(a,'"')),c&&e.push('height="'.concat(r,'"'))}return{href:n,dimensions:e}}var JO=globalThis&&globalThis.__awaiter||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 XTe(n,e){Mo(e)?n.title=U9(e):e!=null&&e.markdownNotSupportedFallback?n.title=e.markdownNotSupportedFallback:n.removeAttribute("title")}class QTe{constructor(e,t,i){this.hoverDelegate=e,this.target=t,this.fadeInAnimation=i}update(e,t,i){var s;return JO(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||Mo(e)||e instanceof HTMLElement)o=e;else if(!hw(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 Tn;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?Lf(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 Lee(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 _l(()=>JO(this,void 0,void 0,function*(){(!o||o.isDisposed)&&(o=new QTe(n,f||e,u>0),yield o.update(t,h,i))}),u),l=()=>{if(s)return;const u=new be,h=p=>r(!1,p.fromElement===e);u.add(ce(e,Pe.MOUSE_LEAVE,h,!0));const f=()=>r(!0,!0);u.add(ce(e,Pe.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(ce(e,Pe.MOUSE_MOVE,p,!0))}u.add(a(n.delay,!1,g)),s=u},c=ce(e,Pe.MOUSE_OVER,l,!0);return{show:u=>{r(!1,!0),a(0,u)},hide:()=>{r(!0,!0)},update:(u,h)=>JO(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 JTe(n,e={}){const t=j9(e);return t.textContent=n,t}function exe(n,e={}){const t=j9(e);return kee(t,ixe(n,!!e.renderCodeSegments),e.actionHandler,e.renderCodeSegments),t}function j9(n){const e=n.inline?"span":"div",t=document.createElement(e);return n.className&&(t.className=n.className),t}class txe{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 kee(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(In(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=>{kee(s,o,t,i)})}function ixe(n,e){const t={type:1,children:[]};let i=0,s=t;const o=[],r=new txe(n);for(;!r.eos();){let a=r.next();const l=a==="\\"&&e4(r.peek(),e)!==0;if(l&&(a=r.next()),!l&&nxe(a,e)&&a===r.peek()){r.advance(),s.type===2&&(s=o.pop());const c=e4(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==="\n")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 nxe(n,e){return e4(n,e)!==0}function e4(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 sxe=new RegExp("(\\\\)?\\$\\((".concat(dt.iconNameExpression,"(?:").concat(dt.iconModifierExpression,")?)\\)"),"g");function kf(n){const e=new Array;let t,i=0,s=0;for(;(t=sxe.exec(n))!==null;){s=t.index||0,iK.length)&&(V=K.length);for(var G=0,N=new Array(V);G=K.length?{done:!0}:{done:!1,value:K[N++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn 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(K){e.defaults=K}var c=/[&<>"']/,d=/[&<>"']/g,u=/[<>"']|&(?!#?\w+;)/,h=/[<>"']|&(?!#?\w+;)/g,f={"&":"&","<":"<",">":">",'"':""","'":"'"},g=function(V){return f[V]};function p(K,V){if(V){if(c.test(K))return K.replace(d,g)}else if(u.test(K))return K.replace(h,g);return K}var _=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function v(K){return K.replace(_,function(V,G){return G=G.toLowerCase(),G==="colon"?":":G.charAt(0)==="#"?G.charAt(1)==="x"?String.fromCharCode(parseInt(G.substring(2),16)):String.fromCharCode(+G.substring(1)):""})}var b=/(^|[^\[])\^/g;function C(K,V){K=typeof K=="string"?K:K.source,V=V||"";var G={replace:function(R,U){return U=U.source||U,U=U.replace(b,"$1"),K=K.replace(R,U),G},getRegex:function(){return new RegExp(K,V)}};return G}var w=/[^\w:]/g,y=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function L(K,V,G){if(K){var N;try{N=decodeURIComponent(v(G)).replace(w,"").toLowerCase()}catch{return null}if(N.indexOf("javascript:")===0||N.indexOf("vbscript:")===0||N.indexOf("data:")===0)return null}V&&!y.test(G)&&(G=A(V,G));try{G=encodeURI(G).replace(/%25/g,"%")}catch{return null}return G}var S={},k=/^[^:]+:\/*[^/]*$/,D=/^([^:]+:)[\s\S]*$/,x=/^([^:]+:\/*[^/]*)[\s\S]*$/;function A(K,V){S[" "+K]||(k.test(K)?S[" "+K]=K+"/":S[" "+K]=$(K,"/",!0)),K=S[" "+K];var G=K.indexOf(":")===-1;return V.substring(0,2)==="//"?G?V:K.replace(D,"$1")+V:V.charAt(0)==="/"?G?V:K.replace(x,"$1")+V:K+V}var T={exec:function(){}};function P(K){for(var V=1,G,N;V=0&&he[qe]==="\\";)Le=!Le;return Le?"|":" |"}),N=G.split(/ \|/),R=0;if(N[0].trim()||N.shift(),N.length>0&&!N[N.length-1].trim()&&N.pop(),N.length>V)N.splice(V);else for(;N.length1;)V&1&&(G+=K),V>>=1,K+=K;return G+K}function le(K,V,G,N){var R=V.href,U=V.title?p(V.title):null,H=K[1].replace(/\\([\[\]])/g,"$1");if(K[0].charAt(0)!=="!"){N.state.inLink=!0;var he={type:"link",raw:G,href:R,title:U,text:H,tokens:N.inlineTokens(H)};return N.state.inLink=!1,he}return{type:"image",raw:G,href:R,title:U,text:p(H)}}function de(K,V){var G=K.match(/^(\s+)(?:```)/);if(G===null)return V;var N=G[1];return V.split("\n").map(function(R){var U=R.match(/^\s+/);if(U===null)return R;var H=U[0];return H.length>=N.length?R.slice(N.length):R}).join("\n")}var _e=function(){function K(G){this.options=G||e.defaults}var V=K.prototype;return V.space=function(N){var R=this.rules.block.newline.exec(N);if(R&&R[0].length>0)return{type:"space",raw:R[0]}},V.code=function(N){var R=this.rules.block.code.exec(N);if(R){var U=R[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:R[0],codeBlockStyle:"indented",text:this.options.pedantic?U:$(U,"\n")}}},V.fences=function(N){var R=this.rules.block.fences.exec(N);if(R){var U=R[0],H=de(U,R[3]||"");return{type:"code",raw:U,lang:R[2]?R[2].trim():R[2],text:H}}},V.heading=function(N){var R=this.rules.block.heading.exec(N);if(R){var U=R[2].trim();if(/#$/.test(U)){var H=$(U,"#");(this.options.pedantic||!H||/ $/.test(H))&&(U=H.trim())}return{type:"heading",raw:R[0],depth:R[1].length,text:U,tokens:this.lexer.inline(U)}}},V.hr=function(N){var R=this.rules.block.hr.exec(N);if(R)return{type:"hr",raw:R[0]}},V.blockquote=function(N){var R=this.rules.block.blockquote.exec(N);if(R){var U=R[0].replace(/^ *>[ \t]?/gm,"");return{type:"blockquote",raw:R[0],tokens:this.lexer.blockTokens(U,[]),text:U}}},V.list=function(N){var R=this.rules.block.list.exec(N);if(R){var U,H,he,Le,qe,ot,yt,Et,gi,_i,ft,Ci,Xi=R[1].trim(),za=Xi.length>1,ui={type:"list",raw:"",ordered:za,start:za?+Xi.slice(0,-1):"",loose:!1,items:[]};Xi=za?"\\d{1,9}\\"+Xi.slice(-1):"\\"+Xi,this.options.pedantic&&(Xi=za?Xi:"[*+-]");for(var Gn=new RegExp("^( {0,3}"+Xi+")((?:[ ][^\\n]*)?(?:\\n|$))");N&&(Ci=!1,!(!(R=Gn.exec(N))||this.rules.block.hr.test(N)));){if(U=R[0],N=N.substring(U.length),Et=R[2].split("\n",1)[0],gi=N.split("\n",1)[0],this.options.pedantic?(Le=2,ft=Et.trimLeft()):(Le=R[2].search(/[^ ]/),Le=Le>4?1:Le,ft=Et.slice(Le),Le+=R[1].length),ot=!1,!Et&&/^ *$/.test(gi)&&(U+=gi+"\n",N=N.substring(gi.length+1),Ci=!0),!Ci)for(var Bg=new RegExp("^ {0,"+Math.min(3,Le-1)+"}(?:[*+-]|\\d{1,9}[.)])((?: [^\\n]*)?(?:\\n|$))"),Wg=new RegExp("^ {0,"+Math.min(3,Le-1)+"}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)"),Dl=new RegExp("^ {0,"+Math.min(3,Le-1)+"}(?:```|~~~)"),uh=new RegExp("^ {0,"+Math.min(3,Le-1)+"}#");N&&(_i=N.split("\n",1)[0],Et=_i,this.options.pedantic&&(Et=Et.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),!(Dl.test(Et)||uh.test(Et)||Bg.test(Et)||Wg.test(N)));){if(Et.search(/[^ ]/)>=Le||!Et.trim())ft+="\n"+Et.slice(Le);else if(!ot)ft+="\n"+Et;else break;!ot&&!Et.trim()&&(ot=!0),U+=_i+"\n",N=N.substring(_i.length+1)}ui.loose||(yt?ui.loose=!0:/\n *\n *$/.test(U)&&(yt=!0)),this.options.gfm&&(H=/^\[[ xX]\] /.exec(ft),H&&(he=H[0]!=="[ ] ",ft=ft.replace(/^\[[ xX]\] +/,""))),ui.items.push({type:"list_item",raw:U,task:!!H,checked:he,loose:!1,text:ft}),ui.raw+=U}ui.items[ui.items.length-1].raw=U.trimRight(),ui.items[ui.items.length-1].text=ft.trimRight(),ui.raw=ui.raw.trimRight();var Vg=ui.items.length;for(qe=0;qe1)return!0}return!1});!ui.loose&&Hg.length&&p_&&(ui.loose=!0,ui.items[qe].loose=!0)}return ui}},V.html=function(N){var R=this.rules.block.html.exec(N);if(R){var U={type:"html",raw:R[0],pre:!this.options.sanitizer&&(R[1]==="pre"||R[1]==="script"||R[1]==="style"),text:R[0]};if(this.options.sanitize){var H=this.options.sanitizer?this.options.sanitizer(R[0]):p(R[0]);U.type="paragraph",U.text=H,U.tokens=this.lexer.inline(H)}return U}},V.def=function(N){var R=this.rules.block.def.exec(N);if(R){R[3]&&(R[3]=R[3].substring(1,R[3].length-1));var U=R[1].toLowerCase().replace(/\s+/g," ");return{type:"def",tag:U,raw:R[0],href:R[2],title:R[3]}}},V.table=function(N){var R=this.rules.block.table.exec(N);if(R){var U={type:"table",header:W(R[1]).map(function(yt){return{text:yt}}),align:R[2].replace(/^ *|\| *$/g,"").split(/ *\| */),rows:R[3]&&R[3].trim()?R[3].replace(/\n[ \t]*$/,"").split("\n"):[]};if(U.header.length===U.align.length){U.raw=R[0];var H=U.align.length,he,Le,qe,ot;for(he=0;he/i.test(R[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(R[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(R[0])&&(this.lexer.state.inRawBlock=!1),{type:this.options.sanitize?"text":"html",raw:R[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(R[0]):p(R[0]):R[0]}},V.link=function(N){var R=this.rules.inline.link.exec(N);if(R){var U=R[2].trim();if(!this.options.pedantic&&/^$/.test(U))return;var H=$(U.slice(0,-1),"\\");if((U.length-H.length)%2===0)return}else{var he=X(R[2],"()");if(he>-1){var Le=R[0].indexOf("!")===0?5:4,qe=Le+R[1].length+he;R[2]=R[2].substring(0,he),R[0]=R[0].substring(0,qe).trim(),R[3]=""}}var ot=R[2],yt="";if(this.options.pedantic){var Et=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(ot);Et&&(ot=Et[1],yt=Et[3])}else yt=R[3]?R[3].slice(1,-1):"";return ot=ot.trim(),/^$/.test(U)?ot=ot.slice(1):ot=ot.slice(1,-1)),le(R,{href:ot&&ot.replace(this.rules.inline._escapes,"$1"),title:yt&&yt.replace(this.rules.inline._escapes,"$1")},R[0],this.lexer)}},V.reflink=function(N,R){var U;if((U=this.rules.inline.reflink.exec(N))||(U=this.rules.inline.nolink.exec(N))){var H=(U[2]||U[1]).replace(/\s+/g," ");if(H=R[H.toLowerCase()],!H||!H.href){var he=U[0].charAt(0);return{type:"text",raw:he,text:he}}return le(U,H,U[0],this.lexer)}},V.emStrong=function(N,R,U){U===void 0&&(U="");var H=this.rules.inline.emStrong.lDelim.exec(N);if(H&&!(H[3]&&U.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 he=H[1]||H[2]||"";if(!he||he&&(U===""||this.rules.inline.punctuation.exec(U))){var Le=H[0].length-1,qe,ot,yt=Le,Et=0,gi=H[0][0]==="*"?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(gi.lastIndex=0,R=R.slice(-1*N.length+Le);(H=gi.exec(R))!=null;)if(qe=H[1]||H[2]||H[3]||H[4]||H[5]||H[6],!!qe){if(ot=qe.length,H[3]||H[4]){yt+=ot;continue}else if((H[5]||H[6])&&Le%3&&!((Le+ot)%3)){Et+=ot;continue}if(yt-=ot,!(yt>0)){if(ot=Math.min(ot,ot+yt+Et),Math.min(Le,ot)%2){var _i=N.slice(1,Le+H.index+ot);return{type:"em",raw:N.slice(0,Le+H.index+ot+1),text:_i,tokens:this.lexer.inlineTokens(_i)}}var ft=N.slice(2,Le+H.index+ot-1);return{type:"strong",raw:N.slice(0,Le+H.index+ot+1),text:ft,tokens:this.lexer.inlineTokens(ft)}}}}}},V.codespan=function(N){var R=this.rules.inline.code.exec(N);if(R){var U=R[2].replace(/\n/g," "),H=/[^ ]/.test(U),he=/^ /.test(U)&&/ $/.test(U);return H&&he&&(U=U.substring(1,U.length-1)),U=p(U,!0),{type:"codespan",raw:R[0],text:U}}},V.br=function(N){var R=this.rules.inline.br.exec(N);if(R)return{type:"br",raw:R[0]}},V.del=function(N){var R=this.rules.inline.del.exec(N);if(R)return{type:"del",raw:R[0],text:R[2],tokens:this.lexer.inlineTokens(R[2])}},V.autolink=function(N,R){var U=this.rules.inline.autolink.exec(N);if(U){var H,he;return U[2]==="@"?(H=p(this.options.mangle?R(U[1]):U[1]),he="mailto:"+H):(H=p(U[1]),he=H),{type:"link",raw:U[0],text:H,href:he,tokens:[{type:"text",raw:H,text:H}]}}},V.url=function(N,R){var U;if(U=this.rules.inline.url.exec(N)){var H,he;if(U[2]==="@")H=p(this.options.mangle?R(U[0]):U[0]),he="mailto:"+H;else{var Le;do Le=U[0],U[0]=this.rules.inline._backpedal.exec(U[0])[0];while(Le!==U[0]);H=p(U[0]),U[1]==="www."?he="http://"+H:he=H}return{type:"link",raw:U[0],text:H,href:he,tokens:[{type:"text",raw:H,text:H}]}}},V.inlineText=function(N,R){var U=this.rules.inline.text.exec(N);if(U){var H;return this.lexer.state.inRawBlock?H=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(U[0]):p(U[0]):U[0]:H=p(this.options.smartypants?R(U[0]):U[0]),{type:"text",raw:U[0],text:H}}},K}(),ie={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:T,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,text:/^[^\n]+/};ie._label=/(?!\s*\])(?:\\.|[^\[\]\\])+/,ie._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,ie.def=C(ie.def).replace("label",ie._label).replace("title",ie._title).getRegex(),ie.bullet=/(?:[*+-]|\d{1,9}[.)])/,ie.listItemStart=C(/^( *)(bull) */).replace("bull",ie.bullet).getRegex(),ie.list=C(ie.list).replace(/bull/g,ie.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+ie.def.source+")").getRegex(),ie._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",ie._comment=/|$)/,ie.html=C(ie.html,"i").replace("comment",ie._comment).replace("tag",ie._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),ie.paragraph=C(ie._paragraph).replace("hr",ie.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",ie._tag).getRegex(),ie.blockquote=C(ie.blockquote).replace("paragraph",ie.paragraph).getRegex(),ie.normal=P({},ie),ie.gfm=P({},ie.normal,{table:"^ *([^\\n ].*\\|.*)\\n {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)(?:\\| *)?(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"}),ie.gfm.table=C(ie.gfm.table).replace("hr",ie.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",ie._tag).getRegex(),ie.gfm.paragraph=C(ie._paragraph).replace("hr",ie.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("table",ie.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",ie._tag).getRegex(),ie.pedantic=P({},ie.normal,{html:C("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",ie._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:T,paragraph:C(ie.normal._paragraph).replace("hr",ie.hr).replace("heading"," *#{1,6} *[^\n]").replace("lheading",ie.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var ne={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:T,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:T,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\?@\\[\\]`^{|}~",ne.punctuation=C(ne.punctuation).replace(/punctuation/g,ne._punctuation).getRegex(),ne.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g,ne.escapedEmSt=/\\\*|\\_/g,ne._comment=C(ie._comment).replace("(?:-->|$)","-->").getRegex(),ne.emStrong.lDelim=C(ne.emStrong.lDelim).replace(/punct/g,ne._punctuation).getRegex(),ne.emStrong.rDelimAst=C(ne.emStrong.rDelimAst,"g").replace(/punct/g,ne._punctuation).getRegex(),ne.emStrong.rDelimUnd=C(ne.emStrong.rDelimUnd,"g").replace(/punct/g,ne._punctuation).getRegex(),ne._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,ne._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,ne._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])?)+(?![-_])/,ne.autolink=C(ne.autolink).replace("scheme",ne._scheme).replace("email",ne._email).getRegex(),ne._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,ne.tag=C(ne.tag).replace("comment",ne._comment).replace("attribute",ne._attribute).getRegex(),ne._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,ne._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/,ne._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,ne.link=C(ne.link).replace("label",ne._label).replace("href",ne._href).replace("title",ne._title).getRegex(),ne.reflink=C(ne.reflink).replace("label",ne._label).replace("ref",ie._label).getRegex(),ne.nolink=C(ne.nolink).replace("ref",ie._label).getRegex(),ne.reflinkSearch=C(ne.reflinkSearch,"g").replace("reflink",ne.reflink).replace("nolink",ne.nolink).getRegex(),ne.normal=P({},ne),ne.pedantic=P({},ne.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:C(/^!?\[(label)\]\((.*?)\)/).replace("label",ne._label).getRegex(),reflink:C(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",ne._label).getRegex()}),ne.gfm=P({},ne.normal,{escape:C(ne.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&&(N="x"+N.toString(16)),V+="&#"+N+";";return V}var Ee=function(){function K(G){this.tokens=[],this.tokens.links=Object.create(null),this.options=G||e.defaults,this.options.tokenizer=this.options.tokenizer||new _e,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 N={block:ie.normal,inline:ne.normal};this.options.pedantic?(N.block=ie.pedantic,N.inline=ne.pedantic):this.options.gfm&&(N.block=ie.gfm,this.options.breaks?N.inline=ne.breaks:N.inline=ne.gfm),this.tokenizer.rules=N}K.lex=function(N,R){var U=new K(R);return U.lex(N)},K.lexInline=function(N,R){var U=new K(R);return U.inlineTokens(N)};var V=K.prototype;return V.lex=function(N){N=N.replace(/\r\n|\r/g,"\n"),this.blockTokens(N,this.tokens);for(var R;R=this.inlineQueue.shift();)this.inlineTokens(R.src,R.tokens);return this.tokens},V.blockTokens=function(N,R){var U=this;R===void 0&&(R=[]),this.options.pedantic?N=N.replace(/\t/g," ").replace(/^ +$/gm,""):N=N.replace(/^( *)(\t+)/gm,function(yt,Et,gi){return Et+" ".repeat(gi.length)});for(var H,he,Le,qe;N;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(function(yt){return(H=yt.call({lexer:U},N,R))?(N=N.substring(H.raw.length),R.push(H),!0):!1}))){if(H=this.tokenizer.space(N)){N=N.substring(H.raw.length),H.raw.length===1&&R.length>0?R[R.length-1].raw+="\n":R.push(H);continue}if(H=this.tokenizer.code(N)){N=N.substring(H.raw.length),he=R[R.length-1],he&&(he.type==="paragraph"||he.type==="text")?(he.raw+="\n"+H.raw,he.text+="\n"+H.text,this.inlineQueue[this.inlineQueue.length-1].src=he.text):R.push(H);continue}if(H=this.tokenizer.fences(N)){N=N.substring(H.raw.length),R.push(H);continue}if(H=this.tokenizer.heading(N)){N=N.substring(H.raw.length),R.push(H);continue}if(H=this.tokenizer.hr(N)){N=N.substring(H.raw.length),R.push(H);continue}if(H=this.tokenizer.blockquote(N)){N=N.substring(H.raw.length),R.push(H);continue}if(H=this.tokenizer.list(N)){N=N.substring(H.raw.length),R.push(H);continue}if(H=this.tokenizer.html(N)){N=N.substring(H.raw.length),R.push(H);continue}if(H=this.tokenizer.def(N)){N=N.substring(H.raw.length),he=R[R.length-1],he&&(he.type==="paragraph"||he.type==="text")?(he.raw+="\n"+H.raw,he.text+="\n"+H.raw,this.inlineQueue[this.inlineQueue.length-1].src=he.text):this.tokens.links[H.tag]||(this.tokens.links[H.tag]={href:H.href,title:H.title});continue}if(H=this.tokenizer.table(N)){N=N.substring(H.raw.length),R.push(H);continue}if(H=this.tokenizer.lheading(N)){N=N.substring(H.raw.length),R.push(H);continue}if(Le=N,this.options.extensions&&this.options.extensions.startBlock&&function(){var yt=1/0,Et=N.slice(1),gi=void 0;U.options.extensions.startBlock.forEach(function(_i){gi=_i.call({lexer:this},Et),typeof gi=="number"&&gi>=0&&(yt=Math.min(yt,gi))}),yt<1/0&&yt>=0&&(Le=N.substring(0,yt+1))}(),this.state.top&&(H=this.tokenizer.paragraph(Le))){he=R[R.length-1],qe&&he.type==="paragraph"?(he.raw+="\n"+H.raw,he.text+="\n"+H.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=he.text):R.push(H),qe=Le.length!==N.length,N=N.substring(H.raw.length);continue}if(H=this.tokenizer.text(N)){N=N.substring(H.raw.length),he=R[R.length-1],he&&he.type==="text"?(he.raw+="\n"+H.raw,he.text+="\n"+H.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=he.text):R.push(H);continue}if(N){var ot="Infinite loop on byte: "+N.charCodeAt(0);if(this.options.silent){console.error(ot);break}else throw new Error(ot)}}return this.state.top=!0,R},V.inline=function(N,R){return R===void 0&&(R=[]),this.inlineQueue.push({src:N,tokens:R}),R},V.inlineTokens=function(N,R){var U=this;R===void 0&&(R=[]);var H,he,Le,qe=N,ot,yt,Et;if(this.tokens.links){var gi=Object.keys(this.tokens.links);if(gi.length>0)for(;(ot=this.tokenizer.rules.inline.reflinkSearch.exec(qe))!=null;)gi.includes(ot[0].slice(ot[0].lastIndexOf("[")+1,-1))&&(qe=qe.slice(0,ot.index)+"["+Q("a",ot[0].length-2)+"]"+qe.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(ot=this.tokenizer.rules.inline.blockSkip.exec(qe))!=null;)qe=qe.slice(0,ot.index)+"["+Q("a",ot[0].length-2)+"]"+qe.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(ot=this.tokenizer.rules.inline.escapedEmSt.exec(qe))!=null;)qe=qe.slice(0,ot.index)+"++"+qe.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex);for(;N;)if(yt||(Et=""),yt=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(function(ft){return(H=ft.call({lexer:U},N,R))?(N=N.substring(H.raw.length),R.push(H),!0):!1}))){if(H=this.tokenizer.escape(N)){N=N.substring(H.raw.length),R.push(H);continue}if(H=this.tokenizer.tag(N)){N=N.substring(H.raw.length),he=R[R.length-1],he&&H.type==="text"&&he.type==="text"?(he.raw+=H.raw,he.text+=H.text):R.push(H);continue}if(H=this.tokenizer.link(N)){N=N.substring(H.raw.length),R.push(H);continue}if(H=this.tokenizer.reflink(N,this.tokens.links)){N=N.substring(H.raw.length),he=R[R.length-1],he&&H.type==="text"&&he.type==="text"?(he.raw+=H.raw,he.text+=H.text):R.push(H);continue}if(H=this.tokenizer.emStrong(N,qe,Et)){N=N.substring(H.raw.length),R.push(H);continue}if(H=this.tokenizer.codespan(N)){N=N.substring(H.raw.length),R.push(H);continue}if(H=this.tokenizer.br(N)){N=N.substring(H.raw.length),R.push(H);continue}if(H=this.tokenizer.del(N)){N=N.substring(H.raw.length),R.push(H);continue}if(H=this.tokenizer.autolink(N,pe)){N=N.substring(H.raw.length),R.push(H);continue}if(!this.state.inLink&&(H=this.tokenizer.url(N,pe))){N=N.substring(H.raw.length),R.push(H);continue}if(Le=N,this.options.extensions&&this.options.extensions.startInline&&function(){var ft=1/0,Ci=N.slice(1),Xi=void 0;U.options.extensions.startInline.forEach(function(za){Xi=za.call({lexer:this},Ci),typeof Xi=="number"&&Xi>=0&&(ft=Math.min(ft,Xi))}),ft<1/0&&ft>=0&&(Le=N.substring(0,ft+1))}(),H=this.tokenizer.inlineText(Le,Ye)){N=N.substring(H.raw.length),H.raw.slice(-1)!=="_"&&(Et=H.raw.slice(-1)),yt=!0,he=R[R.length-1],he&&he.type==="text"?(he.raw+=H.raw,he.text+=H.text):R.push(H);continue}if(N){var _i="Infinite loop on byte: "+N.charCodeAt(0);if(this.options.silent){console.error(_i);break}else throw new Error(_i)}}return R},i(K,null,[{key:"rules",get:function(){return{block:ie,inline:ne}}}]),K}(),ze=function(){function K(G){this.options=G||e.defaults}var V=K.prototype;return V.code=function(N,R,U){var H=(R||"").match(/\S*/)[0];if(this.options.highlight){var he=this.options.highlight(N,H);he!=null&&he!==N&&(U=!0,N=he)}return N=N.replace(/\n$/,"")+"\n",H?'
    '+(U?N:p(N,!0))+"
    \n":"
    "+(U?N:p(N,!0))+"
    \n"},V.blockquote=function(N){return"
    \n"+N+"
    \n"},V.html=function(N){return N},V.heading=function(N,R,U,H){if(this.options.headerIds){var he=this.options.headerPrefix+H.slug(U);return"'+N+"\n"}return""+N+"\n"},V.hr=function(){return this.options.xhtml?"
    \n":"
    \n"},V.list=function(N,R,U){var H=R?"ol":"ul",he=R&&U!==1?' start="'+U+'"':"";return"<"+H+he+">\n"+N+"\n"},V.listitem=function(N){return"
  • "+N+"
  • \n"},V.checkbox=function(N){return" "},V.paragraph=function(N){return"

    "+N+"

    \n"},V.table=function(N,R){return R&&(R=""+R+""),"\n\n"+N+"\n"+R+"
    \n"},V.tablerow=function(N){return"\n"+N+"\n"},V.tablecell=function(N,R){var U=R.header?"th":"td",H=R.align?"<"+U+' align="'+R.align+'">':"<"+U+">";return H+N+("\n")},V.strong=function(N){return""+N+""},V.em=function(N){return""+N+""},V.codespan=function(N){return""+N+""},V.br=function(){return this.options.xhtml?"
    ":"
    "},V.del=function(N){return""+N+""},V.link=function(N,R,U){if(N=L(this.options.sanitize,this.options.baseUrl,N),N===null)return U;var H='",H},V.image=function(N,R,U){if(N=L(this.options.sanitize,this.options.baseUrl,N),N===null)return U;var H=''+U+'":">",H},V.text=function(N){return N},K}(),It=function(){function K(){}var V=K.prototype;return V.strong=function(N){return N},V.em=function(N){return N},V.codespan=function(N){return N},V.del=function(N){return N},V.html=function(N){return N},V.text=function(N){return N},V.link=function(N,R,U){return""+U},V.image=function(N,R,U){return""+U},V.br=function(){return""},K}(),Ke=function(){function K(){this.seen={}}var V=K.prototype;return V.serialize=function(N){return N.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")},V.getNextSafeSlug=function(N,R){var U=N,H=0;if(this.seen.hasOwnProperty(U)){H=this.seen[N];do H++,U=N+"-"+H;while(this.seen.hasOwnProperty(U))}return R||(this.seen[N]=H,this.seen[U]=0),U},V.slug=function(N,R){R===void 0&&(R={});var U=this.serialize(N);return this.getNextSafeSlug(U,R.dryrun)},K}(),Xe=function(){function K(G){this.options=G||e.defaults,this.options.renderer=this.options.renderer||new ze,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new It,this.slugger=new Ke}K.parse=function(N,R){var U=new K(R);return U.parse(N)},K.parseInline=function(N,R){var U=new K(R);return U.parseInline(N)};var V=K.prototype;return V.parse=function(N,R){R===void 0&&(R=!0);var U="",H,he,Le,qe,ot,yt,Et,gi,_i,ft,Ci,Xi,za,ui,Gn,Bg,Wg,Dl,uh,Vg=N.length;for(H=0;H0&&Gn.tokens[0].type==="paragraph"?(Gn.tokens[0].text=Dl+" "+Gn.tokens[0].text,Gn.tokens[0].tokens&&Gn.tokens[0].tokens.length>0&&Gn.tokens[0].tokens[0].type==="text"&&(Gn.tokens[0].tokens[0].text=Dl+" "+Gn.tokens[0].tokens[0].text)):Gn.tokens.unshift({type:"text",text:Dl}):ui+=Dl),ui+=this.parse(Gn.tokens,za),_i+=this.renderer.listitem(ui,Wg,Bg);U+=this.renderer.list(_i,Ci,Xi);continue}case"html":{U+=this.renderer.html(ft.text);continue}case"paragraph":{U+=this.renderer.paragraph(this.parseInline(ft.tokens));continue}case"text":{for(_i=ft.tokens?this.parseInline(ft.tokens):ft.text;H+1"u"||K===null)throw new Error("marked(): input parameter is undefined or null");if(typeof K!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(K)+", string expected");if(typeof V=="function"&&(G=V,V=null),V=P({},je.defaults,V||{}),J(V),G){var N=V.highlight,R;try{R=Ee.lex(K,V)}catch(qe){return G(qe)}var U=function(ot){var yt;if(!ot)try{V.walkTokens&&je.walkTokens(R,V.walkTokens),yt=Xe.parse(R,V)}catch(Et){ot=Et}return V.highlight=N,ot?G(ot):G(null,yt)};if(!N||N.length<3||(delete V.highlight,!R.length))return U();var H=0;je.walkTokens(R,function(qe){qe.type==="code"&&(H++,setTimeout(function(){N(qe.text,qe.lang,function(ot,yt){if(ot)return U(ot);yt!=null&&yt!==qe.text&&(qe.text=yt,qe.escaped=!0),H--,H===0&&U()})},0))}),H===0&&U();return}function he(qe){if(qe.message+="\nPlease report this to https://github.com/markedjs/marked.",V.silent)return"

    An error occurred:

    "+p(qe.message+"",!0)+"
    ";throw qe}try{var Le=Ee.lex(K,V);if(V.walkTokens){if(V.async)return Promise.all(je.walkTokens(Le,V.walkTokens)).then(function(){return Xe.parse(Le,V)}).catch(he);je.walkTokens(Le,V.walkTokens)}return Xe.parse(Le,V)}catch(qe){he(qe)}}je.options=je.setOptions=function(K){return P(je.defaults,K),l(je.defaults),je},je.getDefaults=a,je.defaults=e.defaults,je.use=function(){for(var K=arguments.length,V=new Array(K),G=0;G"u"||K===null)throw new Error("marked.parseInline(): input parameter is undefined or null");if(typeof K!="string")throw new Error("marked.parseInline(): input parameter is of type "+Object.prototype.toString.call(K)+", string expected");V=P({},je.defaults,V||{}),J(V);try{var G=Ee.lexInline(K,V);return V.walkTokens&&je.walkTokens(G,V.walkTokens),Xe.parseInline(G,V)}catch(N){if(N.message+="\nPlease report this to https://github.com/markedjs/marked.",V.silent)return"

    An error occurred:

    "+p(N.message+"",!0)+"
    ";throw N}},je.Parser=Xe,je.parser=Xe.parse,je.Renderer=ze,je.TextRenderer=It,je.Lexer=Ee,je.lexer=Ee.lex,je.Tokenizer=_e,je.Slugger=Ke,je.parse=je;var Z=je.options,z=je.setOptions,ae=je.use,we=je.walkTokens,Ne=je.parseInline,Ce=je,Be=Xe.parse,Ae=Ee.lex;e.Lexer=Ee,e.Parser=Xe,e.Renderer=ze,e.Slugger=Ke,e.TextRenderer=It,e.Tokenizer=_e,e.getDefaults=a,e.lexer=Ae,e.marked=je,e.options=Z,e.parse=Ce,e.parseInline=Ne,e.parser=Be,e.setOptions=z,e.use=ae,e.walkTokens=we,Object.defineProperty(e,"__esModule",{value:!0})})})();Fo.Lexer||exports.Lexer;Fo.Parser||exports.Parser;Fo.Renderer||exports.Renderer;Fo.Slugger||exports.Slugger;Fo.TextRenderer||exports.TextRenderer;Fo.Tokenizer||exports.Tokenizer;Fo.getDefaults||exports.getDefaults;Fo.lexer||exports.lexer;var Zc=Fo.marked||exports.marked;Fo.options||exports.options;Fo.parse||exports.parse;Fo.parseInline||exports.parseInline;Fo.parser||exports.parser;Fo.setOptions||exports.setOptions;Fo.use||exports.use;Fo.walkTokens||exports.walkTokens;function oxe(n){return JSON.stringify(n,rxe)}function n4(n){let e=JSON.parse(n);return e=s4(e),e}function rxe(n,e){return e instanceof RegExp?{$mid:2,source:e.source,flags:e.flags}:e}function s4(n,e=0){if(!n||e>200)return n;if(typeof n=="object"){switch(n.$mid){case 1:return ct.revive(n);case 2:return new RegExp(n.source,n.flags);case 17:return new Date(n.source)}if(n instanceof dx||n instanceof Uint8Array)return n;if(Array.isArray(n))for(let t=0;t{let i=[],s=[];return n&&({href:n,dimensions:i}=ZTe(n),s.push('src="'.concat(QL(n),'"'))),t&&s.push('alt="'.concat(QL(t),'"')),e&&s.push('title="'.concat(QL(e),'"')),i.length&&(s=s.concat(i)),""},paragraph:n=>"

    ".concat(n,"

    "),link:(n,e,t)=>typeof n!="string"?"":(n===t&&(t=QM(t)),e=typeof e=="string"?QL(QM(e)):"",n=QM(n),n=n.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'"),'
    ').concat(t,""))});function Bx(n,e={},t={}){var i,s;const o=new be;let r=!1;const a=j9(e),l=function(v){let b;try{b=n4(decodeURIComponent(v))}catch{}return b?(b=ZZ(b,C=>{if(n.uris&&n.uris[C])return ct.revive(n.uris[C])}),encodeURIComponent(JSON.stringify(b))):v},c=function(v,b){const C=n.uris&&n.uris[v];let w=ct.revive(C);return b?v.startsWith(Nt.data+":")?v:(w||(w=ct.parse(v)),GX.uriToBrowserUri(w).toString(!0)):!w||ct.parse(v).toString()===w.toString()?v:(w.query&&(w=w.with({query:l(w.query)})),w.toString())},d=new Zc.Renderer;d.image=JM.image,d.link=JM.link,d.paragraph=JM.paragraph;const u=[],h=[];if(e.codeBlockRendererSync?d.code=(v,b)=>{const C=i4.nextId(),w=e.codeBlockRendererSync(Oz(b),v);return h.push([C,w]),'
    ').concat(pE(v),"
    ")}:e.codeBlockRenderer&&(d.code=(v,b)=>{const C=i4.nextId(),w=e.codeBlockRenderer(Oz(b),v);return u.push(w.then(y=>[C,y])),'
    ').concat(pE(v),"
    ")}),e.actionHandler){const v=function(w){let y=w.target;if(!(y.tagName!=="A"&&(y=y.parentElement,!y||y.tagName!=="A")))try{let L=y.dataset.href;L&&(n.baseUri&&(L=eR(ct.from(n.baseUri),L)),e.actionHandler.callback(L,w))}catch(L){Dt(L)}finally{w.preventDefault()}},b=e.actionHandler.disposables.add(new Vt(a,"click")),C=e.actionHandler.disposables.add(new Vt(a,"auxclick"));e.actionHandler.disposables.add(We.any(b.event,C.event)(w=>{const y=new ba(w);!y.leftButton&&!y.middleButton||v(y)})),e.actionHandler.disposables.add(ce(a,"keydown",w=>{const y=new Oi(w);!y.equals(10)&&!y.equals(3)||v(y)}))}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="".concat(f.substr(0,1e5),"…")),n.supportThemeIcons&&(f=jTe(f));let g;if(e.fillInIncompleteTokens){const v=Object.assign(Object.assign({},Zc.defaults),t),b=Zc.lexer(f,v),C=gxe(b);g=Zc.parser(C,v)}else g=Zc.parse(f,t);n.supportThemeIcons&&(g=kf(g).map(b=>typeof b=="string"?b:b.outerHTML).join(""));const _=new DOMParser().parseFromString(o4(n,g),"text/html");if(_.body.querySelectorAll("img").forEach(v=>{const b=v.getAttribute("src");if(b){let C=b;try{n.baseUri&&(C=eR(ct.from(n.baseUri),C))}catch{}v.src=c(C,!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 C=c(b,!1);n.baseUri&&(C=eR(ct.from(n.baseUri),b)),v.dataset.href=C}}),a.innerHTML=o4(n,_.body.innerHTML),u.length>0)Promise.all(u).then(v=>{var b,C;if(r)return;const w=new Map(v),y=a.querySelectorAll("div[data-code]");for(const L of y){const S=w.get((b=L.dataset.code)!==null&&b!==void 0?b:"");S&&Es(L,S)}(C=e.asyncRenderCallback)===null||C===void 0||C.call(e)});else if(h.length>0){const v=new Map(h),b=a.querySelectorAll("div[data-code]");for(const C of b){const w=v.get((s=C.dataset.code)!==null&&s!==void 0?s:"");w&&Es(C,w)}}if(e.asyncRenderCallback)for(const v of a.getElementsByTagName("img")){const b=o.add(ce(v,"load",()=>{b.dispose(),e.asyncRenderCallback()}))}return{element:a,dispose:()=>{r=!0,o.dispose()}}}function Oz(n){if(!n)return"";const e=n.split(/[\s+|:|,|\{|\?]/,1);return e.length?e[0]:n}function eR(n,e){return/^\w[\w\d+.-]*:/.test(e)?e:n.path.endsWith("/")?R$(n,e).toString():R$(Ix(n),e).toString()}function o4(n,e){const{config:t,allowedSchemes:i}=lxe(n);jX("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=a0e(i);try{return UX(e,Object.assign(Object.assign({},t),{RETURN_TRUSTED_TYPE:!0}))}finally{KX("uponSanitizeAttribute"),s.dispose()}}const axe=["align","autoplay","alt","class","controls","data-code","data-href","height","href","loop","muted","playsinline","poster","src","style","target","title","width","start"];function lxe(n){const e=[Nt.http,Nt.https,Nt.mailto,Nt.data,Nt.file,Nt.vscodeFileResource,Nt.vscodeRemote,Nt.vscodeRemoteResource];return n.isTrusted&&e.push(Nt.command),{config:{ALLOWED_TAGS:[...l0e],ALLOWED_ATTR:axe,ALLOW_UNKNOWN_PROTOCOLS:!0},allowedSchemes:e}}function cxe(n){return typeof n=="string"?n:dxe(n)}function dxe(n){var e;let t=(e=n.value)!==null&&e!==void 0?e:"";t.length>1e5&&(t="".concat(t.substr(0,1e5),"…"));const i=Zc.parse(t,{renderer:hxe.value}).replace(/&(#\d+|[a-zA-Z]+);/g,s=>{var o;return(o=uxe.get(s))!==null&&o!==void 0?o:s});return o4({isTrusted:!1},i).toString()}const uxe=new Map([[""",'"'],[" "," "],["&","&"],["'","'"],["<","<"],[">",">"]]),hxe=new kg(()=>{const n=new Zc.Renderer;return n.code=e=>e,n.blockquote=e=>e,n.html=e=>"",n.heading=(e,t,i)=>e+"\n",n.hr=()=>"",n.list=(e,t)=>e,n.listitem=e=>e+"\n",n.paragraph=e=>e+"\n",n.table=(e,t)=>e+t+"\n",n.tablerow=e=>e,n.tablecell=(e,t)=>e+" ",n.strong=e=>e,n.em=e=>e,n.codespan=e=>e,n.br=()=>"\n",n.del=e=>e,n.image=(e,t,i)=>"",n.text=e=>e,n.link=(e,t,i)=>i,n});function q9(n){let e="";return n.forEach(t=>{e+=t.raw}),e}function fxe(n){for(const e of n.tokens)if(e.type==="text"){const t=e.raw.split("\n"),i=t[t.length-1];if(i.includes("`"))return mxe(n);if(i.includes("**"))return wxe(n);if(i.match(/\*\w/))return _xe(n);if(i.match(/(^|\s)__\w/))return yxe(n);if(i.match(/(^|\s)_\w/))return vxe(n);if(i.match(/(^|\s)\[.*\]\(\w*/))return bxe(n);if(i.match(/(^|\s)\[\w/))return Cxe(n)}}function gxe(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("\n"):e,r=!!o.match(/\|\s*$/),a=o+(r?"":"|")+"\n|".concat(" --- |".repeat(i));return Zc.lexer(a)}}class Lxe{constructor(e){this.spliceables=e}splice(e,t,i){this.spliceables.forEach(s=>s.splice(e,t,i))}}class T_ extends Error{constructor(e,t){super("ListError [".concat(e,"] ").concat(t))}}function Fz(n,e){const t=[];for(const i of e){if(n.start>=i.range.end)continue;if(n.ende.concat(t),[]))}class Bz{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!=null?e:0,this._size=this._paddingTop}splice(e,t,i=[]){const s=i.length-t,o=Fz({start:0,end:e},this.groups),r=Fz({start:e+t,end:Number.POSITIVE_INFINITY},this.groups).map(l=>({range:r4(l.range,s),size:l.size})),a=i.map((l,c)=>({range:{start:e+c,end:e+c+1},size:l.size}));this.groups=Dxe(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 ".concat(e));return t}}var ah=globalThis&&globalThis.__decorate||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 Gg={CurrentDragAndDropData:void 0},Ic={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 ES{constructor(e){this.elements=e}update(){}getData(){return this.elements}}class Txe{constructor(e){this.elements=e}update(){}getData(){return this.elements}}class xxe{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 Ha{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:rM(this.domNode)}),this.rowsContainer.style.width="".concat(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=Ic){var o,r,a,l,c,d,u,h,f,g,p,_,v;if(this.virtualDelegate=t,this.domId="list_id_".concat(++Ha.InstanceCount),this.renderers=new Map,this.renderWidth=0,this._scrollHeight=0,this.scrollableElementUpdateDisposable=null,this.scrollableElementWidthDelayer=new pl(50),this.splicing=!1,this.dragOverAnimationStopDisposable=te.None,this.dragOverMouseY=0,this.canDrop=!1,this.currentDragFeedbackDisposable=te.None,this.onDragLeaveTimeout=te.None,this.disposables=new be,this._onDidChangeContentHeight=new j,this._onDidChangeContentWidth=new j,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 Bz((o=s.paddingTop)!==null&&o!==void 0?o:0);for(const C of i)this.renderers.set(C.templateId,C);this.cache=this.disposables.add(new Ixe(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:Ic.horizontalScrolling,this.domNode.classList.toggle("horizontal-scrolling",this._horizontalScrolling),this.paddingBottom=typeof s.paddingBottom>"u"?0:s.paddingBottom,this.accessibilityProvider=new Axe(s.accessibilityProvider),this.rowsContainer=document.createElement("div"),this.rowsContainer.className="monaco-list-rows",((a=s.transformOptimization)!==null&&a!==void 0?a:Ic.transformOptimization)&&(this.rowsContainer.style.transform="translate3d(0px, 0px, 0px)",this.rowsContainer.style.overflow="hidden",this.rowsContainer.style.contain="strict"),this.disposables.add(Ii.addTarget(this.rowsContainer)),this.scrollable=this.disposables.add(new vS({forceIntegerValues:!0,smoothScrollDuration:(l=s.smoothScrolling)!==null&&l!==void 0&&l?125:0,scheduleAtNextAnimationFrame:C=>xa(C)})),this.scrollableElement=this.disposables.add(new c9(this.rowsContainer,{alwaysConsumeMouseWheel:(c=s.alwaysConsumeMouseWheel)!==null&&c!==void 0?c:Ic.alwaysConsumeMouseWheel,horizontal:1,vertical:(d=s.verticalScrollMode)!==null&&d!==void 0?d:Ic.verticalScrollMode,useShadows:(u=s.useShadows)!==null&&u!==void 0?u:Ic.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(ce(this.rowsContainer,Ti.Change,C=>this.onTouchChange(C))),this.disposables.add(ce(this.scrollableElement.getDomNode(),"scroll",C=>C.target.scrollTop=0)),this.disposables.add(ce(this.domNode,"dragover",C=>this.onDragOver(this.toDragEvent(C)))),this.disposables.add(ce(this.domNode,"drop",C=>this.onDrop(this.toDragEvent(C)))),this.disposables.add(ce(this.domNode,"dragleave",C=>this.onDragLeave(this.toDragEvent(C)))),this.disposables.add(ce(this.domNode,"dragend",C=>this.onDragEnd(C))),this.setRowLineHeight=(h=s.setRowLineHeight)!==null&&h!==void 0?h:Ic.setRowLineHeight,this.setRowHeight=(f=s.setRowHeight)!==null&&f!==void 0?f:Ic.setRowHeight,this.supportDynamicHeights=(g=s.supportDynamicHeights)!==null&&g!==void 0?g:Ic.supportDynamicHeights,this.dnd=(p=s.dnd)!==null&&p!==void 0?p:this.disposables.add(Ic.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!=null?t:{}),{scrollByPage:e.scrollByPage})),e.mouseWheelScrollSensitivity!==void 0&&(t=Object.assign(Object.assign({},t!=null?t:{}),{mouseWheelScrollSensitivity:e.mouseWheelScrollSensitivity})),e.fastScrollSensitivity!==void 0&&(t=Object.assign(Object.assign({},t!=null?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=js.intersect(s,o),a=new Map;for(let L=r.end-1;L>=r.start;L--){const S=this.items[L];if(S.dragStartDisposable.dispose(),S.checkedDisposable.dispose(),S.row){let k=a.get(S.templateId);k||(k=[],a.set(S.templateId,k));const D=this.renderers.get(S.templateId);D&&D.disposeElement&&D.disposeElement(S.element,L,S.row.templateData,S.size),k.push(S.row)}S.row=null}const l={start:e+t,end:this.items.length},c=js.intersect(l,s),d=js.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:te.None,checkedDisposable:te.None}));let h;e===0&&t>=this.items.length?(this.rangeMap=new Bz(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=r4(c,f),_=js.intersect(g,p);for(let L=_.start;L<_.end;L++)this.updateItemInDOM(this.items[L],L);const v=js.relativeComplement(p,g);for(const L of v)for(let S=L.start;Sr4(L,f)),w=[{start:e,end:e+i.length},...b].map(L=>js.intersect(g,L)),y=this.getNextToLastElement(w);for(const L of w)for(let S=L.start;SL.element)}eventuallyUpdateScrollDimensions(){this._scrollHeight=this.contentHeight,this.rowsContainer.style.height="".concat(this._scrollHeight,"px"),this.scrollableElementUpdateDisposable||(this.scrollableElementUpdateDisposable=xa(()=>{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 ".concat(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=ce(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=rM(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="".concat(this.elementTop(t),"px"),this.setRowHeight&&(e.row.domNode.style.height="".concat(e.size,"px")),this.setRowLineHeight&&(e.row.domNode.style.lineHeight="".concat(e.size,"px")),e.row.domNode.setAttribute("data-index","".concat(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 We.map(this.disposables.add(new Vt(this.domNode,"click")).event,e=>this.toMouseEvent(e),this.disposables)}get onMouseDblClick(){return We.map(this.disposables.add(new Vt(this.domNode,"dblclick")).event,e=>this.toMouseEvent(e),this.disposables)}get onMouseMiddleClick(){return We.filter(We.map(this.disposables.add(new Vt(this.domNode,"auxclick")).event,e=>this.toMouseEvent(e),this.disposables),e=>e.browserEvent.button===1,this.disposables)}get onMouseDown(){return We.map(this.disposables.add(new Vt(this.domNode,"mousedown")).event,e=>this.toMouseEvent(e),this.disposables)}get onMouseOver(){return We.map(this.disposables.add(new Vt(this.domNode,"mouseover")).event,e=>this.toMouseEvent(e),this.disposables)}get onMouseOut(){return We.map(this.disposables.add(new Vt(this.domNode,"mouseout")).event,e=>this.toMouseEvent(e),this.disposables)}get onContextMenu(){return We.any(We.map(this.disposables.add(new Vt(this.domNode,"contextmenu")).event,e=>this.toMouseEvent(e),this.disposables),We.map(this.disposables.add(new Vt(this.domNode,Ti.Contextmenu)).event,e=>this.toGestureEvent(e),this.disposables))}get onTouchStart(){return We.map(this.disposables.add(new Vt(this.domNode,"touchstart")).event,e=>this.toTouchEvent(e),this.disposables)}get onTap(){return We.map(this.disposables.add(new Vt(this.rowsContainer,Ti.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(Jw.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=ye(".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 ES(r),Gg.CurrentDragAndDropData=new Txe(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(),Gg.CurrentDragAndDropData&&Gg.CurrentDragAndDropData.getData()==="vscode-ui"||(this.setupDragAndDropScrollTopAnimation(e.browserEvent),!e.browserEvent.dataTransfer))return!1;if(!this.currentDragData)if(Gg.CurrentDragAndDropData)this.currentDragData=Gg.CurrentDragAndDropData;else{if(!e.browserEvent.dataTransfer.types)return!1;this.currentDragData=new xxe}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=Vf(s).filter(o=>o>=-1&&oo-r),s=s[0]===-1?[-1]:s,Nxe(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=vt(()=>{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=vt(()=>{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=Kf(()=>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,Gg.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,Gg.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=te.None}setupDragAndDropScrollTopAnimation(e){if(!this.dragOverAnimationDisposable){const t=ZX(this.domNode).top;this.dragOverAnimationDisposable=r0e(this.animateDragAndDropScrollTop.bind(this,t))}this.dragOverAnimationStopDisposable.dispose(),this.dragOverAnimationStopDisposable=Kf(()=>{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},Wz=globalThis&&globalThis.__awaiter||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 Mxe{constructor(e){this.trait=e,this.renderedElements=[]}get templateId(){return"template:".concat(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 rI=class{get name(){return this._trait}get renderer(){return new Mxe(this)}constructor(e){this._trait=e,this.length=0,this.indexes=[],this.sortedIndexes=[],this._onChange=new j,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(Hz),t)}_set(e,t,i){const s=this.indexes,o=this.sortedIndexes;this.indexes=e,this.sortedIndexes=t;const r=a4(o,e);return this.renderer.renderIndexes(r),this._onChange.fire({indexes:e,browserEvent:i}),s}get(){return this.indexes}contains(e){return cw(this.sortedIndexes,e,Hz)>=0}dispose(){fi(this._onChange)}};Jm([xn],rI.prototype,"renderer",null);class Rxe extends rI{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 tR{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 Df(n){return n.tagName==="INPUT"||n.tagName==="TEXTAREA"}function _v(n){return n.classList.contains("monaco-editor")?!0:n.classList.contains("monaco-list")||!n.parentElement?!1:_v(n.parentElement)}function Dee(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:Dee(n.parentElement)}class Eee{get onKeyDown(){return We.chain(this.disposables.add(new Vt(this.view.domNode,"keydown")).event,e=>e.filter(t=>!Df(t.target)).map(t=>new Oi(t)))}constructor(e,t,i){this.list=e,this.view=t,this.disposables=new be,this.multipleSelectionDisposables=new be,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&&(Kt?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(yo(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()}}Jm([xn],Eee.prototype,"onKeyDown",null);var Xc;(function(n){n[n.Automatic=0]="Automatic",n[n.Trigger=1]="Trigger"})(Xc||(Xc={}));var vv;(function(n){n[n.Idle=0]="Idle",n[n.Typing=1]="Typing"})(vv||(vv={}));const Pxe=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 Oxe{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=vv.Idle,this.mode=Xc.Automatic,this.triggered=!1,this.previouslyFocused=-1,this.enabledDisposables=new be,this.disposables=new be,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:Xc.Automatic}enable(){if(this.enabled)return;let e=!1;const t=We.chain(this.enabledDisposables.add(new Vt(this.view.domNode,"keydown")).event,o=>o.filter(r=>!Df(r.target)).filter(()=>this.mode===Xc.Automatic||this.triggered).map(r=>new Oi(r)).filter(r=>e||this.keyboardNavigationEventFilter(r)).filter(r=>this.delegate.mightProducePrintableCharacter(r)).forEach(r=>xt.stop(r,!0)).map(r=>r.browserEvent.key)),i=We.debounce(t,()=>null,800,void 0,void 0,void 0,this.enabledDisposables);We.reduce(We.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&&to(i)}this.previouslyFocused=-1}onInput(e){if(!e){this.state=vv.Idle,this.triggered=!1;return}const t=this.list.getFocus(),i=t.length>0?t[0]:0,s=this.state===vv.Idle?1:0;this.state=vv.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"||ey(e,l)){this.previouslyFocused=i,this.list.setFocus([r]),this.list.reveal(r);return}}}dispose(){this.disable(),this.enabledDisposables.dispose(),this.disposables.dispose()}}class Fxe{constructor(e,t){this.list=e,this.view=t,this.disposables=new be;const i=We.chain(this.disposables.add(new Vt(t.domNode,"keydown")).event,o=>o.filter(r=>!Df(r.target)).map(r=>new Oi(r)));We.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 Iee(n){return Kt?n.browserEvent.metaKey:n.browserEvent.ctrlKey}function Tee(n){return n.browserEvent.shiftKey}function Bxe(n){return n instanceof MouseEvent&&n.button===2}const Vz={isSelectionSingleChangeEvent:Iee,isSelectionRangeChangeEvent:Tee};class xee{constructor(e){this.list=e,this.disposables=new be,this._onPointer=new j,this.onPointer=this._onPointer.event,e.options.multipleSelectionSupport!==!1&&(this.multipleSelectionController=this.list.options.multipleSelectionController||Vz),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(Ii.addTarget(e.getHTMLElement()))),We.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||Vz))}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){_v(e.browserEvent.target)||document.activeElement!==e.browserEvent.target&&this.list.domFocus()}onContextMenu(e){if(Df(e.browserEvent.target)||_v(e.browserEvent.target))return;const t=typeof e.index>"u"?[]:[e.index];this.list.setFocus(t,e.browserEvent)}onViewPointer(e){if(!this.mouseSupport||Df(e.browserEvent.target)||_v(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),Bxe(e.browserEvent)||this.list.setSelection([t],e.browserEvent),this._onPointer.fire(e)}onDoubleClick(e){if(Df(e.browserEvent.target)||_v(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!=null?d:t,this.list.setAnchor(i)}const s=Math.min(i,t),o=Math.max(i,t),r=yo(s,o+1),a=this.list.getSelection(),l=Hxe(a4(a,[i]),i);if(l.length===0)return;const c=a4(r,$xe(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 Nee{constructor(e,t){this.styleElement=e,this.selectorSuffix=t}style(e){var t,i;const s=this.selectorSuffix&&".".concat(this.selectorSuffix),o=[];e.listBackground&&o.push(".monaco-list".concat(s," .monaco-list-rows { background: ").concat(e.listBackground,"; }")),e.listFocusBackground&&(o.push(".monaco-list".concat(s,":focus .monaco-list-row.focused { background-color: ").concat(e.listFocusBackground,"; }")),o.push(".monaco-list".concat(s,":focus .monaco-list-row.focused:hover { background-color: ").concat(e.listFocusBackground,"; }"))),e.listFocusForeground&&o.push(".monaco-list".concat(s,":focus .monaco-list-row.focused { color: ").concat(e.listFocusForeground,"; }")),e.listActiveSelectionBackground&&(o.push(".monaco-list".concat(s,":focus .monaco-list-row.selected { background-color: ").concat(e.listActiveSelectionBackground,"; }")),o.push(".monaco-list".concat(s,":focus .monaco-list-row.selected:hover { background-color: ").concat(e.listActiveSelectionBackground,"; }"))),e.listActiveSelectionForeground&&o.push(".monaco-list".concat(s,":focus .monaco-list-row.selected { color: ").concat(e.listActiveSelectionForeground,"; }")),e.listActiveSelectionIconForeground&&o.push(".monaco-list".concat(s,":focus .monaco-list-row.selected .codicon { color: ").concat(e.listActiveSelectionIconForeground,"; }")),e.listFocusAndSelectionBackground&&o.push("\n .monaco-drag-image,\n .monaco-list".concat(s,":focus .monaco-list-row.selected.focused { background-color: ").concat(e.listFocusAndSelectionBackground,"; }\n ")),e.listFocusAndSelectionForeground&&o.push("\n .monaco-drag-image,\n .monaco-list".concat(s,":focus .monaco-list-row.selected.focused { color: ").concat(e.listFocusAndSelectionForeground,"; }\n ")),e.listInactiveFocusForeground&&(o.push(".monaco-list".concat(s," .monaco-list-row.focused { color: ").concat(e.listInactiveFocusForeground,"; }")),o.push(".monaco-list".concat(s," .monaco-list-row.focused:hover { color: ").concat(e.listInactiveFocusForeground,"; }"))),e.listInactiveSelectionIconForeground&&o.push(".monaco-list".concat(s," .monaco-list-row.focused .codicon { color: ").concat(e.listInactiveSelectionIconForeground,"; }")),e.listInactiveFocusBackground&&(o.push(".monaco-list".concat(s," .monaco-list-row.focused { background-color: ").concat(e.listInactiveFocusBackground,"; }")),o.push(".monaco-list".concat(s," .monaco-list-row.focused:hover { background-color: ").concat(e.listInactiveFocusBackground,"; }"))),e.listInactiveSelectionBackground&&(o.push(".monaco-list".concat(s," .monaco-list-row.selected { background-color: ").concat(e.listInactiveSelectionBackground,"; }")),o.push(".monaco-list".concat(s," .monaco-list-row.selected:hover { background-color: ").concat(e.listInactiveSelectionBackground,"; }"))),e.listInactiveSelectionForeground&&o.push(".monaco-list".concat(s," .monaco-list-row.selected { color: ").concat(e.listInactiveSelectionForeground,"; }")),e.listHoverBackground&&o.push(".monaco-list".concat(s,":not(.drop-target):not(.dragging) .monaco-list-row:hover:not(.selected):not(.focused) { background-color: ").concat(e.listHoverBackground,"; }")),e.listHoverForeground&&o.push(".monaco-list".concat(s,":not(.drop-target):not(.dragging) .monaco-list-row:hover:not(.selected):not(.focused) { color: ").concat(e.listHoverForeground,"; }"));const r=zp(e.listFocusAndSelectionOutline,zp(e.listSelectionOutline,(t=e.listFocusOutline)!==null&&t!==void 0?t:""));r&&o.push(".monaco-list".concat(s,":focus .monaco-list-row.focused.selected { outline: 1px solid ").concat(r,"; outline-offset: -1px;}")),e.listFocusOutline&&o.push("\n .monaco-drag-image,\n .monaco-list".concat(s,":focus .monaco-list-row.focused { outline: 1px solid ").concat(e.listFocusOutline,"; outline-offset: -1px; }\n .monaco-workbench.context-menu-visible .monaco-list").concat(s,".last-focused .monaco-list-row.focused { outline: 1px solid ").concat(e.listFocusOutline,"; outline-offset: -1px; }\n "));const a=zp(e.listSelectionOutline,(i=e.listInactiveFocusOutline)!==null&&i!==void 0?i:"");a&&o.push(".monaco-list".concat(s," .monaco-list-row.focused.selected { outline: 1px dotted ").concat(a,"; outline-offset: -1px; }")),e.listSelectionOutline&&o.push(".monaco-list".concat(s," .monaco-list-row.selected { outline: 1px dotted ").concat(e.listSelectionOutline,"; outline-offset: -1px; }")),e.listInactiveFocusOutline&&o.push(".monaco-list".concat(s," .monaco-list-row.focused { outline: 1px dotted ").concat(e.listInactiveFocusOutline,"; outline-offset: -1px; }")),e.listHoverOutline&&o.push(".monaco-list".concat(s," .monaco-list-row:hover { outline: 1px dashed ").concat(e.listHoverOutline,"; outline-offset: -1px; }")),e.listDropBackground&&o.push("\n .monaco-list".concat(s,".drop-target,\n .monaco-list").concat(s," .monaco-list-rows.drop-target,\n .monaco-list").concat(s," .monaco-list-row.drop-target { background-color: ").concat(e.listDropBackground," !important; color: inherit !important; }\n ")),e.tableColumnsBorder&&o.push("\n .monaco-table > .monaco-split-view2,\n .monaco-table > .monaco-split-view2 .monaco-sash.vertical::before,\n .monaco-workbench:not(.reduce-motion) .monaco-table:hover > .monaco-split-view2,\n .monaco-workbench:not(.reduce-motion) .monaco-table:hover > .monaco-split-view2 .monaco-sash.vertical::before {\n border-color: ".concat(e.tableColumnsBorder,";\n }\n\n .monaco-workbench:not(.reduce-motion) .monaco-table > .monaco-split-view2,\n .monaco-workbench:not(.reduce-motion) .monaco-table > .monaco-split-view2 .monaco-sash.vertical::before {\n border-color: transparent;\n }\n ")),e.tableOddRowsBackgroundColor&&o.push("\n .monaco-table .monaco-list-row[data-parity=odd]:not(.focused):not(.selected):not(:hover) .monaco-table-tr,\n .monaco-table .monaco-list:not(:focus) .monaco-list-row[data-parity=odd].focused:not(.selected):not(:hover) .monaco-table-tr,\n .monaco-table .monaco-list:not(.focused) .monaco-list-row[data-parity=odd].focused:not(.selected):not(:hover) .monaco-table-tr {\n background-color: ".concat(e.tableOddRowsBackgroundColor,";\n }\n ")),this.styleElement.textContent=o.join("\n")}}const Wxe={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:ee.fromHex("#a9a9a9").transparent(.4).toString(),tableColumnsBorder:ee.fromHex("#cccccc").transparent(.2).toString(),tableOddRowsBackgroundColor:ee.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},Vxe={keyboardSupport:!0,mouseSupport:!0,multipleSelectionSupport:!0,dnd:{getDragURI(){return null},onDragStart(){},onDragOver(){return!1},drop(){},dispose(){}}};function Hxe(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 zxe{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 Uxe{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","".concat(o)):i.removeAttribute("aria-level")}disposeTemplate(e){}}class jxe{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 wl{get onDidChangeFocus(){return We.map(this.eventBufferer.wrapEvent(this.focus.onChange),e=>this.toListEvent(e),this.disposables)}get onDidChangeSelection(){return We.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=We.chain(this.disposables.add(new Vt(this.view.domNode,"keydown")).event,o=>o.map(r=>new Oi(r)).filter(r=>e=r.keyCode===58||r.shiftKey&&r.keyCode===68).map(r=>xt.stop(r,!0)).filter(()=>!1)),i=We.chain(this.disposables.add(new Vt(this.view.domNode,"keyup")).event,o=>o.forEach(()=>e=!1).map(r=>new Oi(r)).filter(r=>r.keyCode===58||r.shiftKey&&r.keyCode===68).map(r=>xt.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=We.chain(this.view.onContextMenu,o=>o.filter(r=>!e).map(({element:r,index:a,browserEvent:l})=>({element:r,index:a,anchor:new ba(l),browserEvent:l})));return We.any(t,i,s)}get onKeyDown(){return this.disposables.add(new Vt(this.view.domNode,"keydown")).event}get onDidFocus(){return We.signal(this.disposables.add(new Vt(this.view.domNode,"focus",!0)).event)}constructor(e,t,i,s,o=Vxe){var r,a,l,c;this.user=e,this._options=o,this.focus=new rI("focused"),this.anchor=new rI("anchor"),this.eventBufferer=new C8,this._ariaLabel="",this.disposables=new be,this._onDidDispose=new j,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 Rxe(d!=="listbox");const u=[this.focus.renderer,this.selection.renderer];this.accessibilityProvider=o.accessibilityProvider,this.accessibilityProvider&&(u.push(new Uxe(this.accessibilityProvider)),(l=(a=this.accessibilityProvider).onDidChangeActiveDescendant)===null||l===void 0||l.call(a,this.onDidChangeActiveDescendant,this,this.disposables)),s=s.map(f=>new zxe(f.templateId,[...u,f]));const h=Object.assign(Object.assign({},o),{dnd:o.dnd&&new jxe(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=Na(this.view.domNode);this.styleController=new Nee(f,this.view.domId)}if(this.spliceable=new Lxe([new tR(this.focus,this.view,o.identityProvider),new tR(this.selection,this.view,o.identityProvider),new tR(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 Fxe(this,this.view)),(typeof o.keyboardSupport!="boolean"||o.keyboardSupport)&&(this.keyboardController=new Eee(this,this.view,o),this.disposables.add(this.keyboardController)),o.keyboardNavigationLabelProvider){const f=o.keyboardNavigationDelegate||Pxe;this.typeNavigationController=new Oxe(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 Ha(e,t,i,s)}createMouseController(e){return new xee(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 T_(this.user,"Invalid start index: ".concat(e));if(t<0)throw new T_(this.user,"Invalid delete count: ".concat(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 T_(this.user,"Invalid index ".concat(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 T_(this.user,"Invalid index ".concat(e));this.anchor.set([e])}getAnchor(){return jZ(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 T_(this.user,"Invalid index ".concat(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 Wz(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 jf(0),yield this.focusNextPage(e,t))}})}focusPreviousPage(e,t){return Wz(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 jf(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 T_(this.user,"Invalid index ".concat(e));const i=this.view.getScrollTop(),s=this.view.elementTop(e),o=this.view.elementHeight(e);if(Hf(t)){const r=o-this.view.renderHeight;this.view.setScrollTop(r*fr(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()}}Jm([xn],wl.prototype,"onDidChangeFocus",null);Jm([xn],wl.prototype,"onDidChangeSelection",null);Jm([xn],wl.prototype,"onContextMenu",null);Jm([xn],wl.prototype,"onKeyDown",null);Jm([xn],wl.prototype,"onDidFocus",null);const Mp=ye,Aee="selectOption.entry.template";class Kxe{get templateId(){return Aee}renderTemplate(e){const t=Object.create(null);return t.root=e,t.text=ge(e,Mp(".option-text")),t.detail=ge(e,Mp(".option-detail")),t.decoratorRight=ge(e,Mp(".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 Qc extends te{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=Qc.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 j,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 Aee}constructSelectDropDown(e){this.contextViewProvider=e,this.selectDropDownContainer=ye(".monaco-select-box-dropdown-container"),this.selectDropDownContainer.classList.add("monaco-select-box-dropdown-padding"),this.selectionDetailsPane=ge(this.selectDropDownContainer,Mp(".select-box-details-pane"));const t=ge(this.selectDropDownContainer,Mp(".select-box-dropdown-container-width-control")),i=ge(t,Mp(".width-control-div"));this.widthControlElement=document.createElement("span"),this.widthControlElement.className="option-text-width-control",ge(i,this.widthControlElement),this._dropDownPosition=0,this.styleElement=Na(this.selectDropDownContainer),this.selectDropDownContainer.setAttribute("draggable","true"),this._register(ce(this.selectDropDownContainer,Pe.DRAG_START,s=>{xt.stop(s,!0)}))}registerListeners(){this._register(In(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(ce(this.selectElement,Pe.CLICK,t=>{xt.stop(t),this._isVisible?this.hideSelectDropDown(!0):this.showSelectDropDown()})),this._register(ce(this.selectElement,Pe.MOUSE_DOWN,t=>{xt.stop(t)}));let e;this._register(ce(this.selectElement,"touchstart",t=>{e=this._isVisible})),this._register(ce(this.selectElement,"touchend",t=>{xt.stop(t),e?this.hideSelectDropDown(!0):this.showSelectDropDown()})),this._register(ce(this.selectElement,Pe.KEY_DOWN,t=>{const i=new Oi(t);let s=!1;Kt?(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(),xt.stop(t,!0))}))}get onDidSelect(){return this._onDidSelect.event}setOptions(e,t){yn(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: ".concat(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: ".concat(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: ".concat(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 ".concat(this.styles.selectBorder," } ")),e.push(".monaco-select-box-dropdown-container > .select-box-details-pane.border-top { border-top: 1px solid ".concat(this.styles.selectBorder," } ")),e.push(".monaco-select-box-dropdown-container > .select-box-details-pane.border-bottom { border-bottom: 1px solid ".concat(this.styles.selectBorder," } "))):this.styles.selectListBorder&&(e.push(".monaco-select-box-dropdown-container > .select-box-details-pane.border-top { border-top: 1px solid ".concat(this.styles.selectListBorder," } ")),e.push(".monaco-select-box-dropdown-container > .select-box-details-pane.border-bottom { border-bottom: 1px solid ".concat(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: ".concat(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: ".concat(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 ".concat(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 ".concat(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("\n")}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=zp(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=Un(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-Qc.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=Ko(e)}return t}createSelectList(e){if(this.selectList)return;this.selectDropDownListContainer=ge(e,Mp(".select-box-dropdown-list-container")),this.listRenderer=new Kxe,this.selectList=new wl("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+=". ".concat(s.detail)),s.decoratorRight&&(o+=". ".concat(s.decoratorRight)),s.description&&(o+=". ".concat(s.description)),o},getWidgetAriaLabel:()=>m({key:"selectBox",comment:["Behave like native select dropdown element."]},"Select Box"),getRole:()=>Kt?"":"option",getWidgetRole:()=>"listbox"}}),this.selectBoxOptions.ariaLabel&&(this.selectList.ariaLabel=this.selectBoxOptions.ariaLabel);const t=this._register(new Vt(this.selectDropDownListContainer,"keydown")),i=We.chain(t.event,s=>s.filter(()=>this.selectList.length>0).map(o=>new Oi(o)));this._register(We.chain(i,s=>s.filter(o=>o.keyCode===3))(this.onEnter,this)),this._register(We.chain(i,s=>s.filter(o=>o.keyCode===2))(this.onEnter,this)),this._register(We.chain(i,s=>s.filter(o=>o.keyCode===9))(this.onEscape,this)),this._register(We.chain(i,s=>s.filter(o=>o.keyCode===16))(this.onUpArrow,this)),this._register(We.chain(i,s=>s.filter(o=>o.keyCode===18))(this.onDownArrow,this)),this._register(We.chain(i,s=>s.filter(o=>o.keyCode===12))(this.onPageDown,this)),this._register(We.chain(i,s=>s.filter(o=>o.keyCode===11))(this.onPageUp,this)),this._register(We.chain(i,s=>s.filter(o=>o.keyCode===14))(this.onHome,this)),this._register(We.chain(i,s=>s.filter(o=>o.keyCode===13))(this.onEnd,this)),this._register(We.chain(i,s=>s.filter(o=>o.keyCode>=21&&o.keyCode<=56||o.keyCode>=85&&o.keyCode<=113))(this.onCharacter,this)),this._register(ce(this.selectList.getHTMLElement(),Pe.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(ce(this.selectDropDownContainer,Pe.FOCUS_OUT,s=>{!this._isVisible||Ws(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;xt.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&&(xt.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){xt.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){xt.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){xt.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=pu.toString(e.keyCode);let i=-1;for(let s=0;s{this._register(ce(this.selectElement,e,t=>{this.selectElement.focus()}))}),this._register(In(this.selectElement,"click",e=>{xt.stop(e,!0)})),this._register(In(this.selectElement,"change",e=>{this.selectElement.title=e.target.value,this._onDidSelect.fire({index:e.target.selectedIndex,selected:e.target.value})})),this._register(In(this.selectElement,"keydown",e=>{let t=!1;Kt?(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||!yn(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 yb)),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(Ii.addTarget(e));const i=this.options&&this.options.draggable;i&&(e.draggable=!0,Ta&&this._register(ce(e,Pe.DRAG_START,s=>{var o;return(o=s.dataTransfer)===null||o===void 0?void 0:o.setData(Jw.TEXT,this._action.label)}))),this._register(ce(t,Ti.Tap,s=>this.onClick(s,!0))),this._register(ce(t,Pe.MOUSE_DOWN,s=>{i||xt.stop(s,!0),this._action.enabled&&s.button===0&&t.classList.add("active")})),Kt&&this._register(ce(t,Pe.CONTEXT_MENU,s=>{s.button===0&&s.ctrlKey===!0&&this.onClick(s)})),this._register(ce(t,Pe.CLICK,s=>{xt.stop(s,!0),this.options&&this.options.isMenu||this.onClick(s)})),this._register(ce(t,Pe.DBLCLICK,s=>{xt.stop(s,!0)})),[Pe.MOUSE_UP,Pe.MOUSE_OUT].forEach(s=>{this._register(ce(t,s,o=>{xt.stop(o),t.classList.remove("active")}))})}onClick(e,t=!1){var i;xt.stop(e,!0);const s=Fr(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=Lee(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 Hb extends Ul{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=ge(this.element,ye("a.action-label"))),this.label&&this.label.setAttribute("role",this.getDefaultAriaRole()),this.options.label&&this.options.keybinding&&this.element&&(ge(this.element,ye("span.keybinding")).textContent=this.options.keybinding),this.updateClass(),this.updateLabel(),this.updateTooltip(),this.updateEnabled(),this.updateChecked()}getDefaultAriaRole(){return this._action.id===hs.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!=null?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 Yxe extends Ul{constructor(e,t,i,s,o,r,a){super(e,t),this.selectBox=new Gxe(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 Zxe extends yb{constructor(e,t){super(),this._onDidChangeVisibility=this._register(new j),this.onDidChangeVisibility=this._onDidChangeVisibility.event,this._element=ge(e,ye(".monaco-dropdown")),this._label=ge(this._element,ye(".dropdown-label"));let i=t.labelRenderer;i||(i=o=>(o.textContent=t.label||"",null));for(const o of[Pe.CLICK,Pe.MOUSE_DOWN,Ti.Tap])this._register(ce(this.element,o,r=>xt.stop(r,!0)));for(const o of[Pe.MOUSE_DOWN,Ti.Tap])this._register(ce(this._label,o,r=>{r instanceof MouseEvent&&(r.detail>1||r.button!==0)||(this.visible?this.hide():this.show())}));this._register(ce(this._label,Pe.KEY_UP,o=>{const r=new Oi(o);(r.equals(3)||r.equals(10))&&(xt.stop(o,!0),this.visible?this.hide():this.show())}));const s=i(this._label);s&&this._register(s),this._register(Ii.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 Xxe extends Zxe{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 aI extends Ul{constructor(e,t,i,s=Object.create(null)){super(null,e,s),this.actionItem=null,this._onDidChangeVisibility=this._register(new j),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=ge(o,ye("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 Xxe(e,s)),this._register(this.dropdownMenu.onDidChangeVisibility(o=>{var r;(r=this.element)===null||r===void 0||r.setAttribute("aria-expanded","".concat(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!=null?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 Qxe(n){return n?n.condition!==void 0:!1}var X1=globalThis&&globalThis.__awaiter||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())})},tb;(function(n){n[n.STORAGE_DOES_NOT_EXIST=0]="STORAGE_DOES_NOT_EXIST",n[n.STORAGE_IN_MEMORY=1]="STORAGE_IN_MEMORY"})(tb||(tb={}));var bv;(function(n){n[n.None=0]="None",n[n.Initialized=1]="Initialized",n[n.Closed=2]="Closed"})(bv||(bv={}));class ib extends te{constructor(e,t=Object.create(null)){super(),this.database=e,this.options=t,this._onDidChangeStorage=this._register(new nm),this.onDidChangeStorage=this._onDidChangeStorage.event,this.state=bv.None,this.cache=new Map,this.flushDelayer=this._register(new lQ(ib.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===bv.Closed)return;let i=!1;Fr(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 Fr(i)?t:i}getBoolean(e,t){const i=this.get(e);return Fr(i)?t:i==="true"}getNumber(e,t){const i=this.get(e);return Fr(i)?t:parseInt(i,10)}set(e,t,i=!1){return X1(this,void 0,void 0,function*(){if(this.state===bv.Closed)return;if(Fr(t))return this.delete(e,i);const s=Io(t)||Array.isArray(t)?oxe(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 X1(this,void 0,void 0,function*(){if(!(this.state===bv.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 X1(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 X1(this,void 0,void 0,function*(){return this.options.hint===tb.STORAGE_IN_MEMORY?this.flushPending():this.flushDelayer.trigger(()=>this.flushPending(),e)})}}ib.DEFAULT_FLUSH_DELAY=100;class iR{constructor(){this.onDidChangeItemsExternal=We.None,this.items=new Map}updateItems(e){var t,i;return X1(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 yD="__$__targetStorageMarker",yl=Wt("storageService");var lI;(function(n){n[n.NONE=0]="NONE",n[n.SHUTDOWN=1]="SHUTDOWN"})(lI||(lI={}));function Jxe(n){const e=n.get(yD);if(e)try{return JSON.parse(e)}catch{}return Object.create(null)}class Wx extends te{constructor(e={flushInterval:Wx.DEFAULT_FLUSH_INTERVAL}){super(),this.options=e,this._onDidChangeValue=this._register(new nm),this._onDidChangeTarget=this._register(new nm),this._onWillSaveState=this._register(new j),this.onWillSaveState=this._onWillSaveState.event,this._workspaceKeyTargets=void 0,this._profileKeyTargets=void 0,this._applicationKeyTargets=void 0}onDidChangeValue(e,t,i){return We.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===yD){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(Fr(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(yD,JSON.stringify(a),s)):typeof a[e]=="number"&&(delete a[e],(r=this.getStorage(t))===null||r===void 0||r.set(yD,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?Jxe(t):Object.create(null)}}Wx.DEFAULT_FLUSH_INTERVAL=60*1e3;class eNe extends Wx{constructor(){super(),this.applicationStorage=this._register(new ib(new iR,{hint:tb.STORAGE_IN_MEMORY})),this.profileStorage=this._register(new ib(new iR,{hint:tb.STORAGE_IN_MEMORY})),this.workspaceStorage=this._register(new ib(new iR,{hint:tb.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 tNe(n,e){const t=Object.assign({},e);for(const i in n){const s=n[i];t[i]=s!==void 0?He(s):void 0}return t}const iNe={keybindingLabelBackground:He(Fwe),keybindingLabelForeground:He(Bwe),keybindingLabelBorder:He(Wwe),keybindingLabelBottomBorder:He(Vwe),keybindingLabelShadow:He(nd)},nNe={buttonForeground:He(B1),buttonSeparator:He(Swe),buttonBackground:He(W1),buttonHoverBackground:He(Lwe),buttonSecondaryForeground:He(Dwe),buttonSecondaryBackground:He(cO),buttonSecondaryHoverBackground:He(Ewe),buttonBorder:He(kwe)},sNe={progressBarBackground:He(xwe)},cI={inputActiveOptionBorder:He(e9),inputActiveOptionForeground:He(t9),inputActiveOptionBackground:He(Ip)};He(bye),He(wye),He(Cye);He(un),He(rd),He(nd),He($t),He(Fye),He(Bye),He(Wye),He(hwe);const dI={inputBackground:He(VQ),inputForeground:He(HQ),inputBorder:He($Q),inputValidationInfoBorder:He(pwe),inputValidationInfoBackground:He(fwe),inputValidationInfoForeground:He(gwe),inputValidationWarningBorder:He(vwe),inputValidationWarningBackground:He(mwe),inputValidationWarningForeground:He(_we),inputValidationErrorBorder:He(wwe),inputValidationErrorBackground:He(bwe),inputValidationErrorForeground:He(Cwe)},oNe={listFilterWidgetBackground:He(hye),listFilterWidgetOutline:He(fye),listFilterWidgetNoMatchesOutline:He(gye),listFilterWidgetShadow:He(pye),inputBoxStyles:dI,toggleStyles:cI},Mee={badgeBackground:He(fD),badgeForeground:He(Iwe),badgeBorder:He($t)};He(xye),He(Tye),He(i$),He(i$),He(Nye);const e_={listBackground:void 0,listInactiveFocusForeground:void 0,listFocusBackground:He(iye),listFocusForeground:He(nye),listFocusOutline:He(sye),listActiveSelectionBackground:He(Eu),listActiveSelectionForeground:He(cd),listActiveSelectionIconForeground:He(z1),listFocusAndSelectionOutline:He(oye),listFocusAndSelectionBackground:He(Eu),listFocusAndSelectionForeground:He(cd),listInactiveSelectionBackground:He(rye),listInactiveSelectionIconForeground:He(lye),listInactiveSelectionForeground:He(aye),listInactiveFocusBackground:He(cye),listInactiveFocusOutline:He(dye),listHoverBackground:He(jQ),listHoverForeground:He(KQ),listDropBackground:He(uye),listSelectionOutline:He($i),listHoverOutline:He($i),treeIndentGuidesStroke:He(U1),treeInactiveIndentGuidesStroke:He(mye),tableColumnsBorder:He(_ye),tableOddRowsBackgroundColor:He(vye)};function N0(n){return tNe(n,e_)}const rNe={selectBackground:He(sd),selectListBackground:He(ywe),selectForeground:He(Lu),decoratorRightForeground:He(zQ),selectBorder:He(rv),focusBorder:He(zr),listFocusBackground:He(xp),listInactiveSelectionIconForeground:He(av),listFocusForeground:He(Tp),listFocusOutline:cwe($i,ee.transparent.toString()),listHoverBackground:He(jQ),listHoverForeground:He(KQ),listHoverOutline:He($i),selectListBorder:He(ad),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},aNe={shadowColor:He(nd),borderColor:He(yye),foregroundColor:He(Sye),backgroundColor:He(Lye),selectionForegroundColor:He(kye),selectionBackgroundColor:He(Dye),selectionBorderColor:He(Eye),separatorColor:He(Iye),scrollbarShadow:He(Twe),scrollbarSliderBackground:He(V1),scrollbarSliderHoverBackground:He(H1),scrollbarSliderActiveBackground:He($1)};var Vx=globalThis&&globalThis.__decorate||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},Yo=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},Ree=globalThis&&globalThis.__awaiter||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 lNe(n,e,t,i){const s=n.getActions(e),o=wu.getInstance(),r=o.keyStatus.altKey||(zs||Co)&&o.keyStatus.shiftKey;Oee(s,t,r,i?a=>a===i:a=>a==="navigation")}function Pee(n,e,t,i,s,o){const r=n.getActions(e);Oee(r,t,!1,typeof i=="string"?l=>l===i:i,s,o)}function Oee(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 hs)):(u=a,u.length>0&&u.push(new hs));for(let h of d){t&&(h=h instanceof fl&&h.alt?h.alt:h);const f=u.push(h);h instanceof Sb&&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 gm=class extends Hb{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 Ts),this._altKey=wu.getInstance()}get _menuItemAction(){return this._action}get _commandAction(){return this._wantsAltCommand&&this._menuItemAction.alt||this._menuItemAction}onClick(e){return Ree(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(ce(e,"mouseleave",s=>{t=!1,i()})),this._register(ce(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}\n[{1}] {2}",o,O9.modifierLabels[$r].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&&Qxe(e.toggled)&&e.toggled.icon?e.toggled.icon:e.icon;if(s)if(dt.isThemeIcon(s)){const o=dt.asClassNameArray(s);i.classList.add(...o),this._itemClassDispose.value=vt(()=>{i.classList.remove(...o)})}else{const o=Nb(this._themeService.getColorTheme().type)?Uf(s.dark):Uf(s.light),r=ye("span");r.style.webkitMask=r.style.mask="".concat(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=rl(vt(()=>{i.classList.remove("icon"),Es(i)}),this._themeService.onDidColorThemeChange(()=>{this.updateClass()}))}}};gm=Vx([Yo(2,Di),Yo(3,Nn),Yo(4,bt),Yo(5,os),Yo(6,Cl),Yo(7,oh)],gm);let l4=class extends aI{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:dt.isThemeIcon(e.item.icon)?dt.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),bi(this.element),e.classList.add("menu-entry");const t=this._action,{icon:i}=t.item;if(i&&!dt.isThemeIcon(i)){this.element.classList.add("icon");const s=()=>{this.element&&(this.element.style.backgroundImage=Nb(this._themeService.getColorTheme().type)?Uf(i.dark):Uf(i.light))};s(),this._register(this._themeService.onDidColorThemeChange(()=>{s()}))}}};l4=Vx([Yo(2,Di),Yo(3,Cl),Yo(4,os)],l4);let c4=class extends Ul{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="".concat(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(gm,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 yb});this._dropdown=new aI(e,e.actions,this._contextMenuService,g),this._dropdown.actionRunner.onDidRun(p=>{p.action instanceof fl&&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(gm,e,{keybinding:this._getDefaultActionKeybindingLabel(e)}),this._defaultAction.actionRunner=new class extends yb{runAction(i,s){return Ree(this,void 0,void 0,function*(){yield i.run(void 0)})}},this._container&&this._defaultAction.render(JX(this._container,ye(".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="(".concat(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=ye(".action-container");this._defaultAction.render(ge(this._container,t)),this._register(ce(t,Pe.KEY_DOWN,s=>{const o=new Oi(s);o.equals(17)&&(this._defaultAction.element.tabIndex=-1,this._dropdown.focus(),o.stopPropagation())}));const i=ye(".dropdown-action-container");this._dropdown.render(ge(this._container,i)),this._register(ce(i,Pe.KEY_DOWN,s=>{var o;const r=new Oi(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()}};c4=Vx([Yo(2,Di),Yo(3,Nn),Yo(4,Cl),Yo(5,Vd),Yo(6,_t),Yo(7,yl)],c4);let d4=class extends Yxe{constructor(e,t){super(null,e,e.actions.map(i=>({text:i.id===hs.ID?"─────────":i.label,isDisabled:!i.enabled})),0,t,rNe,{ariaLabel:e.tooltip,optionsAsChildren:!0}),this.select(Math.max(0,e.actions.findIndex(i=>i.checked)))}render(e){super.render(e),e.style.borderColor=He(rv)}runAction(e,t){const i=this.action.actions[t];i&&this.actionRunner.run(i)}};d4=Vx([Yo(1,rh)],d4);function cNe(n,e,t){return e instanceof fl?n.createInstance(gm,e,t):e instanceof ww?e.item.isSelection?n.createInstance(d4,e):e.item.rememberDefaultAction?n.createInstance(c4,e,Object.assign(Object.assign({},t),{persistLastActionId:!0})):n.createInstance(l4,e,t):void 0}var dNe=globalThis&&globalThis.__awaiter||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 Pa extends te{constructor(e,t={}){var i,s,o,r,a,l;super(),this._actionRunnerDisposables=this._register(new be),this.viewItemDisposables=this._register(new v8),this.triggerKeyDown=!1,this.focusable=!0,this._onDidBlur=this._register(new j),this.onDidBlur=this._onDidBlur.event,this._onDidCancel=this._register(new j({onWillAddFirstListener:()=>this.cancelHasListener=!0})),this.onDidCancel=this._onDidCancel.event,this.cancelHasListener=!1,this._onDidRun=this._register(new j),this.onDidRun=this._onDidRun.event,this._onWillRun=this._register(new j),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 yb,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(ce(this.domNode,Pe.KEY_DOWN,u=>{const h=new Oi(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 Ul&&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(ce(this.domNode,Pe.KEY_UP,u=>{const h=new Oi(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(Ld(this.domNode)),this._register(this.focusTracker.onDidBlur(()=>{(al()===this.domNode||!Ws(al(),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 Ul&&i.isEnabled());t instanceof Ul&&t.setFocusable(!0)}else this.viewItems.forEach(t=>{t instanceof Ul&&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 Hb(this.context,o,l)),this.options.allowContextMenu||this.viewItemDisposables.set(a,ce(r,Pe.CONTEXT_MENU,c=>{xt.stop(c,!0)})),a.actionRunner=this._actionRunner,a.setActionContext(this.context),a.render(r),this.focusable&&a instanceof Ul&&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=fi(this.viewItems),this.viewItemDisposables.clearAndDisposeAll(),Ds(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===hs.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===hs.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;hw(o.focus)||(r=!1),this.options.focusOnlyEnabledItems&&hw(o.isEnabled)&&!o.isEnabled()&&(r=!1),o.action.id===hs.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 Ul){const i=t._context===null||t._context===void 0?e:t._context;this.run(t._action,i)}}run(e,t){return dNe(this,void 0,void 0,function*(){yield this._actionRunner.run(e,t)})}dispose(){this._context=void 0,this.viewItems=fi(this.viewItems),this.getContainer().remove(),super.dispose()}}const u4=/\(&([^\s&])\)|(^|[^&])&([^\s&])/,nR=/(&)?(&)([^\s&])/g;var uI;(function(n){n[n.Right=0]="Right",n[n.Left=1]="Left"})(uI||(uI={}));class nb extends Pa{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,...Kt||Co?[10]:[]],keyDown:!0}}),this.menuStyles=s,this.menuElement=o,this.actionsList.tabIndex=0,this.menuDisposables=this._register(new be),this.initializeOrUpdateStyleSheet(e,s),this._register(Ii.addTarget(o)),ce(o,Pe.KEY_DOWN,l=>{new Oi(l).equals(2)&&l.preventDefault()}),i.enableMnemonics&&this.menuDisposables.add(ce(o,Pe.KEY_DOWN,l=>{const c=l.key.toLocaleLowerCase();if(this.mnemonics.has(c)){xt.stop(l,!0);const d=this.mnemonics.get(c);if(d.length===1&&(d[0]instanceof $z&&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)}}})),Co&&this._register(ce(o,Pe.KEY_DOWN,l=>{const c=new Oi(l);c.equals(14)||c.equals(11)?(this.focusedItem=this.viewItems.length-1,this.focusNext(),xt.stop(l,!0)):(c.equals(13)||c.equals(12))&&(this.focusedItem=0,this.focusPrevious(),xt.stop(l,!0))})),this._register(ce(this.domNode,Pe.MOUSE_OUT,l=>{const c=l.relatedTarget;Ws(c,this.domNode)||(this.focusedItem=void 0,this.updateFocus(),l.stopPropagation())})),this._register(ce(this.actionsList,Pe.MOUSE_OVER,l=>{let c=l.target;if(!(!c||!Ws(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(Ii.addTarget(this.actionsList)),this._register(ce(this.actionsList,Ti.Tap,l=>{let c=l.initialTarget;if(!(!c||!Ws(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 bS(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(ce(o,Ti.Change,l=>{xt.stop(l,!0);const c=this.scrollableElement.getScrollPosition().scrollTop;this.scrollableElement.setScrollPosition({scrollTop:c-l.translationY})})),this._register(ce(a,Pe.MOUSE_UP,l=>{l.preventDefault()})),o.style.maxHeight="".concat(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: ".concat(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 zz)).forEach((l,c,d)=>{l.updatePositionInSet(c+1,d.length)})}initializeOrUpdateStyleSheet(e,t){this.styleSheet||(CE(e)?this.styleSheet=Na(e):(nb.globalStyleSheet||(nb.globalStyleSheet=Na()),this.styleSheet=nb.globalStyleSheet)),this.styleSheet.textContent=hNe(t,CE(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 ".concat(t.borderColor):"",l="5px",c=t.shadowColor?"0 2px 8px ".concat(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(ce(this.element,Pe.MOUSE_UP,o=>{if(xt.stop(o,!0),Ta){if(new ba(o).rightButton)return;this.onClick(o)}else setTimeout(()=>{this.onClick(o)},0)})),this._register(ce(this.element,Pe.CONTEXT_MENU,o=>{xt.stop(o,!0)})))},100),this._register(this.runOnceToEnableMouseUp)}render(e){super.render(e),this.element&&(this.container=e,this.item=ge(this.element,ye("a.action-menu-item")),this._action.id===hs.ID?this.item.setAttribute("role","presentation"):(this.item.setAttribute("role","menuitem"),this.mnemonic&&this.item.setAttribute("aria-keyshortcuts","".concat(this.mnemonic))),this.check=ge(this.item,ye("span.menu-item-check"+dt.asCSSSelector(Me.menuSelection))),this.check.setAttribute("role","none"),this.label=ge(this.item,ye("span.action-label")),this.options.label&&this.options.keybinding&&(ge(this.item,ye("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","".concat(e)),this.item.setAttribute("aria-setsize","".concat(t)))}updateLabel(){var e;if(this.label&&this.options.label){Ds(this.label);let t=U9(this.action.label);if(t){const i=uNe(t);this.options.enableMnemonics||(t=i),this.label.setAttribute("aria-label",i.replace(/&&/g,"&"));const s=u4.exec(t);if(s){t=pE(t),nR.lastIndex=0;let o=nR.exec(t);for(;o&&o[1];)o=nR.exec(t);const r=a=>a.replace(/&&/g,"&");o?this.label.append(aS(r(t.substr(0,o.index))," "),ye("u",{"aria-hidden":"true"},o[3]),LX(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 ".concat(this.menuStyle.selectionBorderColor):"",o=e&&this.menuStyle.selectionBorderColor?"-1px":"";this.item&&(this.item.style.color=t!=null?t:"",this.item.style.backgroundColor=i!=null?i:"",this.item.style.outline=s,this.item.style.outlineOffset=o),this.check&&(this.check.style.color=t!=null?t:"")}}class $z extends Fee{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 be),this.mouseOver=!1,this.expandDirection=s&&s.expandDirection!==void 0?s.expandDirection:uI.Right,this.showScheduler=new Si(()=>{this.mouseOver&&(this.cleanupExistingSubmenu(!1),this.createSubmenu(!1))},250),this.hideScheduler=new Si(()=>{this.element&&!Ws(al(),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=ge(this.item,ye("span.submenu-indicator"+dt.asCSSSelector(Me.menuSubmenu))),this.submenuIndicator.setAttribute("aria-hidden","true")),this._register(ce(this.element,Pe.KEY_UP,t=>{const i=new Oi(t);(i.equals(17)||i.equals(3))&&(xt.stop(t,!0),this.createSubmenu(!0))})),this._register(ce(this.element,Pe.KEY_DOWN,t=>{const i=new Oi(t);al()===this.item&&(i.equals(17)||i.equals(3))&&xt.stop(t,!0)})),this._register(ce(this.element,Pe.MOUSE_OVER,t=>{this.mouseOver||(this.mouseOver=!0,this.showScheduler.schedule())})),this._register(ce(this.element,Pe.MOUSE_LEAVE,t=>{this.mouseOver=!1})),this._register(ce(this.element,Pe.FOCUS_OUT,t=>{this.element&&!Ws(al(),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){xt.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=mv(e.width,t.width,{position:s===uI.Right?0:1,offset:i.left,size:i.width}),o.left>=i.left&&o.left{new Oi(c).equals(15)&&(xt.stop(c,!0),this.parentData.parent.focus(),this.cleanupExistingSubmenu(!0))})),this.submenuDisposables.add(ce(this.submenuContainer,Pe.KEY_DOWN,c=>{new Oi(c).equals(15)&&xt.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!=null?t:"")}dispose(){super.dispose(),this.hideScheduler.dispose(),this.mysubmenu&&(this.mysubmenu.dispose(),this.mysubmenu=null),this.submenuContainer&&(this.submenuContainer=void 0)}}class zz extends Hb{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?"".concat(this.menuStyles.separatorColor):"")}}function uNe(n){const e=u4,t=e.exec(n);if(!t)return n;const i=!t[1];return n.replace(e,i?"$2$3":"").trim()}function Uz(n){const e=CX()[n.id];return".codicon-".concat(n.id,":before { content: '\\").concat(e.toString(16),"'; }")}function hNe(n,e){let t="\n.monaco-menu {\n font-size: 13px;\n border-radius: 5px;\n min-width: 160px;\n}\n\n".concat(Uz(Me.menuSelection),"\n").concat(Uz(Me.menuSubmenu),"\n\n.monaco-menu .monaco-action-bar {\n text-align: right;\n overflow: hidden;\n white-space: nowrap;\n}\n\n.monaco-menu .monaco-action-bar .actions-container {\n display: flex;\n margin: 0 auto;\n padding: 0;\n width: 100%;\n justify-content: flex-end;\n}\n\n.monaco-menu .monaco-action-bar.vertical .actions-container {\n display: inline-block;\n}\n\n.monaco-menu .monaco-action-bar.reverse .actions-container {\n flex-direction: row-reverse;\n}\n\n.monaco-menu .monaco-action-bar .action-item {\n cursor: pointer;\n display: inline-block;\n transition: transform 50ms ease;\n position: relative; /* DO NOT REMOVE - this is the key to preventing the ghosting icon bug in Chrome 42 */\n}\n\n.monaco-menu .monaco-action-bar .action-item.disabled {\n cursor: default;\n}\n\n.monaco-menu .monaco-action-bar.animated .action-item.active {\n transform: scale(1.272019649, 1.272019649); /* 1.272019649 = √φ */\n}\n\n.monaco-menu .monaco-action-bar .action-item .icon,\n.monaco-menu .monaco-action-bar .action-item .codicon {\n display: inline-block;\n}\n\n.monaco-menu .monaco-action-bar .action-item .codicon {\n display: flex;\n align-items: center;\n}\n\n.monaco-menu .monaco-action-bar .action-label {\n font-size: 11px;\n margin-right: 4px;\n}\n\n.monaco-menu .monaco-action-bar .action-item.disabled .action-label,\n.monaco-menu .monaco-action-bar .action-item.disabled .action-label:hover {\n color: var(--vscode-disabledForeground);\n}\n\n/* Vertical actions */\n\n.monaco-menu .monaco-action-bar.vertical {\n text-align: left;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-item {\n display: block;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-label.separator {\n display: block;\n border-bottom: 1px solid var(--vscode-menu-separatorBackground);\n padding-top: 1px;\n padding: 30px;\n}\n\n.monaco-menu .secondary-actions .monaco-action-bar .action-label {\n margin-left: 6px;\n}\n\n/* Action Items */\n.monaco-menu .monaco-action-bar .action-item.select-container {\n overflow: hidden; /* somehow the dropdown overflows its container, we prevent it here to not push */\n flex: 1;\n max-width: 170px;\n min-width: 60px;\n display: flex;\n align-items: center;\n justify-content: center;\n margin-right: 10px;\n}\n\n.monaco-menu .monaco-action-bar.vertical {\n margin-left: 0;\n overflow: visible;\n}\n\n.monaco-menu .monaco-action-bar.vertical .actions-container {\n display: block;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-item {\n padding: 0;\n transform: none;\n display: flex;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-item.active {\n transform: none;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-menu-item {\n flex: 1 1 auto;\n display: flex;\n height: 2em;\n align-items: center;\n position: relative;\n margin: 0 4px;\n border-radius: 4px;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-menu-item:hover .keybinding,\n.monaco-menu .monaco-action-bar.vertical .action-menu-item:focus .keybinding {\n opacity: unset;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-label {\n flex: 1 1 auto;\n text-decoration: none;\n padding: 0 1em;\n background: none;\n font-size: 12px;\n line-height: 1;\n}\n\n.monaco-menu .monaco-action-bar.vertical .keybinding,\n.monaco-menu .monaco-action-bar.vertical .submenu-indicator {\n display: inline-block;\n flex: 2 1 auto;\n padding: 0 1em;\n text-align: right;\n font-size: 12px;\n line-height: 1;\n}\n\n.monaco-menu .monaco-action-bar.vertical .submenu-indicator {\n height: 100%;\n}\n\n.monaco-menu .monaco-action-bar.vertical .submenu-indicator.codicon {\n font-size: 16px !important;\n display: flex;\n align-items: center;\n}\n\n.monaco-menu .monaco-action-bar.vertical .submenu-indicator.codicon::before {\n margin-left: auto;\n margin-right: -20px;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-item.disabled .keybinding,\n.monaco-menu .monaco-action-bar.vertical .action-item.disabled .submenu-indicator {\n opacity: 0.4;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-label:not(.separator) {\n display: inline-block;\n box-sizing: border-box;\n margin: 0;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-item {\n position: static;\n overflow: visible;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-item .monaco-submenu {\n position: absolute;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-label.separator {\n width: 100%;\n height: 0px !important;\n opacity: 1;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-label.separator.text {\n padding: 0.7em 1em 0.1em 1em;\n font-weight: bold;\n opacity: 1;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-label:hover {\n color: inherit;\n}\n\n.monaco-menu .monaco-action-bar.vertical .menu-item-check {\n position: absolute;\n visibility: hidden;\n width: 1em;\n height: 100%;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-menu-item.checked .menu-item-check {\n visibility: visible;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\n/* Context Menu */\n\n.context-view.monaco-menu-container {\n outline: 0;\n border: none;\n animation: fadeIn 0.083s linear;\n -webkit-app-region: no-drag;\n}\n\n.context-view.monaco-menu-container :focus,\n.context-view.monaco-menu-container .monaco-action-bar.vertical:focus,\n.context-view.monaco-menu-container .monaco-action-bar.vertical :focus {\n outline: 0;\n}\n\n.hc-black .context-view.monaco-menu-container,\n.hc-light .context-view.monaco-menu-container,\n:host-context(.hc-black) .context-view.monaco-menu-container,\n:host-context(.hc-light) .context-view.monaco-menu-container {\n box-shadow: none;\n}\n\n.hc-black .monaco-menu .monaco-action-bar.vertical .action-item.focused,\n.hc-light .monaco-menu .monaco-action-bar.vertical .action-item.focused,\n:host-context(.hc-black) .monaco-menu .monaco-action-bar.vertical .action-item.focused,\n:host-context(.hc-light) .monaco-menu .monaco-action-bar.vertical .action-item.focused {\n background: none;\n}\n\n/* Vertical Action Bar Styles */\n\n.monaco-menu .monaco-action-bar.vertical {\n padding: 4px 0;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-menu-item {\n height: 2em;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-label:not(.separator),\n.monaco-menu .monaco-action-bar.vertical .keybinding {\n font-size: inherit;\n padding: 0 2em;\n}\n\n.monaco-menu .monaco-action-bar.vertical .menu-item-check {\n font-size: inherit;\n width: 2em;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-label.separator {\n font-size: inherit;\n margin: 5px 0 !important;\n padding: 0;\n border-radius: 0;\n}\n\n.linux .monaco-menu .monaco-action-bar.vertical .action-label.separator,\n:host-context(.linux) .monaco-menu .monaco-action-bar.vertical .action-label.separator {\n margin-left: 0;\n margin-right: 0;\n}\n\n.monaco-menu .monaco-action-bar.vertical .submenu-indicator {\n font-size: 60%;\n padding: 0 1.8em;\n}\n\n.linux .monaco-menu .monaco-action-bar.vertical .submenu-indicator,\n:host-context(.linux) .monaco-menu .monaco-action-bar.vertical .submenu-indicator {\n height: 100%;\n mask-size: 10px 10px;\n -webkit-mask-size: 10px 10px;\n}\n\n.monaco-menu .action-item {\n cursor: default;\n}");if(e){t+="\n /* Arrows */\n .monaco-scrollable-element > .scrollbar > .scra {\n cursor: pointer;\n font-size: 11px !important;\n }\n\n .monaco-scrollable-element > .visible {\n opacity: 1;\n\n /* Background rule added for IE9 - to allow clicks on dom node */\n background:rgba(0,0,0,0);\n\n transition: opacity 100ms linear;\n }\n .monaco-scrollable-element > .invisible {\n opacity: 0;\n pointer-events: none;\n }\n .monaco-scrollable-element > .invisible.fade {\n transition: opacity 800ms linear;\n }\n\n /* Scrollable Content Inset Shadow */\n .monaco-scrollable-element > .shadow {\n position: absolute;\n display: none;\n }\n .monaco-scrollable-element > .shadow.top {\n display: block;\n top: 0;\n left: 3px;\n height: 3px;\n width: 100%;\n }\n .monaco-scrollable-element > .shadow.left {\n display: block;\n top: 3px;\n left: 0;\n height: 100%;\n width: 3px;\n }\n .monaco-scrollable-element > .shadow.top-left-corner {\n display: block;\n top: 0;\n left: 0;\n height: 3px;\n width: 3px;\n }\n ";const i=n.scrollbarShadow;i&&(t+="\n .monaco-scrollable-element > .shadow.top {\n box-shadow: ".concat(i," 0 6px 6px -6px inset;\n }\n\n .monaco-scrollable-element > .shadow.left {\n box-shadow: ").concat(i," 6px 0 6px -6px inset;\n }\n\n .monaco-scrollable-element > .shadow.top.left {\n box-shadow: ").concat(i," 6px 6px 6px -6px inset;\n }\n "));const s=n.scrollbarSliderBackground;s&&(t+="\n .monaco-scrollable-element > .scrollbar > .slider {\n background: ".concat(s,";\n }\n "));const o=n.scrollbarSliderHoverBackground;o&&(t+="\n .monaco-scrollable-element > .scrollbar > .slider:hover {\n background: ".concat(o,";\n }\n "));const r=n.scrollbarSliderActiveBackground;r&&(t+="\n .monaco-scrollable-element > .scrollbar > .slider.active {\n background: ".concat(r,";\n }\n "))}return t}class fNe{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=F8(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(ye(".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=ce(this.block,Pe.MOUSE_DOWN,d=>d.stopPropagation()));const l=new be,c=e.actionRunner||new yb;return c.onWillRun(d=>this.onActionRun(d,!e.skipTelemetry),this,l),c.onDidRun(this.onDidActionRun,this,l),i=new nb(o,t,{actionViewItemProvider:e.getActionViewItem,context:e.getActionsContext?e.getActionsContext():null,actionRunner:c,getKeyBinding:e.getKeyBinding?e.getKeyBinding:d=>this.keybindingService.lookupKeybinding(d.id)},aNe),i.onDidCancel(()=>this.contextViewService.hideContextView(!0),null,l),i.onDidBlur(()=>this.contextViewService.hideContextView(!0),null,l),l.add(ce(window,Pe.BLUR,()=>this.contextViewService.hideContextView(!0))),l.add(ce(window,Pe.MOUSE_DOWN,d=>{if(d.defaultPrevented)return;const u=new ba(d);let h=u.target;if(!u.rightButton){for(;h;){if(h===o)return;h=h.parentElement}this.contextViewService.hideContextView(!0)}})),rl(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&&(al()===this.lastContainer||Ws(al(),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&&!bc(e.error)&&this.notificationService.error(e.error)}}var gNe=globalThis&&globalThis.__decorate||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},x_=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let h4=class extends te{get contextMenuHandler(){return this._contextMenuHandler||(this._contextMenuHandler=new fNe(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 j),this._onDidHideContextMenu=this._store.add(new j)}configure(e){this.contextMenuHandler.configure(e)}showContextMenu(e){e=f4.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()}})),wu.getInstance().resetKeyStatus(),this._onDidShowContextMenu.fire()}};h4=gNe([x_(0,ra),x_(1,Nn),x_(2,rh),x_(3,Di),x_(4,Vd),x_(5,bt)],h4);var f4;(function(n){function e(i){return i&&i.menuId instanceof M}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!=null?l:o);lNe(d,a,c),d.dispose()}return i.getActions?hs.join(i.getActions(),c):c}})}n.transform=t})(f4||(f4={}));var hI;(function(n){n[n.API=0]="API",n[n.USER=1]="USER"})(hI||(hI={}));var G9=globalThis&&globalThis.__decorate||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},fI=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},wp=globalThis&&globalThis.__awaiter||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 g4=class{constructor(e){this._commandService=e}open(e,t){return wp(this,void 0,void 0,function*(){if(!M9(e,Nt.command))return!1;if(!(t!=null&&t.allowCommands)||(typeof e=="string"&&(e=ct.parse(e)),Array.isArray(t.allowCommands)&&!t.allowCommands.includes(e.path)))return!0;let i=[];try{i=n4(decodeURIComponent(e.query))}catch{try{i=n4(e.query)}catch{}}return Array.isArray(i)||(i=[i]),yield this._commandService.executeCommand(e.path,...i),!0})}};g4=G9([fI(0,gn)],g4);let p4=class{constructor(e){this._editorService=e}open(e,t){return wp(this,void 0,void 0,function*(){typeof e=="string"&&(e=ct.parse(e));const{selection:i,uri:s}=vIe(e);return e=s,e.scheme===Nt.file&&(e=eDe(e)),yield this._editorService.openCodeEditor({resource:e,options:Object.assign({selection:i,source:t!=null&&t.fromUserGesture?hI.USER:hI.API},t==null?void 0:t.editorOptions)},this._editorService.getFocusedCodeEditor(),t==null?void 0:t.openToSide),!0})}};p4=G9([fI(0,ai)],p4);let m4=class{constructor(e,t){this._openers=new To,this._validators=new To,this._resolvers=new To,this._resolvedUriTargets=new Js(i=>i.with({path:null,fragment:null,query:null}).toString()),this._externalOpeners=new To,this._defaultExternalOpener={openExternal:i=>wp(this,void 0,void 0,function*(){return pz(i,Nt.http,Nt.https)?tQ(i):window.location.href=i,!0})},this._openers.push({open:(i,s)=>wp(this,void 0,void 0,function*(){return s!=null&&s.openExternal||pz(i,Nt.mailto,Nt.http,Nt.https,Nt.vsls)?(yield this._doOpenExternal(i,s),!0):!1})}),this._openers.push(new g4(t)),this._openers.push(new p4(e))}registerOpener(e){return{dispose:this._openers.unshift(e)}}open(e,t){var i;return wp(this,void 0,void 0,function*(){const s=typeof e=="string"?ct.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 wp(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 wp(this,void 0,void 0,function*(){const i=typeof e=="string"?ct.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},Ft.None))return!0}return this._defaultExternalOpener.openExternal(o,{sourceUri:i},Ft.None)})}dispose(){this._validators.clear()}};m4=G9([fI(0,ai),fI(1,gn)],m4);const Sl=Wt("editorWorkerService");var rn;(function(n){n[n.Hint=1]="Hint",n[n.Info=2]="Info",n[n.Warning=4]="Warning",n[n.Error=8]="Error"})(rn||(rn={}));(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 bn.Error:return n.Error;case bn.Warning:return n.Warning;case bn.Info:return n.Info;case bn.Ignore:return n.Hint}}n.fromSeverity=s;function o(r){switch(r){case n.Error:return bn.Error;case n.Warning:return bn.Warning;case n.Info:return bn.Info;case n.Hint:return bn.Ignore}}n.toSeverity=o})(rn||(rn={}));var gI;(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(rn.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})(gI||(gI={}));const zd=Wt("markerService");function pNe(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 mNe(n,e){const t=new Set;for(const i of e)n.has(i)&&t.add(i);return t}var _Ne=globalThis&&globalThis.__decorate||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},jz=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let _4=class extends te{constructor(e,t){super(),this._markerService=t,this._onDidChangeMarker=this._register(new j),this._markerDecorations=new Js,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 vNe(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===Nt.inMemory||e.uri.scheme===Nt.internal||e.uri.scheme===Nt.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)}};_4=_Ne([jz(0,Zi),jz(1,zd)],_4);class vNe extends te{constructor(e){super(),this.model=e,this._map=new eCe,this._register(vt(()=>{this.model.deltaDecorations([...this._map.values()],[]),this._map.clear()}))}update(e){const{added:t,removed:i}=pNe(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 I(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 bNe=globalThis&&globalThis.__decorate||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},g1=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},q_;function Yg(n){return n.toString()}class CNe{constructor(e,t,i){this.model=e,this._modelEventListeners=new be,this.model=e,this._modelEventListeners.add(e.onWillDispose(()=>t(e))),this._modelEventListeners.add(e.onDidChangeLanguage(s=>i(e,s)))}dispose(){this._modelEventListeners.dispose()}}const wNe=Co||Kt?1:2;class yNe{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 pI=q_=class extends te{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 j),this.onModelAdded=this._onModelAdded.event,this._onModelRemoved=this._register(new j),this.onModelRemoved=this._onModelRemoved.event,this._onModelModeChanged=this._register(new j),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=Qs.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=Qs.insertSpaces;e.editor&&typeof e.editor.insertSpaces<"u"&&(r=e.editor.insertSpaces==="false"?!1:!!e.editor.insertSpaces);let a=wNe;const l=e.eol;l==="\r\n"?a=2:l==="\n"&&(a=1);let c=Qs.trimAutoWhitespace;e.editor&&typeof e.editor.trimAutoWhitespace<"u"&&(c=e.editor.trimAutoWhitespace==="false"?!1:!!e.editor.trimAutoWhitespace);let d=Qs.detectIndentation;e.editor&&typeof e.editor.detectIndentation<"u"&&(d=e.editor.detectIndentation==="false"?!1:!!e.editor.detectIndentation);let u=Qs.largeFileOptimizations;e.editor&&typeof e.editor.largeFileOptimizations<"u"&&(u=e.editor.largeFileOptimizations==="false"?!1:!!e.editor.largeFileOptimizations);let h=Qs.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:$r===3||$r===2?"\n":"\r\n"}_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=q_._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 Id(e,t,o,i,this._undoRedoService,this._languageService,this._languageConfigurationService);if(i&&this._disposedModels.has(Yg(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)hu(f)&&f.matchesResource(i)&&f.setModel(r);for(const f of d.future)hu(f)&&f.matchesResource(i)&&f.setModel(r);this._undoRedoService.setElementsValidFlag(i,!0,f=>hu(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=Yg(r.uri);if(this._models[a])throw new Error("ModelService: Cannot add model because it already exists!");const l=new CNe(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,Yr,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)hu(d)&&d.matchesResource(e.uri)&&(o=!0,r+=d.heapSize(e.uri),d.setModel(e.uri));for(const d of c.future)hu(d)&&d.matchesResource(e.uri)&&(o=!0,r+=d.heapSize(e.uri),d.setModel(e.uri))}}const a=q_.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=>hu(c)&&c.matchesResource(e.uri)),this._insertDisposedModel(new yNe(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);q_._setModelOptionsForModel(e,r,o),this._onModelModeChanged.fire({model:e,oldLanguageId:i})}_getSHA1Computer(){return new Hx}};pI.MAX_MEMORY_FOR_CLOSED_FILES_UNDO_STACK=20*1024*1024;pI=q_=bNe([g1(0,zt),g1(1,NQ),g1(2,Tx),g1(3,qi),g1(4,Ni)],pI);class Hx{canComputeSHA1(e){return e.getValueLength()<=Hx.MAX_MODEL_SIZE}computeSHA1(e){const t=new px,i=e.createSnapshot();let s;for(;s=i.read();)t.update(s);return t.digest()}}Hx.MAX_MODEL_SIZE=10*1024*1024;class SNe{get templateId(){return this.renderer.templateId}constructor(e,t){this.renderer=e,this.modelProvider=t}renderTemplate(e){return{data:this.renderer.renderTemplate(e),disposable:te.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 Tn,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 LNe{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 kNe(n,e){return Object.assign(Object.assign({},e),{accessibilityProvider:e.accessibilityProvider&&new LNe(n,e.accessibilityProvider)})}class DNe{constructor(e,t,i,s,o={}){const r=()=>this.model,a=s.map(l=>new SNe(l,r));this.list=new wl(e,t,i,a,kNe(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 We.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 We.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 We.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,yo(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 A0=globalThis&&globalThis.__decorate||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 ENe=!1;var mI;(function(n){n.North="north",n.South="south",n.East="east",n.West="west"})(mI||(mI={}));let INe=4;const TNe=new j;let xNe=300;const NNe=new j;class Y9{constructor(){this.disposables=new be}get onPointerMove(){return this.disposables.add(new Vt(window,"mousemove")).event}get onPointerUp(){return this.disposables.add(new Vt(window,"mouseup")).event}dispose(){this.disposables.dispose()}}A0([xn],Y9.prototype,"onPointerMove",null);A0([xn],Y9.prototype,"onPointerUp",null);class Z9{get onPointerMove(){return this.disposables.add(new Vt(this.el,Ti.Change)).event}get onPointerUp(){return this.disposables.add(new Vt(this.el,Ti.End)).event}constructor(e){this.el=e,this.disposables=new be}dispose(){this.disposables.dispose()}}A0([xn],Z9.prototype,"onPointerMove",null);A0([xn],Z9.prototype,"onPointerUp",null);class _I{get onPointerMove(){return this.factory.onPointerMove}get onPointerUp(){return this.factory.onPointerUp}constructor(e){this.factory=e}dispose(){}}A0([xn],_I.prototype,"onPointerMove",null);A0([xn],_I.prototype,"onPointerUp",null);const Kz="pointer-events-disabled";class qs extends te{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=ge(this.el,ye(".orthogonal-drag-handle.start")),this.orthogonalStartDragHandleDisposables.add(vt(()=>this._orthogonalStartDragHandle.remove())),this.orthogonalStartDragHandleDisposables.add(new Vt(this._orthogonalStartDragHandle,"mouseenter")).event(()=>qs.onMouseEnter(e),void 0,this.orthogonalStartDragHandleDisposables),this.orthogonalStartDragHandleDisposables.add(new Vt(this._orthogonalStartDragHandle,"mouseleave")).event(()=>qs.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=ge(this.el,ye(".orthogonal-drag-handle.end")),this.orthogonalEndDragHandleDisposables.add(vt(()=>this._orthogonalEndDragHandle.remove())),this.orthogonalEndDragHandleDisposables.add(new Vt(this._orthogonalEndDragHandle,"mouseenter")).event(()=>qs.onMouseEnter(e),void 0,this.orthogonalEndDragHandleDisposables),this.orthogonalEndDragHandleDisposables.add(new Vt(this._orthogonalEndDragHandle,"mouseleave")).event(()=>qs.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=xNe,this.hoverDelayer=this._register(new pl(this.hoverDelay)),this._state=3,this.onDidEnablementChange=this._register(new j),this._onDidStart=this._register(new j),this._onDidChange=this._register(new j),this._onDidReset=this._register(new j),this._onDidEnd=this._register(new j),this.orthogonalStartSashDisposables=this._register(new be),this.orthogonalStartDragHandleDisposables=this._register(new be),this.orthogonalEndSashDisposables=this._register(new be),this.orthogonalEndDragHandleDisposables=this._register(new be),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=ge(e,ye(".monaco-sash")),i.orthogonalEdge&&this.el.classList.add("orthogonal-edge-".concat(i.orthogonalEdge)),Kt&&this.el.classList.add("mac");const s=this._register(new Vt(this.el,"mousedown")).event;this._register(s(u=>this.onPointerStart(u,new Y9),this));const o=this._register(new Vt(this.el,"dblclick")).event;this._register(o(this.onPointerDoublePress,this));const r=this._register(new Vt(this.el,"mouseenter")).event;this._register(r(()=>qs.onMouseEnter(this)));const a=this._register(new Vt(this.el,"mouseleave")).event;this._register(a(()=>qs.onMouseLeave(this))),this._register(Ii.addTarget(this.el));const l=this._register(new Vt(this.el,Ti.Start)).event;this._register(l(u=>this.onPointerStart(u,new Z9(this.el)),this));const c=this._register(new Vt(this.el,Ti.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="".concat(this.size,"px"):this.el.style.height="".concat(this.size,"px")):(this.size=INe,this._register(TNe.event(u=>{this.size=u,this.layout()}))),this._register(NNe.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",ENe),this.layout()}onPointerStart(e,t){xt.stop(e);let i=!1;if(!e.__orthogonalSashEvent){const g=this.getOrthogonalSash(e);g&&(i=!0,e.__orthogonalSashEvent=!0,g.onPointerStart(e,new _I(t)))}if(this.linkedSash&&!e.__linkedSashEvent&&(e.__linkedSashEvent=!0,this.linkedSash.onPointerStart(e,new _I(t))),!this.state)return;const s=document.getElementsByTagName("iframe");for(const g of s)g.classList.add(Kz);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=Na(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=Kt?"row-resize":"ns-resize":this.state===1?g="e-resize":this.state===2?g="w-resize":g=Kt?"col-resize":"ew-resize",c.textContent="* { cursor: ".concat(g," !important; }")},u=new be;d(),i||this.onDidEnablementChange.event(d,null,u);const h=g=>{xt.stop(g,!1);const p={startX:o,currentX:g.pageX,startY:r,currentY:g.pageY,altKey:a};this._onDidChange.fire(p)},f=g=>{xt.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(Kz)};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&&qs.onMouseEnter(e.linkedSash,!0)}static onMouseLeave(e,t=!1){e.hoverDelayer.cancel(),e.el.classList.remove("hover"),!t&&e.linkedSash&&qs.onMouseLeave(e.linkedSash,!0)}clearSashHoverState(){qs.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 ANe={separatorBorder:ee.transparent};class Bee{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=fr(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 MNe extends Bee{layoutContainer(e){this.container.style.top="".concat(e,"px"),this.container.style.height="".concat(this.size,"px")}}class RNe extends Bee{layoutContainer(e){this.container.style.left="".concat(e,"px"),this.container.style.width="".concat(this.size,"px")}}var au;(function(n){n[n.Idle=0]="Idle",n[n.Busy=1]="Busy"})(au||(au={}));var vI;(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})(vI||(vI={}));class Wee extends te{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=au.Idle,this._onDidSashChange=this._register(new j),this._onDidSashReset=this._register(new j),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=ge(this.el,ye(".sash-container")),this.viewContainer=ye(".split-view-container"),this.scrollable=this._register(new vS({forceIntegerValues:!0,smoothScrollDuration:125,scheduleAtNextAnimationFrame:xa})),this.scrollableElement=this._register(new c9(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 Vt(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)})),ge(this.el,this.scrollableElement.getDomNode()),this.style(t.styles||ANe),t.descriptor&&(this.size=t.descriptor.size,t.descriptor.views.forEach((c,d)=>{const u=_r(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=rl(ce(document.body,"keydown",a=>r(this.sashDragState.current,a.altKey)),ce(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=yo(s,-1),p=yo(s+1,this.viewItems.length),_=g.reduce((k,D)=>k+(this.viewItems[D].minimumSize-c[D]),0),v=g.reduce((k,D)=>k+(this.viewItems[D].viewMaximumSize-c[D]),0),b=p.length===0?Number.POSITIVE_INFINITY:p.reduce((k,D)=>k+(c[D]-this.viewItems[D].minimumSize),0),C=p.length===0?Number.NEGATIVE_INFINITY:p.reduce((k,D)=>k+(c[D]-this.viewItems[D].viewMaximumSize),0),w=Math.max(_,C),y=Math.min(b,v),L=this.findFirstSnapIndex(g),S=this.findFirstSnapIndex(p);if(typeof L=="number"){const k=this.viewItems[L],D=Math.floor(k.viewMinimumSize/2);h={index:L,limitDelta:k.visible?w-D:w+D,size:k.size}}if(typeof S=="number"){const k=this.viewItems[S],D=Math.floor(k.viewMinimumSize/2);f={index:S,limitDelta:k.visible?y+D:y-D,size:k.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(C=>C.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=fr(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!==au.Idle)throw new Error("Cant modify splitview");if(this.state=au.Busy,e<0||e>=this.viewItems.length)return;const i=yo(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=fr(t,r.minimumSize,Math.min(r.maximumSize,this.size)),r.size=t,this.relayout(s,o),this.state=au.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=fr(i,a.minimumSize,a.maximumSize);const s=yo(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!==au.Idle)throw new Error("Cant modify splitview");this.state=au.Busy;const o=ye(".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=vt(()=>this.viewContainer.removeChild(o)),l=rl(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 MNe(o,e,c,l):new RNe(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 qs(this.sashContainer,{getHorizontalSashTop:k=>this.getSashPosition(k),getHorizontalSashWidth:this.getSashOrthogonalSize},Object.assign(Object.assign({},h),{orientation:1})):new qs(this.sashContainer,{getVerticalSashLeft:k=>this.getSashPosition(k),getVerticalSashHeight:this.getSashOrthogonalSize},Object.assign(Object.assign({},h),{orientation:0})),g=this.orientation===0?k=>({sash:f,start:k.startY,current:k.currentY,alt:k.altKey}):k=>({sash:f,start:k.startX,current:k.currentX,alt:k.altKey}),_=We.map(f.onDidStart,g)(this.onSashStart,this),b=We.map(f.onDidChange,g)(this.onSashChange,this),w=We.map(f.onDidEnd,()=>this.sashItems.findIndex(k=>k.sash===f))(this.onSashEnd,this),y=f.onDidReset(()=>{const k=this.sashItems.findIndex(P=>P.sash===f),D=yo(k,-1),x=yo(k+1,this.viewItems.length),A=this.findFirstSnapIndex(D),T=this.findFirstSnapIndex(x);typeof A=="number"&&!this.viewItems[A].visible||typeof T=="number"&&!this.viewItems[T].visible||this._onDidSashReset.fire(k)}),L=rl(_,b,w,y,f),S={sash:f,disposable:L};this.sashItems.splice(i-1,0,S)}o.appendChild(e.element);let u;typeof t!="number"&&t.type==="split"&&(u=[t.index]),s||this.relayout([i],u),this.state=au.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=yo(e,-1),u=yo(e+1,this.viewItems.length);if(o)for(const S of o)KA(d,S),KA(u,S);if(s)for(const S of s)fL(d,S),fL(u,S);const h=d.map(S=>this.viewItems[S]),f=d.map(S=>i[S]),g=u.map(S=>this.viewItems[S]),p=u.map(S=>i[S]),_=d.reduce((S,k)=>S+(this.viewItems[k].minimumSize-i[k]),0),v=d.reduce((S,k)=>S+(this.viewItems[k].maximumSize-i[k]),0),b=u.length===0?Number.POSITIVE_INFINITY:u.reduce((S,k)=>S+(i[k]-this.viewItems[k].minimumSize),0),C=u.length===0?Number.NEGATIVE_INFINITY:u.reduce((S,k)=>S+(i[k]-this.viewItems[k].maximumSize),0),w=Math.max(_,C,r),y=Math.min(b,v,a);let L=!1;if(l){const S=this.viewItems[l.index],k=t>=l.limitDelta;L=k!==S.visible,S.setVisible(k,l.size)}if(!L&&c){const S=this.viewItems[c.index],k=ta+l.size,0);let i=this.size-t;const s=yo(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)KA(s,a);for(const a of o)fL(s,a);typeof e=="number"&&fL(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(),fi(this.viewItems),this.viewItems=[],this.sashItems.forEach(t=>t.disposable.dispose()),this.sashItems=[],super.dispose()}}class IS{constructor(e,t,i){this.columns=e,this.getColumnSize=i,this.templateId=IS.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 ".concat(o.templateId," not found."));this.renderers.push(r)}}renderTemplate(e){const t=ge(e,ye(".monaco-table-tr")),i=[],s=[];for(let r=0;rnew ONe(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 Wee(this.domNode,{orientation:1,scrollbarVisibility:2,getSashOrthogonalSize:()=>this.cachedHeight,descriptor:l})),this.splitview.el.style.height="".concat(i.headerRowHeight,"px"),this.splitview.el.style.lineHeight="".concat(i.headerRowHeight,"px");const c=new IS(s,o,d=>this.splitview.getViewSize(d));this.list=this.disposables.add(new wl(e,this.domNode,PNe(i),[c],r)),We.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=Na(this.domNode),this.style(Wxe)}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.".concat(this.domId," > .monaco-split-view2 .monaco-sash.vertical::before {\n top: ").concat(this.virtualDelegate.headerRowHeight+1,"px;\n height: calc(100% - ").concat(this.virtualDelegate.headerRowHeight,"px);\n }")),this.styleElement.textContent=t.join("\n"),this.list.style(e)}getSelectedElements(){return this.list.getSelectedElements()}getSelection(){return this.list.getSelection()}getFocus(){return this.list.getFocus()}dispose(){this.disposables.dispose()}}$x.InstanceCount=0;class M0 extends vl{constructor(e){super(),this._onChange=this._register(new j),this.onChange=this._onChange.event,this._onKeyDown=this._register(new j),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(...dt.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 FNe=m("caseDescription","Match Case"),BNe=m("wordsDescription","Match Whole Word"),WNe=m("regexDescription","Use Regular Expression");class Vee extends M0{constructor(e){super({icon:Me.caseSensitive,title:FNe+e.appendTitle,isChecked:e.isChecked,inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class Hee extends M0{constructor(e){super({icon:Me.wholeWord,title:BNe+e.appendTitle,isChecked:e.isChecked,inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class $ee extends M0{constructor(e){super({icon:Me.regex,title:WNe+e.appendTitle,isChecked:e.isChecked,inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class VNe{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 HNe{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 VNe(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 p1=ye;let $Ne=class extends vl{constructor(e,t,i){var s;super(),this.state="idle",this.maxHeight=Number.POSITIVE_INFINITY,this._onDidChange=this._register(new j),this.onDidChange=this._onDidChange.event,this._onDidHeightChange=this._register(new j),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=ge(e,p1(".monaco-inputbox.idle"));const o=this.options.flexibleHeight?"textarea":"input",r=ge(this.element,p1(".ibwrapper"));if(this.input=ge(r,p1(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=ge(r,p1("div.mirror")),this.mirror.innerText=" ",this.scrollableElement=new tJ(this.element,{vertical:1}),this.options.flexibleWidth&&(this.input.setAttribute("wrap","off"),this.mirror.style.whiteSpace="pre",this.mirror.style.wordWrap="initial"),ge(e,this.scrollableElement.getDomNode()),this._register(this.scrollableElement),this._register(this.scrollableElement.onScroll(c=>this.input.scrollTop=c.scrollTop));const a=this._register(new Vt(document,"selectionchange")),l=We.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 Pa(this.element)),this.actionbar.push(this.options.actions,{icon:!0,label:!1})),this.applyStyles()}onBlur(){this._hideMessage(),this.options.showPlaceholderOnFocus&&this.input.setAttribute("placeholder","")}onFocus(){this._showMessage(),this.options.showPlaceholderOnFocus&&this.input.setAttribute("placeholder",this.placeholder||"")}setPlaceHolder(e){this.placeholder=e,this.input.setAttribute("placeholder",e)}setTooltip(e){this.tooltip=e,this.input.title=e}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:Ep(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% - ".concat(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"&&Gr(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 ".concat(zp(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=Ko(this.element)+"px";this.contextViewProvider.showContextView({getAnchor:()=>this.element,anchorAlignment:1,render:s=>{var o,r;if(!this.message)return null;e=ge(s,p1(".monaco-inputbox-container")),t();const a={inline:!0,className:"monaco-inputbox-message"},l=this.message.formatContent?exe(this.message.content,a):JTe(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 ".concat(c.border):"",ge(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),to(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 ".concat(zp(a,"transparent"))}layout(){if(!this.mirror)return;const e=this.cachedContentHeight;this.cachedContentHeight=Ep(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 zee extends $Ne{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 ⇅ ".concat(s),r=" (⇅ ".concat(s,")");super(e,t,i),this._onDidFocus=this._register(new j),this.onDidFocus=this._onDidFocus.event,this._onDidBlur=this._register(new j),this.onDidBlur=this._onDidBlur.event,this.history=new HNe(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!=null?e:"",Yf(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,Yf(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 zNe=m("defaultLabel","input");class Uee extends vl{constructor(e,t,i){super(),this.fixFocusOnOptionClickEnabled=!0,this.imeSessionInProgress=!1,this.additionalTogglesDisposables=this._register(new Ts),this.additionalToggles=[],this._onDidOptionChange=this._register(new j),this.onDidOptionChange=this._onDidOptionChange.event,this._onKeyDown=this._register(new j),this.onKeyDown=this._onKeyDown.event,this._onMouseDown=this._register(new j),this.onMouseDown=this._onMouseDown.event,this._onInput=this._register(new j),this._onKeyUp=this._register(new j),this._onCaseSensitiveKeyDown=this._register(new j),this.onCaseSensitiveKeyDown=this._onCaseSensitiveKeyDown.event,this._onRegexKeyDown=this._register(new j),this.onRegexKeyDown=this._onRegexKeyDown.event,this._lastHighlightFindOptions=0,this.placeholder=i.placeholder||"",this.validation=i.validation,this.label=i.label||zNe,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 zee(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 $ee(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 Hee(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 Vee(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(),xt.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(ce(this.inputBox.inputElement,"compositionstart",u=>{this.imeSessionInProgress=!0})),this._register(ce(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 be;for(const t of e!=null?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 Pc;(function(n){n[n.Expanded=0]="Expanded",n[n.Collapsed=1]="Collapsed",n[n.PreserveOrExpanded=2]="PreserveOrExpanded",n[n.PreserveOrCollapsed=3]="PreserveOrCollapsed"})(Pc||(Pc={}));var Rp;(function(n){n[n.Unknown=0]="Unknown",n[n.Twistie=1]="Twistie",n[n.Element=2]="Element",n[n.Filter=3]="Filter"})(Rp||(Rp={}));class Wr extends Error{constructor(e,t){super("TreeError [".concat(e,"] ").concat(t))}}class X9{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 Q9(n){return typeof n=="object"&&"visibility"in n&&"data"in n}function ty(n){switch(n){case!0:return 1;case!1:return 0;default:return n}}function sR(n){return typeof n.collapsible=="boolean"}class UNe{constructor(e,t,i,s={}){this.user=e,this.list=t,this.rootRef=[],this.eventBufferer=new C8,this._onDidChangeCollapseState=new j,this.onDidChangeCollapseState=this.eventBufferer.wrapEvent(this._onDidChangeCollapseState.event),this._onDidChangeRenderNodeCount=new j,this.onDidChangeRenderNodeCount=this.eventBufferer.wrapEvent(this._onDidChangeRenderNodeCount.event),this._onDidSplice=new j,this.onDidSplice=this._onDidSplice.event,this.refilterDelayer=new pl(aQ),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=Pt.empty(),s={}){if(e.length===0)throw new Wr(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=Pt.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 Kc({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 C=0;Cb.originalStart-v.originalStart))f(g,p,g-(_.originalStart+_.originalLength)),g=_.originalStart,p=_.modifiedStart-d,this.spliceSimple([...h,g],_.originalLength,Pt.slice(c,p,p+_.modifiedLength),o);f(g,p,g)}spliceSimple(e,t,i=Pt.empty(),{onDidCreateNode:s,onDidDeleteNode:o,diffIdentityProvider:r}){const{parentNode:a,listIndex:l,revealed:c,visible:d}=this.getParentNodeWithListIndex(e),u=[],h=Pt.map(i,S=>this.createTreeNode(S,a,a.visible?1:0,c,u,s)),f=e[e.length-1],g=a.children.length>0;let p=0;for(let S=f;S>=0&&Sr.getId(S.element).toString())):a.lastDiffIds=a.children.map(S=>r.getId(S.element).toString()):a.lastDiffIds=void 0;let w=0;for(const S of C)S.visible&&w++;if(w!==0)for(let S=f+_.length;Sk+(D.visible?D.renderNodeCount:0),0);this._updateAncestorsRenderNodeCount(a,b-S),this.list.splice(l,S,u)}if(C.length>0&&o){const S=k=>{o(k),k.children.forEach(S)};C.forEach(S)}this._onDidSplice.fire({insertedNodes:_,deletedNodes:C});const y=a.children.length>0;g!==y&&this.setCollapsible(e.slice(0,-1),y);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 Wr(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&&!sR(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:(sR(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})),!sR(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||Pt.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):Q9(i)?(e.filterData=i.data,ty(i.visibility)):(e.filterData=void 0,ty(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 Wr(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 Wr(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 Wr(this.user,"Invalid tree location");for(let l=0;lt.element)),this.data=e}}function oR(n){return n instanceof ES?new jNe(n):n}class KNe{constructor(e,t){this.modelProvider=e,this.dnd=t,this.autoExpandDisposable=te.None,this.disposables=new be}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,oR(e),t)}onDragOver(e,t,i,s,o=!0){const r=this.dnd.onDragOver(oR(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=Kf(()=>{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:yo(d,d+u)})}drop(e,t,i,s){this.autoExpandDisposable.dispose(),this.autoExpandNode=void 0,this.dnd.drop(oR(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 qNe(n,e){return e&&Object.assign(Object.assign({},e),{identityProvider:e.identityProvider&&{getId(t){return e.identityProvider.getId(t.element)}},dnd:e.dnd&&new KNe(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 J9{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 iy;(function(n){n.None="none",n.OnHover="onHover",n.Always="always"})(iy||(iy={}));class GNe{get elements(){return this._elements}constructor(e,t=[]){this._elements=t,this.disposables=new be,this.onDidChange=We.forEach(e,i=>this._elements=i,this.disposables)}dispose(){this.disposables.dispose()}}class ny{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=ny.DefaultIndent,this.hideTwistiesOfChildlessElements=!1,this.shouldRenderIndentGuides=!1,this.activeIndentNodes=new Set,this.indentGuidesDisposable=te.None,this.disposables=new be,this.templateId=e.templateId,this.updateOptions(r),We.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=fr(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!==iy.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 be;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=ge(e,ye(".monaco-tl-row")),i=ge(t,ye(".monaco-tl-indent")),s=ge(t,ye(".monaco-tl-twistie")),o=ge(t,ye(".monaco-tl-contents")),r=this.renderer.renderTemplate(o);return{container:e,indent:i,twistie:s,indentGuidesDisposable:te.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=ny.DefaultIndent+(e.depth-1)*this.indent;t.twistie.style.paddingLeft="".concat(i,"px"),t.indent.style.width="".concat(i+this.indent-16,"px"),e.collapsible?t.container.setAttribute("aria-expanded",String(!e.collapsed)):t.container.removeAttribute("aria-expanded"),t.twistie.classList.remove(...dt.asClassNameArray(Me.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(...dt.asClassNameArray(Me.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(Ds(t.indent),t.indentGuidesDisposable.dispose(),!this.shouldRenderIndentGuides)return;const i=new be,s=this.modelProvider();for(;;){const o=s.getNodeLocation(e),r=s.getParentNodeLocation(o);if(!r)break;const a=s.getNode(r),l=ye(".indent-guide",{style:"width: ".concat(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(vt(()=>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(),fi(this.disposables)}}ny.DefaultIndent=8;class YNe{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 be,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:Q9(r)?i=ty(r.visibility):i=r,i===0)return!1}if(this._totalCount++,!this._pattern)return this._matchCount++,{data:lc.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:lc.Default,visibility:i};let l;if(this.tree.findMatchType===pm.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=fm(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===dd.Filter?typeof this.tree.options.defaultFindVisibility=="number"?this.tree.options.defaultFindVisibility:this.tree.options.defaultFindVisibility?this.tree.options.defaultFindVisibility(e):2:{data:lc.Default,visibility:i}}reset(){this._totalCount=0,this._matchCount=0}dispose(){fi(this.disposables)}}var dd;(function(n){n[n.Highlight=0]="Highlight",n[n.Filter=1]="Filter"})(dd||(dd={}));var pm;(function(n){n[n.Fuzzy=0]="Fuzzy",n[n.Contiguous=1]="Contiguous"})(pm||(pm={}));let ZNe=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 j,this.onDidChangeMode=this._onDidChangeMode.event,this._onDidChangeMatchType=new j,this.onDidChangeMatchType=this._onDidChangeMatchType.event,this._onDidChangePattern=new j,this._onDidChangeOpenState=new j,this.onDidChangeOpenState=this._onDidChangeOpenState.event,this.enabledDisposables=new be,this.disposables=new be,this._mode=(a=e.options.defaultFindMode)!==null&&a!==void 0?a:dd.Highlight,this._matchType=(l=e.options.defaultFindMatchType)!==null&&l!==void 0?l:pm.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===dd.Filter||this.filter.totalCount>0&&this.filter.matchCount<=1?!0:!lc.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 qz(n){let e=Rp.Unknown;return aM(n.browserEvent.target,"monaco-tl-twistie","monaco-tl-row")?e=Rp.Twistie:aM(n.browserEvent.target,"monaco-tl-contents","monaco-tl-row")?e=Rp.Element:aM(n.browserEvent.target,"monaco-tree-type-filter","monaco-list")&&(e=Rp.Filter),{browserEvent:n.browserEvent,element:n.element?n.element.element:null,target:e}}function SD(n,e){e(n),n.children.forEach(t=>SD(t,e))}class rR{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 j,this.onDidChange=this._onDidChange.event}set(e,t){!(t!=null&&t.__forceEvent)&&yn(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=>SD(d,c)),this.set([...l.values()]);return}const i=new Set,s=l=>i.add(this.identityProvider.getId(l.element).toString());t.forEach(l=>SD(l,s));const o=new Map,r=l=>o.set(this.identityProvider.getId(l.element).toString(),l);e.forEach(l=>SD(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 XNe extends xee{constructor(e,t){super(e),this.tree=t}onViewPointer(e){if(Dee(e.browserEvent.target)||Df(e.browserEvent.target)||_v(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 QNe extends wl{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 XNe(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(Vf([...super.getFocus(),...s])),o.length>0&&super.setSelection(Vf([...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 jee{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 We.filter(We.map(this.view.onMouseDblClick,qz),e=>e.target!==Rp.Filter)}get onPointer(){return We.map(this.view.onPointer,qz)}get onDidFocus(){return this.view.onDidFocus}get onDidChangeModel(){return We.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:dd.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:pm.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 C8,this.onDidChangeFindOpenState=We.None,this.disposables=new be,this._onWillRefilter=new j,this.onWillRefilter=this._onWillRefilter.event,this._onDidUpdateOptions=new j;const a=new J9(i),l=new BV,c=new BV,d=this.disposables.add(new GNe(c.event)),u=new z8;this.renderers=s.map(_=>new ny(_,()=>this.model,l.event,d,u,o));for(const _ of this.renderers)this.disposables.add(_);let h;o.keyboardNavigationLabelProvider&&(h=new YNe(this,o.keyboardNavigationLabelProvider,o.filter),o=Object.assign(Object.assign({},o),{filter:h}),this.disposables.add(h)),this.focus=new rR(()=>this.view.getFocusedElements()[0],o.identityProvider),this.selection=new rR(()=>this.view.getSelectedElements()[0],o.identityProvider),this.anchor=new rR(()=>this.view.getAnchorElement(),o.identityProvider),this.view=new QNe(e,t,a,this.renderers,this.focus,this.selection,this.anchor,Object.assign(Object.assign({},qNe(()=>this.model,o)),{tree:this})),this.model=this.createModel(e,this.view,o),l.input=this.model.onDidChangeCollapseState;const f=We.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 j),p=this.disposables.add(new pl(0));if(this.disposables.add(We.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 _=We.chain(this.view.onKeyDown,v=>v.filter(b=>!Df(b.target)).map(b=>new Oi(b)));We.chain(_,v=>v.filter(b=>b.keyCode===15))(this.onLeftArrow,this,this.disposables),We.chain(_,v=>v.filter(b=>b.keyCode===17))(this.onRightArrow,this,this.disposables),We.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 ZNe(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=We.None,this.onDidChangeFindMatchType=We.None;this.styleElement=Na(this.view.getHTMLElement()),this.getHTMLElement().classList.toggle("always",this._options.renderIndentGuides===iy.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===iy.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),Hf(t)&&((i=this.findController)===null||i===void 0||i.layout(t))}style(e){const t=".".concat(this.view.domId),i=[];e.treeIndentGuidesStroke&&(i.push(".monaco-list".concat(t,":hover .monaco-tl-indent > .indent-guide, .monaco-list").concat(t,".always .monaco-tl-indent > .indent-guide { border-color: ").concat(e.treeInactiveIndentGuidesStroke,"; }")),i.push(".monaco-list".concat(t," .monaco-tl-indent > .indent-guide.active { border-color: ").concat(e.treeIndentGuidesStroke,"; }"))),this.styleElement.textContent=i.join("\n"),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(){fi(this.disposables),this.view.dispose()}}class e7{constructor(e,t,i={}){this.user=e,this.rootRef=null,this.nodes=new Map,this.nodesByIdentity=new Map,this.model=new UNe(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=Pt.empty(),i={}){const s=this.getElementLocation(e);this._setChildren(s,this.preserveCollapseState(t),i)}_setChildren(e,t=Pt.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=Pt.empty()){return this.sorter&&(e=[...e].sort(this.sorter.compare.bind(this.sorter))),Pt.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===Pc.Collapsed||t.collapsed===Pc.PreserveOrCollapsed?r=!0:t.collapsed===Pc.Expanded||t.collapsed===Pc.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===Pc.PreserveOrCollapsed||t.collapsed===Pc.PreserveOrExpanded?o=i.collapsed:t.collapsed===Pc.Collapsed?o=!0:t.collapsed===Pc.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 Wr(this.user,"Tree element not found: ".concat(e));return t}getNodeLocation(e){return e.element}getParentNodeLocation(e){if(e===null)throw new Wr(this.user,"Invalid getParentNodeLocation call");const t=this.nodes.get(e);if(!t)throw new Wr(this.user,"Tree element not found: ".concat(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 Wr(this.user,"Tree element not found: ".concat(e));return this.model.getNodeLocation(t)}}function LD(n){const e=[n.element],t=n.incompressible||!1;return{element:{elements:e,incompressible:t},children:Pt.map(Pt.from(n.children),LD),collapsible:n.collapsible,collapsed:n.collapsed}}function kD(n){const e=[n.element],t=n.incompressible||!1;let i,s;for(;[s,i]=Pt.consume(Pt.from(n.children),2),!(s.length!==1||s[0].incompressible);)n=s[0],e.push(n.element);return{element:{elements:e,incompressible:t},children:Pt.map(Pt.concat(s,i),kD),collapsible:n.collapsible,collapsed:n.collapsed}}function v4(n,e=0){let t;return ev4(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 Gz(n){return v4(n,0)}function Kee(n,e,t){return n.element===e?Object.assign(Object.assign({},n),{children:t}):Object.assign(Object.assign({},n),{children:Pt.map(Pt.from(n.children),i=>Kee(i,e,t))})}const JNe=n=>({getId(e){return e.elements.map(t=>n.getId(t).toString()).join("\0")}});class eAe{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 e7(e,t,i),this.enabled=typeof i.compressionEnabled>"u"?!0:i.compressionEnabled,this.identityProvider=i.identityProvider}setChildren(e,t=Pt.empty(),i){const s=i.diffIdentityProvider&&JNe(i.diffIdentityProvider);if(e===null){const g=Pt.map(t,this.enabled?kD:LD);this._setChildren(null,g,{diffIdentityProvider:s,diffDepth:1/0});return}const o=this.nodes.get(e);if(!o)throw new Wr(this.user,"Unknown compressed tree node");const r=this.model.getNode(o),a=this.model.getParentNodeLocation(o),l=this.model.getNode(a),c=Gz(r),d=Kee(c,e,t),u=(this.enabled?kD:LD)(d),h=i.diffIdentityProvider?(g,p)=>i.diffIdentityProvider.getId(g)===i.diffIdentityProvider.getId(p):void 0;if(yn(u.element.elements,r.element.elements,h)){this._setChildren(o,u.children||Pt.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=Pt.map(i,Gz),o=Pt.map(s,e?kD:LD);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 Wr(this.user,"Tree element not found: ".concat(e));return t}}const tAe=n=>n[n.length-1];class t7{get element(){return this.node.element===null?null:this.unwrapper(this.node.element)}get children(){return this.node.children.map(e=>new t7(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 iAe(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 nAe(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 sAe{get onDidSplice(){return We.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 We.map(this.model.onDidChangeCollapseState,({node:e,deep:t})=>({node:this.nodeMapper.map(e),deep:t}))}get onDidChangeRenderNodeCount(){return We.map(this.model.onDidChangeRenderNodeCount,e=>this.nodeMapper.map(e))}constructor(e,t,i={}){this.rootRef=null,this.elementMapper=i.elementMapper||tAe;const s=o=>this.elementMapper(o.elements);this.nodeMapper=new X9(o=>new t7(s,o)),this.model=new eAe(e,iAe(this.nodeMapper,t),nAe(s,i))}setChildren(e,t=Pt.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 oAe=globalThis&&globalThis.__decorate||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 i7 extends jee{get onDidChangeCollapseState(){return this.model.onDidChangeCollapseState}constructor(e,t,i,s,o={}){super(e,t,i,s,o),this.user=e}setChildren(e,t=Pt.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 e7(e,t,i)}}class qee{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}}oAe([xn],qee.prototype,"compressedTreeNodeProvider",null);function rAe(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 Gee extends i7{constructor(e,t,i,s,o={}){const r=()=>this,a=s.map(l=>new qee(r,l));super(e,t,i,a,rAe(r,o))}setChildren(e,t=Pt.empty(),i){this.model.setChildren(e,t,i)}createModel(e,t,i){return new sAe(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 bh=globalThis&&globalThis.__awaiter||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 aR(n){return Object.assign(Object.assign({},n),{children:[],refreshPromise:void 0,stale:!0,slow:!1,collapsedByDefault:void 0})}function b4(n,e){return e.parent?e.parent===n?!0:b4(n,e.parent):!1}function aAe(n,e){return n===e||b4(n,e)||b4(e,n)}class n7{get element(){return this.node.element.element}get children(){return this.node.children.map(e=>new n7(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 lAe{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(...dt.asClassNameArray(Me.treeItemLoading)),!0):(t.classList.remove(...dt.asClassNameArray(Me.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 Yz(n){return{browserEvent:n.browserEvent,elements:n.elements.map(e=>e.element)}}function Zz(n){return{browserEvent:n.browserEvent,element:n.element&&n.element.element,target:n.target}}class cAe extends ES{constructor(e){super(e.elements.map(t=>t.element)),this.data=e}}function lR(n){return n instanceof ES?new cAe(n):n}class dAe{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,lR(e),t)}onDragOver(e,t,i,s,o=!0){return this.dnd.onDragOver(lR(e),t&&t.element,i,s)}drop(e,t,i,s){this.dnd.drop(lR(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 Yee(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 dAe(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 C4(n,e){e(n),n.children.forEach(t=>C4(t,e))}class Zee{get onDidScroll(){return this.tree.onDidScroll}get onDidChangeFocus(){return We.map(this.tree.onDidChangeFocus,Yz)}get onDidChangeSelection(){return We.map(this.tree.onDidChangeSelection,Yz)}get onMouseDblClick(){return We.map(this.tree.onMouseDblClick,Zz)}get onPointer(){return We.map(this.tree.onPointer,Zz)}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 j,this._onDidChangeNodeSlowState=new j,this.nodeMapper=new X9(a=>new n7(a)),this.disposables=new be,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=aR({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 J9(i),a=s.map(c=>new lAe(c,this.nodeMapper,this._onDidChangeNodeSlowState.event)),l=Yee(o)||{};return new i7(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 bh(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 bh(this,void 0,void 0,function*(){if(typeof this.root.element>"u")throw new Wr(this.user,"Tree input not set");this.root.refreshPromise&&(yield this.root.refreshPromise,yield We.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 bh(this,void 0,void 0,function*(){if(typeof this.root.element>"u")throw new Wr(this.user,"Tree input not set");this.root.refreshPromise&&(yield this.root.refreshPromise,yield We.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 We.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 We.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 Wr(this.user,"Data tree node not found: ".concat(e));return t}refreshAndRenderNode(e,t,i,s){return bh(this,void 0,void 0,function*(){yield this.refreshNode(e,t,i),this.render(e,i,s)})}refreshNode(e,t,i){return bh(this,void 0,void 0,function*(){let s;if(this.subTreeRefreshPromises.forEach((o,r)=>{!s&&aAe(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 bh(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 qP.settled(o.map(r=>this.doRefreshSubTree(r,t,i)))}finally{s()}})}doRefreshNode(e,t,i){return bh(this,void 0,void 0,function*(){e.hasChildren=!!this.dataSource.hasChildren(e.element);let s;if(!e.hasChildren)s=Promise.resolve(Pt.empty());else{const o=this.doGetChildren(e);if(AV(o))s=Promise.resolve(o);else{const r=jf(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),bc(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 AV(i)?this.processChildren(i):(t=Xn(()=>bh(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(Dt))}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=aR({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(_=>C4(_,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=aR({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())C4(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?Pt.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 s7{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 s7(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 uAe{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(...dt.asClassNameArray(Me.treeItemLoading)),!0):(t.classList.remove(...dt.asClassNameArray(Me.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=fi(this.disposables)}}function hAe(n){const e=n&&Yee(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 fAe extends Zee{constructor(e,t,i,s,o,r,a={}){super(e,t,i,o,r,a),this.compressionDelegate=s,this.compressibleNodeMapper=new X9(l=>new s7(l)),this.filter=a.filter}createTree(e,t,i,s,o){const r=new J9(i),a=s.map(c=>new uAe(c,this.nodeMapper,()=>this.compressibleNodeMapper,this._onDidChangeNodeSlowState.event)),l=hAe(o)||{};return new Gee(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=gAe(i);if(s===2)throw new Error("Recursive tree visibility not supported in async data compressed trees");return s===1})),super.processChildren(e)}}function gAe(n){return typeof n=="boolean"?n?1:0:Q9(n)?ty(n.visibility):ty(n)}class pAe extends jee{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 e7(e,t,i)}}new Ve("isMac",Kt,m("isMac","Whether the operating system is macOS"));new Ve("isLinux",Co,m("isLinux","Whether the operating system is Linux"));const zx=new Ve("isWindows",zs,m("isWindows","Whether the operating system is Windows")),Xee=new Ve("isWeb",yg,m("isWeb","Whether the platform is a web browser"));new Ve("isMacNative",Kt&&!yg,m("isMacNative","Whether the operating system is macOS on a non-browser platform"));new Ve("isIOS",uc,m("isIOS","Whether the operating system is iOS"));new Ve("isMobile",Wme,m("isMobile","Whether the platform is a mobile web browser"));new Ve("isDevelopment",!1,!0);new Ve("productQualityType","",m("productQualityType","Quality type of VS Code"));const Qee="inputFocus";new Ve(Qee,!1,m("inputFocus","Whether keyboard focus is inside an input box"));var lh=globalThis&&globalThis.__decorate||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},Fi=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};const $a=Wt("listService");class mAe{get lastFocusedList(){return this._lastFocusedWidget}constructor(){this.disposables=new be,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 Nee(Na(),"").style(e_)),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),rl(e.onDidFocus(()=>this.setLastFocusedList(e)),vt(()=>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 sy=new Ve("listScrollAtBoundary","none");fe.or(sy.isEqualTo("top"),sy.isEqualTo("both"));fe.or(sy.isEqualTo("bottom"),sy.isEqualTo("both"));const Jee=new Ve("listFocus",!0),Ux=new Ve("listSupportsMultiselect",!0),ete=fe.and(Jee,fe.not(Qee)),o7=new Ve("listHasSelectionOrFocus",!1),r7=new Ve("listDoubleSelection",!1),a7=new Ve("listMultiSelection",!1),jx=new Ve("listSelectionNavigation",!1),_Ae=new Ve("listSupportsFind",!0),l7=new Ve("treeElementCanCollapse",!1),vAe=new Ve("treeElementHasParent",!1),c7=new Ve("treeElementCanExpand",!1),bAe=new Ve("treeElementHasChild",!1),CAe=new Ve("treeFindOpen",!1),tte="listTypeNavigationMode",ite="listAutomaticKeyboardNavigation";function Kx(n,e){const t=n.createScoped(e.getHTMLElement());return Jee.bindTo(t),t}function qx(n,e){const t=sy.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 t_="workbench.list.multiSelectModifier",DD="workbench.list.openMode",Da="workbench.list.horizontalScrolling",d7="workbench.list.defaultFindMode",u7="workbench.list.typeNavigationMode",bI="workbench.list.keyboardNavigation",gc="workbench.list.scrollByPage",h7="workbench.list.defaultFindMatchType",oy="workbench.tree.indent",CI="workbench.tree.renderIndentGuides",pc="workbench.list.smoothScrolling",Td="workbench.list.mouseWheelScrollSensitivity",xd="workbench.list.fastScrollSensitivity",wI="workbench.tree.expandMode";function Nd(n){return n.getValue(t_)==="alt"}class wAe extends te{constructor(e){super(),this.configurationService=e,this.useAltAsMultipleSelectionModifier=Nd(e),this.registerListeners()}registerListeners(){this._register(this.configurationService.onDidChangeConfiguration(e=>{e.affectsConfiguration(t_)&&(this.useAltAsMultipleSelectionModifier=Nd(this.configurationService))}))}isSelectionSingleChangeEvent(e){return this.useAltAsMultipleSelectionModifier?e.browserEvent.altKey:Iee(e)}isSelectionRangeChangeEvent(e){return Tee(e)}}function Gx(n,e){var t;const i=n.get(zt),s=n.get(Di),o=new be;return[Object.assign(Object.assign({},e),{keyboardNavigationDelegate:{mightProducePrintableCharacter(a){return s.mightProducePrintableCharacter(a)}},smoothScrolling:!!i.getValue(pc),mouseWheelScrollSensitivity:i.getValue(Td),fastScrollSensitivity:i.getValue(xd),multipleSelectionController:(t=e.multipleSelectionController)!==null&&t!==void 0?t:o.add(new wAe(i)),keyboardNavigationEventFilter:LAe(s),scrollByPage:!!i.getValue(gc)}),o]}let w4=class extends wl{constructor(e,t,i,s,o,r,a,l,c){const d=typeof o.horizontalScrolling<"u"?o.horizontalScrolling:!!l.getValue(Da),[u,h]=c.invokeFunction(Gx,o);super(e,t,i,s,Object.assign(Object.assign({keyboardSupport:!1},u),{horizontalScrolling:d})),this.disposables.add(h),this.contextKeyService=Kx(r,this),this.disposables.add(qx(this.contextKeyService,this)),this.listSupportsMultiSelect=Ux.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(o.multipleSelectionSupport!==!1),jx.bindTo(this.contextKeyService).set(!!o.selectionNavigation),this.listHasSelectionOrFocus=o7.bindTo(this.contextKeyService),this.listDoubleSelection=r7.bindTo(this.contextKeyService),this.listMultiSelection=a7.bindTo(this.contextKeyService),this.horizontalScrolling=o.horizontalScrolling,this._useAltAsMultipleSelectionModifier=Nd(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(t_)&&(this._useAltAsMultipleSelectionModifier=Nd(l));let p={};if(g.affectsConfiguration(Da)&&this.horizontalScrolling===void 0){const _=!!l.getValue(Da);p=Object.assign(Object.assign({},p),{horizontalScrolling:_})}if(g.affectsConfiguration(gc)){const _=!!l.getValue(gc);p=Object.assign(Object.assign({},p),{scrollByPage:_})}if(g.affectsConfiguration(pc)){const _=!!l.getValue(pc);p=Object.assign(Object.assign({},p),{smoothScrolling:_})}if(g.affectsConfiguration(Td)){const _=l.getValue(Td);p=Object.assign(Object.assign({},p),{mouseWheelScrollSensitivity:_})}if(g.affectsConfiguration(xd)){const _=l.getValue(xd);p=Object.assign(Object.assign({},p),{fastScrollSensitivity:_})}Object.keys(p).length>0&&this.updateOptions(p)})),this.navigator=new nte(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?N0(e):e_)}};w4=lh([Fi(5,bt),Fi(6,$a),Fi(7,zt),Fi(8,_t)],w4);let Xz=class extends DNe{constructor(e,t,i,s,o,r,a,l,c){const d=typeof o.horizontalScrolling<"u"?o.horizontalScrolling:!!l.getValue(Da),[u,h]=c.invokeFunction(Gx,o);super(e,t,i,s,Object.assign(Object.assign({keyboardSupport:!1},u),{horizontalScrolling:d})),this.disposables=new be,this.disposables.add(h),this.contextKeyService=Kx(r,this),this.disposables.add(qx(this.contextKeyService,this.widget)),this.horizontalScrolling=o.horizontalScrolling,this.listSupportsMultiSelect=Ux.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(o.multipleSelectionSupport!==!1),jx.bindTo(this.contextKeyService).set(!!o.selectionNavigation),this._useAltAsMultipleSelectionModifier=Nd(l),this.disposables.add(this.contextKeyService),this.disposables.add(a.register(this)),this.updateStyles(o.overrideStyles),this.disposables.add(l.onDidChangeConfiguration(g=>{g.affectsConfiguration(t_)&&(this._useAltAsMultipleSelectionModifier=Nd(l));let p={};if(g.affectsConfiguration(Da)&&this.horizontalScrolling===void 0){const _=!!l.getValue(Da);p=Object.assign(Object.assign({},p),{horizontalScrolling:_})}if(g.affectsConfiguration(gc)){const _=!!l.getValue(gc);p=Object.assign(Object.assign({},p),{scrollByPage:_})}if(g.affectsConfiguration(pc)){const _=!!l.getValue(pc);p=Object.assign(Object.assign({},p),{smoothScrolling:_})}if(g.affectsConfiguration(Td)){const _=l.getValue(Td);p=Object.assign(Object.assign({},p),{mouseWheelScrollSensitivity:_})}if(g.affectsConfiguration(xd)){const _=l.getValue(xd);p=Object.assign(Object.assign({},p),{fastScrollSensitivity:_})}Object.keys(p).length>0&&this.updateOptions(p)})),this.navigator=new nte(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?N0(e):e_)}dispose(){this.disposables.dispose(),super.dispose()}};Xz=lh([Fi(5,bt),Fi(6,$a),Fi(7,zt),Fi(8,_t)],Xz);let Qz=class extends $x{constructor(e,t,i,s,o,r,a,l,c,d){const u=typeof r.horizontalScrolling<"u"?r.horizontalScrolling:!!c.getValue(Da),[h,f]=d.invokeFunction(Gx,r);super(e,t,i,s,o,Object.assign(Object.assign({keyboardSupport:!1},h),{horizontalScrolling:u})),this.disposables.add(f),this.contextKeyService=Kx(a,this),this.disposables.add(qx(this.contextKeyService,this)),this.listSupportsMultiSelect=Ux.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(r.multipleSelectionSupport!==!1),jx.bindTo(this.contextKeyService).set(!!r.selectionNavigation),this.listHasSelectionOrFocus=o7.bindTo(this.contextKeyService),this.listDoubleSelection=r7.bindTo(this.contextKeyService),this.listMultiSelection=a7.bindTo(this.contextKeyService),this.horizontalScrolling=r.horizontalScrolling,this._useAltAsMultipleSelectionModifier=Nd(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(t_)&&(this._useAltAsMultipleSelectionModifier=Nd(c));let _={};if(p.affectsConfiguration(Da)&&this.horizontalScrolling===void 0){const v=!!c.getValue(Da);_=Object.assign(Object.assign({},_),{horizontalScrolling:v})}if(p.affectsConfiguration(gc)){const v=!!c.getValue(gc);_=Object.assign(Object.assign({},_),{scrollByPage:v})}if(p.affectsConfiguration(pc)){const v=!!c.getValue(pc);_=Object.assign(Object.assign({},_),{smoothScrolling:v})}if(p.affectsConfiguration(Td)){const v=c.getValue(Td);_=Object.assign(Object.assign({},_),{mouseWheelScrollSensitivity:v})}if(p.affectsConfiguration(xd)){const v=c.getValue(xd);_=Object.assign(Object.assign({},_),{fastScrollSensitivity:v})}Object.keys(_).length>0&&this.updateOptions(_)})),this.navigator=new yAe(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?N0(e):e_)}dispose(){this.disposables.dispose(),super.dispose()}};Qz=lh([Fi(6,bt),Fi(7,$a),Fi(8,zt),Fi(9,_t)],Qz);class f7 extends te{constructor(e,t){var i;super(),this.widget=e,this._onDidOpen=this._register(new j),this.onDidOpen=this._onDidOpen.event,this._register(We.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(DD))!=="doubleClick",this._register(t==null?void 0:t.configurationService.onDidChangeConfiguration(s=>{s.affectsConfiguration(DD)&&(this.openOnSingleClick=(t==null?void 0:t.configurationService.getValue(DD))!=="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 nte extends f7{constructor(e,t){super(e,t),this.widget=e}getSelectedElement(){return this.widget.getSelectedElements()[0]}}class yAe extends f7{constructor(e,t){super(e,t)}getSelectedElement(){return this.widget.getSelectedElements()[0]}}class SAe extends f7{constructor(e,t){super(e,t)}getSelectedElement(){var e;return(e=this.widget.getSelection()[0])!==null&&e!==void 0?e:void 0}}function LAe(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 Jz=class extends i7{constructor(e,t,i,s,o,r,a,l,c){const{options:d,getTypeNavigationMode:u,disposable:h}=r.invokeFunction(TS,o);super(e,t,i,s,d),this.disposables.add(h),this.internals=new mm(this,o,u,o.overrideStyles,a,l,c),this.disposables.add(this.internals)}updateOptions(e){super.updateOptions(e),this.internals.updateOptions(e)}};Jz=lh([Fi(5,_t),Fi(6,bt),Fi(7,$a),Fi(8,zt)],Jz);let eU=class extends Gee{constructor(e,t,i,s,o,r,a,l,c){const{options:d,getTypeNavigationMode:u,disposable:h}=r.invokeFunction(TS,o);super(e,t,i,s,d),this.disposables.add(h),this.internals=new mm(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)}};eU=lh([Fi(5,_t),Fi(6,bt),Fi(7,$a),Fi(8,zt)],eU);let tU=class extends pAe{constructor(e,t,i,s,o,r,a,l,c,d){const{options:u,getTypeNavigationMode:h,disposable:f}=a.invokeFunction(TS,r);super(e,t,i,s,o,u),this.disposables.add(f),this.internals=new mm(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)}};tU=lh([Fi(6,_t),Fi(7,bt),Fi(8,$a),Fi(9,zt)],tU);let y4=class extends Zee{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(TS,r);super(e,t,i,s,o,u),this.disposables.add(f),this.internals=new mm(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)}};y4=lh([Fi(6,_t),Fi(7,bt),Fi(8,$a),Fi(9,zt)],y4);let iU=class extends fAe{constructor(e,t,i,s,o,r,a,l,c,d,u){const{options:h,getTypeNavigationMode:f,disposable:g}=l.invokeFunction(TS,a);super(e,t,i,s,o,r,h),this.disposables.add(g),this.internals=new mm(this,a,f,a.overrideStyles,c,d,u),this.disposables.add(this.internals)}updateOptions(e){super.updateOptions(e),this.internals.updateOptions(e)}};iU=lh([Fi(7,_t),Fi(8,bt),Fi(9,$a),Fi(10,zt)],iU);function ste(n){const e=n.getValue(d7);if(e==="highlight")return dd.Highlight;if(e==="filter")return dd.Filter;const t=n.getValue(bI);if(t==="simple"||t==="highlight")return dd.Highlight;if(t==="filter")return dd.Filter}function ote(n){const e=n.getValue(h7);if(e==="fuzzy")return pm.Fuzzy;if(e==="contiguous")return pm.Contiguous}function TS(n,e){var t;const i=n.get(zt),s=n.get(rh),o=n.get(bt),r=n.get(_t),a=()=>{const f=o.getContextKeyValue(tte);if(f==="automatic")return Xc.Automatic;if(f==="trigger"||o.getContextKeyValue(ite)===!1)return Xc.Trigger;const p=i.getValue(u7);if(p==="automatic")return Xc.Automatic;if(p==="trigger")return Xc.Trigger},l=e.horizontalScrolling!==void 0?e.horizontalScrolling:!!i.getValue(Da),[c,d]=r.invokeFunction(Gx,e),u=e.paddingBottom,h=e.renderIndentGuides!==void 0?e.renderIndentGuides:i.getValue(CI);return{getTypeNavigationMode:a,disposable:d,options:Object.assign(Object.assign({keyboardSupport:!1},c),{indent:typeof i.getValue(oy)=="number"?i.getValue(oy):void 0,renderIndentGuides:h,smoothScrolling:!!i.getValue(pc),defaultFindMode:ste(i),defaultFindMatchType:ote(i),horizontalScrolling:l,scrollByPage:!!i.getValue(gc),paddingBottom:u,hideTwistiesOfChildlessElements:e.hideTwistiesOfChildlessElements,expandOnlyOnTwistieClick:(t=e.expandOnlyOnTwistieClick)!==null&&t!==void 0?t:i.getValue(wI)==="doubleClick",contextViewProvider:s,findWidgetStyles:oNe})}}let mm=class{get onDidOpen(){return this.navigator.onDidOpen}constructor(e,t,i,s,o,r,a){var l;this.tree=e,this.disposables=[],this.contextKeyService=Kx(o,e),this.disposables.push(qx(this.contextKeyService,e)),this.listSupportsMultiSelect=Ux.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(t.multipleSelectionSupport!==!1),jx.bindTo(this.contextKeyService).set(!!t.selectionNavigation),this.listSupportFindWidget=_Ae.bindTo(this.contextKeyService),this.listSupportFindWidget.set((l=t.findWidgetEnabled)!==null&&l!==void 0?l:!0),this.hasSelectionOrFocus=o7.bindTo(this.contextKeyService),this.hasDoubleSelection=r7.bindTo(this.contextKeyService),this.hasMultiSelection=a7.bindTo(this.contextKeyService),this.treeElementCanCollapse=l7.bindTo(this.contextKeyService),this.treeElementHasParent=vAe.bindTo(this.contextKeyService),this.treeElementCanExpand=c7.bindTo(this.contextKeyService),this.treeElementHasChild=bAe.bindTo(this.contextKeyService),this.treeFindOpen=CAe.bindTo(this.contextKeyService),this._useAltAsMultipleSelectionModifier=Nd(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(tte),u.add(ite),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(t_)&&(this._useAltAsMultipleSelectionModifier=Nd(a)),h.affectsConfiguration(oy)){const g=a.getValue(oy);f=Object.assign(Object.assign({},f),{indent:g})}if(h.affectsConfiguration(CI)&&t.renderIndentGuides===void 0){const g=a.getValue(CI);f=Object.assign(Object.assign({},f),{renderIndentGuides:g})}if(h.affectsConfiguration(pc)){const g=!!a.getValue(pc);f=Object.assign(Object.assign({},f),{smoothScrolling:g})}if(h.affectsConfiguration(d7)||h.affectsConfiguration(bI)){const g=ste(a);f=Object.assign(Object.assign({},f),{defaultFindMode:g})}if(h.affectsConfiguration(u7)||h.affectsConfiguration(bI)){const g=i();f=Object.assign(Object.assign({},f),{typeNavigationMode:g})}if(h.affectsConfiguration(h7)){const g=ote(a);f=Object.assign(Object.assign({},f),{defaultFindMatchType:g})}if(h.affectsConfiguration(Da)&&t.horizontalScrolling===void 0){const g=!!a.getValue(Da);f=Object.assign(Object.assign({},f),{horizontalScrolling:g})}if(h.affectsConfiguration(gc)){const g=!!a.getValue(gc);f=Object.assign(Object.assign({},f),{scrollByPage:g})}if(h.affectsConfiguration(wI)&&t.expandOnlyOnTwistieClick===void 0&&(f=Object.assign(Object.assign({},f),{expandOnlyOnTwistieClick:a.getValue(wI)==="doubleClick"})),h.affectsConfiguration(Td)){const g=a.getValue(Td);f=Object.assign(Object.assign({},f),{mouseWheelScrollSensitivity:g})}if(h.affectsConfiguration(xd)){const g=a.getValue(xd);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 SAe(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?N0(e):e_)}dispose(){this.disposables=fi(this.disposables)}};mm=lh([Fi(4,bt),Fi(5,$a),Fi(6,zt)],mm);const kAe=en.as(wc.Configuration);kAe.registerConfiguration({id:"workbench",order:7,title:m("workbenchConfigurationTitle","Workbench"),type:"object",properties:{[t_]:{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.")},[DD]:{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.")},[Da]:{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.")},[gc]:{type:"boolean",default:!1,description:m("list.scrollByPage","Controls whether clicks in the scrollbar scroll page by page.")},[oy]:{type:"number",default:8,minimum:4,maximum:40,description:m("tree indent setting","Controls tree indentation in pixels.")},[CI]:{type:"string",enum:["none","onHover","always"],default:"onHover",description:m("render tree indent guides","Controls whether the tree should render indent guides.")},[pc]:{type:"boolean",default:!1,description:m("list smoothScrolling setting","Controls whether lists and trees have smooth scrolling.")},[Td]:{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.")},[xd]:{type:"number",default:5,markdownDescription:m("Fast Scroll Sensitivity","Scrolling speed multiplier when pressing `Alt`.")},[d7]:{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.")},[bI]:{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.")},[h7]:{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.")},[wI]:{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.")},[u7]:{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 S4;(function(n){n[n.PRESERVE=0]="PRESERVE",n[n.LAST=1]="LAST"})(S4||(S4={}));const i_={Quickaccess:"workbench.contributions.quickaccess"};class DAe{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),vt(()=>{this.providers.splice(this.providers.indexOf(e),1),this.defaultProvider===e&&(this.defaultProvider=void 0)})}getQuickAccessProviders(){return wd([this.defaultProvider,...this.providers])}getQuickAccessProvider(e){return e&&this.providers.find(i=>e.startsWith(i.prefix))||void 0||this.defaultProvider}}en.add(i_.Quickaccess,new DAe);const EAe={ctrlCmd:!1,alt:!1};var ry;(function(n){n[n.Blur=1]="Blur",n[n.Gesture=2]="Gesture",n[n.Other=3]="Other"})(ry||(ry={}));var Bl;(function(n){n[n.NONE=0]="NONE",n[n.FIRST=1]="FIRST",n[n.SECOND=2]="SECOND",n[n.LAST=3]="LAST"})(Bl||(Bl={}));const yc=Wt("quickInputService");var IAe=globalThis&&globalThis.__decorate||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},nU=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let L4=class extends te{constructor(e,t){super(),this.quickInputService=e,this.instantiationService=t,this.registry=en.as(i_.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="".concat(r.prefix).concat(g))}if(!f){const g=o==null?void 0:o.defaultFilterValue;g===S4.LAST?f=this.lastAcceptedPickerValues.get(r):typeof g=="string"&&(f="".concat(r.prefix).concat(g))}typeof f=="string"&&(e=f)}const c=new be,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:Bl.SECOND),d.contextKey=r==null?void 0:r.contextKey,d.filterValue=f=>f.substring(r?r.prefix.length:0);let u;t&&(u=new ax,c.add(We.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 Tn);if(o&&c.add(o.provide(d,h.token,i==null?void 0:i.providerOptions)),We.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 be,a=this.visibleQuickAccess={picker:e,descriptor:i,value:s};return r.add(vt(()=>{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]}};L4=IAe([nU(0,yc),nU(1,_t)],L4);ee.white.toString(),ee.white.toString();class k4 extends te{get onDidClick(){return this._onDidClick.event}constructor(e,t){super(),this._label="",this._onDidClick=this._register(new j),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(Ii.addTarget(this._element)),[Pe.CLICK,Ti.Tap].forEach(o=>{this._register(ce(this._element,o,r=>{if(!this.enabled){xt.stop(r);return}this._onDidClick.fire(r)}))}),this._register(ce(this._element,Pe.KEY_DOWN,o=>{const r=new Oi(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&&xt.stop(r,!0)})),this._register(ce(this._element,Pe.MOUSE_OVER,o=>{this._element.classList.contains("disabled")||this.updateBackground(!0)})),this._register(ce(this._element,Pe.MOUSE_OUT,o=>{this.updateBackground(!1)})),this.focusTracker=this._register(Ld(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 kf(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||Lf(this._label)&&Lf(e)&>e(this._label,e))return;this._element.classList.add("monaco-text-button");const i=this.options.supportShortLabel?this._labelElement:this._element;if(Lf(e)){const s=Bx(e,{inline:!0});s.dispose();const o=(t=s.element.querySelector("p"))===null||t===void 0?void 0:t.innerHTML;if(o){const r=UX(o,{ADD_TAGS:["b","i","u","code","span"],ALLOWED_ATTR:["class"],RETURN_TRUSTED_TYPE:!0});i.innerHTML=r}else Es(i)}else this.options.supportIcons?Es(i,...this.getContentElements(e)):i.textContent=e;typeof this.options.title=="string"?this._element.title=this.options.title:this.options.title&&(this._element.title=cxe(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 D4{constructor(e,t,i){this.options=t,this.styles=i,this.count=0,this.element=ge(e,ye(".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=sm(this.countFormat,this.count),this.element.title=sm(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 ".concat(this.styles.badgeBorder))}}const sU="done",oU="active",cR="infinite",dR="infinite-long-running",rU="discrete";class Yx extends te{constructor(e,t){super(),this.workedVal=0,this.showDelayedScheduler=this._register(new Si(()=>mr(this.element),0)),this.longRunningScheduler=this._register(new Si(()=>this.infiniteLongRunning(),Yx.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(oU,cR,dR,rU),this.workedVal=0,this.totalWork=void 0,this.longRunningScheduler.cancel()}stop(){return this.doDone(!1)}doDone(e){return this.element.classList.add(sU),this.element.classList.contains(cR)?(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(rU,sU,dR),this.element.classList.add(oU,cR),this.longRunningScheduler.schedule(),this}infiniteLongRunning(){this.element.classList.add(dR)}getContainer(){return this.element}}Yx.LONG_RUNNING_INFINITE_THRESHOLD=1e4;const TAe=ye;class xAe extends te{constructor(e,t,i){super(),this.parent=e,this.onKeyDown=o=>ce(this.findInput.inputBox.inputElement,Pe.KEY_DOWN,r=>{o(new Oi(r))}),this.onMouseDown=o=>ce(this.findInput.inputBox.inputElement,Pe.MOUSE_DOWN,r=>{o(new ba(r))}),this.onDidChange=o=>this.findInput.onDidChange(o),this.container=ge(this.parent,TAe(".quick-input-box")),this.findInput=this._register(new Uee(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===bn.Ignore?this.findInput.clearMessage():this.findInput.showMessage({type:e===bn.Info?1:e===bn.Warning?2:3,content:""})}stylesForType(e){return this.findInput.inputBox.stylesForType(e===bn.Info?1:e===bn.Warning?2:3)}setFocus(){this.findInput.focus()}layout(){this.findInput.inputBox.layout()}}class Ef{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=ge(e,ye("span.monaco-highlighted-label"))}get element(){return this.domNode}set(e,t=[],i="",s){e||(e=""),s&&(e=Ef.escapeNewLines(e,t)),!(this.didEverRender&&this.text===e&&this.title===i&&Gr(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\n"?-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 uR{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 yI extends te{constructor(e,t){super(),this.customHovers=new Map,this.creationOptions=t,this.domNode=this._register(new uR(ge(e,ye(".monaco-icon-label")))),this.labelContainer=ge(this.domNode.element,ye(".monaco-icon-label-container"));const i=ge(this.labelContainer,ye("span.monaco-icon-name-container"));t!=null&&t.supportHighlights||t!=null&&t.supportIcons?this.nameNode=new MAe(i,!!t.supportIcons):this.nameNode=new NAe(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 Ef?(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)?Ef.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)XTe(e,t);else{const s=Lee(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 uR(ge(this.labelContainer,ye("span.monaco-icon-description-container"))));!((e=this.creationOptions)===null||e===void 0)&&e.supportDescriptionHighlights?this.descriptionNode=new Ef(ge(t.element,ye("span.label-description")),{supportIcons:!!this.creationOptions.supportIcons}):this.descriptionNode=this._register(new uR(ge(t.element,ye("span.label-description"))))}return this.descriptionNode}}class NAe{constructor(e){this.container=e,this.label=void 0,this.singleLabel=void 0}setLabel(e,t){if(!(this.label===e&&Gr(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=ge(this.container,ye("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=>js.intersect(o,a)).filter(a=>!js.isEmpty(a)).map(({start:a,end:l})=>({start:a-i,end:l-i}));return i=o.end+e.length,r})}class MAe{constructor(e,t){this.container=e,this.supportIcons=t,this.label=void 0,this.singleLabel=void 0}setLabel(e,t){if(!(this.label===e&&Gr(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 Ef(ge(this.container,ye("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=AAe(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 PAe(n,e,t=!1){const i=n||"",s=e||"",o=aU.value.collator.compare(i,s);return aU.value.collatorIsNumeric&&o===0&&i!==s?is.length)return 1}return 0}var BAe=globalThis&&globalThis.__decorate||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 rte{constructor(e){this.nodes=e}toString(){return this.nodes.map(e=>typeof e=="string"?e:e.label).join("")}}BAe([xn],rte.prototype,"toString",null);const WAe=/\[([^\]]+)\]\(((?:https?:\/\/|command:|file:)[^\)\s]+)(?: (["'])(.+?)(\3))?\)/gi;function VAe(n){const e=[];let t=0,i;for(;i=WAe.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{t0e(f)&&xt.stop(f,!0),t.callback(o.href)},c=t.disposables.add(new Vt(a,Pe.CLICK)).event,d=t.disposables.add(new Vt(a,Pe.KEY_DOWN)).event,u=We.chain(d,f=>f.filter(g=>{const p=new Oi(g);return p.equals(10)||p.equals(3)}));t.disposables.add(Ii.addTarget(a));const h=t.disposables.add(new Vt(a,Ti.Tap)).event;We.any(c,h,u)(l,null,t.disposables),e.appendChild(a)}}var ate=globalThis&&globalThis.__decorate||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},lU=globalThis&&globalThis.__awaiter||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 Al=ye;class zAe{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?We.map(We.filter(this._onChecked.event,u=>u.listElement===this),u=>u.checked):We.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 kg(()=>{var u;const h=(u=e.label)!==null&&u!==void 0?u:"",f=Z1(h).text.trim(),g=e.ariaLabel||[h,this.saneDescription,this.saneDetail].map(p=>qTe(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 NS{constructor(e){this.themeService=e}get templateId(){return NS.ID}renderTemplate(e){const t=Object.create(null);t.toDisposeElement=[],t.toDisposeTemplate=[],t.entry=ge(e,Al(".quick-input-list-entry"));const i=ge(t.entry,Al("label.quick-input-list-label"));t.toDisposeTemplate.push(In(i,Pe.CLICK,c=>{t.checkbox.offsetParent||c.preventDefault()})),t.checkbox=ge(i,Al("input.quick-input-list-checkbox")),t.checkbox.type="checkbox",t.toDisposeTemplate.push(In(t.checkbox,Pe.CHANGE,c=>{t.element.checked=t.checkbox.checked}));const s=ge(i,Al(".quick-input-list-rows")),o=ge(s,Al(".quick-input-list-row")),r=ge(s,Al(".quick-input-list-row"));t.label=new yI(o,{supportHighlights:!0,supportDescriptionHighlights:!0,supportIcons:!0}),t.toDisposeTemplate.push(t.label),t.icon=JX(t.label.element,Al(".quick-input-list-icon"));const a=ge(o,Al(".quick-input-list-entry-keybinding"));t.keybinding=new xS(a,$r);const l=ge(r,Al(".quick-input-list-label-meta"));return t.detail=new yI(l,{supportHighlights:!0,supportIcons:!0}),t.toDisposeTemplate.push(t.detail),t.separator=ge(t.entry,Al(".quick-input-list-separator")),t.actionBar=new Pa(t.entry),t.actionBar.domNode.classList.add("quick-input-list-entry-action-bar"),t.toDisposeTemplate.push(t.actionBar),t}renderElement(e,t,i){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=Nb(this.themeService.getColorTheme().type)?e.item.iconPath.dark:(r=e.item.iconPath.light)!==null&&r!==void 0?r:e.item.iconPath.dark,p=ct.revive(g);i.icon.className="quick-input-list-icon",i.icon.style.backgroundImage=Uf(p)}else i.icon.style.backgroundImage="",i.icon.className=!((a=e.item)===null||a===void 0)&&a.iconClass?"quick-input-list-icon ".concat(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?E4(g.iconPath):void 0);return g.alwaysVisible&&(_=_?"".concat(_," always-visible"):"always-visible"),{id:"id-".concat(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=fi(i.toDisposeElement),i.actionBar.clear()}disposeTemplate(e){e.toDisposeElement=fi(e.toDisposeElement),e.toDisposeTemplate=fi(e.toDisposeTemplate)}}NS.ID="listelement";class UAe{getHeight(e){return e.item?e.saneDetail?44:22:24}getTemplateId(e){return NS.ID}}var cs;(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"})(cs||(cs={}));class g7{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 j,this.onChangedAllVisibleChecked=this._onChangedAllVisibleChecked.event,this._onChangedCheckedCount=new j,this.onChangedCheckedCount=this._onChangedCheckedCount.event,this._onChangedVisibleCount=new j,this.onChangedVisibleCount=this._onChangedVisibleCount.event,this._onChangedCheckedElements=new j,this.onChangedCheckedElements=this._onChangedCheckedElements.event,this._onButtonTriggered=new j,this.onButtonTriggered=this._onButtonTriggered.event,this._onSeparatorButtonTriggered=new j,this.onSeparatorButtonTriggered=this._onSeparatorButtonTriggered.event,this._onKeyDown=new j,this.onKeyDown=this._onKeyDown.event,this._onLeave=new j,this.onLeave=this._onLeave.event,this._listElementChecked=new j,this._fireCheckedEvents=!0,this.elementDisposables=[],this.disposables=[],this.id=t,this.container=ge(this.parent,Al(".quick-input-list"));const o=new UAe,r=new qAe;if(this.list=i.createList("QuickInput",this.container,o,[new NS(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 Oi(a);switch(l.keyCode){case 10:this.toggleCheckbox();break;case 31:(Kt?a.metaKey:a.ctrlKey)&&this.list.setFocus(yo(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(ce(this.container,Pe.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 lQ(i.hoverDelegate.delay);this.disposables.push(this.list.onMouseOver(l=>lU(this,void 0,void 0,function*(){var c;if(l.browserEvent.target instanceof HTMLAnchorElement){a.cancel();return}if(!(!(l.browserEvent.relatedTarget instanceof HTMLAnchorElement)&&Ws(l.browserEvent.relatedTarget,(c=l.element)===null||c===void 0?void 0:c.element)))try{yield a.trigger(()=>lU(this,void 0,void 0,function*(){l.element&&this.showHover(l.element)}))}catch(d){if(!bc(d))throw d}}))),this.disposables.push(this.list.onMouseOut(l=>{var c;Ws(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 We.map(this.list.onDidChangeFocus,e=>e.elements.map(t=>t.item))}get onDidChangeSelection(){return We.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=fi(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 zAe(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===cs.Second&&this.list.length<2&&(e=cs.First),e){case cs.First:this.list.scrollTop=0,this.list.focusFirst(void 0,i=>!!i.item);break;case cs.Second:this.list.scrollTop=0,this.list.focusNth(1,void 0,i=>!!i.item);break;case cs.Last:this.list.scrollTop=this.list.scrollHeight,this.list.focusLast(void 0,i=>!!i.item);break;case cs.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 cs.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 cs.NextPage:this.list.focusNextPage(void 0,i=>!!i.item);break;case cs.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?"".concat(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=XM(e,Z1(o.saneLabel)))!==null&&r!==void 0?r:void 0:d=this.matchOnLabel&&(a=jAe(t,Z1(o.saneLabel)))!==null&&a!==void 0?a:void 0;const u=this.matchOnDescription&&(l=XM(e,Z1(o.saneDescription||"")))!==null&&l!==void 0?l:void 0,h=this.matchOnDetail&&(c=XM(e,Z1(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)=>KAe(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=fi(this.elementDisposables),this.disposables=fi(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 be;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)}}ate([xn],g7.prototype,"onDidChangeFocus",null);ate([xn],g7.prototype,"onDidChangeSelection",null);function jAe(n,e){const{text:t,iconOffsets:i}=e;if(!i||i.length===0)return cU(n,t);const s=aS(t," "),o=t.length-s.length,r=cU(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 cU(n,e){const t=e.toLowerCase().indexOf(n.toLowerCase());return t!==-1?[{start:t,end:t+n.length}]:null}function KAe(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:OAe(n.saneSortLabel,e.saneSortLabel,t)}class qAe{getWidgetAriaLabel(){return m("quickInput","Quick Input")}getAriaLabel(e){var t;return!((t=e.separator)===null||t===void 0)&&t.label?"".concat(e.saneAriaLabel,", ").concat(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 dU=globalThis&&globalThis.__awaiter||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 I4={iconClass:dt.asClassName(Me.quickInputBack),tooltip:m("quickInput.back","Back"),handle:-1};class AS extends te{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=AS.noPromptMessage,this._severity=bn.Ignore,this.onDidTriggerButtonEmitter=this._register(new j),this.onDidHideEmitter=this._register(new j),this.onDisposeEmitter=this._register(new j),this.visibleDisposables=this._register(new be),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&&!uc;this._ignoreFocusOut=e&&!uc,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!=null?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=ry.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?Es(this.ui.widget,this._widget):Es(this.ui.widget)),this.busy&&!this.busyDelay&&(this.busyDelay=new _l,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===I4);this.ui.leftActionBar.push(r.map((l,c)=>{const d=new Ro("id-".concat(c),"",l.iconClass||E4(l.iconPath),!0,()=>dU(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!==I4);this.ui.rightActionBar.push(a.map((l,c)=>{const d=new Ro("id-".concat(c),"",l.iconClass||E4(l.iconPath),!0,()=>dU(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 M0))!==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,Es(this.ui.message),$Ae(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?"".concat(this.title," (").concat(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!==bn.Ignore){const t=this.ui.inputBox.stylesForType(e);this.ui.message.style.color=t.foreground?"".concat(t.foreground):"",this.ui.message.style.backgroundColor=t.background?"".concat(t.background):"",this.ui.message.style.border=t.border?"1px solid ".concat(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()}}AS.noPromptMessage=m("inputModeEntry","Press 'Enter' to confirm your input or 'Escape' to cancel");class ay extends AS{constructor(){super(...arguments),this._value="",this.onDidChangeValueEmitter=this._register(new j),this.onWillAcceptEmitter=this._register(new j),this.onDidAcceptEmitter=this._register(new j),this.onDidCustomEmitter=this._register(new j),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=Bl.FIRST,this._activeItems=[],this.activeItemsUpdated=!1,this.activeItemsToConfirm=[],this.onDidChangeActiveEmitter=this._register(new j),this._selectedItems=[],this.selectedItemsUpdated=!1,this.selectedItemsToConfirm=[],this.onDidChangeSelectionEmitter=this._register(new j),this.onDidTriggerItemButtonEmitter=this._register(new j),this.onDidTriggerSeparatorButtonEmitter=this._register(new j),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?EAe: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(cs.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(cs.Next),this.canSelectMany&&this.ui.list.domFocus(),xt.stop(e,!0);break;case 16:this.ui.list.getFocusedElements().length?this.ui.list.focus(cs.Previous):this.ui.list.focus(cs.Last),this.canSelectMany&&this.ui.list.domFocus(),xt.stop(e,!0);break;case 12:this.ui.list.focus(cs.NextPage),this.canSelectMany&&this.ui.list.domFocus(),xt.stop(e,!0);break;case 11:this.ui.list.focus(cs.PreviousPage),this.canSelectMany&&this.ui.list.domFocus(),xt.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(cs.First),xt.stop(e,!0));break;case 13:(e.ctrlKey||e.metaKey)&&!e.shiftKey&&!e.altKey&&(this.ui.list.focus(cs.Last),xt.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&&yn(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&&yn(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&&yn(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 ce(this.ui.container,Pe.KEY_UP,e=>{if(this.canSelectMany||!this._quickNavigate)return;const t=new Oi(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||ay.DEFAULT_ARIA_LABEL,this.title&&(s+=" - ".concat(this.title))),this.ui.list.ariaLabel!==s&&(this.ui.list.ariaLabel=s!=null?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 Bl.NONE:this._itemActivation=Bl.FIRST;break;case Bl.SECOND:this.ui.list.focus(cs.Second),this._itemActivation=Bl.FIRST;break;case Bl.LAST:this.ui.list.focus(cs.Last),this._itemActivation=Bl.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(cs.First)),this.keepScrollPosition&&(this.scrollTop=e)}}ay.DEFAULT_ARIA_LABEL=m("quickInputBox.ariaLabel","Type to narrow down results.");class GAe extends AS{constructor(){super(...arguments),this._value="",this.valueSelectionUpdated=!0,this._password=!1,this.onDidValueChangeEmitter=this._register(new j),this.onDidAcceptEmitter=this._register(new j),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 ar=ye;class Zx extends te{constructor(e,t){super(),this.options=e,this.themeService=t,this.enabled=!0,this.onDidAcceptEmitter=this._register(new j),this.onDidCustomEmitter=this._register(new j),this.onDidTriggerButtonEmitter=this._register(new j),this.keyMods={ctrlCmd:!1,alt:!1},this.controller=null,this.onShowEmitter=this._register(new j),this.onShow=this.onShowEmitter.event,this.onHideEmitter=this._register(new j),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(ce(window,Pe.KEY_DOWN,e,!0)),this._register(ce(window,Pe.KEY_UP,e,!0)),this._register(ce(window,Pe.MOUSE_DOWN,e,!0))}getUI(){if(this.ui)return this.ui;const e=ge(this.parentElement,ar(".quick-input-widget.show-file-icons"));e.tabIndex=-1,e.style.display="none";const t=Na(e),i=ge(e,ar(".quick-input-titlebar")),s=this.options.hoverDelegate?{hoverDelegate:this.options.hoverDelegate}:void 0,o=this._register(new Pa(i,s));o.domNode.classList.add("quick-input-left-action-bar");const r=ge(i,ar(".quick-input-title")),a=this._register(new Pa(i,s));a.domNode.classList.add("quick-input-right-action-bar");const l=ge(e,ar(".quick-input-header")),c=ge(l,ar("input.quick-input-check-all"));c.type="checkbox",c.setAttribute("aria-label",m("quickInput.checkAll","Toggle all checkboxes")),this._register(In(c,Pe.CHANGE,P=>{const W=c.checked;A.setAllVisibleChecked(W)})),this._register(ce(c,Pe.CLICK,P=>{(P.x||P.y)&&f.setFocus()}));const d=ge(l,ar(".quick-input-description")),u=ge(l,ar(".quick-input-and-message")),h=ge(u,ar(".quick-input-filter")),f=this._register(new xAe(h,this.styles.inputBox,this.styles.toggle));f.setAttribute("aria-describedby","".concat(this.idPrefix,"message"));const g=ge(h,ar(".quick-input-visible-count"));g.setAttribute("aria-live","polite"),g.setAttribute("aria-atomic","true");const p=new D4(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),_=ge(h,ar(".quick-input-count"));_.setAttribute("aria-live","polite");const v=new D4(_,{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=ge(l,ar(".quick-input-action")),C=this._register(new k4(b,this.styles.button));C.label=m("ok","OK"),this._register(C.onDidClick(P=>{this.onDidAcceptEmitter.fire()}));const w=ge(l,ar(".quick-input-action")),y=this._register(new k4(w,this.styles.button));y.label=m("custom","Custom"),this._register(y.onDidClick(P=>{this.onDidCustomEmitter.fire()}));const L=ge(u,ar("#".concat(this.idPrefix,"message.quick-input-message"))),S=this._register(new Yx(e,this.styles.progressBar));S.getContainer().classList.add("quick-input-progress");const k=ge(e,ar(".quick-input-html-widget"));k.tabIndex=-1;const D=ge(e,ar(".quick-input-description")),x=this.idPrefix+"list",A=this._register(new g7(e,x,this.options,this.themeService));f.setAttribute("aria-controls",x),this._register(A.onDidChangeFocus(()=>{var P;f.setAttribute("aria-activedescendant",(P=A.getActiveDescendant())!==null&&P!==void 0?P:"")})),this._register(A.onChangedAllVisibleChecked(P=>{c.checked=P})),this._register(A.onChangedVisibleCount(P=>{p.setCount(P)})),this._register(A.onChangedCheckedCount(P=>{v.setCount(P)})),this._register(A.onLeave(()=>{setTimeout(()=>{f.setFocus(),this.controller instanceof ay&&this.controller.canSelectMany&&A.clearFocus()},0)}));const T=Ld(e);return this._register(T),this._register(ce(e,Pe.FOCUS,P=>{Ws(P.relatedTarget,e)||(this.previousFocusElement=P.relatedTarget instanceof HTMLElement?P.relatedTarget:void 0)},!0)),this._register(T.onDidBlur(()=>{!this.getUI().ignoreFocusOut&&!this.options.ignoreFocusOut()&&this.hide(ry.Blur),this.previousFocusElement=void 0})),this._register(ce(e,Pe.FOCUS,P=>{f.setFocus()})),this._register(In(e,Pe.KEY_DOWN,P=>{if(!Ws(P.target,k))switch(P.keyCode){case 3:xt.stop(P,!0),this.enabled&&this.onDidAcceptEmitter.fire();break;case 9:xt.stop(P,!0),this.hide(ry.Gesture);break;case 2:if(!P.altKey&&!P.ctrlKey&&!P.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(Ws(P.target,this.getUI().widget))break;W.push(".quick-input-html-widget")}const $=e.querySelectorAll(W.join(", "));P.shiftKey&&P.target===$[0]?(xt.stop(P,!0),A.clearFocus()):!P.shiftKey&&Ws(P.target,$[$.length-1])&&(xt.stop(P,!0),$[0].focus())}break;case 10:P.ctrlKey&&(xt.stop(P,!0),this.getUI().list.toggleHover());break}})),this.ui={container:e,styleSheet:t,leftActionBar:o,titleBar:i,title:r,description1:D,description2:d,widget:k,rightActionBar:a,checkAll:c,inputContainer:u,filterContainer:h,inputBox:f,visibleCountContainer:g,visibleCount:p,countContainer:_,count:v,okContainer:b,ok:C,message:L,customButtonContainer:w,customButton:y,list:A,progressBar:S,onDidAccept:this.onDidAcceptEmitter.event,onDidCustom:this.onDidCustomEmitter.event,onDidTriggerButton:this.onDidTriggerButtonEmitter.event,ignoreFocusOut:!1,keyMods:this.keyMods,show:P=>this.show(P),hide:()=>this.hide(),setVisibilities:P=>this.setVisibilities(P),setEnabled:P=>this.setEnabled(P),setContextKey:P=>this.options.setContextKey(P),linkOpenerDelegate:P=>this.options.linkOpenerDelegate(P)},this.updateStyles(),this.ui}pick(e,t={},i=Ft.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(()=>{fi(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 ay(e)}createInputBox(){const e=this.getUI();return new GAe(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="",Es(t.widget),t.rightActionBar.clear(),t.checkAll.checked=!1,t.inputBox.placeholder="",t.inputBox.password=!1,t.inputBox.showDecoration(bn.Ignore),t.visibleCount.setCount(0),t.count.setCount(0),Es(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();I4.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=!Ws(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="".concat(this.titleBarOffset,"px");const e=this.ui.container.style,t=Math.min(this.dimension.width*.62,Zx.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!=null?e:"",this.ui.container.style.backgroundColor=t!=null?t:"",this.ui.container.style.color=i!=null?i:"",this.ui.container.style.border=s?"1px solid ".concat(s):"",this.ui.container.style.boxShadow=o?"0 0 8px 2px ".concat(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: ".concat(this.styles.pickerGroup.pickerGroupBorder,"; }")),this.styles.pickerGroup.pickerGroupForeground&&r.push(".quick-input-list .quick-input-list-separator { color: ".concat(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: ".concat(this.styles.keybindingLabel.keybindingLabelBackground,";")),this.styles.keybindingLabel.keybindingLabelBorder&&r.push("border-color: ".concat(this.styles.keybindingLabel.keybindingLabelBorder,";")),this.styles.keybindingLabel.keybindingLabelBottomBorder&&r.push("border-bottom-color: ".concat(this.styles.keybindingLabel.keybindingLabelBottomBorder,";")),this.styles.keybindingLabel.keybindingLabelShadow&&r.push("box-shadow: inset 0 -1px 0 ".concat(this.styles.keybindingLabel.keybindingLabelShadow,";")),this.styles.keybindingLabel.keybindingLabelForeground&&r.push("color: ".concat(this.styles.keybindingLabel.keybindingLabelForeground,";")),r.push("}"));const a=r.join("\n");a!==this.ui.styleSheet.textContent&&(this.ui.styleSheet.textContent=a)}}isDisplayed(){return this.ui&&this.ui.container.style.display!=="none"}}Zx.MAX_WIDTH=600;var YAe=globalThis&&globalThis.__decorate||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=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let T4=class extends ISe{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(L4))),this._quickAccess}constructor(e,t,i,s){super(i),this.instantiationService=e,this.contextKeyService=t,this.layoutService=s,this._onShow=this._register(new j),this._onHide=this._register(new j),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(Ir).open(o,{allowCommands:!0,fromUserGesture:!0})})},returnFocus:()=>e.focus(),createList:(o,r,a,l,c)=>this.instantiationService.createInstance(w4,o,r,a,l,c),styles:this.computeStyles()},s=this._register(new Zx(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 Ve(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=Ft.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:He(e$),quickInputForeground:He(Rwe),quickInputTitleBackground:He(Pwe),widgetBorder:He(J8),widgetShadow:He(nd)},inputBox:dI,toggle:cI,countBadge:Mee,button:nNe,progressBar:sNe,keybindingLabel:iNe,list:N0({listBackground:e$,listFocusBackground:xp,listFocusForeground:Tp,listInactiveFocusForeground:Tp,listInactiveSelectionIconForeground:av,listInactiveFocusBackground:xp,listFocusOutline:$i,listInactiveFocusOutline:$i}),pickerGroup:{pickerGroupBorder:He(Owe),pickerGroupForeground:He(zQ)}}}};T4=YAe([ek(0,_t),ek(1,bt),ek(2,os),ek(3,x0)],T4);var lte=globalThis&&globalThis.__decorate||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},Cv=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let x4=class extends T4{constructor(e,t,i,s,o){super(t,i,s,new OO(e.getContainerDomNode(),o)),this.host=void 0;const r=$b.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)}};x4=lte([Cv(1,_t),Cv(2,bt),Cv(3,os),Cv(4,ai)],x4);let N4=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(x4,e);this.mapEditorToService.set(e,t),$f(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=Ft.None){return this.activeService.pick(e,t,i)}createQuickPick(){return this.activeService.createQuickPick()}createInputBox(){return this.activeService.createInputBox()}};N4=lte([Cv(0,_t),Cv(1,ai)],N4);class $b{static get(e){return e.getContribution($b.ID)}constructor(e){this.editor=e,this.widget=new Xx(this.editor)}dispose(){this.widget.dispose()}}$b.ID="editor.controller.quickInput";class Xx{constructor(e){this.codeEditor=e,this.domNode=document.createElement("div"),this.codeEditor.addOverlayWidget(this)}getId(){return Xx.ID}getDomNode(){return this.domNode}getPosition(){return{preference:2}}dispose(){this.codeEditor.removeOverlayWidget(this)}}Xx.ID="editor.contrib.quickInputWidget";ti($b.ID,$b,4);class ZAe{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 XAe(n){if(!n||!Array.isArray(n))return[];const e=[];let t=0;for(let i=0,s=n.length;i{const h=nMe(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 eMe;for(const d of e)o.getId(d);const r=o.getId(i),a=o.getId(s),l=new p7(t,r,a),c=new m7(l);for(let d=0,u=n.length;d"u"){const s=this._match(t),o=iMe(t);i=(s.metadata|o<<8)>>>0,this._cache.set(t,i)}return(i|e<<0)>>>0}}const tMe=/\b(comment|string|regex|regexp)\b/;function iMe(n){const e=n.match(tMe);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 nMe(n,e){return ne?1:0}class p7{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 p7(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 m7{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 m7(this._mainRule.clone()),this._children.set(r,l)),l.insert(a,t,i,s)}}function sMe(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=>Mo(o)?o:void 0;if(i&&Array.isArray(i.src)&&i.src.every(o=>Mo(o.format)&&Mo(o.location)))return{weight:s(i.weight),style:s(i.style),src:i.src.map(o=>({format:o.format,location:ct.parse(o.location)}))}}n.fromJSONObject=t})(hU||(hU={}));class dMe{constructor(){this._onDidChange=new j,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:"^".concat(dt.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="".concat(i," $(").concat(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="".concat(i,": $(").concat(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(;dt.isThemeIcon(o.defaults);)o=this.iconsById[o.defaults.id];return"codicon codicon-".concat(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('||').concat(o.id,"|").concat(dt.isThemeIcon(o.defaults)?o.defaults.id:o.id,"|").concat(o.description||"","|"));i.push("| preview | identifier "),i.push("| ----------- | --------------------------------- |");for(const o of s.filter(r=>!dt.isThemeIcon(r.defaults)).sort(e))i.push('||').concat(o.id,"|"));return i.join("\n")}}const n_=new dMe;en.add(cMe.IconContribution,n_);function Sn(n,e,t,i){return n_.registerIcon(n,e,t,i)}function dte(){return n_}function uMe(){const n=CX();for(const e in n){const t="\\"+n[e].toString(16);n_.registerIcon(e,{fontCharacter:t})}}uMe();const ute="vscode://schemas/icons",hte=en.as(fx.JSONContribution);hte.registerSchema(ute,n_.getIconSchema());const fU=new Si(()=>hte.notifySchemaChanged(ute),200);n_.onDidChange(()=>{fU.isScheduled()||fU.schedule()});const fte=Sn("widget-close",Me.close,m("widgetClose","Icon for the close action in widgets."));Sn("goto-previous-location",Me.arrowUp,m("previousChangeIcon","Icon for goto previous editor location."));Sn("goto-next-location",Me.arrowDown,m("nextChangeIcon","Icon for goto next editor location."));dt.modify(Me.sync,"spin");dt.modify(Me.loading,"spin");function hMe(n){const e=new be,t=e.add(new j),i=dte();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 gte,o={},r=l=>{const c=s.getIcon(l);if(!c)return;const d=c.font;return d?(o[d.id]=d.definition,".codicon-".concat(l.id,":before { content: '").concat(c.fontCharacter,"'; font-family: ").concat(rH(d.id),"; }")):".codicon-".concat(l.id,":before { content: '").concat(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: ".concat(c.weight,";"):"",u=c.style?"font-style: ".concat(c.style,";"):"",h=c.src.map(f=>"".concat(Uf(f.location)," format('").concat(f.format,"')")).join(", ");a.push("@font-face { src: ".concat(h,"; font-family: ").concat(rH(l),";").concat(d).concat(u," font-display: block; }"))}return a.join("\n")}}}class gte{getIcon(e){const t=dte();let i=e.defaults;for(;dt.isThemeIcon(i);){const s=t.getIcon(i.id);if(!s)return;i=s.defaults}return i}}const Cu="vs",sb="vs-dark",Gp="hc-black",Yp="hc-light",pte=en.as(WQ.ColorContribution),fMe=en.as(iJ.ThemingContribution);class mte{constructor(e,t){this.semanticHighlighting=!1,this.themeData=t;const i=t.base;e.length>0?(ED(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,ee.fromHex(this.themeData.colors[t]));if(this.themeData.inherit){const t=A4(this.themeData.base);for(const i in t.colors)e.has(i)||e.set(i,ee.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=pte.resolveDefaultColor(e,this),this.defaultColors[e]=t,t)}defines(e){return this.getColors().has(e)}get type(){switch(this.base){case Cu:return Ca.LIGHT;case Gp:return Ca.HIGH_CONTRAST_DARK;case Yp:return Ca.HIGH_CONTRAST_LIGHT;default:return Ca.DARK}}get tokenTheme(){if(!this._tokenTheme){let e=[],t=[];if(this.themeData.inherit){const o=A4(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=cte.createFromRawTokenTheme(e,t)}return this._tokenTheme}getTokenStyleMetadata(e,t,i){const o=this.tokenTheme._match([e].concat(t).join(".")).metadata,r=Fs.getForeground(o),a=Fs.getFontStyle(o);return{foreground:r,italic:!!(a&1),bold:!!(a&2),underline:!!(a&4),strikethrough:!!(a&8)}}}function ED(n){return n===Cu||n===sb||n===Gp||n===Yp}function A4(n){switch(n){case Cu:return oMe;case sb:return rMe;case Gp:return aMe;case Yp:return lMe}}function tk(n){const e=A4(n);return new mte(n,e)}class gMe extends te{constructor(){super(),this._onColorThemeChange=this._register(new j),this.onDidColorThemeChange=this._onColorThemeChange.event,this._onProductIconThemeChange=this._register(new j),this.onDidProductIconThemeChange=this._onProductIconThemeChange.event,this._environment=Object.create(null),this._builtInProductIconTheme=new gte,this._autoDetectHighContrast=!0,this._knownThemes=new Map,this._knownThemes.set(Cu,tk(Cu)),this._knownThemes.set(sb,tk(sb)),this._knownThemes.set(Gp,tk(Gp)),this._knownThemes.set(Yp,tk(Yp));const e=this._register(hMe(this));this._codiconCSS=e.getCSS(),this._themeCSS="",this._allCSS="".concat(this._codiconCSS,"\n").concat(this._themeCSS),this._globalStyleElement=null,this._styleElements=[],this._colorMapOverride=null,this.setTheme(Cu),this._onOSSchemeChanged(),this._register(e.onDidChange(()=>{this._codiconCSS=e.getCSS(),this._updateCSS()})),NX("(forced-colors: active)",()=>{this._onOSSchemeChanged()})}registerEditorContainer(e){return CE(e)?this._registerShadowDomContainer(e):this._registerRegularEditorContainer()}_registerRegularEditorContainer(){return this._globalStyleElement||(this._globalStyleElement=Na(void 0,e=>{e.className="monaco-colors",e.textContent=this._allCSS}),this._styleElements.push(this._globalStyleElement)),te.None}_registerShadowDomContainer(e){const t=Na(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(Cu),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!==ac(this._theme.type)){let t;Nb(this._theme.type)?t=e?Gp:sb:t=e?Yp:Cu,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)}};fMe.getThemingParticipants().forEach(r=>r(this._theme,i,this._environment));const s=[];for(const r of pte.getColors()){const a=this._theme.getColor(r.id,!0);a&&s.push("".concat(Q8(r.id),": ").concat(a.toString(),";"))}i.addRule(".monaco-editor, .monaco-diff-editor { ".concat(s.join("\n")," }"));const o=this._colorMapOverride||this._theme.tokenTheme.getColorMap();i.addRule(sMe(o)),this._themeCSS=e.join("\n"),this._updateCSS(),nn.setColorMap(o),this._onColorThemeChange.fire(this._theme)}_updateCSS(){this._allCSS="".concat(this._codiconCSS,"\n").concat(this._themeCSS),this._styleElements.forEach(e=>e.textContent=this._allCSS)}getFileIconTheme(){return{hasFileIcons:!1,hasFolderIcons:!1,hidesExplorerArrows:!1}}getProductIconTheme(){return this._builtInProductIconTheme}}const la=Wt("themeService");var pMe=globalThis&&globalThis.__decorate||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},fR=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let M4=class extends te{constructor(e,t,i){super(),this._contextKeyService=e,this._layoutService=t,this._configurationService=i,this._accessibilitySupport=0,this._onDidChangeScreenReaderOptimized=new j,this._onDidChangeReducedMotion=new j,this._accessibilityModeEnabledContext=pS.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(ce(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}};M4=pMe([fR(0,bt),fR(1,x0),fR(2,zt)],M4);var Qx=globalThis&&globalThis.__decorate||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},_m=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},G_,Ah;let R4=class{constructor(e,t){this._commandService=e,this._hiddenStates=new SI(t)}createMenu(e,t,i){return new O4(e,this._hiddenStates,Object.assign({emitEventsForSubmenuChanges:!1,eventDebounceDelay:50},i),this._commandService,t)}resetHiddenStates(e){this._hiddenStates.reset(e)}};R4=Qx([_m(0,gn),_m(1,yl)],R4);let SI=G_=class{constructor(e){this._storageService=e,this._disposables=new be,this._onDidChange=new j,this.onDidChange=this._onDidChange.event,this._ignoreChangeEvent=!1,this._hiddenByDefaultCache=new Map;try{const t=e.get(G_._key,0,"{}");this._data=JSON.parse(t)}catch{this._data=Object.create(null)}this._disposables.add(e.onDidChangeValue(0,G_._key,this._disposables)(()=>{if(!this._ignoreChangeEvent)try{const t=e.get(G_._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("".concat(e.id,"/").concat(t)))!==null&&i!==void 0?i:!1}setDefaultState(e,t,i){this._hiddenByDefaultCache.set("".concat(e.id,"/").concat(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&&wme(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(G_._key,e,0,0)}finally{this._ignoreChangeEvent=!1}}};SI._key="menu.hiddenCommands";SI=G_=Qx([_m(0,yl)],SI);let P4=Ah=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=Ls.getMenuItems(this._id);let t;e.sort(Ah._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(Ah._fillInKbExprKeys(e.when,this._structureContextKeys),iv(e)){if(e.command.precondition&&Ah._fillInKbExprKeys(e.command.precondition,this._preconditionContextKeys),e.command.toggled){const t=e.command.toggled.condition||e.command.toggled;Ah._fillInKbExprKeys(t,this._toggledContextKeys)}}else this._collectContextKeysForSubmenus&&Ls.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=iv(a);l&&this._hiddenStates.setDefaultState(this._id,a.command.id,!!a.isHiddenByDefault);const c=mMe(this._id,l?a.command:a,this._hiddenStates);if(l)r.push(new fl(a.command,a.alt,e,c,this._contextKeyService,this._commandService));else{const d=new Ah(a.submenu,this._hiddenStates,this._collectContextKeysForSubmenus,this._commandService,this._contextKeyService).createActionGroups(e),u=hs.join(...d.map(h=>h[1]));u.length>0&&r.push(new ww(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:Ah._compareTitles(iv(e)?e.command.title:e.title,iv(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)}};P4=Ah=Qx([_m(3,gn),_m(4,bt)],P4);let O4=class{constructor(e,t,i,s,o){this._disposables=new be,this._menuInfo=new P4(e,t,i.emitEventsForSubmenuChanges,s,o);const r=new Si(()=>{this._menuInfo.refresh(),this._onDidChange.fire({menu:this,isStructuralChange:!0,isEnablementChange:!0,isToggleChange:!0})},i.eventDebounceDelay);this._disposables.add(r),this._disposables.add(Ls.onDidChangeMenu(d=>{d.has(e)&&r.schedule()}));const a=this._disposables.add(new be),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 cX({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()}};O4=Qx([_m(3,gn),_m(4,bt)],O4);function mMe(n,e,t){const i=hbe(e)?e.submenu.id:e.id,s=typeof e.title=="string"?e.title:e.title.value,o=Bv({id:"hide/".concat(n.id,"/").concat(i),label:m("hide.label","Hide '{0}'",s),run(){t.updateHidden(n,i,!0)}}),r=Bv({id:"toggle/".concat(n.id,"/").concat(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 _Me=globalThis&&globalThis.__decorate||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},gU=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},Zg=globalThis&&globalThis.__awaiter||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 F4=class extends te{constructor(e,t){super(),this.layoutService=e,this.logService=t,this.mapTextToType=new Map,this.findText="",this.resources=[],(qu||AX)&&this.installWebKitWriteTextWorkaround()}installWebKitWriteTextWorkaround(){const e=()=>{const t=new ax;this.webKitPendingClipboardWritePromise&&!this.webKitPendingClipboardWritePromise.isSettled&&this.webKitPendingClipboardWritePromise.cancel(),this.webKitPendingClipboardWritePromise=t,navigator.clipboard.write([new ClipboardItem({"text/plain":t.p})]).catch(i=>Zg(this,void 0,void 0,function*(){(!(i instanceof Error)||i.name!=="NotAllowedError"||!t.isRejected)&&this.logService.error(i)}))};this.layoutService.hasContainer&&(this._register(ce(this.layoutService.container,"click",e)),this._register(ce(this.layoutService.container,"keydown",e)))}writeText(e,t){return Zg(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(ye("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 Zg(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 Zg(this,void 0,void 0,function*(){return this.findText})}writeFindText(e){return Zg(this,void 0,void 0,function*(){this.findText=e})}writeResources(e){return Zg(this,void 0,void 0,function*(){this.resources=e})}readResources(){return Zg(this,void 0,void 0,function*(){return this.resources})}};F4=_Me([gU(0,x0),gU(1,aa)],F4);const ch=Wt("clipboardService");var vMe=globalThis&&globalThis.__decorate||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},bMe=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};const PC="data-keybinding-context";let _7=class{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 zb extends _7{constructor(){super(-1,null)}setValue(e,t){return!1}removeValue(e){return!1}getValue(e){}}zb.INSTANCE=new zb;class ly extends _7{constructor(e,t,i){super(e,null),this._configurationService=t,this._values=eb.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 mU(o))}else{const o=[];for(const r of s.affectedKeys){const a="config.".concat(r),l=this._values.findSuperstr(a);l!==void 0&&(o.push(...Pt.map(l,([c])=>c)),this._values.deleteSuperstr(a)),this._values.has(a)&&(o.push(a),this._values.delete(a))}i.fire(new mU(o))}})}dispose(){this._listener.dispose()}getValue(e){if(e.indexOf(ly._keyPrefix)!==0)return super.getValue(e);if(this._values.has(e))return this._values.get(e);const t=e.substr(ly._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)}}ly._keyPrefix="config.";class CMe{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 pU{constructor(e){this.key=e}affectsSome(e){return e.has(this.key)}allKeysContainedIn(e){return this.affectsSome(e)}}class mU{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 wMe{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 yMe(n,e){return n.allKeysContainedIn(new Set(Object.keys(e)))}class _te extends te{constructor(e){super(),this._onDidChangeContext=this._register(new nm({merge:t=>new wMe(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 CMe(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 SMe(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 pU(e))}removeContext(e){this._isDisposed||this.getContextValuesContainer(this._myContextId).removeValue(e)&&this._onDidChangeContext.fire(new pU(e))}getContext(e){return this._isDisposed?zb.INSTANCE:this.getContextValuesContainer(LMe(e))}dispose(){super.dispose(),this._isDisposed=!0}}let B4=class extends _te{constructor(e){super(0),this._contexts=new Map,this._lastContextId=0;const t=this._register(new ly(this._myContextId,e,this._onDidChangeContext));this._contexts.set(this._myContextId,t)}getContextValuesContainer(e){return this._isDisposed?zb.INSTANCE:this._contexts.get(e)||zb.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 _7(t,this.getContextValuesContainer(e))),t}disposeContext(e){this._isDisposed||this._contexts.delete(e)}};B4=vMe([bMe(0,zt)],B4);class SMe extends _te{constructor(e,t){if(super(e.createChildContext()),this._parentChangeListener=this._register(new Ts),this._parent=e,this._updateParentChangeListener(),this._domNode=t,this._domNode.hasAttribute(PC)){let i="";this._domNode.classList&&(i=Array.from(this._domNode.classList.values()).join(", ")),console.error("Element already has context attribute".concat(i?": "+i:""))}this._domNode.setAttribute(PC,String(this._myContextId))}_updateParentChangeListener(){this._parentChangeListener.value=this._parent.onDidChangeContext(e=>{const i=this._parent.getContextValuesContainer(this._myContextId).value;yMe(e,i)||this._onDidChangeContext.fire(e)})}dispose(){this._isDisposed||(this._parent.disposeContext(this._myContextId),this._domNode.removeAttribute(PC),super.dispose())}getContextValuesContainer(e){return this._isDisposed?zb.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 LMe(n){for(;n;){if(n.hasAttribute(PC)){const e=n.getAttribute(PC);return e?parseInt(e,10):NaN}n=n.parentElement}return 0}function kMe(n,e,t){n.get(bt).createKey(String(e),DMe(t))}function DMe(n){return ZZ(n,e=>{if(typeof e=="object"&&e.$mid===1)return ct.revive(e).toString();if(e instanceof ct)return e.toString()})}qt.registerCommand("_setContext",kMe);qt.registerCommand({id:"getContextKeyInfo",handler(){return[...Ve.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 Ve.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 EMe=class{constructor(e,t){this.key=e,this.data=t,this.incoming=new Map,this.outgoing=new Map}};class _U{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 EMe(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("".concat(t,"\n (-> incoming)[").concat([...i.incoming.keys()].join(", "),"]\n (outgoing ->)[").concat([...i.outgoing.keys()].join(","),"]\n"));return e.join("\n")}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 IMe=!1;class vU 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: \n".concat(e.toString())}}class LI{constructor(e=new xx,t=!1,i,s=IMe){var o;this._services=e,this._strict=t,this._parent=i,this._enableTracing=s,this._activeInstantiations=new Set,this._services.set(_t,this),this._globalGraph=s?(o=i==null?void 0:i._globalGraph)!==null&&o!==void 0?o:new _U(r=>r):void 0}createChild(e){return new LI(e,this._strict,this,this._enableTracing)}invokeFunction(e,...t){const i=qo.traceInvocation(this._enableTracing,e);let s=!1;try{return e({get:r=>{if(s)throw m8("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 '".concat(r,"'"));return a}},...t)}finally{s=!0,i.stop()}}createInstance(e,...t){let i,s;return e instanceof Hc?(i=qo.traceCreation(this._enableTracing,e.ctor),s=this._createInstance(e.ctor,e.staticArguments.concat(t),i)):(i=qo.traceCreation(this._enableTracing,e),s=this._createInstance(e,t,i)),i.stop(),s}_createInstance(e,t=[],i){const s=Ql.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] ".concat(e.name," depends on UNKNOWN service ").concat(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 ".concat(e.name," at position ").concat(r+1," conflicts with ").concat(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 Hc)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 Hc?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 '".concat(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 _U(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 vU(o);for(const c of Ql.getServiceDependencies(l.desc.ctor)){const d=this._getServiceInstanceOrDescriptor(c.id);if(d||this._throwIfStrict("[createInstance] ".concat(e," depends on ").concat(c.id," which is NOT registered."),!0),(s=this._globalGraph)===null||s===void 0||s.insertEdge(String(l.id),String(c.id)),d instanceof Hc){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 vU(o);break}for(const{data:c}of l){if(this._getServiceInstanceOrDescriptor(c.id)instanceof Hc){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 Hc)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 ".concat(t.name))}_createServiceInstance(e,t,i=[],s,o){if(s){const r=new LI(void 0,this._strict,this,this._enableTracing);r._globalGraphImplicitDependency=String(e);const a=new Map,l=new aD(()=>{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 To,a.set(d,f)),(p,_,v)=>{const b=f.push([p,_,v]);return vt(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 qo{static traceInvocation(e,t){return e?new qo(2,t.name||new Error().stack.split("\n").slice(3,4).join("\n")):qo._None}static traceCreation(e,t){return e?new qo(1,t.name):qo._None}constructor(e,t){this.type=e,this.name=t,this._start=Date.now(),this._dep=[]}branch(e,t){const i=new qo(3,e.toString());return this._dep.push([e,t,i]),i}stop(){const e=Date.now()-this._start;qo._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("".concat(l,"CREATES -> ").concat(c));const h=i(o+1,u);h&&a.push(h)}else a.push("".concat(l,"uses -> ").concat(c));return a.join("\n")}const s=["".concat(this.type===1?"CREATE":"CALL"," ").concat(this.name),"".concat(i(1,this)),"DONE, took ".concat(e.toFixed(2),"ms (grand total ").concat(qo._totals.toFixed(2),"ms)")];(e>2||t)&&qo.all.add(s.join("\n"))}}qo.all=new Set;qo._None=new class extends qo{constructor(){super(0,null)}stop(){}branch(){return this}};qo._totals=0;const TMe=new Set([Nt.inMemory,Nt.vscodeSourceControl,Nt.walkThrough,Nt.walkThroughSnippet]);class xMe{constructor(){this._byResource=new Js,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 Js,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:Pt.empty():ct.isUri(e)?(o=(s=this._byResource.get(e))===null||s===void 0?void 0:s.values())!==null&&o!==void 0?o:Pt.empty():Pt.map(Pt.concat(...this._byOwner.values()),r=>r[1])}}class NMe{constructor(e){this.errors=0,this.infos=0,this.warnings=0,this.unknowns=0,this._data=new Js,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(TMe.has(e.scheme))return t;for(const{severity:i}of this._service.read({resource:e}))i===rn.Error?t.errors+=1:i===rn.Warning?t.warnings+=1:i===rn.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 Oh{constructor(){this._onMarkerChanged=new cX({delay:0,merge:Oh._merge}),this.onMarkerChanged=this._onMarkerChanged.event,this._data=new xMe,this._stats=new NMe(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(UZ(i))this._data.delete(t,e)&&this._onMarkerChanged.fire([t]);else{const s=[];for(const o of i){const r=Oh._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=Pt.first(o);r&&(i.push(r.resource),this._data.delete(r.resource,e))}if(io(t)){const o=new Js;for(const{resource:r,marker:a}of t){const l=Oh._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(Oh._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(Oh._accept(l,s)){const c=r.push(l);if(o>0&&c===o)return r}return r}else{const r=this._data.values(i!=null?i:t),a=[];for(const l of r)for(const c of l)if(Oh._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 Js;for(const i of e)for(const s of i)t.set(s,!0);return Array.from(t.keys())}}class AMe extends te{constructor(){super(...arguments),this._configurationModel=new Ys}get configurationModel(){return this._configurationModel}reload(){return this.resetConfigurationModel(),this.configurationModel}getConfigurationDefaultOverrides(){return{}}resetConfigurationModel(){this._configurationModel=new Ys;const e=en.as(wc.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 MS=Wt("audioCue");class At{static register(e){return new At(e.fileName)}constructor(e){this.fileName=e}}At.error=At.register({fileName:"error.mp3"});At.warning=At.register({fileName:"warning.mp3"});At.foldedArea=At.register({fileName:"foldedAreas.mp3"});At.break=At.register({fileName:"break.mp3"});At.quickFixes=At.register({fileName:"quickFixes.mp3"});At.taskCompleted=At.register({fileName:"taskCompleted.mp3"});At.taskFailed=At.register({fileName:"taskFailed.mp3"});At.terminalBell=At.register({fileName:"terminalBell.mp3"});At.diffLineInserted=At.register({fileName:"diffLineInserted.mp3"});At.diffLineDeleted=At.register({fileName:"diffLineDeleted.mp3"});At.diffLineModified=At.register({fileName:"diffLineModified.mp3"});At.chatRequestSent=At.register({fileName:"chatRequestSent.mp3"});At.chatResponsePending=At.register({fileName:"chatResponsePending.mp3"});At.chatResponseReceived1=At.register({fileName:"chatResponseReceived1.mp3"});At.chatResponseReceived2=At.register({fileName:"chatResponseReceived2.mp3"});At.chatResponseReceived3=At.register({fileName:"chatResponseReceived3.mp3"});At.chatResponseReceived4=At.register({fileName:"chatResponseReceived4.mp3"});class MMe{constructor(e){this.randomOneOf=e}}class Jt{static register(e){const t=new MMe("randomOneOf"in e.sound?e.sound.randomOneOf:[e.sound]),i=new Jt(t,e.name,e.settingsKey);return Jt._audioCues.add(i),i}constructor(e,t,i){this.sound=e,this.name=t,this.settingsKey=i}}Jt._audioCues=new Set;Jt.error=Jt.register({name:m("audioCues.lineHasError.name","Error on Line"),sound:At.error,settingsKey:"audioCues.lineHasError"});Jt.warning=Jt.register({name:m("audioCues.lineHasWarning.name","Warning on Line"),sound:At.warning,settingsKey:"audioCues.lineHasWarning"});Jt.foldedArea=Jt.register({name:m("audioCues.lineHasFoldedArea.name","Folded Area on Line"),sound:At.foldedArea,settingsKey:"audioCues.lineHasFoldedArea"});Jt.break=Jt.register({name:m("audioCues.lineHasBreakpoint.name","Breakpoint on Line"),sound:At.break,settingsKey:"audioCues.lineHasBreakpoint"});Jt.inlineSuggestion=Jt.register({name:m("audioCues.lineHasInlineSuggestion.name","Inline Suggestion on Line"),sound:At.quickFixes,settingsKey:"audioCues.lineHasInlineSuggestion"});Jt.terminalQuickFix=Jt.register({name:m("audioCues.terminalQuickFix.name","Terminal Quick Fix"),sound:At.quickFixes,settingsKey:"audioCues.terminalQuickFix"});Jt.onDebugBreak=Jt.register({name:m("audioCues.onDebugBreak.name","Debugger Stopped on Breakpoint"),sound:At.break,settingsKey:"audioCues.onDebugBreak"});Jt.noInlayHints=Jt.register({name:m("audioCues.noInlayHints","No Inlay Hints on Line"),sound:At.error,settingsKey:"audioCues.noInlayHints"});Jt.taskCompleted=Jt.register({name:m("audioCues.taskCompleted","Task Completed"),sound:At.taskCompleted,settingsKey:"audioCues.taskCompleted"});Jt.taskFailed=Jt.register({name:m("audioCues.taskFailed","Task Failed"),sound:At.taskFailed,settingsKey:"audioCues.taskFailed"});Jt.terminalCommandFailed=Jt.register({name:m("audioCues.terminalCommandFailed","Terminal Command Failed"),sound:At.error,settingsKey:"audioCues.terminalCommandFailed"});Jt.terminalBell=Jt.register({name:m("audioCues.terminalBell","Terminal Bell"),sound:At.terminalBell,settingsKey:"audioCues.terminalBell"});Jt.notebookCellCompleted=Jt.register({name:m("audioCues.notebookCellCompleted","Notebook Cell Completed"),sound:At.taskCompleted,settingsKey:"audioCues.notebookCellCompleted"});Jt.notebookCellFailed=Jt.register({name:m("audioCues.notebookCellFailed","Notebook Cell Failed"),sound:At.taskFailed,settingsKey:"audioCues.notebookCellFailed"});Jt.diffLineInserted=Jt.register({name:m("audioCues.diffLineInserted","Diff Line Inserted"),sound:At.diffLineInserted,settingsKey:"audioCues.diffLineInserted"});Jt.diffLineDeleted=Jt.register({name:m("audioCues.diffLineDeleted","Diff Line Deleted"),sound:At.diffLineDeleted,settingsKey:"audioCues.diffLineDeleted"});Jt.diffLineModified=Jt.register({name:m("audioCues.diffLineModified","Diff Line Modified"),sound:At.diffLineModified,settingsKey:"audioCues.diffLineModified"});Jt.chatRequestSent=Jt.register({name:m("audioCues.chatRequestSent","Chat Request Sent"),sound:At.chatRequestSent,settingsKey:"audioCues.chatRequestSent"});Jt.chatResponseReceived=Jt.register({name:m("audioCues.chatResponseReceived","Chat Response Received"),settingsKey:"audioCues.chatResponseReceived",sound:{randomOneOf:[At.chatResponseReceived1,At.chatResponseReceived2,At.chatResponseReceived3,At.chatResponseReceived4]}});Jt.chatResponsePending=Jt.register({name:m("audioCues.chatResponsePending","Chat Response Pending"),sound:At.chatResponsePending,settingsKey:"audioCues.chatResponsePending"});class RMe extends te{constructor(e,t=[]){super(),this.logger=new gbe([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 vte=[];function Jx(n){vte.push(n)}function PMe(){return vte.slice(0)}var xg=globalThis&&globalThis.__decorate||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},ys=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},ob=globalThis&&globalThis.__awaiter||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 OMe{constructor(e){this.disposed=!1,this.model=e,this._onWillDispose=new j}get textEditorModel(){return this.model}dispose(){this.disposed=!0,this._onWillDispose.fire()}}let W4=class{constructor(e){this.modelService=e}createModelReference(e){const t=this.modelService.getModel(e);return t?Promise.resolve(new W_e(new OMe(t))):Promise.reject(new Error("Model not found"))}};W4=xg([ys(0,Zi)],W4);class eN{show(){return eN.NULL_PROGRESS_RUNNER}showWhile(e,t){return ob(this,void 0,void 0,function*(){yield e})}}eN.NULL_PROGRESS_RUNNER={done:()=>{},total:()=>{},worked:()=>{}};class FMe{withProgress(e,t,i){return t({report:()=>{}})}}class BMe{constructor(){this.isExtensionDevelopment=!1,this.isBuilt=!1}}class WMe{confirm(e){return ob(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+"\n\n"+t),window.confirm(i)}prompt(e){var t,i;return ob(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 ob(this,void 0,void 0,function*(){yield this.prompt({type:bn.Error,message:e,detail:t})})}}class cy{info(e){return this.notify({severity:bn.Info,message:e})}warn(e){return this.notify({severity:bn.Warning,message:e})}error(e){return this.notify({severity:bn.Error,message:e})}notify(e){switch(e.severity){case bn.Error:console.error(e.message);break;case bn.Warning:console.warn(e.message);break;default:console.log(e.message);break}return cy.NO_OP}prompt(e,t,i,s){return cy.NO_OP}status(e,t){return te.None}}cy.NO_OP=new zEe;let V4=class{constructor(e){this._onWillExecuteCommand=new j,this._onDidExecuteCommand=new j,this.onDidExecuteCommand=this._onDidExecuteCommand.event,this._instantiationService=e}executeCommand(e,...t){const i=qt.getCommand(e);if(!i)return Promise.reject(new Error("command '".concat(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)}}};V4=xg([ys(0,_t)],V4);let Ub=class extends XIe{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 be;g.add(ce(f,Pe.KEY_DOWN,p=>{const _=new Oi(p);this._dispatch(_,_.target)&&(_.preventDefault(),_.stopPropagation())})),g.add(ce(f,Pe.KEY_UP,p=>{const _=new Oi(p);this._singleModifierDispatch(_,_.target)&&_.preventDefault()})),this._domNodeListeners.push(new VMe(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 rl(qt.registerCommand(e,i),this.addDynamicKeybindings([{keybinding:t,command:e,when:s}]))}addDynamicKeybindings(e){const t=e.map(i=>{var s;return{keybinding:$P(i.keybinding,$r),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(),vt(()=>{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 Tz(void 0,o.command,o.commandArgs,r,t,null,!1);else{const l=Yw.resolveKeybinding(a,$r);for(const c of l)i[s++]=new Tz(c,o.command,o.commandArgs,r,t,null,!1)}}return i}resolveKeyboardEvent(e){const t=new Gu(e.ctrlKey,e.shiftKey,e.altKey,e.metaKey,e.keyCode);return new Yw([t],$r)}};Ub=xg([ys(0,bt),ys(1,gn),ys(2,ra),ys(3,Nn),ys(4,aa),ys(5,ai)],Ub);class VMe extends te{constructor(e,t){super(),this.domNode=e,this._register(t)}}function bU(n){return n&&typeof n=="object"&&(!n.overrideIdentifier||typeof n.overrideIdentifier=="string")&&(!n.resource||n.resource instanceof ct)}class bte{constructor(){this._onDidChangeConfiguration=new j,this.onDidChangeConfiguration=this._onDidChangeConfiguration.event;const e=new AMe;this._configuration=new Rx(e.reload(),new Ys,new Ys,new Ys),e.dispose()}getValue(e,t){const i=typeof e=="string"?e:void 0,s=bU(e)?e:bU(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 qIe({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 H4=class{constructor(e,t,i){this.configurationService=e,this.modelService=t,this.languageService=i,this._onDidChangeConfiguration=new j,this.configurationService.onDidChangeConfiguration(s=>{this._onDidChangeConfiguration.fire({affectedKeys:s.affectedKeys,affectsConfiguration:(o,r)=>s.affectsConfiguration(r)})})}getValue(e,t,i){const s=Y.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)}};H4=xg([ys(0,zt),ys(1,Zi),ys(2,qi)],H4);let $4=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:Co||Kt?"\n":"\r\n"}};$4=xg([ys(0,zt)],$4);class HMe{publicLog2(){}}class dy{constructor(){const e=ct.from({scheme:dy.SCHEME,authority:"model",path:"/"});this.workspace={id:dee,folders:[new hTe({uri:e,name:"",index:0})]}}getWorkspace(){return this.workspace}getWorkspaceFolder(e){return e&&e.scheme===dy.SCHEME?this.workspace.folders[0]:null}}dy.SCHEME="inmemory";function kI(n,e,t){if(!e||!(n instanceof bte))return;const i=[];Object.keys(e).forEach(s=>{$Ie(s)&&i.push(["editor.".concat(s),e[s]]),t&&zIe(s)&&i.push(["diffEditor.".concat(s),e[s]])}),i.length>0&&n.updateValues(i)}let z4=class{constructor(e){this._modelService=e}hasPreviewHandler(){return!1}apply(e,t){return ob(this,void 0,void 0,function*(){const i=Array.isArray(e)?e:P9.convert(e),s=new Map;for(const a of i){if(!(a instanceof Ou))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(Yi.replaceMove(I.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:sm(qO.bulkEditServiceSummary,o,r),isApplied:o>0}})}};z4=xg([ys(0,Zi)],z4);class $Me{getUriLabel(e,t){return e.scheme==="file"?e.fsPath:e.path}getUriBasenameLabel(e){return Ra(e)}}let U4=class extends GO{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)}};U4=xg([ys(0,x0),ys(1,ai)],U4);class zMe{constructor(){this._neverEmitter=new j,this.onDidChangeTrust=this._neverEmitter.event}isWorkspaceTrusted(){return!0}}class UMe extends Qw{constructor(){super()}}class jMe extends RMe{constructor(){super(new fbe)}}let j4=class extends h4{constructor(e,t,i,s,o,r){super(e,t,i,s,o,r),this.configure({blockMouse:!1})}};j4=xg([ys(0,ra),ys(1,Nn),ys(2,rh),ys(3,Di),ys(4,Vd),ys(5,bt)],j4);class KMe{playAudioCue(e,t){return ob(this,void 0,void 0,function*(){})}}Gt(zt,bte,0);Gt(j8,H4,0);Gt(NQ,$4,0);Gt(hm,dy,0);Gt(Fb,$Me,0);Gt(ra,HMe,0);Gt(LS,WMe,0);Gt(A9,BMe,0);Gt(Nn,cy,0);Gt(zd,Oh,0);Gt(qi,UMe,0);Gt(la,gMe,0);Gt(aa,jMe,0);Gt(Zi,pI,0);Gt(X8,_4,0);Gt(bt,B4,0);Gt(cee,FMe,0);Gt(Tg,eN,0);Gt(yl,eNe,0);Gt(Sl,nO,0);Gt(kS,z4,0);Gt(uee,zMe,0);Gt(sr,W4,0);Gt(oh,M4,0);Gt($a,mAe,0);Gt(gn,V4,0);Gt(Di,Ub,0);Gt(yc,N4,0);Gt(rh,U4,0);Gt(Ir,m4,0);Gt(ch,F4,0);Gt(Cl,j4,0);Gt(Vd,R4,0);Gt(MS,KMe,0);var mt;(function(n){const e=new xx;for(const[l,c]of pH())e.set(l,c);const t=new LI(e,!0);e.set(_t,t);function i(l){s||r({});const c=e.get(l);if(!c)throw new Error("Missing service "+l);return c instanceof Hc?t.invokeFunction(d=>d.get(l)):c}n.get=i;let s=!1;const o=new j;function r(l){if(s)return t;s=!0;for(const[d,u]of pH())e.get(d)||e.set(d,u);for(const d in l)if(l.hasOwnProperty(d)){const u=Wt(d);e.get(u)instanceof Hc&&e.set(u,l[d])}const c=PMe();for(const d of c)try{t.createInstance(d)}catch(u){Dt(u)}return o.fire(),t}n.initialize=r;function a(l){if(s)return l();const c=new be,d=c.add(o.event(()=>{d.dispose(),c.add(l())}));return c}n.withServices=a})(mt||(mt={}));let qMe;function Bu(){return qMe}let Cte;function GMe(n){Cte=n}class wte{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 Cte({owner:i,debugName:()=>{const o=s_(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"".concat(this.debugName,".").concat(a[2]);if(!i)return"".concat(this.debugName," (mapped)")}},o=>s(this.read(o),o))}}class RS extends wte{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 Gi(n,e){const t=new yte(n,e);try{n(t)}finally{t.finish()}}function K4(n,e,t){n?e(n):Gi(e,t)}class yte{constructor(e,t){var i;this._fn=e,this._getDebugName=t,this.updatingObservers=[],(i=Bu())===null||i===void 0||i.handleBeginTransaction(this)}getDebugName(){return this._getDebugName?this._getDebugName():s_(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=Bu())===null||e===void 0||e.handleEndTransaction()}}function v7(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=s_(e),s!==void 0))return s;if(t!==void 0){for(const o in t)if(t[o]===i)return o}}function s_(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 Pi(n,e){return typeof n=="string"?new q4(void 0,n,e):new q4(n,void 0,e)}class q4 extends RS{get debugName(){var e;return(e=v7(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 yte(()=>{},()=>"Setting ".concat(this.debugName)));try{const r=this._value;this._setValue(e),(s=Bu())===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"".concat(this.debugName,": ").concat(this._value)}_setValue(e){this._value=e}}function DI(n,e){return typeof n=="string"?new CU(void 0,n,e):new CU(n,void 0,e)}class CU extends q4{_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 uy=(n,e)=>n===e;function Ut(n,e){return e!==void 0?new fy(n,void 0,e,void 0,void 0,void 0,uy):new fy(void 0,void 0,n,void 0,void 0,void 0,uy)}function wU(n,e){var t;return new fy(n.owner,n.debugName,e,void 0,void 0,void 0,(t=n.equalityComparer)!==null&&t!==void 0?t:uy)}function YMe(n,e){var t;return new fy(n.owner,n.debugName,e,n.createEmptyChangeSummary,n.handleChange,void 0,(t=n.equalityComparer)!==null&&t!==void 0?t:uy)}function hy(n,e){let t,i;e===void 0?(t=n,i=void 0):(i=n,t=e);const s=new be;return new fy(i,()=>{var o;return(o=s_(t))!==null&&o!==void 0?o:"(anonymous)"},o=>(s.clear(),t(o,s)),void 0,void 0,()=>s.dispose(),uy)}GMe(Ut);class fy extends RS{get debugName(){var e;return(e=v7(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=Bu())===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=Bu())===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<".concat(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 Rn}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 b7(n,e){return new iN(n.debugName,e,void 0,void 0)}function xi(n){return new iN(void 0,n,void 0,void 0)}function tN(n,e){return new iN(n.debugName,e,n.createEmptyChangeSummary,n.handleChange)}function pr(n){const e=new be,t=b7({debugName:()=>s_(n)||"(anonymous)"},i=>{e.clear(),n(i,e)});return vt(()=>{t.dispose(),e.dispose()})}class iN{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=s_(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=Bu())===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=Bu())===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=Bu())===null||i===void 0||i.handleAutorunFinished(this);for(const o of this.dependenciesToBeRemoved)o.removeObserver(this);this.dependenciesToBeRemoved.clear()}}toString(){return"Autorun<".concat(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--,Cw(()=>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=iN})(xi||(xi={}));function EI(n){return new ZMe(n)}class ZMe extends wte{constructor(e){super(),this.value=e}get debugName(){return this.toString()}get(){return this.value}addObserver(e){}removeObserver(e){}toString(){return"Const: ".concat(this.value)}}function XMe(n,e){return new Promise(t=>{let i=!1,s=!1;const o=xi(r=>{const a=n.read(r);e(a)&&(i?o.dispose():s=!0,t(a))});i=!0,s&&o.dispose()})}function ks(n,e){return new Ste(n,e)}class Ste extends RS{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=Bu())===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&&Gi(a=>{for(const l of this.observers)a.updateObserver(l,this),l.handleChange(this,void 0)},()=>{const a=this.getDebugName();return"Event fired"+(a?": ".concat(a):"")}),this.hasValue=!0)}}getDebugName(){return s_(this._getValue)}get debugName(){const e=this.getDebugName();return"From Event"+(e?": ".concat(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=Ste})(ks||(ks={}));function Vr(n,e){return new QMe(n,e)}class QMe extends RS{constructor(e,t){super(),this.debugName=e,this.event=t,this.handleEvent=()=>{Gi(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 Lte(n){return typeof n=="string"?new yU(n):new yU(void 0,n)}class yU extends RS{get debugName(){var e;return(e=v7(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){Gi(i=>{this.trigger(i,t)},()=>"Trigger signal ".concat(this.debugName));return}for(const i of this.observers)e.updateObserver(i,this),i.handleChange(this,t)}get(){}}function gy(n){const e=new JMe(!0);return n.addObserver(e),n.reportChanges(),vt(()=>{n.removeObserver(e)})}class JMe{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 kte(){return!!hX.VSCODE_DEV}function eRe(n){if(kte()){const e=tRe();return e.add(n),{dispose(){e.delete(n)}}}else return{dispose(){}}}function tRe(){ik||(ik=new Set);const n=globalThis;return n.$hotReload_applyNewExports||(n.$hotReload_applyNewExports=e=>{for(const t of ik){const i=t(e);if(i)return i}}),ik}let ik;function iRe(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 ".concat(e.debugName)},s=>{const o=e.read(s);i.set(o)})),t.add({dispose:()=>{i.clear()}}),t}function nk(n,e){return n.appendChild(e),vt(()=>{n.removeChild(e)})}class nRe extends te{get width(){return this._width}get height(){return this._height}constructor(e,t){super(),this.elementSizeObserver=this._register(new BQ(e,t)),this._width=Pi(this,this.elementSizeObserver.getWidth()),this._height=Pi(this,this.elementSizeObserver.getHeight()),this._register(this.elementSizeObserver.onDidChange(i=>Gi(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 SU(n,e){let t=n.get(),i=t,s=t;const o=Pi("animatedValue",t);let r=-1;const a=300;let l;e.add(tN({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(sRe(d,i,t-i,a)),d{this._actualTop.set(i,void 0)},this.onComputedHeight=i=>{this._actualHeight.set(i,void 0)}}}class nN{constructor(e,t){this._editor=e,this._domElement=t,this._overlayWidgetId="managedOverlayWidget-".concat(nN._counter++),this._overlayWidget={getId:()=>this._overlayWidgetId,getDomNode:()=>this._domElement,getPosition:()=>null},this._editor.addOverlayWidget(this._overlayWidget)}dispose(){this._editor.removeOverlayWidget(this._overlayWidget)}}nN._counter=0;function If(n,e){return xi(t=>{for(let[i,s]of Object.entries(e))s&&typeof s=="object"&&"read"in s&&(s=s.read(t)),typeof s=="number"&&(s="".concat(s,"px")),i=i.replace(/[A-Z]/g,o=>"-"+o.toLowerCase()),n.style[i]=s})}function Fh(n,e){return oRe([n],e),n}function oRe(n,e){kte()&&Vr("reload",i=>eRe(s=>{if([...Object.values(s)].some(o=>n.includes(o)))return o=>(i(void 0),!0)})).read(e)}function xI(n,e,t){const i=new be,s=[];return i.add(xi(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(tN({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 rRe extends Tn{dispose(){super.dispose(!0)}}var C7=globalThis&&globalThis.__decorate||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},w7=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},aRe=globalThis&&globalThis.__awaiter||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 lRe=Sn("diff-review-insert",Me.add,m("accessibleDiffViewerInsertIcon","Icon for 'Insert' in accessible diff viewer.")),cRe=Sn("diff-review-remove",Me.remove,m("accessibleDiffViewerRemoveIcon","Icon for 'Remove' in accessible diff viewer.")),dRe=Sn("diff-review-close",Me.close,m("accessibleDiffViewerCloseIcon","Icon for 'Close' in accessible diff viewer."));let af=class extends te{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=hy(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(G4,this._diffs,this._editors,this._setVisible,this._canClose)),g=u.add(this._instantiationService.createInstance(Y4,this._parentNode,f,this._width,this._height,this._editors));return{model:f,view:g}}),this._register(gy(this.model))}next(){Gi(e=>{const t=this._visible.get();this._setVisible(!0,e),t&&this.model.get().model.nextGroup(e)})}prev(){Gi(e=>{this._setVisible(!0,e),this.model.get().model.previousGroup(e)})}close(){Gi(e=>{this._setVisible(!1,e)})}};af._ttPolicy=sh("diffReview",{createHTML:n=>n});af=C7([w7(8,_t)],af);let G4=class extends te{constructor(e,t,i,s,o){super(),this._diffs=e,this._editors=t,this._setVisible=i,this.canClose=s,this._audioCueService=o,this._groups=Pi(this,[]),this._currentGroupIdx=Pi(this,0),this._currentElementIdx=Pi(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(xi(r=>{const a=this._diffs.read(r);if(!a){this._groups.set([],void 0);return}const l=uRe(a,this._editors.original.getModel().getLineCount(),this._editors.modified.getModel().getLineCount());Gi(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)===ko.Deleted?this._audioCueService.playAudioCue(Jt.diffLineDeleted,{source:"accessibleDiffViewer.currentElementChanged"}):(a==null?void 0:a.type)===ko.Added&&this._audioCueService.playAudioCue(Jt.diffLineInserted,{source:"accessibleDiffViewer.currentElementChanged"})})),this._register(xi(r=>{var a;const l=this.currentElement.read(r);if(l&&l.type!==ko.Header){const c=(a=l.modifiedLineNumber)!==null&&a!==void 0?a:l.diff.modified.startLineNumber;this._editors.modified.setSelection(I.fromPositions(new Y(c,1)))}}))}_goToGroupDelta(e,t){const i=this.groups.get();!i||i.length<=1||K4(t,s=>{this._currentGroupIdx.set(Bt.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||Gi(i=>{this._currentElementIdx.set(Bt.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&&Gi(s=>{this._currentElementIdx.set(i,s)})}revealCurrentElementInEditor(){this._setVisible(!1,void 0);const e=this.currentElement.get();e&&(e.type===ko.Deleted?(this._editors.original.setSelection(I.fromPositions(new Y(e.originalLineNumber,1))),this._editors.original.revealLine(e.originalLineNumber),this._editors.original.focus()):(e.type!==ko.Header&&(this._editors.modified.setSelection(I.fromPositions(new Y(e.modifiedLineNumber,1))),this._editors.modified.revealLine(e.modifiedLineNumber)),this._editors.modified.focus()))}close(){this._setVisible(!1,void 0),this._editors.modified.focus()}};G4=C7([w7(4,MS)],G4);const m1=3;function uRe(n,e,t){const i=[];for(const s of $Z(n,(o,r)=>r.modified.startLineNumber-o.modified.endLineNumberExclusive<2*m1)){const o=[];o.push(new fRe);const r=new Ht(Math.max(1,s[0].original.startLineNumber-m1),Math.min(s[s.length-1].original.endLineNumberExclusive+m1,e+1)),a=new Ht(Math.max(1,s[0].modified.startLineNumber-m1),Math.min(s[s.length-1].modified.endLineNumberExclusive+m1,t+1));zZ(s,(d,u)=>{const h=new Ht(d?d.original.endLineNumberExclusive:r.startLineNumber,u?u.original.startLineNumber:r.endLineNumberExclusive),f=new Ht(d?d.modified.endLineNumberExclusive:a.startLineNumber,u?u.modified.startLineNumber:a.endLineNumberExclusive);h.forEach(g=>{o.push(new mRe(g,f.startLineNumber+(g-h.startLineNumber)))}),u&&(u.original.forEach(g=>{o.push(new gRe(u,g))}),u.modified.forEach(g=>{o.push(new pRe(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 hRe(new kd(l,c),o))}return i}var ko;(function(n){n[n.Header=0]="Header",n[n.Unchanged=1]="Unchanged",n[n.Deleted=2]="Deleted",n[n.Added=3]="Added"})(ko||(ko={}));class hRe{constructor(e,t){this.range=e,this.lines=t}}class fRe{constructor(){this.type=ko.Header}}class gRe{constructor(e,t){this.diff=e,this.originalLineNumber=t,this.type=ko.Deleted,this.modifiedLineNumber=void 0}}class pRe{constructor(e,t){this.diff=e,this.modifiedLineNumber=t,this.type=ko.Added,this.originalLineNumber=void 0}}class mRe{constructor(e,t){this.originalLineNumber=e,this.modifiedLineNumber=t,this.type=ko.Unchanged}}let Y4=class extends te{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 Pa(a)),this._register(xi(l=>{this._actionBar.clear(),this._model.canClose.read(l)&&this._actionBar.push(new Ro("diffreview.close",m("label.close","Close"),"close-diff-review "+dt.asClassName(dRe),!0,()=>aRe(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 bS(this._content,{})),Es(this.domNode,this._scrollbar.getDomNode(),a),this._register(vt(()=>{Es(this.domNode)})),this._register(If(this.domNode,{width:this._width,height:this._height})),this._register(If(this._content,{width:this._width,height:this._height})),this._register(pr((l,c)=>{this._model.currentGroup.read(l),this._render(c)})),this._register(In(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.")),Vs(s,i.get(50)),Es(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===ko.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),C=b(p.original.length),w=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,C,p.modified.startLineNumber,w));const y=document.createElement("div");y.className="diff-review-cell diff-review-summary",y.appendChild(document.createTextNode("".concat(_+1,"/").concat(v,": @@ -").concat(p.original.startLineNumber,",").concat(p.original.length," +").concat(p.modified.startLineNumber,",").concat(p.modified.length," @@"))),g.appendChild(y),h=g}else h=this._createRow(u,c,this._width.get(),t,o,a,i,r,l);s.appendChild(h);const f=Ut(g=>this._model.currentElement.read(g)===u);e.add(xi(g=>{const p=f.read(g);h.tabIndex=p?0:-1,p&&h.focus()})),e.add(ce(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 ko.Added:g="diff-review-row line-insert",p=" char-insert",v=lRe;break;case ko.Deleted:g="diff-review-row line-delete",p=" char-delete",v=cRe;break}const b=document.createElement("div");b.style.minWidth=i+"px",b.className=g,b.setAttribute("role","listitem"),b.ariaLevel="";const C=document.createElement("div");C.className="diff-review-cell",C.style.height="".concat(t,"px"),b.appendChild(C);const w=document.createElement("span");w.style.width=u+"px",w.style.minWidth=u+"px",w.className="diff-review-line-number"+p,e.originalLineNumber!==void 0?w.appendChild(document.createTextNode(String(e.originalLineNumber))):w.innerText=" ",C.appendChild(w);const y=document.createElement("span");y.style.width=f+"px",y.style.minWidth=f+"px",y.style.paddingRight="10px",y.className="diff-review-line-number"+p,e.modifiedLineNumber!==void 0?y.appendChild(document.createTextNode(String(e.modifiedLineNumber))):y.innerText=" ",C.appendChild(y);const L=document.createElement("span");if(L.className=_,v){const D=document.createElement("span");D.className=dt.asClassName(v),D.innerText="  ",L.appendChild(D)}else L.innerText="  ";C.appendChild(L);let S;if(e.modifiedLineNumber!==void 0){let D=this._getLineHtml(l,a,c.tabSize,e.modifiedLineNumber,this._languageService.languageIdCodec);af._ttPolicy&&(D=af._ttPolicy.createHTML(D)),C.insertAdjacentHTML("beforeend",D),S=l.getLineContent(e.modifiedLineNumber)}else{let D=this._getLineHtml(o,s,r.tabSize,e.originalLineNumber,this._languageService.languageIdCodec);af._ttPolicy&&(D=af._ttPolicy.createHTML(D)),C.insertAdjacentHTML("beforeend",D),S=o.getLineContent(e.originalLineNumber)}S.length===0&&(S=m("blankLine","blank"));let k="";switch(e.type){case ko.Unchanged:e.originalLineNumber===e.modifiedLineNumber?k=m({key:"unchangedLine",comment:["The placeholders are contents of the line and should not be translated."]},"{0} unchanged line {1}",S,e.originalLineNumber):k=m("equalLine","{0} original line {1} modified line {2}",S,e.originalLineNumber,e.modifiedLineNumber);break;case ko.Added:k=m("insertLine","+ {0} modified line {1}",S,e.modifiedLineNumber);break;case ko.Deleted:k=m("deleteLine","- {0} original line {1}",S,e.originalLineNumber);break}return b.setAttribute("aria-label",k),b}_getLineHtml(e,t,i,s,o){const r=e.getLineContent(s),a=t.get(50),l=ts.createEmpty(r,o),c=Jr.isBasicASCII(r,e.mightContainNonBasicASCII()),d=Jr.containsRTL(r,c,e.mightContainRTL());return _x(new Eg(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)!==Br.OFF,null)).html}};Y4=C7([w7(5,qi)],Y4);const _Re=Sn("diff-insert",Me.add,m("diffInsertIcon","Line decoration for inserts in the diff editor.")),Ete=Sn("diff-remove",Me.remove,m("diffRemoveIcon","Line decoration for removals in the diff editor.")),LU=kt.register({className:"line-insert",description:"line-insert",isWholeLine:!0,linesDecorationsClassName:"insert-sign "+dt.asClassName(_Re),marginClassName:"gutter-insert"}),kU=kt.register({className:"line-delete",description:"line-delete",isWholeLine:!0,linesDecorationsClassName:"delete-sign "+dt.asClassName(Ete),marginClassName:"gutter-delete"}),DU=kt.register({className:"line-insert",description:"line-insert",isWholeLine:!0,marginClassName:"gutter-insert"}),EU=kt.register({className:"line-delete",description:"line-delete",isWholeLine:!0,marginClassName:"gutter-delete"}),IU=kt.register({className:"char-insert",description:"char-insert",shouldFillLineOnLineBreak:!0}),vRe=kt.register({className:"char-insert",description:"char-insert",isWholeLine:!0}),bRe=kt.register({className:"char-insert diff-range-empty",description:"char-insert diff-range-empty"}),Z4=kt.register({className:"char-delete",description:"char-delete",shouldFillLineOnLineBreak:!0}),CRe=kt.register({className:"char-delete",description:"char-delete",isWholeLine:!0}),wRe=kt.register({className:"char-delete diff-range-empty",description:"char-delete diff-range-empty"}),yRe=kt.register({description:"diff-editor-arrow-revert-change",glyphMarginHoverMessage:new Bs(void 0,{isTrusted:!0,supportThemeIcons:!0}).appendMarkdown(m("revertChangeHoverMessage","Click to revert change")),glyphMarginClassName:"arrow-revert-change "+dt.asClassName(Me.arrowRight),zIndex:10001});class Tf extends te{constructor(e,t,i,s,o){super(),this._rootElement=e,this._diffModel=t,this._originalEditorLayoutInfo=i,this._modifiedEditorLayoutInfo=s,this._editors=o,this._originalScrollTop=ks(this._editors.original.onDidScrollChange,()=>this._editors.original.getScrollTop()),this._modifiedScrollTop=ks(this._editors.modified.onDidScrollChange,()=>this._editors.modified.getScrollTop()),this._viewZonesChanged=Vr("onDidChangeViewZones",this._editors.modified.onDidChangeViewZones),this.width=Pi(this,0),this._modifiedViewZonesChangedSignal=Vr("modified.onDidChangeViewZones",this._editors.modified.onDidChangeViewZones),this._originalViewZonesChangedSignal=Vr("original.onDidChangeViewZones",this._editors.original.onDidChangeViewZones),this._state=hy((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 C=_.map(x=>{function A(de,_e){const ie=_e.getTopForLineNumber(de.startLineNumber,!0),ne=_e.getTopForLineNumber(de.endLineNumberExclusive,!0);return(ie+ne)/2}const T=A(x.lineRangeMapping.original,this._editors.original),P=this._originalScrollTop.read(h),W=A(x.lineRangeMapping.modified,this._editors.modified),$=this._modifiedScrollTop.read(h),X=T-P,J=W-$,Q=Math.min(T,W),le=Math.max(T,W);return{range:new Bt(Q,le),from:X,to:J,fromWithoutScroll:T,toWithoutScroll:W,move:x}});C.sort(kme(Sa(x=>x.fromWithoutScroll>x.toWithoutScroll,Dme),Sa(x=>x.fromWithoutScroll>x.toWithoutScroll?x.fromWithoutScroll:-x.toWithoutScroll,Mu)));const w=y7.compute(C.map(x=>x.range)),y=10,L=v.verticalScrollbarWidth,S=(w.getTrackCount()-1)*10+y*2,k=L+S+(b.contentLeft-Tf.movedCodeBlockPadding);let D=0;for(const x of C){const A=w.getTrack(D),T=L+y+A*10,P=15,W=15,$=k,X=b.glyphMarginWidth+b.lineNumbersWidth,J=18,Q=document.createElementNS("http://www.w3.org/2000/svg","rect");Q.classList.add("arrow-rectangle"),Q.setAttribute("x","".concat($-X)),Q.setAttribute("y","".concat(x.to-J/2)),Q.setAttribute("width","".concat(X)),Q.setAttribute("height","".concat(J)),this._element.appendChild(Q);const le=document.createElementNS("http://www.w3.org/2000/svg","g"),de=document.createElementNS("http://www.w3.org/2000/svg","path");de.setAttribute("d","M 0 ".concat(x.from," L ").concat(T," ").concat(x.from," L ").concat(T," ").concat(x.to," L ").concat($-W," ").concat(x.to)),de.setAttribute("fill","none"),le.appendChild(de);const _e=document.createElementNS("http://www.w3.org/2000/svg","polygon");_e.classList.add("arrow"),f.add(xi(ie=>{de.classList.toggle("currentMove",x.move===p.activeMovedText.read(ie)),_e.classList.toggle("currentMove",x.move===p.activeMovedText.read(ie))})),_e.setAttribute("points","".concat($-W,",").concat(x.to-P/2," ").concat($,",").concat(x.to," ").concat($-W,",").concat(x.to+P/2)),le.appendChild(_e),this._element.appendChild(le),D++}this.width.set(S,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(vt(()=>this._element.remove())),this._register(xi(h=>{const f=this._originalEditorLayoutInfo.read(h),g=this._modifiedEditorLayoutInfo.read(h);!f||!g||(this._element.style.left="".concat(f.width-f.verticalScrollbarWidth,"px"),this._element.style.height="".concat(f.height,"px"),this._element.style.width="".concat(f.verticalScrollbarWidth+f.contentLeft-Tf.movedCodeBlockPadding+this.width.read(h),"px"))})),this._register(gy(this._state));const r=Ut(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 TI(EI(p.lineRangeMapping.original.startLineNumber-1),18),modified:new TI(EI(p.lineRangeMapping.modified.startLineNumber-1),18)})):[]});this._register(xI(this._editors.original,r.map(h=>h.map(f=>f.original)))),this._register(xI(this._editors.modified,r.map(h=>h.map(f=>f.modified)))),this._register(pr((h,f)=>{const g=r.read(h);for(const p of g)f.add(new TU(this._editors.original,p.original,p.move,"original",this._diffModel.get())),f.add(new TU(this._editors.modified,p.modified,p.move,"modified",this._diffModel.get()))}));const a=ks(this._editors.original.onDidChangeCursorPosition,()=>this._editors.original.getPosition()),l=ks(this._editors.modified.onDidChangeCursorPosition,()=>this._editors.modified.getPosition()),c=Vr("original.onDidFocusEditorWidget",h=>this._editors.original.onDidFocusEditorWidget(()=>setTimeout(()=>h(void 0),0))),d=Vr("modified.onDidFocusEditorWidget",h=>this._editors.modified.onDidFocusEditorWidget(()=>setTimeout(()=>h(void 0),0)));let u="modified";this._register(tN({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)}))}}Tf.movedCodeBlockPadding=4;class y7{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=V1e(t,Sa(a=>a.intersectWithRangeLength(s),Mu)):(o=t.length,t.push(new $8))),t[o].addRange(s),i.push(o)}return new y7(t.length,i)}constructor(e,t){this._trackCount=e,this.trackPerLineIdx=t}getTrack(e){return this.trackPerLineIdx[e]}getTrackCount(){return this._trackCount}}class TU extends Dte{constructor(e,t,i,s,o){const r=vs("div.diff-hidden-lines-widget");super(e,t,r.root),this._editor=e,this._move=i,this._kind=s,this._diffModel=o,this._nodes=vs("div.diff-moved-code-block",{style:{marginRight:"4px"}},[vs("div.text-content@textContent"),vs("div.action-bar@actionBar")]),r.root.appendChild(this._nodes.root);const a=ks(this._editor.onDidLayoutChange,()=>this._editor.getLayoutInfo());this._register(If(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 Pa(this._nodes.actionBar,{highlightToggledItems:!0})),d=new Ro("",l,"",!1);c.push(d,{icon:!1,label:!0});const u=new Ro("","Compare",dt.asClassName(Me.compareChanges),!0,()=>{this._editor.focus(),this._diffModel.movedTextToCompare.set(this._diffModel.movedTextToCompare.get()===i?void 0:this._move,void 0)});this._register(xi(h=>{const f=this._diffModel.movedTextToCompare.read(h)===i;u.checked=f})),c.push(u,{icon:!1,label:!0})}}class SRe extends te{constructor(e,t,i){super(),this._editors=e,this._diffModel=t,this._options=i,this._decorations=Ut(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?kU:EU}),f.lineRangeMapping.modified.isEmpty||u.push({range:f.lineRangeMapping.modified.toInclusiveRange(),options:l?LU:DU}),f.lineRangeMapping.modified.isEmpty||f.lineRangeMapping.original.isEmpty)f.lineRangeMapping.original.isEmpty||d.push({range:f.lineRangeMapping.original.toInclusiveRange(),options:CRe}),f.lineRangeMapping.modified.isEmpty||u.push({range:f.lineRangeMapping.modified.toInclusiveRange(),options:vRe});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?wRe:Z4}),f.lineRangeMapping.modified.contains(g.modifiedRange.startLineNumber)&&u.push({range:g.modifiedRange,options:g.modifiedRange.isEmpty()&&c?bRe:IU});!f.lineRangeMapping.modified.isEmpty&&this._options.shouldRenderRevertArrows.read(s)&&!a&&u.push({range:I.fromPositions(new Y(f.lineRangeMapping.modified.startLineNumber,1)),options:yRe})}if(a)for(const f of a.changes){const g=f.original.toInclusiveRange();g&&d.push({range:g,options:l?kU:EU});const p=f.modified.toInclusiveRange();p&&u.push({range:p,options:l?LU:DU});for(const _ of f.innerChanges||[])d.push({range:_.originalRange,options:Z4}),u.push({range:_.modifiedRange,options:IU})}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:[Tf.movedCodeBlockPadding,0,Tf.movedCodeBlockPadding,Tf.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(II(this._editors.original,this._decorations.map(s=>(s==null?void 0:s.originalDecorations)||[]))),this._register(II(this._editors.modified,this._decorations.map(s=>(s==null?void 0:s.modifiedDecorations)||[])))}}class LRe extends te{constructor(e,t,i){super(),this._options=e,this._domNode=t,this._dimensions=i,this._sashRatio=Pi(this,void 0),this.sashLeft=Ut(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 qs(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(xi(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}}let wv=class{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="".concat(t.id,"/").concat(e):(i="".concat(t.id,"/").concat(e.name),t.children.get(i)!==void 0&&(i="".concat(t.id,"/").concat(e.name,"_").concat(e.range.startLineNumber,"_").concat(e.range.startColumn)));let s=i;for(let o=0;t.children.get(s)!==void 0;o++)s="".concat(i,"_").concat(o);return s}static empty(e){return e.children.size===0}},xU=class extends wv{constructor(e,t,i){super(),this.id=e,this.parent=t,this.symbol=i,this.children=new Map}},kRe=class extends wv{constructor(e,t,i,s){super(),this.id=e,this.parent=t,this.label=i,this.order=s,this.children=new Map}},DRe=class op extends wv{static create(e,t,i){const s=new Tn(i),o=new op(t.uri),r=e.ordered(t),a=r.map((c,d)=>{var u;const h=wv.findId("provider_".concat(d),o),f=new kRe(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||[])op._makeOutlineElement(p,f);return f},g=>(Bn(g),f)).then(g=>{wv.empty(g)?g.remove():o._groups.set(h,g)})}),l=e.onDidChange(()=>{const c=e.ordered(t);yn(c,r)||s.cancel()});return Promise.all(a).then(()=>s.token.isCancellationRequested&&!i.isCancellationRequested?op.create(e,t,i):o._compact()).finally(()=>{s.dispose(),l.dispose()})}static _makeOutlineElement(e,t){const i=wv.findId(e,t),s=new xU(i,t,e);if(e.children)for(const o of e.children)op._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=Pt.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 xU?e.push(t.symbol):e.push(...Pt.map(t.children.values(),i=>i.symbol));return e.sort((t,i)=>I.compareRangesUsingStarts(t.range,i.range))}asListOfDocumentSymbols(){const e=this.getTopLevelSymbols(),t=[];return op._flattenDocumentSymbols(t,e,""),t.sort((i,s)=>Y.compare(I.getStartPosition(i.range),I.getStartPosition(s.range))||Y.compare(I.getEndPosition(s.range),I.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&&op._flattenDocumentSymbols(e,s.children,s.name)}};var Ite=globalThis&&globalThis.__decorate||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},Tte=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},ERe=globalThis&&globalThis.__awaiter||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 X4=class extends te{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=hy(this,(c,d)=>{const u=this._editors.modifiedModel.read(c);if(u)return d.add(new Q4(this._languageFeaturesService,u))}),this._register(this._editors.original.onDidChangeCursorPosition(c=>{if(c.reason===3){const d=this._diffModel.get();Gi(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();Gi(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=hy(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=Ut(C=>_.getHiddenOriginalRange(C).startLineNumber-1),b=new TI(v,24);h.push(b),d.add(new NU(this._editors.original,b,_,_.originalUnchangedRange,!g,u,C=>this._diffModel.get().ensureModifiedLineIsVisible(C,void 0),this._options))}{const v=Ut(C=>_.getHiddenModifiedRange(C).startLineNumber-1),b=new TI(v,24);f.push(b),d.add(new NU(this._editors.modified,b,_,_.modifiedUnchangedRange,!1,u,C=>this._diffModel.get().ensureModifiedLineIsVisible(C,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 Bs(void 0,{isTrusted:!0,supportThemeIcons:!0}).appendMarkdown(m("foldUnchanged","Fold Unchanged Region")),glyphMarginClassName:"fold-unchanged "+dt.asClassName(Me.fold),zIndex:10001};this._register(II(this._editors.original,Ut(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:I.fromPositions(new Y(h.originalLineNumber,1)),options:l});return u}))),this._register(II(this._editors.modified,Ut(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:Ht.ofLength(h.modifiedLineNumber,1).toInclusiveRange(),options:l});return u}))),this._register(xI(this._editors.original,r.map(c=>c.origViewZones),c=>this._isUpdatingViewZones=c)),this._register(xI(this._editors.modified,r.map(c=>c.modViewZones),c=>this._isUpdatingViewZones=c)),this._register(xi(c=>{const d=o.read(c);this._editors.original.setHiddenAreas(d.map(u=>u.getHiddenOriginalRange(c).toInclusiveRange()).filter(uw)),this._editors.modified.setHiddenAreas(d.map(u=>u.getHiddenModifiedRange(c).toInclusiveRange()).filter(uw))})),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()}}))}};X4=Ite([Tte(3,Ze)],X4);let Q4=class extends te{constructor(e,t){super(),this._languageFeaturesService=e,this._textModel=t,this._currentModel=Pi(this,void 0);const i=Vr("documentSymbolProvider.onDidChange",this._languageFeaturesService.documentSymbolProvider.onDidChange),s=Vr("_textModel.onDidChangeContent",We.debounce(o=>this._textModel.onDidChangeContent(o),()=>{},100));this._register(pr((o,r)=>ERe(this,void 0,void 0,function*(){i.read(o),s.read(o);const a=r.add(new rRe),l=yield DRe.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(qZ(Sa(o=>o.range.endLineNumber-o.range.startLineNumber,Mu))),s.map(o=>({name:o.name,kind:o.kind,startLineNumber:o.range.startLineNumber}))}};Q4=Ite([Tte(0,Ze)],Q4);class NU extends Dte{constructor(e,t,i,s,o,r,a,l){const c=vs("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=vs("div.diff-hidden-lines",[vs("div.top@top",{title:m("diff.hiddenLines.top","Click or drag to show more above")}),vs("div.center@content",{style:{display:"flex"}},[vs("div@first",{style:{display:"flex",justifyContent:"center",alignItems:"center",flexShrink:"0"}},[ye("a",{title:m("showAll","Show all"),role:"button",onclick:()=>{this._unchangedRegion.showAll(void 0)}},...kf("$(unfold)"))]),vs("div@others",{style:{display:"flex",justifyContent:"center",alignItems:"center"}})]),vs("div.bottom@bottom",{title:m("diff.bottom","Click or drag to show more below"),role:"button"})]),c.root.appendChild(this._nodes.root);const d=ks(this._editor.onDidLayoutChange,()=>this._editor.getLayoutInfo());this.hide?Es(this._nodes.first):this._register(If(this._nodes.first,{width:d.map(h=>h.contentLeft)}));const u=this._editor;this._register(ce(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 _=ce(window,"mousemove",b=>{const w=b.clientY-f;g=g||Math.abs(w)>2;const y=Math.round(w/u.getOption(66)),L=Math.max(0,Math.min(p+y,this._unchangedRegion.getMaxVisibleLineCountTop()));this._unchangedRegion.visibleLineCountTop.set(L,void 0)}),v=ce(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(ce(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 _=ce(window,"mousemove",b=>{const w=b.clientY-f;g=g||Math.abs(w)>2;const y=Math.round(w/u.getOption(66)),L=Math.max(0,Math.min(p-y,this._unchangedRegion.getMaxVisibleLineCountBottom())),S=u.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);this._unchangedRegion.visibleLineCountBottom.set(L,void 0);const k=u.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);u.setScrollTop(u.getScrollTop()+(k-S))}),v=ce(window,"mouseup",b=>{if(this._unchangedRegion.isDragged.set(!1,void 0),!g){const C=u.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);this._unchangedRegion.showMoreBelow(this._options.hideUnchangedRegionsRevealLineCount.get(),void 0);const w=u.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);u.setScrollTop(u.getScrollTop()+(w-C))}this._nodes.bottom.classList.toggle("dragging",!1),this._nodes.root.classList.toggle("dragging",!1),_.dispose(),v.dispose()})})),this._register(xi(h=>{const f=[];if(!this.hide){const g=i.getHiddenModifiedRange(h).length,p=m("hiddenLines","{0} hidden lines",g),_=ye("span",{title:m("diff.hiddenLines.expandAll","Double click to unfold")},p);_.addEventListener("dblclick",C=>{C.button===0&&(C.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(ye("span",void 0,"  |  "));for(let C=0;C{this._revealModifiedHiddenLine(w.startLineNumber)}}}}Es(this._nodes.others,...f)}))}}class mc{static capture(e){if(e.getScrollTop()===0||e.hasPendingScrollAnimation())return new mc(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 mc(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 IRe=globalThis&&globalThis.__decorate||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},AU=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},TRe=globalThis&&globalThis.__awaiter||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())})},rp;let NI=rp=class{constructor(e,t,i){this.editorWorkerService=t,this.telemetryService=i,this.onDidChangeEventEmitter=new j,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 TRe(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 Ma(new Ht(1,2),new Ht(1,t.getLineCount()+1),[new Gf(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=rp.diffCache.get(a);if(c&&c.context===l)return c.result;const d=so.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 rp.diffCache.size>10&&rp.diffCache.delete(rp.diffCache.keys().next().value),rp.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()}};NI.diffCache=new Map;NI=rp=IRe([AU(1,Sl),AU(2,ra)],NI);var xRe=globalThis&&globalThis.__decorate||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},NRe=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};const xte=Wt("diffProviderFactoryService");let J4=class{constructor(e){this.instantiationService=e}createDiffProvider(e,t){return this.instantiationService.createInstance(NI,t)}};J4=xRe([NRe(0,_t)],J4);Gt(xte,J4,1);var ARe=globalThis&&globalThis.__decorate||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},MRe=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},MU=globalThis&&globalThis.__awaiter||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 eF=class extends te{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=Pi(this,!1),this.isDiffUpToDate=this._isDiffUpToDate,this._diff=Pi(this,void 0),this.diff=this._diff,this._unchangedRegions=Pi(this,{regions:[],originalDecorationIds:[],modifiedDecorationIds:[]}),this.unchangedRegions=Ut(this,l=>this._options.hideUnchangedRegions.read(l)?this._unchangedRegions.read(l).regions:(Gi(c=>{for(const d of this._unchangedRegions.get().regions)d.collapseAll(c)}),[])),this.movedTextToCompare=Pi(this,void 0),this._activeMovedText=Pi(this,void 0),this._hoveredMovedText=Pi(this,void 0),this.activeMovedText=Ut(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 Tn,this._diffProvider=Ut(this,l=>{const c=this._diffProviderFactoryService.createDiffProvider(this._editor,{diffAlgorithm:this._options.diffAlgorithm.read(l)}),d=Vr("onDidChange",c.onDidChange);return{diffProvider:c,onChangeSignal:d}}),this._register(vt(()=>this._cancellationTokenSource.cancel()));const o=Lte("contentChangedSignal"),r=this._register(new Si(()=>o.trigger(void 0),200)),a=(l,c,d)=>{const u=AI.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=>Ht.fromRange(v)),g=h.modifiedDecorationIds.map(v=>e.modified.getDecorationRange(v)).filter(v=>!!v).map(v=>Ht.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=Tu.fromModelContentChanges(l.changes);this._lastDiff,e.original,e.modified}r.schedule()})),this._register(e.original.onDidChangeContent(l=>{if(this._diff.get()){const d=Tu.fromModelContentChanges(l.changes);this._lastDiff,e.original,e.modified}r.schedule()})),this._register(pr((l,c)=>MU(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),Fh(TQ,l),Fh(iO,l),this._isDiffUpToDate.set(!1,void 0);let f=[];c.add(e.original.onDidChangeContent(_=>{const v=Tu.fromModelContentChanges(_.changes);f=UE(f,v)}));let g=[];c.add(e.modified.onDidChangeContent(_=>{const v=Tu.fromModelContentChanges(_.changes);g=UE(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=RRe(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,Gi(_=>{a(p,_),this._lastDiff=p;const v=S7.fromDiffResult(p);this._diff.set(v,_),this._isDiffUpToDate.set(!0,_);const b=this.movedTextToCompare.get();this.movedTextToCompare.set(b?this._lastDiff.moves.find(C=>C.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 MU(this,void 0,void 0,function*(){yield XMe(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=>Ht.deserialize(s.range)),i=this._unchangedRegions.get();Gi(s=>{for(const o of i.regions)for(const r of t)if(o.modifiedUnchangedRange.intersect(r)){o.setHiddenModifiedRange(r,s);break}})}};eF=ARe([MRe(3,xte)],eF);function RRe(n,e,t){return{changes:n.changes.map(i=>new Ma(i.original,i.modified,i.innerChanges?i.innerChanges.map(s=>PRe(s,e,t)):void 0)),moves:n.moves,identical:n.identical,quitEarly:n.quitEarly}}function PRe(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 Nte(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 Nte{constructor(e){this.lineRangeMapping=e}}class AI{static fromDiffs(e,t,i,s,o){const r=Ma.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 AI(c,d,u,0,0))):u>=o*2+s&&(c+=o,d+=o,u-=o*2,a.push(new AI(c,d,u,0,0)))}return a}get originalUnchangedRange(){return Ht.ofLength(this.originalLineNumber,this.lineCount)}get modifiedUnchangedRange(){return Ht.ofLength(this.modifiedLineNumber,this.lineCount)}constructor(e,t,i,s,o){this.originalLineNumber=e,this.modifiedLineNumber=t,this.lineCount=i,this._visibleLineCountTop=Pi(this,0),this.visibleLineCountTop=this._visibleLineCountTop,this._visibleLineCountBottom=Pi(this,0),this.visibleLineCountBottom=this._visibleLineCountBottom,this._shouldHideControls=Ut(this,r=>this.visibleLineCountTop.read(r)+this.visibleLineCountBottom.read(r)===this.lineCount&&!this.isDragged.read(r)),this.isDragged=Pi(this,!1),this._visibleLineCountTop.set(s,void 0),this._visibleLineCountBottom.set(o,void 0)}shouldHideControls(e){return this._shouldHideControls.read(e)}getHiddenOriginalRange(e){return Ht.ofLength(this.originalLineNumber+this._visibleLineCountTop.read(e),this.lineCount-this._visibleLineCountTop.read(e)-this._visibleLineCountBottom.read(e))}getHiddenModifiedRange(e){return Ht.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 Ro("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,()=>gR(this,void 0,void 0,function*(){const w=this._originalTextModel.getValueInRange(s.original.toExclusiveRange());yield this._clipboardService.writeText(w)}))),s.original.length>1&&v.push(new Ro("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,()=>gR(this,void 0,void 0,function*(){let w=this._originalTextModel.getLineContent(s.original.startLineNumber+u);w===""&&(w=this._originalTextModel.getEndOfLineSequence()===0?"\n":"\r\n"),yield this._clipboardService.writeText(w)}))),i.getOption(90)||v.push(new Ro("diff.inline.revertChange",m("diff.inline.revertChange.label","Revert this change"),void 0,!0,()=>gR(this,void 0,void 0,function*(){this._editor.revert(this._diff)}))),v},autoSelectFirstItem:!0})};this._register(In(this._diffActions,"mousedown",g=>{const{top:p,height:_}=Un(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}=Un(e),o=t-s,r=Math.floor(o/i),a=r*i;if(this._diffActions.style.top="".concat(a,"px"),this._viewLineCounts){let l=0;for(let c=0;cn});function FRe(n,e,t,i){Vs(i,e.fontInfo);const s=t.length>0,o=new D0(1e4);let r=0,a=0;const l=[];for(let h=0;h');const l=e.getLineContent(),c=Jr.isBasicASCII(l,s),d=Jr.containsRTL(l,c,o),u=gS(new Eg(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!==Br.OFF,null),a);return a.appendString(""),u.characterMapping.getHorizontalOffset(u.characterMapping.length)}var WRe=globalThis&&globalThis.__decorate||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},OU=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let tF=class extends te{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=Pi(this,0),this._originalScrollOffset=Pi(this,0),this._originalScrollOffsetAnimated=SU(this._originalScrollOffset,this._store),this._modifiedTopPadding=Pi(this,0),this._modifiedScrollOffset=Pi(this,0),this._modifiedScrollOffsetAnimated=SU(this._modifiedScrollOffset,this._store);let l=!1;const c=Pi("state",0),d=this._register(new Si(()=>{c.set(c.get()+1,void 0)},0));this._register(this._editors.original.onDidChangeViewZones(w=>{!l&&!this._canIgnoreViewZoneUpdateEvent()&&d.schedule()})),this._register(this._editors.modified.onDidChangeViewZones(w=>{!l&&!this._canIgnoreViewZoneUpdateEvent()&&d.schedule()})),this._register(this._editors.original.onDidChangeConfiguration(w=>{(w.hasChanged(144)||w.hasChanged(66))&&d.schedule()})),this._register(this._editors.modified.onDidChangeConfiguration(w=>{(w.hasChanged(144)||w.hasChanged(66))&&d.schedule()}));const u=this._diffModel.map(w=>w?ks(w.model.original.onDidChangeTokens,()=>w.model.original.tokenization.backgroundTokenizationState===2):void 0).map((w,y)=>w==null?void 0:w.read(y)),h=new Set,f=new Set,g=Ut(w=>{const y=this._diffModel.read(w),L=y==null?void 0:y.diff.read(w);if(!y||!L)return null;c.read(w);const k=this._options.renderSideBySide.read(w);return FU(this._editors.original,this._editors.modified,L.mappings,h,f,k)}),p=Ut(w=>{var y;const L=(y=this._diffModel.read(w))===null||y===void 0?void 0:y.movedTextToCompare.read(w);if(!L)return null;c.read(w);const S=L.changes.map(k=>new Nte(k));return FU(this._editors.original,this._editors.modified,S,h,f,!0)});function _(){const w=document.createElement("div");return w.className="diagonal-fill",w}const v=this._register(new be),b=Ut(w=>{var y,L,S,k,D,x,A,T;v.clear();const P=g.read(w)||[],W=[],$=[],X=this._modifiedTopPadding.read(w);X>0&&$.push({afterLineNumber:0,domNode:document.createElement("div"),heightInPx:X,showInHiddenAreas:!0,suppressMouseDown:!0});const J=this._originalTopPadding.read(w);J>0&&W.push({afterLineNumber:0,domNode:document.createElement("div"),heightInPx:J,showInHiddenAreas:!0,suppressMouseDown:!0});const Q=this._options.renderSideBySide.read(w),le=Q||(y=this._editors.modified._getViewModel())===null||y===void 0?void 0:y.createLineBreaksComputer();if(le){for(const ze of P)if(ze.diff)for(let It=ze.originalRange.startLineNumber;Itthis._editors.original.getModel().tokenization.getLineTokens(we)),ze.originalRange.mapToLineArray(we=>de[_e++]),Ye,pe),je=[];for(const we of ze.diff.innerChanges||[])je.push(new vC(we.originalRange.delta(-(ze.diff.original.startLineNumber-1)),Z4.className,0));const Z=FRe(Xe,Ee,je,Ke),z=document.createElement("div");if(z.className="inline-deleted-margin-view-zone",Vs(z,Ee.fontInfo),this._options.renderIndicators.read(w))for(let we=0;wekp(ae),z,this._editors.modified,ze.diff,this._diffEditorWidget,Z.viewLineCounts,this._editors.original.getModel(),this._contextMenuService,this._clipboardService));for(let we=0;we1&&W.push({afterLineNumber:ze.originalRange.startLineNumber+we,domNode:_(),heightInPx:(Ne-1)*ie,showInHiddenAreas:!0,suppressMouseDown:!0})}$.push({afterLineNumber:ze.modifiedRange.startLineNumber-1,domNode:Ke,heightInPx:Z.heightInLines*ie,minWidthInPx:Z.minWidthInPx,marginDomNode:z,setZoneId(we){ae=we},showInHiddenAreas:!0,suppressMouseDown:!0})}const It=document.createElement("div");It.className="gutter-delete",W.push({afterLineNumber:ze.originalRange.endLineNumberExclusive-1,domNode:_(),heightInPx:ze.modifiedHeightInPx,marginDomNode:It,showInHiddenAreas:!0,suppressMouseDown:!0})}else{const It=ze.modifiedHeightInPx-ze.originalHeightInPx;if(It>0){if(ne!=null&&ne.lineRangeMapping.original.delta(-1).deltaLength(2).contains(ze.originalRange.endLineNumberExclusive-1))continue;W.push({afterLineNumber:ze.originalRange.endLineNumberExclusive-1,domNode:_(),heightInPx:It,showInHiddenAreas:!0,suppressMouseDown:!0})}else{let Ke=function(){const je=document.createElement("div");return je.className="arrow-revert-change "+dt.asClassName(Me.arrowRight),ye("div",{},je)};if(ne!=null&&ne.lineRangeMapping.modified.delta(-1).deltaLength(2).contains(ze.modifiedRange.endLineNumberExclusive-1))continue;let Xe;ze.diff&&ze.diff.modified.isEmpty&&this._options.shouldRenderRevertArrows.read(w)&&(Xe=Ke()),$.push({afterLineNumber:ze.modifiedRange.endLineNumberExclusive-1,domNode:_(),heightInPx:-It,marginDomNode:Xe,showInHiddenAreas:!0,suppressMouseDown:!0})}}for(const ze of(T=p.read(w))!==null&&T!==void 0?T:[]){if(!(ne!=null&&ne.lineRangeMapping.original.intersect(ze.originalRange))||!(ne!=null&&ne.lineRangeMapping.modified.intersect(ze.modifiedRange)))continue;const It=ze.modifiedHeightInPx-ze.originalHeightInPx;It>0?W.push({afterLineNumber:ze.originalRange.endLineNumberExclusive-1,domNode:_(),heightInPx:It,showInHiddenAreas:!0,suppressMouseDown:!0}):$.push({afterLineNumber:ze.modifiedRange.endLineNumberExclusive-1,domNode:_(),heightInPx:-It,showInHiddenAreas:!0,suppressMouseDown:!0})}return{orig:W,mod:$}});this._register(pr(w=>{const y=mc.capture(this._editors.modified),L=b.read(w);l=!0,this._editors.original.changeViewZones(S=>{for(const k of h)S.removeZone(k);h.clear();for(const k of L.orig){const D=S.addZone(k);k.setZoneId&&k.setZoneId(D),h.add(D)}}),this._editors.modified.changeViewZones(S=>{for(const k of f)S.removeZone(k);f.clear();for(const k of L.mod){const D=S.addZone(k);k.setZoneId&&k.setZoneId(D),f.add(D)}}),l=!1,y.restore(this._editors.modified)})),this._register(vt(()=>{this._editors.original.changeViewZones(w=>{for(const y of h)w.removeZone(y);h.clear()}),this._editors.modified.changeViewZones(w=>{for(const y of f)w.removeZone(y);f.clear()})}));let C=!1;this._register(this._editors.original.onDidScrollChange(w=>{w.scrollLeftChanged&&!C&&(C=!0,this._editors.modified.setScrollLeft(w.scrollLeft),C=!1)})),this._register(this._editors.modified.onDidScrollChange(w=>{w.scrollLeftChanged&&!C&&(C=!0,this._editors.original.setScrollLeft(w.scrollLeft),C=!1)})),this._originalScrollTop=ks(this._editors.original.onDidScrollChange,()=>this._editors.original.getScrollTop()),this._modifiedScrollTop=ks(this._editors.modified.onDidScrollChange,()=>this._editors.modified.getScrollTop()),this._register(xi(w=>{const y=this._originalScrollTop.read(w)-(this._originalScrollOffsetAnimated.get()-this._modifiedScrollOffsetAnimated.read(w))-(this._originalTopPadding.get()-this._modifiedTopPadding.read(w));y!==this._editors.modified.getScrollTop()&&this._editors.modified.setScrollTop(y,1)})),this._register(xi(w=>{const y=this._modifiedScrollTop.read(w)-(this._modifiedScrollOffsetAnimated.get()-this._originalScrollOffsetAnimated.read(w))-(this._modifiedTopPadding.get()-this._originalTopPadding.read(w));y!==this._editors.original.getScrollTop()&&this._editors.original.setScrollTop(y,1)})),this._register(xi(w=>{var y;const L=(y=this._diffModel.read(w))===null||y===void 0?void 0:y.movedTextToCompare.read(w);let S=0;if(L){const k=this._editors.original.getTopForLineNumber(L.lineRangeMapping.original.startLineNumber,!0)-this._originalTopPadding.get();S=this._editors.modified.getTopForLineNumber(L.lineRangeMapping.modified.startLineNumber,!0)-this._modifiedTopPadding.get()-k}S>0?(this._modifiedTopPadding.set(0,void 0),this._originalTopPadding.set(S,void 0)):S<0?(this._modifiedTopPadding.set(-S,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()-S,void 0,!0):this._modifiedScrollOffset.set(this._originalScrollOffset.get()+S,void 0,!0)}))}};tF=WRe([OU(5,ch),OU(6,Cl)],tF);function FU(n,e,t,i,s,o){const r=new Ku(BU(n,i)),a=new Ku(BU(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,C=v?v.lineNumber-h:Number.MAX_VALUE;bC?(a.dequeue(),_={lineNumber:v.lineNumber-h+u,heightInPx:0}):(r.dequeue(),a.dequeue()),d.push({originalRange:Ht.ofLength(_.lineNumber,1),modifiedRange:Ht.ofLength(v.lineNumber,1),originalHeightInPx:l+_.heightInPx,modifiedHeightInPx:c+v.heightInPx,diff:void 0})}}for(const g of t){let C=function(w,y){var L,S,k,D;if(wW.lineNumberW+$.heightInPx,0))!==null&&S!==void 0?S:0,P=(D=(k=a.takeWhile(W=>W.lineNumberW+$.heightInPx,0))!==null&&D!==void 0?D:0;d.push({originalRange:x,modifiedRange:A,originalHeightInPx:x.length*l+T,modifiedHeightInPx:A.length*c+P,diff:g.lineRangeMapping}),b=w,v=y};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 w of p.innerChanges||[])w.originalRange.startColumn>1&&w.modifiedRange.startColumn>1&&C(w.originalRange.startLineNumber,w.modifiedRange.startLineNumber),w.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 Y(l.afterLineNumber,1)).lineNumber;t.push({lineNumber:c,heightInPx:l.height})}return iRe(t,i,l=>l.lineNumber,(l,c)=>({lineNumber:l.lineNumber,heightInPx:l.heightInPx+c.heightInPx}))}var VRe=globalThis&&globalThis.__decorate||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},HRe=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},Pl;let Wu=Pl=class extends te{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=ks(this._themeService.onDidColorThemeChange,()=>this._themeService.getColorTheme()),d=Ut(f=>{const g=c.read(f),p=g.getColor(eye)||(g.getColor(Qwe)||dO).transparent(2),_=g.getColor(tye)||(g.getColor(Jwe)||uO).transparent(2);return{insertColor:p,removeColor:_}}),u=ks(this._editors.modified.onDidScrollChange,()=>this._editors.modified.getScrollTop()),h=ks(this._editors.modified.onDidScrollChange,()=>this._editors.modified.getScrollHeight());this._register(pr((f,g)=>{if(!this._options.renderOverviewRuler.read(f))return;const p=ci(document.createElement("div"));p.setClassName("diffViewport"),p.setPosition("absolute");const _=vs("div.diffOverview",{style:{position:"absolute",top:"0px",width:Pl.ENTIRE_DIFF_OVERVIEW_WIDTH+"px"}}).root;g.add(nk(_,p.domNode)),g.add(In(_,Pe.POINTER_DOWN,v=>{this._editors.modified.delegateVerticalScrollbarPointerDown(v)})),g.add(ce(_,Pe.MOUSE_WHEEL,v=>{this._editors.modified.delegateScrollFromMouseWheelEvent(v)},{passive:!1})),g.add(nk(this._rootElement,_)),g.add(pr((v,b)=>{const C=this._diffModel.read(v),w=this._editors.original.createOverviewRuler("original diffOverviewRuler");w&&(b.add(w),b.add(nk(_,w.getDomNode())));const y=this._editors.modified.createOverviewRuler("modified diffOverviewRuler");if(y&&(b.add(y),b.add(nk(_,y.getDomNode()))),!w||!y)return;const L=Vr("viewZoneChanged",this._editors.original.onDidChangeViewZones),S=Vr("viewZoneChanged",this._editors.modified.onDidChangeViewZones),k=Vr("hiddenRangesChanged",this._editors.original.onDidChangeHiddenAreas),D=Vr("hiddenRangesChanged",this._editors.modified.onDidChangeHiddenAreas);b.add(xi(x=>{var A;L.read(x),S.read(x),k.read(x),D.read(x);const T=d.read(x),P=(A=C==null?void 0:C.diff.read(x))===null||A===void 0?void 0:A.mappings;function W(J,Q,le){const de=le._getViewModel();return de?J.filter(_e=>_e.length>0).map(_e=>{const ie=de.coordinatesConverter.convertModelPositionToViewPosition(new Y(_e.startLineNumber,1)),ne=de.coordinatesConverter.convertModelPositionToViewPosition(new Y(_e.endLineNumberExclusive,1)),Ye=ne.lineNumber-ie.lineNumber;return new SJ(ie.lineNumber,ne.lineNumber,Ye,Q.toString())}):[]}const $=W((P||[]).map(J=>J.lineRangeMapping.original),T.removeColor,this._editors.original),X=W((P||[]).map(J=>J.lineRangeMapping.modified),T.insertColor,this._editors.modified);w==null||w.setZones($),y==null||y.setZones(X)})),b.add(xi(x=>{const A=this._rootHeight.read(x),T=this._rootWidth.read(x),P=this._modifiedEditorLayoutInfo.read(x);if(P){const W=Pl.ENTIRE_DIFF_OVERVIEW_WIDTH-2*Pl.ONE_OVERVIEW_WIDTH;w.setLayout({top:0,height:A,right:W+Pl.ONE_OVERVIEW_WIDTH,width:Pl.ONE_OVERVIEW_WIDTH}),y.setLayout({top:0,height:A,right:0,width:Pl.ONE_OVERVIEW_WIDTH});const $=u.read(x),X=h.read(x),J=this._editors.modified.getOption(102),Q=new Rb(J.verticalHasArrows?J.arrowSize:0,J.verticalScrollbarSize,0,P.height,X,$);p.setTop(Q.getSliderPosition()),p.setHeight(Q.getSliderSize())}else p.setTop(0),p.setHeight(0);_.style.height=A+"px",_.style.left=T-Pl.ENTIRE_DIFF_OVERVIEW_WIDTH+"px",p.setWidth(Pl.ENTIRE_DIFF_OVERVIEW_WIDTH)}))}))}))}};Wu.ONE_OVERVIEW_WIDTH=15;Wu.ENTIRE_DIFF_OVERVIEW_WIDTH=Pl.ONE_OVERVIEW_WIDTH*2;Wu=Pl=VRe([HRe(7,os)],Wu);F("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."));F("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 sN extends te{constructor(){super(...arguments),this._id=++sN.idCounter,this._onDidDispose=this._register(new j),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)}}sN.idCounter=0;var $Re=globalThis&&globalThis.__decorate||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},WU=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let iF=class extends te{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 j),this.original=this._register(this._createLeftHandSideEditor(i.editorOptions.get(),s.originalEditor||{})),this.modified=this._register(this._createRightHandSideEditor(i.editorOptions.get(),s.modifiedEditor||{})),this.modifiedModel=ks(this.modified.onDidChangeModel,()=>this.modified.getModel()),this._register(tN({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()+Wu.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=vc.revealHorizontalRightPadding.defaultValue+Wu.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,""):""}};iF=$Re([WU(5,_t),WU(6,Di)],iF);class zRe{get editorOptions(){return this._options}constructor(e,t){this.diffEditorWidth=t,this.couldShowInlineViewBecauseOfSize=Ut(this,s=>this._options.read(s).renderSideBySide&&this.diffEditorWidth.read(s)<=this._options.read(s).renderSideBySideInlineBreakpoint),this.renderOverviewRuler=Ut(this,s=>this._options.read(s).renderOverviewRuler),this.renderSideBySide=Ut(this,s=>this._options.read(s).renderSideBySide&&!(this._options.read(s).useInlineViewWhenSpaceIsLimited&&this.couldShowInlineViewBecauseOfSize.read(s))),this.readOnly=Ut(this,s=>this._options.read(s).readOnly),this.shouldRenderRevertArrows=Ut(this,s=>!(!this._options.read(s).renderMarginRevertIcon||!this.renderSideBySide.read(s)||this.readOnly.read(s))),this.renderIndicators=Ut(this,s=>this._options.read(s).renderIndicators),this.enableSplitViewResizing=Ut(this,s=>this._options.read(s).enableSplitViewResizing),this.splitViewDefaultRatio=Ut(this,s=>this._options.read(s).splitViewDefaultRatio),this.ignoreTrimWhitespace=Ut(this,s=>this._options.read(s).ignoreTrimWhitespace),this.maxComputationTimeMs=Ut(this,s=>this._options.read(s).maxComputationTime),this.showMoves=Ut(this,s=>this._options.read(s).experimental.showMoves&&this.renderSideBySide.read(s)),this.isInEmbeddedEditor=Ut(this,s=>this._options.read(s).isInEmbeddedEditor),this.diffWordWrap=Ut(this,s=>this._options.read(s).diffWordWrap),this.originalEditable=Ut(this,s=>this._options.read(s).originalEditable),this.diffCodeLens=Ut(this,s=>this._options.read(s).diffCodeLens),this.accessibilityVerbose=Ut(this,s=>this._options.read(s).accessibilityVerbose),this.diffAlgorithm=Ut(this,s=>this._options.read(s).diffAlgorithm),this.showEmptyDecorations=Ut(this,s=>this._options.read(s).experimental.showEmptyDecorations),this.onlyShowAccessibleDiffViewer=Ut(this,s=>this._options.read(s).onlyShowAccessibleDiffViewer),this.hideUnchangedRegions=Ut(this,s=>this._options.read(s).hideUnchangedRegions.enabled),this.hideUnchangedRegionsRevealLineCount=Ut(this,s=>this._options.read(s).hideUnchangedRegions.revealLineCount),this.hideUnchangedRegionsContextLineCount=Ut(this,s=>this._options.read(s).hideUnchangedRegions.contextLineCount),this.hideUnchangedRegionsMinimumLineCount=Ut(this,s=>this._options.read(s).hideUnchangedRegions.minimumLineCount);const i=Object.assign(Object.assign({},e),VU(e,co));this._options=Pi(this,i)}updateOptions(e){const t=VU(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 VU(n,e){var t,i,s,o,r,a,l,c;return{enableSplitViewResizing:rt(n.enableSplitViewResizing,e.enableSplitViewResizing),splitViewDefaultRatio:qme(n.splitViewDefaultRatio,.5,.1,.9),renderSideBySide:rt(n.renderSideBySide,e.renderSideBySide),renderMarginRevertIcon:rt(n.renderMarginRevertIcon,e.renderMarginRevertIcon),maxComputationTime:ep(n.maxComputationTime,e.maxComputationTime,0,1073741824),maxFileSize:ep(n.maxFileSize,e.maxFileSize,0,1073741824),ignoreTrimWhitespace:rt(n.ignoreTrimWhitespace,e.ignoreTrimWhitespace),renderIndicators:rt(n.renderIndicators,e.renderIndicators),originalEditable:rt(n.originalEditable,e.originalEditable),diffCodeLens:rt(n.diffCodeLens,e.diffCodeLens),renderOverviewRuler:rt(n.renderOverviewRuler,e.renderOverviewRuler),diffWordWrap:Dn(n.diffWordWrap,e.diffWordWrap,["off","on","inherit"]),diffAlgorithm:Dn(n.diffAlgorithm,e.diffAlgorithm,["legacy","advanced"],{smart:"legacy",experimental:"advanced"}),accessibilityVerbose:rt(n.accessibilityVerbose,e.accessibilityVerbose),experimental:{showMoves:rt((t=n.experimental)===null||t===void 0?void 0:t.showMoves,e.experimental.showMoves),showEmptyDecorations:rt((i=n.experimental)===null||i===void 0?void 0:i.showEmptyDecorations,e.experimental.showEmptyDecorations)},hideUnchangedRegions:{enabled:rt((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:ep((a=n.hideUnchangedRegions)===null||a===void 0?void 0:a.contextLineCount,e.hideUnchangedRegions.contextLineCount,0,1073741824),minimumLineCount:ep((l=n.hideUnchangedRegions)===null||l===void 0?void 0:l.minimumLineCount,e.hideUnchangedRegions.minimumLineCount,0,1073741824),revealLineCount:ep((c=n.hideUnchangedRegions)===null||c===void 0?void 0:c.revealLineCount,e.hideUnchangedRegions.revealLineCount,0,1073741824)},isInEmbeddedEditor:rt(n.isInEmbeddedEditor,e.isInEmbeddedEditor),onlyShowAccessibleDiffViewer:rt(n.onlyShowAccessibleDiffViewer,e.onlyShowAccessibleDiffViewer),renderSideBySideInlineBreakpoint:ep(n.renderSideBySideInlineBreakpoint,e.renderSideBySideInlineBreakpoint,0,1073741824),useInlineViewWhenSpaceIsLimited:rt(n.useInlineViewWhenSpaceIsLimited,e.useInlineViewWhenSpaceIsLimited)}}var URe=globalThis&&globalThis.__decorate||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},_1=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let vm=class extends sN{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=vs("div.monaco-diff-editor.side-by-side",{style:{position:"relative",height:"100%"}},[vs("div.noModificationsOverlay@overlay",{style:{position:"absolute",height:"100%",visibility:"hidden"}},[ye("span",{},"No Changes")]),vs("div.editor.original@original",{style:{position:"absolute",height:"100%"}}),vs("div.editor.modified@modified",{style:{position:"absolute",height:"100%"}}),vs("div.accessibleDiffViewer@accessibleDiffViewer",{style:{position:"absolute",height:"100%"}})]),this._diffModel=this._register(DI("diffModel",void 0)),this.onDidChangeModel=We.fromObservableLight(this._diffModel),this._contextKeyService=this._register(this._parentContextKeyService.createScoped(this._domElement)),this._instantiationService=this._parentInstantiationService.createChild(new xx([bt,this._contextKeyService])),this._boundarySashes=Pi(this,void 0),this._accessibleDiffViewerShouldBeVisible=Pi(this,!1),this._accessibleDiffViewerVisible=Ut(this,p=>this._options.onlyShowAccessibleDiffViewer.read(p)?!0:this._accessibleDiffViewerShouldBeVisible.read(p)),this.movedBlocksLinesPart=Pi(this,void 0),this._layoutInfo=Ut(this,p=>{var _,v,b;const C=this._rootSizeObserver.width.read(p),w=this._rootSizeObserver.height.read(p),y=(_=this._sash.read(p))===null||_===void 0?void 0:_.sashLeft.read(p),L=y!=null?y:Math.max(5,this._editors.original.getLayoutInfo().decorationsLeft),S=C-L-(this._options.renderOverviewRuler.read(p)?Wu.ENTIRE_DIFF_OVERVIEW_WIDTH:0),k=(b=(v=this.movedBlocksLinesPart.read(p))===null||v===void 0?void 0:v.width.read(p))!==null&&b!==void 0?b:0,D=L-k;return this.elements.original.style.width=D+"px",this.elements.original.style.left="0px",this.elements.modified.style.width=S+"px",this.elements.modified.style.left=L+"px",this._editors.original.layout({width:D,height:w}),this._editors.modified.layout({width:S,height:w}),{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=We.fromObservableLight(this._diffValue),r.willCreateDiffEditor(),this._contextKeyService.createKey("isInDiffEditor",!0),this._domElement.appendChild(this.elements.root),this._register(vt(()=>this._domElement.removeChild(this.elements.root))),this._rootSizeObserver=this._register(new nRe(this.elements.root,t.dimension)),this._rootSizeObserver.setAutomaticLayout((c=t.automaticLayout)!==null&&c!==void 0?c:!1),this._options=new zRe(t,this._rootSizeObserver.width),this._contextKeyService.createKey(O.isEmbeddedDiffEditor.key,!1);const d=O.isEmbeddedDiffEditor.bindTo(this._contextKeyService);this._register(xi(p=>{d.set(this._options.isInEmbeddedEditor.read(p))}));const u=O.comparingMovedCode.bindTo(this._contextKeyService);this._register(xi(p=>{var _;u.set(!!(!((_=this._diffModel.read(p))===null||_===void 0)&&_.movedTextToCompare.read(p)))}));const h=O.diffEditorRenderSideBySideInlineBreakpointReached.bindTo(this._contextKeyService);this._register(xi(p=>{h.set(this._options.couldShowInlineViewBecauseOfSize.read(p))})),this._editors=this._register(this._instantiationService.createInstance(iF,this.elements.original,this.elements.modified,this._options,i,(p,_,v,b)=>this._createInnerEditor(p,_,v,b))),this._sash=hy(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 LRe(this._options,this.elements.root,{height:this._rootSizeObserver.height,width:this._rootSizeObserver.width.map((C,w)=>C-(this._options.renderOverviewRuler.read(w)?Wu.ENTIRE_DIFF_OVERVIEW_WIDTH:0))}));return _.add(xi(C=>{const w=this._boundarySashes.read(C);w&&b.setBoundarySashes(w)})),b}),this._register(gy(this._sash)),this._register(pr((p,_)=>{this.unchangedRangesFeature=_.add(this._instantiationService.createInstance(Fh(X4,p),this._editors,this._diffModel,this._options))})),this._register(pr((p,_)=>{_.add(new(Fh(SRe,p))(this._editors,this._diffModel,this._options))})),this._register(pr((p,_)=>{_.add(this._instantiationService.createInstance(Fh(tF,p),this._editors,this._diffModel,this._options,this,()=>this.unchangedRangesFeature.isUpdatingViewZones))})),this._register(pr((p,_)=>{_.add(this._instantiationService.createInstance(Fh(Wu,p),this._editors,this.elements.root,this._diffModel,this._rootSizeObserver.width,this._rootSizeObserver.height,this._layoutInfo.map(v=>v.modifiedEditor),this._options))})),this._register(pr((p,_)=>{this._accessibleDiffViewer=_.add(this._register(this._instantiationService.createInstance(Fh(af,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 C;return(C=v==null?void 0:v.diff.read(b))===null||C===void 0?void 0:C.mappings.map(w=>w.lineRangeMapping)}),this._editors)))}));const f=this._accessibleDiffViewerVisible.map(p=>p?"hidden":"visible");this._register(If(this.elements.modified,{visibility:f})),this._register(If(this.elements.original,{visibility:f})),this._createDiffEditorContributions(),r.addDiffEditor(this),this._register(gy(this._layoutInfo)),this._register(pr((p,_)=>{this.movedBlocksLinesPart.set(_.add(new(Fh(Tf,p))(this.elements.root,this._diffModel,this._layoutInfo.map(v=>v.originalEditor),this._layoutInfo.map(v=>v.modifiedEditor),this._editors)),void 0)})),this._register(If(this.elements.overlay,{width:this._layoutInfo.map((p,_)=>p.originalEditor.width+(this._options.renderSideBySide.read(_)?0:p.modifiedEditor.width)),visibility:Ut(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,C=p.target,w=this._diffModel.get();if(!w)return;const y=(v=w.diff.get())===null||v===void 0?void 0:v.mappings;if(!y)return;const L=y.find(S=>(C==null?void 0:C.detail.afterLineNumber)===S.lineRangeMapping.modified.startLineNumber-1||S.lineRangeMapping.modified.startLineNumber===b);if(!L)return;this.revert(L.lineRangeMapping),p.event.stopPropagation()}})),this._register(We.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(C=>C.lineRangeMapping.modified.contains(p.position.lineNumber));b!=null&&b.lineRangeMapping.modified.isEmpty?this._audioCueService.playAudioCue(Jt.diffLineDeleted,{source:"diffEditor.cursorPositionChanged"}):b!=null&&b.lineRangeMapping.original.isEmpty?this._audioCueService.playAudioCue(Jt.diffLineInserted,{source:"diffEditor.cursorPositionChanged"}):b&&this._audioCueService.playAudioCue(Jt.diffLineModified,{source:"diffEditor.cursorPositionChanged"})}}));const g=this._diffModel.map((p,_)=>p==null?void 0:p.isDiffUpToDate.read(_));this._register(pr((p,_)=>{if(g.read(p)===!1){const v=this._editorProgressService.show(!0,1e3);_.add(vt(()=>v.done()))}}))}_createInnerEditor(e,t,i,s){return e.createInstance(Ob,t,i,s)}_createDiffEditorContributions(){const e=Wv.getDiffEditorContributions();for(const t of e)try{this._register(this._instantiationService.createInstance(t.ctor,this))}catch(i){Dt(i)}}get _targetEditor(){return this._editors.modified}getEditorType(){return fS.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(eF,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),Gi(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?qRe(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=HU(a.getStartPosition(),l),d=HU(a.getEndPosition(),l);r=I.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&&Gi(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&&Gi(i=>{for(const s of t)s.showAll(i)})}};vm=URe([_1(3,bt),_1(4,_t),_1(5,ai),_1(6,MS),_1(7,Tg)],vm);function HU(n,e){const t=EE(e,s=>s.original.startLineNumber<=n.lineNumber);if(!t)return I.fromPositions(n);if(t.original.endLineNumberExclusive<=n.lineNumber){const s=n.lineNumber-t.original.endLineNumberExclusive+t.modified.endLineNumberExclusive;return I.fromPositions(new Y(s,n.column))}if(!t.innerChanges)return I.fromPositions(new Y(t.modified.startLineNumber,1));const i=EE(t.innerChanges,s=>s.originalRange.getStartPosition().isBeforeOrEqual(n));if(!i){const s=n.lineNumber-t.original.startLineNumber+t.modified.startLineNumber;return I.fromPositions(new Y(s,n.column))}if(i.originalRange.containsPosition(n))return i.modifiedRange;{const s=jRe(i.originalRange.getEndPosition(),n);return I.fromPositions(KRe(i.modifiedRange.getEndPosition(),s))}}function jRe(n,e){return n.lineNumber===e.lineNumber?new zw(0,e.column-n.column):new zw(e.lineNumber-n.lineNumber,e.column-1)}function KRe(n,e){return e.lineCount===0?new Y(n.lineNumber,n.column+e.columnCount):new Y(n.lineNumber+e.lineCount,e.columnCount+1)}function qRe(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 k7=globalThis&&globalThis.__decorate||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},Ki=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let GRe=0,$U=!1;function YRe(n){if(!n){if($U)return;$U=!0}ZCe(n||document.body)}let MI=class extends Ob{constructor(e,t,i,s,o,r,a,l,c,d,u,h){const f=Object.assign({},t);f.ariaLabel=f.ariaLabel||sI.editorViewAccessibleLabel,f.ariaLabel=f.ariaLabel+";"+sI.accessibilityHelpMessage,super(e,f,{},i,s,o,r,l,c,d,u,h),a instanceof Ub?this._standaloneKeybindingService=a:this._standaloneKeybindingService=null,YRe(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_"+ ++GRe,o=fe.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"),te.None;const t=e.id,i=e.label,s=fe.and(fe.equals("editorId",this.getId()),fe.deserialize(e.precondition)),o=e.keybindings,r=fe.and(s,fe.deserialize(e.keybindingContext)),a=e.contextMenuGroupId||null,l=e.contextMenuOrder||0,c=(f,...g)=>Promise.resolve(e.run(this,...g)),d=new be,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(Ls.appendMenuItem(M.EditorContext,f))}if(Array.isArray(o))for(const f of o)d.add(this._standaloneKeybindingService.addDynamicKeybinding(u,f,c,r));const h=new LJ(u,i,i,s,(...f)=>Promise.resolve(e.run(this,...f)),this._contextKeyService);return this._actions.set(t,h),d.add(vt(()=>{this._actions.delete(t)})),d}_triggerCommand(e,t){if(this._codeEditorService instanceof ZE)try{this._codeEditorService.setActiveCodeEditor(this),super._triggerCommand(e,t)}finally{this._codeEditorService.setActiveCodeEditor(null)}else super._triggerCommand(e,t)}};MI=k7([Ki(2,_t),Ki(3,ai),Ki(4,gn),Ki(5,bt),Ki(6,Di),Ki(7,os),Ki(8,Nn),Ki(9,oh),Ki(10,Ni),Ki(11,Ze)],MI);let nF=class extends MI{constructor(e,t,i,s,o,r,a,l,c,d,u,h,f,g,p){const _=Object.assign({},t);kI(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 C;if(typeof b>"u"){const w=f.getLanguageIdByMimeType(_.language)||_.language||Yr;C=Ate(h,f,_.value||"",w,void 0),this._ownsModel=!0}else C=b,this._ownsModel=!1;if(this._attachModel(C),C){const w={oldModelUrl:null,newModelUrl:C.uri};this._onDidChangeModel.fire(w)}}dispose(){super.dispose()}updateOptions(e){kI(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)}};nF=k7([Ki(2,_t),Ki(3,ai),Ki(4,gn),Ki(5,bt),Ki(6,Di),Ki(7,la),Ki(8,Nn),Ki(9,zt),Ki(10,oh),Ki(11,Zi),Ki(12,qi),Ki(13,Ni),Ki(14,Ze)],nF);let sF=class extends vm{constructor(e,t,i,s,o,r,a,l,c,d,u,h){const f=Object.assign({},t);kI(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){kI(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(MI,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)}};sF=k7([Ki(2,_t),Ki(3,bt),Ki(4,ai),Ki(5,la),Ki(6,Nn),Ki(7,zt),Ki(8,Cl),Ki(9,Tg),Ki(10,ch),Ki(11,MS)],sF);function Ate(n,e,t,i,s){if(t=t||"",!i){const o=t.indexOf("\n");let r=t;return o!==-1&&(r=t.substring(0,o)),zU(n,t,e.createByFilepathOrFirstLine(s||null,r),s)}return zU(n,t,e.createById(i),s)}function zU(n,e,t,i){return n.createModel(e,t,i)}var Mte=globalThis&&globalThis.__awaiter||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 ZRe(n,e,t){return mt.initialize(t||{}).createInstance(nF,n,e)}function XRe(n){return mt.get(ai).onCodeEditorAdd(t=>{n(t)})}function QRe(n){return mt.get(ai).onDiffEditorAdd(t=>{n(t)})}function JRe(){return mt.get(ai).listCodeEditors()}function e2e(){return mt.get(ai).listDiffEditors()}function t2e(n,e,t){return mt.initialize(t||{}).createInstance(sF,n,e)}function i2e(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 n2e(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=fe.deserialize(n.precondition),t=(s,...o)=>fs.runEditorCommand(s,o,e,(r,a,l)=>Promise.resolve(n.run(a,...l))),i=new be;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(Ls.appendMenuItem(M.EditorContext,s))}if(Array.isArray(n.keybindings)){const s=mt.get(Di);if(!(s instanceof Ub))console.warn("Cannot add keybinding because the editor is configured with an unrecognized KeybindingService");else{const o=fe.and(e,fe.deserialize(n.keybindingContext));i.add(s.addDynamicKeybindings(n.keybindings.map(r=>({keybinding:r,command:n.id,when:o}))))}}return i}function s2e(n){return Rte([n])}function Rte(n){const e=mt.get(Di);return e instanceof Ub?e.addDynamicKeybindings(n.map(t=>({keybinding:t.keybinding,command:t.command,commandArgs:t.commandArgs,when:fe.deserialize(t.when)}))):(console.warn("Cannot add keybinding because the editor is configured with an unrecognized KeybindingService"),te.None)}function o2e(n,e,t){const i=mt.get(qi),s=i.getLanguageIdByMimeType(e)||e;return Ate(mt.get(Zi),i,n,s,t)}function r2e(n,e){const t=mt.get(qi),i=t.getLanguageIdByMimeType(e)||e||Yr;n.setLanguage(t.createById(i))}function a2e(n,e,t){n&&mt.get(zd).changeOne(e,n.uri,t)}function l2e(n){mt.get(zd).changeAll(n,[])}function c2e(n){return mt.get(zd).read(n)}function d2e(n){return mt.get(zd).onMarkerChanged(n)}function u2e(n){return mt.get(Zi).getModel(n)}function h2e(){return mt.get(Zi).getModels()}function f2e(n){return mt.get(Zi).onModelAdded(n)}function g2e(n){return mt.get(Zi).onModelRemoved(n)}function p2e(n){return mt.get(Zi).onModelLanguageChanged(t=>{n({model:t.model,oldLanguage:t.oldLanguageId})})}function m2e(n){return SCe(mt.get(Zi),mt.get(Ni),n)}function _2e(n,e){const t=mt.get(qi),i=mt.get(la);return Z8.colorizeElement(i,t,n,e).then(()=>{i.registerEditorContainer(n)})}function v2e(n,e,t){const i=mt.get(qi);return mt.get(la).registerEditorContainer(document.body),Z8.colorize(i,n,e,t)}function b2e(n,e,t=4){return mt.get(la).registerEditorContainer(document.body),Z8.colorizeModelLine(n,e,t)}function C2e(n){const e=nn.get(n);return e||{getInitialState:()=>Eb,tokenize:(t,i,s)=>q8(n,s)}}function w2e(n,e){nn.getOrCreate(e);const t=C2e(e),i=Sd(n),s=[];let o=t.getInitialState();for(let r=0,a=i.length;rMte(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 I2e(){return{create:ZRe,getEditors:JRe,getDiffEditors:e2e,onDidCreateEditor:XRe,onDidCreateDiffEditor:QRe,createDiffEditor:t2e,addCommand:i2e,addEditorAction:n2e,addKeybindingRule:s2e,addKeybindingRules:Rte,createModel:o2e,setModelLanguage:r2e,setModelMarkers:a2e,getModelMarkers:c2e,removeAllMarkers:l2e,onDidChangeMarkers:d2e,getModels:h2e,getModel:u2e,onDidCreateModel:f2e,onWillDisposeModel:g2e,onDidChangeModelLanguage:p2e,createWebWorker:m2e,colorizeElement:_2e,colorize:v2e,colorizeModelLine:b2e,tokenize:w2e,defineTheme:y2e,setTheme:S2e,remeasureFonts:L2e,registerCommand:k2e,registerLinkOpener:D2e,registerEditorOpener:E2e,AccessibilitySupport:Z2,ContentWidgetPositionPreference:iP,CursorChangeReason:nP,DefaultEndOfLine:sP,EditorAutoIndentStrategy:rP,EditorOption:aP,EndOfLinePreference:lP,EndOfLineSequence:cP,MinimapPosition:vP,MouseTargetType:bP,OverlayWidgetPositionPreference:CP,OverviewRulerLane:wP,GlyphMarginLane:dP,RenderLineNumbersType:SP,RenderMinimap:LP,ScrollbarVisibility:DP,ScrollType:kP,TextEditorCursorBlinkingStyle:NP,TextEditorCursorStyle:AP,TrackedRangeStickiness:MP,WrappingIndent:RP,InjectedTextCursorStops:hP,PositionAffinity:yP,ConfigurationChangedEvent:oX,BareFontInfo:$p,FontInfo:FP,TextModelResolvedOptions:cD,FindMatch:Lw,ApplyUpdateResult:pC,EditorZoom:ma,EditorType:fS,EditorOptions:vc}}function T2e(n,e){if(!e||!Array.isArray(e))return!1;for(const t of e)if(!n(t))return!1;return!0}function sk(n,e){return typeof n=="boolean"?n:e}function UU(n,e){return typeof n=="string"?n:e}function x2e(n){const e={};for(const t of n)e[t]=!0;return e}function jU(n,e=!1){e&&(n=n.map(function(i){return i.toLowerCase()}));const t=x2e(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 oF(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?Wi(n,"language definition does not contain attribute '"+r+"', used at: "+e):Wi(n,"attribute reference '"+r+"' must be a string, used at: "+e);return K_(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 N2e(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 Wi(n,"a 'bracket' attribute must be either '@open' or '@close', in rule: "+e);if(t.next){if(typeof t.next!="string")throw Wi(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&&!$Ce(n,$h(n,s,"",[],""))))throw Wi(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=oF(e,"^(?:"+(this.matchOnlyAtLineStart?i.substr(1):i)+")")}setAction(e,t){this.action=rF(e,this.name,t)}}function Pte(n,e){if(!e||typeof e!="object")throw new Error("Monarch: expecting a language definition object");const t={};t.languageId=n,t.includeLF=sk(e.includeLF,!1),t.noThrow=!1,t.maxStack=100,t.start=typeof e.start=="string"?e.start:null,t.ignoreCase=sk(e.ignoreCase,!1),t.unicode=sk(e.unicode,!1),t.tokenPostfix=UU(e.tokenPostfix,"."+t.languageId),t.defaultToken=UU(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 Wi(t,"an 'include' attribute must be a string at: "+r);if(d[0]==="@"&&(d=d.substr(1)),!e.tokenizer[d])throw Wi(t,"include target '"+d+"' is not defined at: "+r);s(r+"."+d,a,e.tokenizer[d])}else{const u=new M2e(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 Wi(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 Wi(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=sk(c.matchOnlyAtLineStart,!1)),u.setRegex(i,c.regex),u.setAction(i,c.action)}a.push(u)}}}if(!e.tokenizer||typeof e.tokenizer!="object")throw Wi(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 Wi(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 Wi(t,"open and close brackets in a 'brackets' attribute must be different: "+a.open+"\n 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:yf(t,a.open),close:yf(t,a.close)});else throw Wi(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 R2e=globalThis&&globalThis.__awaiter||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 P2e(n){kb.registerLanguage(n)}function O2e(){let n=[];return n=n.concat(kb.getLanguages()),n}function F2e(n){return mt.get(qi).languageIdCodec.encodeLanguageId(n)}function B2e(n,e){return mt.withServices(()=>{const i=mt.get(qi).onDidRequestRichLanguageFeatures(s=>{s===n&&(i.dispose(),e())});return i})}function W2e(n,e){return mt.withServices(()=>{const i=mt.get(qi).onDidRequestBasicLanguageFeatures(s=>{s===n&&(i.dispose(),e())});return i})}function V2e(n,e){if(!mt.get(qi).isRegisteredLanguageId(n))throw new Error("Cannot set configuration for unknown language ".concat(n));return mt.get(Ni).register(n,e,100)}class H2e{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 py.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 KT(s.tokens,s.endState)}}class py{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:fR2e(this,void 0,void 0,function*(){const i=yield Promise.resolve(e.create());return i?$2e(i)?Fte(n,i):new Nw(mt.get(qi),mt.get(la),n,Pte(n,i),mt.get(zt)):null}));return nn.registerFactory(n,t)}function j2e(n,e){if(!mt.get(qi).isRegisteredLanguageId(n))throw new Error("Cannot set tokens provider for unknown language ".concat(n));return Ote(e)?D7(n,{create:()=>e}):nn.register(n,Fte(n,e))}function K2e(n,e){const t=i=>new Nw(mt.get(qi),mt.get(la),n,Pte(n,i),mt.get(zt));return Ote(e)?D7(n,{create:()=>e}):nn.register(n,t(e))}function q2e(n,e){return mt.get(Ze).referenceProvider.register(n,e)}function G2e(n,e){return mt.get(Ze).renameProvider.register(n,e)}function Y2e(n,e){return mt.get(Ze).signatureHelpProvider.register(n,e)}function Z2e(n,e){return mt.get(Ze).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 I(s.lineNumber,r.startColumn,s.lineNumber,r.endColumn)),a.range||(a.range=new I(s.lineNumber,s.column,s.lineNumber,s.column)),a})}})}function X2e(n,e){return mt.get(Ze).documentSymbolProvider.register(n,e)}function Q2e(n,e){return mt.get(Ze).documentHighlightProvider.register(n,e)}function J2e(n,e){return mt.get(Ze).linkedEditingRangeProvider.register(n,e)}function ePe(n,e){return mt.get(Ze).definitionProvider.register(n,e)}function tPe(n,e){return mt.get(Ze).implementationProvider.register(n,e)}function iPe(n,e){return mt.get(Ze).typeDefinitionProvider.register(n,e)}function nPe(n,e){return mt.get(Ze).codeLensProvider.register(n,e)}function sPe(n,e,t){return mt.get(Ze).codeActionProvider.register(n,{providedCodeActionKinds:t==null?void 0:t.providedCodeActionKinds,documentation:t==null?void 0:t.documentation,provideCodeActions:(s,o,r,a)=>{const c=mt.get(zd).read({resource:s.uri}).filter(d=>I.areIntersectingOrTouching(d,o));return e.provideCodeActions(s,o,{markers:c,only:r.only,trigger:r.trigger},a)},resolveCodeAction:e.resolveCodeAction})}function oPe(n,e){return mt.get(Ze).documentFormattingEditProvider.register(n,e)}function rPe(n,e){return mt.get(Ze).documentRangeFormattingEditProvider.register(n,e)}function aPe(n,e){return mt.get(Ze).onTypeFormattingEditProvider.register(n,e)}function lPe(n,e){return mt.get(Ze).linkProvider.register(n,e)}function cPe(n,e){return mt.get(Ze).completionProvider.register(n,e)}function dPe(n,e){return mt.get(Ze).colorProvider.register(n,e)}function uPe(n,e){return mt.get(Ze).foldingRangeProvider.register(n,e)}function hPe(n,e){return mt.get(Ze).declarationProvider.register(n,e)}function fPe(n,e){return mt.get(Ze).selectionRangeProvider.register(n,e)}function gPe(n,e){return mt.get(Ze).documentSemanticTokensProvider.register(n,e)}function pPe(n,e){return mt.get(Ze).documentRangeSemanticTokensProvider.register(n,e)}function mPe(n,e){return mt.get(Ze).inlineCompletionsProvider.register(n,e)}function _Pe(n,e){return mt.get(Ze).inlayHintsProvider.register(n,e)}function vPe(){return{register:P2e,getLanguages:O2e,onLanguage:B2e,onLanguageEncountered:W2e,getEncodedLanguageId:F2e,setLanguageConfiguration:V2e,setColorMap:U2e,registerTokensProviderFactory:D7,setTokensProvider:j2e,setMonarchTokensProvider:K2e,registerReferenceProvider:q2e,registerRenameProvider:G2e,registerCompletionItemProvider:cPe,registerSignatureHelpProvider:Y2e,registerHoverProvider:Z2e,registerDocumentSymbolProvider:X2e,registerDocumentHighlightProvider:Q2e,registerLinkedEditingRangeProvider:J2e,registerDefinitionProvider:ePe,registerImplementationProvider:tPe,registerTypeDefinitionProvider:iPe,registerCodeLensProvider:nPe,registerCodeActionProvider:sPe,registerDocumentFormattingEditProvider:oPe,registerDocumentRangeFormattingEditProvider:rPe,registerOnTypeFormattingEditProvider:aPe,registerLinkProvider:lPe,registerColorProvider:dPe,registerFoldingRangeProvider:uPe,registerDeclarationProvider:hPe,registerSelectionRangeProvider:fPe,registerDocumentSemanticTokensProvider:gPe,registerDocumentRangeSemanticTokensProvider:pPe,registerInlineCompletionsProvider:mPe,registerInlayHintsProvider:_Pe,DocumentHighlightKind:oP,CompletionItemKind:J2,CompletionItemTag:eP,CompletionItemInsertTextRule:Q2,SymbolKind:TP,SymbolTag:xP,IndentAction:uP,CompletionTriggerKind:tP,SignatureHelpTriggerKind:IP,InlayHintKind:fP,InlineCompletionTriggerKind:gP,CodeActionTriggerType:X2,FoldingRangeKind:xo,SelectedSuggestionInfo:wX}}const E7=Wt("IEditorCancelService"),Bte=new Ve("cancellableOperation",!1,m("cancellableOperation","Whether the editor runs a cancellable operation, e.g. like 'Peek References'"));Gt(E7,class{constructor(){this._tokens=new WeakMap}add(n,e){let t=this._tokens.get(n);t||(t=n.invokeWithinContext(s=>{const o=Bte.bindTo(s.get(bt)),r=new To;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 bPe extends Tn{constructor(e,t){super(t),this.editor=e,this._unregister=e.invokeWithinContext(i=>i.get(E7).add(e,this))}dispose(){this._unregister(),super.dispose()}}Re(new class extends fs{constructor(){super({id:"editor.cancelOperation",kbOpts:{weight:100,primary:9},precondition:Bte})}runEditorCommand(n,e){n.get(E7).cancel(e)}});let Wte=class aF{constructor(e,t){if(this.flags=t,this.flags&1){const i=e.getModel();this.modelVersionId=i?sm("{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 aF))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 aF(e,this.flags))}};class tg extends bPe{constructor(e,t,i,s){super(e,s),this._listener=new be,t&4&&this._listener.add(e.onDidChangeCursorPosition(o=>{(!i||!I.containsPosition(i,o.position))&&this.cancel()})),t&2&&this._listener.add(e.onDidChangeCursorSelection(o=>{(!i||!I.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 I7 extends Tn{constructor(e,t){super(t),this._listener=e.onDidChangeContent(()=>this.cancel())}dispose(){this._listener.dispose(),super.dispose()}}function Ad(n){return n&&typeof n.getEditorType=="function"?n.getEditorType()===fS.ICodeEditor:!1}function Vte(n){return n&&typeof n.getEditorType=="function"?n.getEditorType()===fS.IDiffEditor:!1}function CPe(n){return!!n&&typeof n=="object"&&typeof n.onDidChangeActiveEditor=="function"}function Hte(n){return Ad(n)?n:Vte(n)?n.getModifiedEditor():CPe(n)&&Ad(n.activeCodeEditor)?n.activeCodeEditor:null}class jb{static _handleEolEdits(e,t){let i;const s=[];for(const o of t)typeof o.eol=="number"&&(i=o.eol),o.range&&typeof o.text=="string"&&s.push(o);return typeof i=="number"&&e.hasModel()&&e.getModel().pushEOL(i),s}static _isFullModelReplaceEdit(e,t){if(!e.hasModel())return!1;const i=e.getModel(),s=i.validateRange(t.range);return i.getFullModelRange().equalsRange(s)}static execute(e,t,i){i&&e.pushUndoStop();const s=mc.capture(e),o=jb._handleEolEdits(e,t);o.length===1&&jb._isFullModelReplaceEdit(e,o[0])?e.executeEdits("formatEditsCommand",o.map(r=>Yi.replace(I.lift(r.range),r.text))):e.executeEdits("formatEditsCommand",o.map(r=>Yi.replaceMove(I.lift(r.range),r.text))),i&&e.pushUndoStop(),s.restoreRelativeVerticalPositionOfCursor(e)}}class KU{constructor(e){this.value=e,this._lower=e.toLowerCase()}static toKey(e){return typeof e=="string"?e.toLowerCase():e._lower}}class wPe{constructor(e){if(this._set=new Set,e)for(const t of e)this.add(t)}add(e){this._set.add(KU.toKey(e))}has(e){return this._set.has(KU.toKey(e))}}var _c=globalThis&&globalThis.__awaiter||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 T7(n){if(n=n.filter(s=>s.range),!n.length)return;let{range:e}=n[0];for(let s=1;s0&&I.areIntersectingOrTouching(u[h-1],v)?u[h-1]=I.fromPositions(u[h-1].getStartPosition(),v.getEndPosition()):h=u.push(v);const f=v=>_c(this,void 0,void 0,function*(){var b,C;l.trace("[format][provideDocumentRangeFormattingEdits] (request)",(b=e.extensionId)===null||b===void 0?void 0:b.value,v);const w=(yield e.provideDocumentRangeFormattingEdits(c,v,c.getFormattingOptions(),d.token))||[];return l.trace("[format][provideDocumentRangeFormattingEdits] (response)",(C=e.extensionId)===null||C===void 0?void 0:C.value,w),w}),g=(v,b)=>{if(!v.length||!b.length)return!1;const C=v.reduce((w,y)=>I.plusRange(w,y.range),v[0].range);if(!b.some(w=>I.intersectRanges(C,w.range)))return!1;for(const w of v)for(const y of b)if(I.intersectRanges(w.range,y.range))return!0;return!1},p=[],_=[];try{if(typeof e.provideDocumentRangesFormattingEdits=="function"){l.trace("[format][provideDocumentRangeFormattingEdits] (request)",(o=e.extensionId)===null||o===void 0?void 0:o.value,u);const v=(yield e.provideDocumentRangesFormattingEdits(c,u,c.getFormattingOptions(),d.token))||[];l.trace("[format][provideDocumentRangeFormattingEdits] (response)",(r=e.extensionId)===null||r===void 0?void 0:r.value,v),_.push(v)}else{for(const v of u){if(d.token.isCancellationRequested)return!0;_.push(yield f(v))}for(let v=0;v({text:C.text,range:I.lift(C.range),forceMoveMarkers:!0})),C=>{for(const{range:w}of C)if(I.areIntersectingOrTouching(w,b))return[new Je(w.startLineNumber,w.startColumn,w.endLineNumber,w.endColumn)];return null})}return!0})}function SPe(n,e,t,i,s){return _c(this,void 0,void 0,function*(){const o=n.get(_t),r=n.get(Ze),a=Ad(e)?e.getModel():e,l=$te(r.documentFormattingEditProvider,r.documentRangeFormattingEditProvider,a),c=yield bm.select(l,a,t);c&&(i.report(c),yield o.invokeFunction(LPe,c,e,t,s))})}function LPe(n,e,t,i,s){return _c(this,void 0,void 0,function*(){const o=n.get(Sl);let r,a;Ad(t)?(r=t.getModel(),a=new tg(t,5,void 0,s)):(r=t,a=new I7(t,s));let l;try{const c=yield e.provideDocumentFormattingEdits(r,r.getFormattingOptions(),a.token);if(l=yield o.computeMoreMinimalEdits(r.uri,c),a.token.isCancellationRequested)return!0}finally{a.dispose()}if(!l||l.length===0)return!1;if(Ad(t))jb.execute(t,l,i!==2),i!==2&&(T7(l),t.revealPositionInCenterIfOutsideViewport(t.getPosition(),1));else{const[{range:c}]=l,d=new Je(c.startLineNumber,c.startColumn,c.endLineNumber,c.endColumn);r.pushEditOperations([d],l.map(u=>({text:u.text,range:I.lift(u.range),forceMoveMarkers:!0})),u=>{for(const{range:h}of u)if(I.areIntersectingOrTouching(h,d))return[new Je(h.startLineNumber,h.startColumn,h.endLineNumber,h.endColumn)];return null})}return!0})}function kPe(n,e,t,i,s,o){return _c(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(Bn);if(io(l))return yield n.computeMoreMinimalEdits(t.uri,l)}})}function DPe(n,e,t,i,s){return _c(this,void 0,void 0,function*(){const o=$te(e.documentFormattingEditProvider,e.documentRangeFormattingEditProvider,t);for(const r of o){const a=yield Promise.resolve(r.provideDocumentFormattingEdits(t,i,s)).catch(Bn);if(io(a))return yield n.computeMoreMinimalEdits(t.uri,a)}})}function Ute(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(Bn).then(l=>n.computeMoreMinimalEdits(t.uri,l))}qt.registerCommand("_executeFormatRangeProvider",function(n,...e){return _c(this,void 0,void 0,function*(){const[t,i,s]=e;bi(ct.isUri(t)),bi(I.isIRange(i));const o=n.get(sr),r=n.get(Sl),a=n.get(Ze),l=yield o.createModelReference(t);try{return kPe(r,a,l.object.textEditorModel,I.lift(i),s,Ft.None)}finally{l.dispose()}})});qt.registerCommand("_executeFormatDocumentProvider",function(n,...e){return _c(this,void 0,void 0,function*(){const[t,i]=e;bi(ct.isUri(t));const s=n.get(sr),o=n.get(Sl),r=n.get(Ze),a=yield s.createModelReference(t);try{return DPe(o,r,a.object.textEditorModel,i,Ft.None)}finally{a.dispose()}})});qt.registerCommand("_executeFormatOnTypeProvider",function(n,...e){return _c(this,void 0,void 0,function*(){const[t,i,s,o]=e;bi(ct.isUri(t)),bi(Y.isIPosition(i)),bi(typeof s=="string");const r=n.get(sr),a=n.get(Sl),l=n.get(Ze),c=yield r.createModelReference(t);try{return Ute(a,l,c.object.textEditorModel,Y.lift(i),s,o,Ft.None)}finally{c.dispose()}})});vc.wrappingIndent.defaultValue=0;vc.glyphMargin.defaultValue=!1;vc.autoIndent.defaultValue=3;vc.overviewRulerLanes.defaultValue=2;bm.setFormatterSelector((n,e,t)=>Promise.resolve(n[0]));const Bo=yX();Bo.editor=I2e();Bo.languages=vPe();const EPe=Bo.CancellationTokenSource,IPe=Bo.Emitter,jte=Bo.KeyCode,Kte=Bo.KeyMod,TPe=Bo.Position,xPe=Bo.Range,NPe=Bo.Selection,APe=Bo.SelectionDirection,MPe=Bo.MarkerSeverity,RPe=Bo.MarkerTag,PPe=Bo.Uri,OPe=Bo.Token,ID=Bo.editor,lF=Bo.languages,pR=globalThis.MonacoEnvironment;(pR!=null&&pR.globalAPI||typeof define=="function"&&define.amd)&&(globalThis.monaco=Bo);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 PS=Object.freeze(Object.defineProperty({__proto__:null,CancellationTokenSource:EPe,Emitter:IPe,KeyCode:jte,KeyMod:Kte,MarkerSeverity:MPe,MarkerTag:RPe,Position:TPe,Range:xPe,Selection:NPe,SelectionDirection:APe,Token:OPe,Uri:PPe,editor:ID,languages:lF},Symbol.toStringTag,{value:"Module"})),FPe="modulepreload",BPe=function(n,e){return new URL(n,e).href},qU={},tt=function(e,t,i){if(!t||t.length===0)return e();const s=document.getElementsByTagName("link");return Promise.all(t.map(o=>{if(o=BPe(o,i),o in qU)return;qU[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="'.concat(o,'"]').concat(a)))return;const c=document.createElement("link");if(c.rel=r?"stylesheet":FPe,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 ".concat(o))))})})).then(()=>e()).catch(o=>{const r=new Event("vite:preloadError",{cancelable:!0});if(r.payload=o,window.dispatchEvent(r),!r.defaultPrevented)throw o})};/*!----------------------------------------------------------------------------- * 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 WPe=Object.defineProperty,VPe=Object.getOwnPropertyDescriptor,HPe=Object.getOwnPropertyNames,$Pe=Object.prototype.hasOwnProperty,GU=(n,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of HPe(e))!$Pe.call(n,s)&&s!==t&&WPe(n,s,{get:()=>e[s],enumerable:!(i=VPe(e,s))||i.enumerable});return n},zPe=(n,e,t)=>(GU(n,e,"default"),t&&GU(t,e,"default")),Q1={};zPe(Q1,PS);var qte={},pR={},Gte=class{constructor(n){an(this,"_languageId");an(this,"_loadingTriggered");an(this,"_lazyLoadPromise");an(this,"_lazyLoadPromiseResolve");an(this,"_lazyLoadPromiseReject");this._languageId=n,this._loadingTriggered=!1,this._lazyLoadPromise=new Promise((e,t)=>{this._lazyLoadPromiseResolve=e,this._lazyLoadPromiseReject=t})}static getOrCreate(n){return pR[n]||(pR[n]=new Gte(n)),pR[n]}load(){return this._loadingTriggered||(this._loadingTriggered=!0,qte[this._languageId].loader().then(n=>this._lazyLoadPromiseResolve(n),n=>this._lazyLoadPromiseReject(n))),this._lazyLoadPromise}};function at(n){const e=n.id;qte[e]=n,Q1.languages.register(n);const t=Gte.getOrCreate(e);Q1.languages.registerTokensProviderFactory(e,{create:async()=>(await t.load()).language}),Q1.languages.onLanguageEncountered(e,async()=>{const i=await t.load();Q1.languages.setLanguageConfiguration(e,i.conf)})}at({id:"abap",extensions:[".abap"],aliases:["abap","ABAP"],loader:()=>tt(()=>import("./abap-e5f08dc1.js"),[],import.meta.url)});at({id:"apex",extensions:[".cls"],aliases:["Apex","apex"],mimetypes:["text/x-apex-source","text/x-apex"],loader:()=>tt(()=>import("./apex-fc8a734c.js"),[],import.meta.url)});at({id:"azcli",extensions:[".azcli"],aliases:["Azure CLI","azcli"],loader:()=>tt(()=>import("./azcli-c4358445.js"),[],import.meta.url)});at({id:"bat",extensions:[".bat",".cmd"],aliases:["Batch","bat"],loader:()=>tt(()=>import("./bat-eaac827b.js"),[],import.meta.url)});at({id:"bicep",extensions:[".bicep"],aliases:["Bicep"],loader:()=>tt(()=>import("./bicep-982b0d5f.js"),[],import.meta.url)});at({id:"cameligo",extensions:[".mligo"],aliases:["Cameligo"],loader:()=>tt(()=>import("./cameligo-ff939f45.js"),[],import.meta.url)});at({id:"clojure",extensions:[".clj",".cljs",".cljc",".edn"],aliases:["clojure","Clojure"],loader:()=>tt(()=>import("./clojure-4a1da11c.js"),[],import.meta.url)});at({id:"coffeescript",extensions:[".coffee"],aliases:["CoffeeScript","coffeescript","coffee"],mimetypes:["text/x-coffeescript","text/coffeescript"],loader:()=>tt(()=>import("./coffee-97023918.js"),[],import.meta.url)});at({id:"c",extensions:[".c",".h"],aliases:["C","c"],loader:()=>tt(()=>import("./cpp-a410d69a.js"),[],import.meta.url)});at({id:"cpp",extensions:[".cpp",".cc",".cxx",".hpp",".hh",".hxx"],aliases:["C++","Cpp","cpp"],loader:()=>tt(()=>import("./cpp-a410d69a.js"),[],import.meta.url)});at({id:"csharp",extensions:[".cs",".csx",".cake"],aliases:["C#","csharp"],loader:()=>tt(()=>import("./csharp-0765aa28.js"),[],import.meta.url)});at({id:"csp",extensions:[],aliases:["CSP","csp"],loader:()=>tt(()=>import("./csp-dba4fa86.js"),[],import.meta.url)});at({id:"css",extensions:[".css"],aliases:["CSS","css"],mimetypes:["text/css"],loader:()=>tt(()=>import("./css-9ed252c5.js"),[],import.meta.url)});at({id:"cypher",extensions:[".cypher",".cyp"],aliases:["Cypher","OpenCypher"],loader:()=>tt(()=>import("./cypher-4b1a5b20.js"),[],import.meta.url)});at({id:"dart",extensions:[".dart"],aliases:["Dart","dart"],mimetypes:["text/x-dart-source","text/x-dart"],loader:()=>tt(()=>import("./dart-c70c4314.js"),[],import.meta.url)});at({id:"dockerfile",extensions:[".dockerfile"],filenames:["Dockerfile"],aliases:["Dockerfile"],loader:()=>tt(()=>import("./dockerfile-ff7f0401.js"),[],import.meta.url)});at({id:"ecl",extensions:[".ecl"],aliases:["ECL","Ecl","ecl"],loader:()=>tt(()=>import("./ecl-3129e183.js"),[],import.meta.url)});at({id:"elixir",extensions:[".ex",".exs"],aliases:["Elixir","elixir","ex"],loader:()=>tt(()=>import("./elixir-ac388b4d.js"),[],import.meta.url)});at({id:"flow9",extensions:[".flow"],aliases:["Flow9","Flow","flow9","flow"],loader:()=>tt(()=>import("./flow9-049a8a6c.js"),[],import.meta.url)});at({id:"fsharp",extensions:[".fs",".fsi",".ml",".mli",".fsx",".fsscript"],aliases:["F#","FSharp","fsharp"],loader:()=>tt(()=>import("./fsharp-535d9fe2.js"),[],import.meta.url)});at({id:"freemarker2",extensions:[".ftl",".ftlh",".ftlx"],aliases:["FreeMarker2","Apache FreeMarker2"],loader:()=>tt(()=>import("./freemarker2-e12e2a68.js"),[],import.meta.url).then(n=>n.TagAutoInterpolationDollar)});at({id:"freemarker2.tag-angle.interpolation-dollar",aliases:["FreeMarker2 (Angle/Dollar)","Apache FreeMarker2 (Angle/Dollar)"],loader:()=>tt(()=>import("./freemarker2-e12e2a68.js"),[],import.meta.url).then(n=>n.TagAngleInterpolationDollar)});at({id:"freemarker2.tag-bracket.interpolation-dollar",aliases:["FreeMarker2 (Bracket/Dollar)","Apache FreeMarker2 (Bracket/Dollar)"],loader:()=>tt(()=>import("./freemarker2-e12e2a68.js"),[],import.meta.url).then(n=>n.TagBracketInterpolationDollar)});at({id:"freemarker2.tag-angle.interpolation-bracket",aliases:["FreeMarker2 (Angle/Bracket)","Apache FreeMarker2 (Angle/Bracket)"],loader:()=>tt(()=>import("./freemarker2-e12e2a68.js"),[],import.meta.url).then(n=>n.TagAngleInterpolationBracket)});at({id:"freemarker2.tag-bracket.interpolation-bracket",aliases:["FreeMarker2 (Bracket/Bracket)","Apache FreeMarker2 (Bracket/Bracket)"],loader:()=>tt(()=>import("./freemarker2-e12e2a68.js"),[],import.meta.url).then(n=>n.TagBracketInterpolationBracket)});at({id:"freemarker2.tag-auto.interpolation-dollar",aliases:["FreeMarker2 (Auto/Dollar)","Apache FreeMarker2 (Auto/Dollar)"],loader:()=>tt(()=>import("./freemarker2-e12e2a68.js"),[],import.meta.url).then(n=>n.TagAutoInterpolationDollar)});at({id:"freemarker2.tag-auto.interpolation-bracket",aliases:["FreeMarker2 (Auto/Bracket)","Apache FreeMarker2 (Auto/Bracket)"],loader:()=>tt(()=>import("./freemarker2-e12e2a68.js"),[],import.meta.url).then(n=>n.TagAutoInterpolationBracket)});at({id:"go",extensions:[".go"],aliases:["Go"],loader:()=>tt(()=>import("./go-d4bfa116.js"),[],import.meta.url)});at({id:"graphql",extensions:[".graphql",".gql"],aliases:["GraphQL","graphql","gql"],mimetypes:["application/graphql"],loader:()=>tt(()=>import("./graphql-e5a73eb7.js"),[],import.meta.url)});at({id:"handlebars",extensions:[".handlebars",".hbs"],aliases:["Handlebars","handlebars","hbs"],mimetypes:["text/x-handlebars-template"],loader:()=>tt(()=>import("./handlebars-0dcb5c5e.js"),[],import.meta.url)});at({id:"hcl",extensions:[".tf",".tfvars",".hcl"],aliases:["Terraform","tf","HCL","hcl"],loader:()=>tt(()=>import("./hcl-8b69c899.js"),[],import.meta.url)});at({id:"html",extensions:[".html",".htm",".shtml",".xhtml",".mdoc",".jsp",".asp",".aspx",".jshtm"],aliases:["HTML","htm","html","xhtml"],mimetypes:["text/html","text/x-jshtm","text/template","text/ng-template"],loader:()=>tt(()=>import("./html-dc7249e5.js"),[],import.meta.url)});at({id:"ini",extensions:[".ini",".properties",".gitconfig"],filenames:["config",".gitattributes",".gitconfig",".editorconfig"],aliases:["Ini","ini"],loader:()=>tt(()=>import("./ini-83ae2a3a.js"),[],import.meta.url)});at({id:"java",extensions:[".java",".jav"],aliases:["Java","java"],mimetypes:["text/x-java-source","text/x-java"],loader:()=>tt(()=>import("./java-4806d9f5.js"),[],import.meta.url)});at({id:"javascript",extensions:[".js",".es6",".jsx",".mjs",".cjs"],firstLine:"^#!.*\\bnode",filenames:["jakefile"],aliases:["JavaScript","javascript","js"],mimetypes:["text/javascript"],loader:()=>tt(()=>import("./javascript-f7d4365a.js"),["./javascript-f7d4365a.js","./typescript-e18a52a8.js"],import.meta.url)});at({id:"julia",extensions:[".jl"],aliases:["julia","Julia"],loader:()=>tt(()=>import("./julia-334b5fb9.js"),[],import.meta.url)});at({id:"kotlin",extensions:[".kt",".kts"],aliases:["Kotlin","kotlin"],mimetypes:["text/x-kotlin-source","text/x-kotlin"],loader:()=>tt(()=>import("./kotlin-ed14cfc6.js"),[],import.meta.url)});at({id:"less",extensions:[".less"],aliases:["Less","less"],mimetypes:["text/x-less","text/less"],loader:()=>tt(()=>import("./less-f176dddd.js"),[],import.meta.url)});at({id:"lexon",extensions:[".lex"],aliases:["Lexon"],loader:()=>tt(()=>import("./lexon-8bf535e2.js"),[],import.meta.url)});at({id:"lua",extensions:[".lua"],aliases:["Lua","lua"],loader:()=>tt(()=>import("./lua-96829d0e.js"),[],import.meta.url)});at({id:"liquid",extensions:[".liquid",".html.liquid"],aliases:["Liquid","liquid"],mimetypes:["application/liquid"],loader:()=>tt(()=>import("./liquid-a601b5f4.js"),[],import.meta.url)});at({id:"m3",extensions:[".m3",".i3",".mg",".ig"],aliases:["Modula-3","Modula3","modula3","m3"],loader:()=>tt(()=>import("./m3-815f612a.js"),[],import.meta.url)});at({id:"markdown",extensions:[".md",".markdown",".mdown",".mkdn",".mkd",".mdwn",".mdtxt",".mdtext"],aliases:["Markdown","markdown"],loader:()=>tt(()=>import("./markdown-1cddbf33.js"),[],import.meta.url)});at({id:"mdx",extensions:[".mdx"],aliases:["MDX","mdx"],loader:()=>tt(()=>import("./mdx-a89474f5.js"),[],import.meta.url)});at({id:"mips",extensions:[".s"],aliases:["MIPS","MIPS-V"],mimetypes:["text/x-mips","text/mips","text/plaintext"],loader:()=>tt(()=>import("./mips-361940ec.js"),[],import.meta.url)});at({id:"msdax",extensions:[".dax",".msdax"],aliases:["DAX","MSDAX"],loader:()=>tt(()=>import("./msdax-b98f6248.js"),[],import.meta.url)});at({id:"mysql",extensions:[],aliases:["MySQL","mysql"],loader:()=>tt(()=>import("./mysql-b4d05809.js"),[],import.meta.url)});at({id:"objective-c",extensions:[".m"],aliases:["Objective-C"],loader:()=>tt(()=>import("./objective-c-64e6f89b.js"),[],import.meta.url)});at({id:"pascal",extensions:[".pas",".p",".pp"],aliases:["Pascal","pas"],mimetypes:["text/x-pascal-source","text/x-pascal"],loader:()=>tt(()=>import("./pascal-e1cbffd7.js"),[],import.meta.url)});at({id:"pascaligo",extensions:[".ligo"],aliases:["Pascaligo","ligo"],loader:()=>tt(()=>import("./pascaligo-013c6c0b.js"),[],import.meta.url)});at({id:"perl",extensions:[".pl",".pm"],aliases:["Perl","pl"],loader:()=>tt(()=>import("./perl-d9423546.js"),[],import.meta.url)});at({id:"pgsql",extensions:[],aliases:["PostgreSQL","postgres","pg","postgre"],loader:()=>tt(()=>import("./pgsql-423e077d.js"),[],import.meta.url)});at({id:"php",extensions:[".php",".php4",".php5",".phtml",".ctp"],aliases:["PHP","php"],mimetypes:["application/x-php"],loader:()=>tt(()=>import("./php-fb65b6b4.js"),[],import.meta.url)});at({id:"pla",extensions:[".pla"],loader:()=>tt(()=>import("./pla-09e93e1b.js"),[],import.meta.url)});at({id:"postiats",extensions:[".dats",".sats",".hats"],aliases:["ATS","ATS/Postiats"],loader:()=>tt(()=>import("./postiats-429bd8e8.js"),[],import.meta.url)});at({id:"powerquery",extensions:[".pq",".pqm"],aliases:["PQ","M","Power Query","Power Query M"],loader:()=>tt(()=>import("./powerquery-0470a494.js"),[],import.meta.url)});at({id:"powershell",extensions:[".ps1",".psm1",".psd1"],aliases:["PowerShell","powershell","ps","ps1"],loader:()=>tt(()=>import("./powershell-b433b622.js"),[],import.meta.url)});at({id:"proto",extensions:[".proto"],aliases:["protobuf","Protocol Buffers"],loader:()=>tt(()=>import("./protobuf-7aea035f.js"),[],import.meta.url)});at({id:"pug",extensions:[".jade",".pug"],aliases:["Pug","Jade","jade"],loader:()=>tt(()=>import("./pug-b7980504.js"),[],import.meta.url)});at({id:"python",extensions:[".py",".rpy",".pyw",".cpy",".gyp",".gypi"],aliases:["Python","py"],firstLine:"^#!/.*\\bpython[0-9.-]*\\b",loader:()=>tt(()=>import("./python-e2c00b4d.js"),[],import.meta.url)});at({id:"qsharp",extensions:[".qs"],aliases:["Q#","qsharp"],loader:()=>tt(()=>import("./qsharp-eed62033.js"),[],import.meta.url)});at({id:"r",extensions:[".r",".rhistory",".rmd",".rprofile",".rt"],aliases:["R","r"],loader:()=>tt(()=>import("./r-8ce27f67.js"),[],import.meta.url)});at({id:"razor",extensions:[".cshtml"],aliases:["Razor","razor"],mimetypes:["text/x-cshtml"],loader:()=>tt(()=>import("./razor-957bc68d.js"),[],import.meta.url)});at({id:"redis",extensions:[".redis"],aliases:["redis"],loader:()=>tt(()=>import("./redis-aec7cdf4.js"),[],import.meta.url)});at({id:"redshift",extensions:[],aliases:["Redshift","redshift"],loader:()=>tt(()=>import("./redshift-7d933e7a.js"),[],import.meta.url)});at({id:"restructuredtext",extensions:[".rst"],aliases:["reStructuredText","restructuredtext"],loader:()=>tt(()=>import("./restructuredtext-a9e4c4cc.js"),[],import.meta.url)});at({id:"ruby",extensions:[".rb",".rbx",".rjs",".gemspec",".pp"],filenames:["rakefile","Gemfile"],aliases:["Ruby","rb"],loader:()=>tt(()=>import("./ruby-a1bbf563.js"),[],import.meta.url)});at({id:"rust",extensions:[".rs",".rlib"],aliases:["Rust","rust"],loader:()=>tt(()=>import("./rust-9669a673.js"),[],import.meta.url)});at({id:"sb",extensions:[".sb"],aliases:["Small Basic","sb"],loader:()=>tt(()=>import("./sb-b221a0fc.js"),[],import.meta.url)});at({id:"scala",extensions:[".scala",".sc",".sbt"],aliases:["Scala","scala","SBT","Sbt","sbt","Dotty","dotty"],mimetypes:["text/x-scala-source","text/x-scala","text/x-sbt","text/x-dotty"],loader:()=>tt(()=>import("./scala-9222416a.js"),[],import.meta.url)});at({id:"scheme",extensions:[".scm",".ss",".sch",".rkt"],aliases:["scheme","Scheme"],loader:()=>tt(()=>import("./scheme-86110af1.js"),[],import.meta.url)});at({id:"scss",extensions:[".scss"],aliases:["Sass","sass","scss"],mimetypes:["text/x-scss","text/scss"],loader:()=>tt(()=>import("./scss-30d2f332.js"),[],import.meta.url)});at({id:"shell",extensions:[".sh",".bash"],aliases:["Shell","sh"],loader:()=>tt(()=>import("./shell-0ca4f4ad.js"),[],import.meta.url)});at({id:"sol",extensions:[".sol"],aliases:["sol","solidity","Solidity"],loader:()=>tt(()=>import("./solidity-0072896b.js"),[],import.meta.url)});at({id:"aes",extensions:[".aes"],aliases:["aes","sophia","Sophia"],loader:()=>tt(()=>import("./sophia-bc45fa87.js"),[],import.meta.url)});at({id:"sparql",extensions:[".rq"],aliases:["sparql","SPARQL"],loader:()=>tt(()=>import("./sparql-28fc150c.js"),[],import.meta.url)});at({id:"sql",extensions:[".sql"],aliases:["SQL"],loader:()=>tt(()=>import("./sql-96f7b353.js"),[],import.meta.url)});at({id:"st",extensions:[".st",".iecst",".iecplc",".lc3lib",".TcPOU",".TcDUT",".TcGVL",".TcIO"],aliases:["StructuredText","scl","stl"],loader:()=>tt(()=>import("./st-c45997f6.js"),[],import.meta.url)});at({id:"swift",aliases:["Swift","swift"],extensions:[".swift"],mimetypes:["text/swift"],loader:()=>tt(()=>import("./swift-3b85cc8e.js"),[],import.meta.url)});at({id:"systemverilog",extensions:[".sv",".svh"],aliases:["SV","sv","SystemVerilog","systemverilog"],loader:()=>tt(()=>import("./systemverilog-2ec460af.js"),[],import.meta.url)});at({id:"verilog",extensions:[".v",".vh"],aliases:["V","v","Verilog","verilog"],loader:()=>tt(()=>import("./systemverilog-2ec460af.js"),[],import.meta.url)});at({id:"tcl",extensions:[".tcl"],aliases:["tcl","Tcl","tcltk","TclTk","tcl/tk","Tcl/Tk"],loader:()=>tt(()=>import("./tcl-37e129b8.js"),[],import.meta.url)});at({id:"twig",extensions:[".twig"],aliases:["Twig","twig"],mimetypes:["text/x-twig"],loader:()=>tt(()=>import("./twig-1734ec31.js"),[],import.meta.url)});at({id:"typescript",extensions:[".ts",".tsx",".cts",".mts"],aliases:["TypeScript","ts","typescript"],mimetypes:["text/typescript"],loader:()=>tt(()=>import("./typescript-e18a52a8.js"),[],import.meta.url)});at({id:"vb",extensions:[".vb"],aliases:["Visual Basic","vb"],loader:()=>tt(()=>import("./vb-77962f32.js"),[],import.meta.url)});at({id:"wgsl",extensions:[".wgsl"],aliases:["WebGPU Shading Language","WGSL","wgsl"],loader:()=>tt(()=>import("./wgsl-737d4af2.js"),[],import.meta.url)});at({id:"xml",extensions:[".xml",".xsd",".dtd",".ascx",".csproj",".config",".props",".targets",".wxi",".wxl",".wxs",".xaml",".svg",".svgz",".opf",".xslt",".xsl"],firstLine:"(\\<\\?xml.*)|(\\tt(()=>import("./xml-ea76a9d4.js"),[],import.meta.url)});at({id:"yaml",extensions:[".yaml",".yml"],aliases:["YAML","yaml","YML","yml"],mimetypes:["application/x-yaml","text/x-yaml"],loader:()=>tt(()=>import("./yaml-cdf718b7.js"),[],import.meta.url)});/*!----------------------------------------------------------------------------- + *-----------------------------------------------------------------------------*/var WPe=Object.defineProperty,VPe=Object.getOwnPropertyDescriptor,HPe=Object.getOwnPropertyNames,$Pe=Object.prototype.hasOwnProperty,GU=(n,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of HPe(e))!$Pe.call(n,s)&&s!==t&&WPe(n,s,{get:()=>e[s],enumerable:!(i=VPe(e,s))||i.enumerable});return n},zPe=(n,e,t)=>(GU(n,e,"default"),t&&GU(t,e,"default")),Q1={};zPe(Q1,PS);var qte={},mR={},Gte=class{constructor(n){an(this,"_languageId");an(this,"_loadingTriggered");an(this,"_lazyLoadPromise");an(this,"_lazyLoadPromiseResolve");an(this,"_lazyLoadPromiseReject");this._languageId=n,this._loadingTriggered=!1,this._lazyLoadPromise=new Promise((e,t)=>{this._lazyLoadPromiseResolve=e,this._lazyLoadPromiseReject=t})}static getOrCreate(n){return mR[n]||(mR[n]=new Gte(n)),mR[n]}load(){return this._loadingTriggered||(this._loadingTriggered=!0,qte[this._languageId].loader().then(n=>this._lazyLoadPromiseResolve(n),n=>this._lazyLoadPromiseReject(n))),this._lazyLoadPromise}};function at(n){const e=n.id;qte[e]=n,Q1.languages.register(n);const t=Gte.getOrCreate(e);Q1.languages.registerTokensProviderFactory(e,{create:async()=>(await t.load()).language}),Q1.languages.onLanguageEncountered(e,async()=>{const i=await t.load();Q1.languages.setLanguageConfiguration(e,i.conf)})}at({id:"abap",extensions:[".abap"],aliases:["abap","ABAP"],loader:()=>tt(()=>import("./abap-e5f08dc1.js"),[],import.meta.url)});at({id:"apex",extensions:[".cls"],aliases:["Apex","apex"],mimetypes:["text/x-apex-source","text/x-apex"],loader:()=>tt(()=>import("./apex-fc8a734c.js"),[],import.meta.url)});at({id:"azcli",extensions:[".azcli"],aliases:["Azure CLI","azcli"],loader:()=>tt(()=>import("./azcli-c4358445.js"),[],import.meta.url)});at({id:"bat",extensions:[".bat",".cmd"],aliases:["Batch","bat"],loader:()=>tt(()=>import("./bat-eaac827b.js"),[],import.meta.url)});at({id:"bicep",extensions:[".bicep"],aliases:["Bicep"],loader:()=>tt(()=>import("./bicep-982b0d5f.js"),[],import.meta.url)});at({id:"cameligo",extensions:[".mligo"],aliases:["Cameligo"],loader:()=>tt(()=>import("./cameligo-ff939f45.js"),[],import.meta.url)});at({id:"clojure",extensions:[".clj",".cljs",".cljc",".edn"],aliases:["clojure","Clojure"],loader:()=>tt(()=>import("./clojure-4a1da11c.js"),[],import.meta.url)});at({id:"coffeescript",extensions:[".coffee"],aliases:["CoffeeScript","coffeescript","coffee"],mimetypes:["text/x-coffeescript","text/coffeescript"],loader:()=>tt(()=>import("./coffee-97023918.js"),[],import.meta.url)});at({id:"c",extensions:[".c",".h"],aliases:["C","c"],loader:()=>tt(()=>import("./cpp-a410d69a.js"),[],import.meta.url)});at({id:"cpp",extensions:[".cpp",".cc",".cxx",".hpp",".hh",".hxx"],aliases:["C++","Cpp","cpp"],loader:()=>tt(()=>import("./cpp-a410d69a.js"),[],import.meta.url)});at({id:"csharp",extensions:[".cs",".csx",".cake"],aliases:["C#","csharp"],loader:()=>tt(()=>import("./csharp-0765aa28.js"),[],import.meta.url)});at({id:"csp",extensions:[],aliases:["CSP","csp"],loader:()=>tt(()=>import("./csp-dba4fa86.js"),[],import.meta.url)});at({id:"css",extensions:[".css"],aliases:["CSS","css"],mimetypes:["text/css"],loader:()=>tt(()=>import("./css-9ed252c5.js"),[],import.meta.url)});at({id:"cypher",extensions:[".cypher",".cyp"],aliases:["Cypher","OpenCypher"],loader:()=>tt(()=>import("./cypher-4b1a5b20.js"),[],import.meta.url)});at({id:"dart",extensions:[".dart"],aliases:["Dart","dart"],mimetypes:["text/x-dart-source","text/x-dart"],loader:()=>tt(()=>import("./dart-c70c4314.js"),[],import.meta.url)});at({id:"dockerfile",extensions:[".dockerfile"],filenames:["Dockerfile"],aliases:["Dockerfile"],loader:()=>tt(()=>import("./dockerfile-ff7f0401.js"),[],import.meta.url)});at({id:"ecl",extensions:[".ecl"],aliases:["ECL","Ecl","ecl"],loader:()=>tt(()=>import("./ecl-3129e183.js"),[],import.meta.url)});at({id:"elixir",extensions:[".ex",".exs"],aliases:["Elixir","elixir","ex"],loader:()=>tt(()=>import("./elixir-ac388b4d.js"),[],import.meta.url)});at({id:"flow9",extensions:[".flow"],aliases:["Flow9","Flow","flow9","flow"],loader:()=>tt(()=>import("./flow9-049a8a6c.js"),[],import.meta.url)});at({id:"fsharp",extensions:[".fs",".fsi",".ml",".mli",".fsx",".fsscript"],aliases:["F#","FSharp","fsharp"],loader:()=>tt(()=>import("./fsharp-535d9fe2.js"),[],import.meta.url)});at({id:"freemarker2",extensions:[".ftl",".ftlh",".ftlx"],aliases:["FreeMarker2","Apache FreeMarker2"],loader:()=>tt(()=>import("./freemarker2-ad19929c.js"),[],import.meta.url).then(n=>n.TagAutoInterpolationDollar)});at({id:"freemarker2.tag-angle.interpolation-dollar",aliases:["FreeMarker2 (Angle/Dollar)","Apache FreeMarker2 (Angle/Dollar)"],loader:()=>tt(()=>import("./freemarker2-ad19929c.js"),[],import.meta.url).then(n=>n.TagAngleInterpolationDollar)});at({id:"freemarker2.tag-bracket.interpolation-dollar",aliases:["FreeMarker2 (Bracket/Dollar)","Apache FreeMarker2 (Bracket/Dollar)"],loader:()=>tt(()=>import("./freemarker2-ad19929c.js"),[],import.meta.url).then(n=>n.TagBracketInterpolationDollar)});at({id:"freemarker2.tag-angle.interpolation-bracket",aliases:["FreeMarker2 (Angle/Bracket)","Apache FreeMarker2 (Angle/Bracket)"],loader:()=>tt(()=>import("./freemarker2-ad19929c.js"),[],import.meta.url).then(n=>n.TagAngleInterpolationBracket)});at({id:"freemarker2.tag-bracket.interpolation-bracket",aliases:["FreeMarker2 (Bracket/Bracket)","Apache FreeMarker2 (Bracket/Bracket)"],loader:()=>tt(()=>import("./freemarker2-ad19929c.js"),[],import.meta.url).then(n=>n.TagBracketInterpolationBracket)});at({id:"freemarker2.tag-auto.interpolation-dollar",aliases:["FreeMarker2 (Auto/Dollar)","Apache FreeMarker2 (Auto/Dollar)"],loader:()=>tt(()=>import("./freemarker2-ad19929c.js"),[],import.meta.url).then(n=>n.TagAutoInterpolationDollar)});at({id:"freemarker2.tag-auto.interpolation-bracket",aliases:["FreeMarker2 (Auto/Bracket)","Apache FreeMarker2 (Auto/Bracket)"],loader:()=>tt(()=>import("./freemarker2-ad19929c.js"),[],import.meta.url).then(n=>n.TagAutoInterpolationBracket)});at({id:"go",extensions:[".go"],aliases:["Go"],loader:()=>tt(()=>import("./go-d4bfa116.js"),[],import.meta.url)});at({id:"graphql",extensions:[".graphql",".gql"],aliases:["GraphQL","graphql","gql"],mimetypes:["application/graphql"],loader:()=>tt(()=>import("./graphql-e5a73eb7.js"),[],import.meta.url)});at({id:"handlebars",extensions:[".handlebars",".hbs"],aliases:["Handlebars","handlebars","hbs"],mimetypes:["text/x-handlebars-template"],loader:()=>tt(()=>import("./handlebars-805d6e9f.js"),[],import.meta.url)});at({id:"hcl",extensions:[".tf",".tfvars",".hcl"],aliases:["Terraform","tf","HCL","hcl"],loader:()=>tt(()=>import("./hcl-8b69c899.js"),[],import.meta.url)});at({id:"html",extensions:[".html",".htm",".shtml",".xhtml",".mdoc",".jsp",".asp",".aspx",".jshtm"],aliases:["HTML","htm","html","xhtml"],mimetypes:["text/html","text/x-jshtm","text/template","text/ng-template"],loader:()=>tt(()=>import("./html-ab9c0d64.js"),[],import.meta.url)});at({id:"ini",extensions:[".ini",".properties",".gitconfig"],filenames:["config",".gitattributes",".gitconfig",".editorconfig"],aliases:["Ini","ini"],loader:()=>tt(()=>import("./ini-83ae2a3a.js"),[],import.meta.url)});at({id:"java",extensions:[".java",".jav"],aliases:["Java","java"],mimetypes:["text/x-java-source","text/x-java"],loader:()=>tt(()=>import("./java-4806d9f5.js"),[],import.meta.url)});at({id:"javascript",extensions:[".js",".es6",".jsx",".mjs",".cjs"],firstLine:"^#!.*\\bnode",filenames:["jakefile"],aliases:["JavaScript","javascript","js"],mimetypes:["text/javascript"],loader:()=>tt(()=>import("./javascript-e0d19f86.js"),["./javascript-e0d19f86.js","./typescript-f88e371e.js"],import.meta.url)});at({id:"julia",extensions:[".jl"],aliases:["julia","Julia"],loader:()=>tt(()=>import("./julia-334b5fb9.js"),[],import.meta.url)});at({id:"kotlin",extensions:[".kt",".kts"],aliases:["Kotlin","kotlin"],mimetypes:["text/x-kotlin-source","text/x-kotlin"],loader:()=>tt(()=>import("./kotlin-ed14cfc6.js"),[],import.meta.url)});at({id:"less",extensions:[".less"],aliases:["Less","less"],mimetypes:["text/x-less","text/less"],loader:()=>tt(()=>import("./less-f176dddd.js"),[],import.meta.url)});at({id:"lexon",extensions:[".lex"],aliases:["Lexon"],loader:()=>tt(()=>import("./lexon-8bf535e2.js"),[],import.meta.url)});at({id:"lua",extensions:[".lua"],aliases:["Lua","lua"],loader:()=>tt(()=>import("./lua-96829d0e.js"),[],import.meta.url)});at({id:"liquid",extensions:[".liquid",".html.liquid"],aliases:["Liquid","liquid"],mimetypes:["application/liquid"],loader:()=>tt(()=>import("./liquid-6db0575e.js"),[],import.meta.url)});at({id:"m3",extensions:[".m3",".i3",".mg",".ig"],aliases:["Modula-3","Modula3","modula3","m3"],loader:()=>tt(()=>import("./m3-815f612a.js"),[],import.meta.url)});at({id:"markdown",extensions:[".md",".markdown",".mdown",".mkdn",".mkd",".mdwn",".mdtxt",".mdtext"],aliases:["Markdown","markdown"],loader:()=>tt(()=>import("./markdown-1cddbf33.js"),[],import.meta.url)});at({id:"mdx",extensions:[".mdx"],aliases:["MDX","mdx"],loader:()=>tt(()=>import("./mdx-540b1040.js"),[],import.meta.url)});at({id:"mips",extensions:[".s"],aliases:["MIPS","MIPS-V"],mimetypes:["text/x-mips","text/mips","text/plaintext"],loader:()=>tt(()=>import("./mips-361940ec.js"),[],import.meta.url)});at({id:"msdax",extensions:[".dax",".msdax"],aliases:["DAX","MSDAX"],loader:()=>tt(()=>import("./msdax-b98f6248.js"),[],import.meta.url)});at({id:"mysql",extensions:[],aliases:["MySQL","mysql"],loader:()=>tt(()=>import("./mysql-b4d05809.js"),[],import.meta.url)});at({id:"objective-c",extensions:[".m"],aliases:["Objective-C"],loader:()=>tt(()=>import("./objective-c-64e6f89b.js"),[],import.meta.url)});at({id:"pascal",extensions:[".pas",".p",".pp"],aliases:["Pascal","pas"],mimetypes:["text/x-pascal-source","text/x-pascal"],loader:()=>tt(()=>import("./pascal-e1cbffd7.js"),[],import.meta.url)});at({id:"pascaligo",extensions:[".ligo"],aliases:["Pascaligo","ligo"],loader:()=>tt(()=>import("./pascaligo-013c6c0b.js"),[],import.meta.url)});at({id:"perl",extensions:[".pl",".pm"],aliases:["Perl","pl"],loader:()=>tt(()=>import("./perl-d9423546.js"),[],import.meta.url)});at({id:"pgsql",extensions:[],aliases:["PostgreSQL","postgres","pg","postgre"],loader:()=>tt(()=>import("./pgsql-423e077d.js"),[],import.meta.url)});at({id:"php",extensions:[".php",".php4",".php5",".phtml",".ctp"],aliases:["PHP","php"],mimetypes:["application/x-php"],loader:()=>tt(()=>import("./php-fb65b6b4.js"),[],import.meta.url)});at({id:"pla",extensions:[".pla"],loader:()=>tt(()=>import("./pla-09e93e1b.js"),[],import.meta.url)});at({id:"postiats",extensions:[".dats",".sats",".hats"],aliases:["ATS","ATS/Postiats"],loader:()=>tt(()=>import("./postiats-429bd8e8.js"),[],import.meta.url)});at({id:"powerquery",extensions:[".pq",".pqm"],aliases:["PQ","M","Power Query","Power Query M"],loader:()=>tt(()=>import("./powerquery-0470a494.js"),[],import.meta.url)});at({id:"powershell",extensions:[".ps1",".psm1",".psd1"],aliases:["PowerShell","powershell","ps","ps1"],loader:()=>tt(()=>import("./powershell-b433b622.js"),[],import.meta.url)});at({id:"proto",extensions:[".proto"],aliases:["protobuf","Protocol Buffers"],loader:()=>tt(()=>import("./protobuf-7aea035f.js"),[],import.meta.url)});at({id:"pug",extensions:[".jade",".pug"],aliases:["Pug","Jade","jade"],loader:()=>tt(()=>import("./pug-b7980504.js"),[],import.meta.url)});at({id:"python",extensions:[".py",".rpy",".pyw",".cpy",".gyp",".gypi"],aliases:["Python","py"],firstLine:"^#!/.*\\bpython[0-9.-]*\\b",loader:()=>tt(()=>import("./python-64c1a453.js"),[],import.meta.url)});at({id:"qsharp",extensions:[".qs"],aliases:["Q#","qsharp"],loader:()=>tt(()=>import("./qsharp-eed62033.js"),[],import.meta.url)});at({id:"r",extensions:[".r",".rhistory",".rmd",".rprofile",".rt"],aliases:["R","r"],loader:()=>tt(()=>import("./r-8ce27f67.js"),[],import.meta.url)});at({id:"razor",extensions:[".cshtml"],aliases:["Razor","razor"],mimetypes:["text/x-cshtml"],loader:()=>tt(()=>import("./razor-a2bbc2c7.js"),[],import.meta.url)});at({id:"redis",extensions:[".redis"],aliases:["redis"],loader:()=>tt(()=>import("./redis-aec7cdf4.js"),[],import.meta.url)});at({id:"redshift",extensions:[],aliases:["Redshift","redshift"],loader:()=>tt(()=>import("./redshift-7d933e7a.js"),[],import.meta.url)});at({id:"restructuredtext",extensions:[".rst"],aliases:["reStructuredText","restructuredtext"],loader:()=>tt(()=>import("./restructuredtext-a9e4c4cc.js"),[],import.meta.url)});at({id:"ruby",extensions:[".rb",".rbx",".rjs",".gemspec",".pp"],filenames:["rakefile","Gemfile"],aliases:["Ruby","rb"],loader:()=>tt(()=>import("./ruby-a1bbf563.js"),[],import.meta.url)});at({id:"rust",extensions:[".rs",".rlib"],aliases:["Rust","rust"],loader:()=>tt(()=>import("./rust-9669a673.js"),[],import.meta.url)});at({id:"sb",extensions:[".sb"],aliases:["Small Basic","sb"],loader:()=>tt(()=>import("./sb-b221a0fc.js"),[],import.meta.url)});at({id:"scala",extensions:[".scala",".sc",".sbt"],aliases:["Scala","scala","SBT","Sbt","sbt","Dotty","dotty"],mimetypes:["text/x-scala-source","text/x-scala","text/x-sbt","text/x-dotty"],loader:()=>tt(()=>import("./scala-9222416a.js"),[],import.meta.url)});at({id:"scheme",extensions:[".scm",".ss",".sch",".rkt"],aliases:["scheme","Scheme"],loader:()=>tt(()=>import("./scheme-86110af1.js"),[],import.meta.url)});at({id:"scss",extensions:[".scss"],aliases:["Sass","sass","scss"],mimetypes:["text/x-scss","text/scss"],loader:()=>tt(()=>import("./scss-30d2f332.js"),[],import.meta.url)});at({id:"shell",extensions:[".sh",".bash"],aliases:["Shell","sh"],loader:()=>tt(()=>import("./shell-0ca4f4ad.js"),[],import.meta.url)});at({id:"sol",extensions:[".sol"],aliases:["sol","solidity","Solidity"],loader:()=>tt(()=>import("./solidity-0072896b.js"),[],import.meta.url)});at({id:"aes",extensions:[".aes"],aliases:["aes","sophia","Sophia"],loader:()=>tt(()=>import("./sophia-bc45fa87.js"),[],import.meta.url)});at({id:"sparql",extensions:[".rq"],aliases:["sparql","SPARQL"],loader:()=>tt(()=>import("./sparql-28fc150c.js"),[],import.meta.url)});at({id:"sql",extensions:[".sql"],aliases:["SQL"],loader:()=>tt(()=>import("./sql-96f7b353.js"),[],import.meta.url)});at({id:"st",extensions:[".st",".iecst",".iecplc",".lc3lib",".TcPOU",".TcDUT",".TcGVL",".TcIO"],aliases:["StructuredText","scl","stl"],loader:()=>tt(()=>import("./st-c45997f6.js"),[],import.meta.url)});at({id:"swift",aliases:["Swift","swift"],extensions:[".swift"],mimetypes:["text/swift"],loader:()=>tt(()=>import("./swift-3b85cc8e.js"),[],import.meta.url)});at({id:"systemverilog",extensions:[".sv",".svh"],aliases:["SV","sv","SystemVerilog","systemverilog"],loader:()=>tt(()=>import("./systemverilog-2ec460af.js"),[],import.meta.url)});at({id:"verilog",extensions:[".v",".vh"],aliases:["V","v","Verilog","verilog"],loader:()=>tt(()=>import("./systemverilog-2ec460af.js"),[],import.meta.url)});at({id:"tcl",extensions:[".tcl"],aliases:["tcl","Tcl","tcltk","TclTk","tcl/tk","Tcl/Tk"],loader:()=>tt(()=>import("./tcl-37e129b8.js"),[],import.meta.url)});at({id:"twig",extensions:[".twig"],aliases:["Twig","twig"],mimetypes:["text/x-twig"],loader:()=>tt(()=>import("./twig-1734ec31.js"),[],import.meta.url)});at({id:"typescript",extensions:[".ts",".tsx",".cts",".mts"],aliases:["TypeScript","ts","typescript"],mimetypes:["text/typescript"],loader:()=>tt(()=>import("./typescript-f88e371e.js"),[],import.meta.url)});at({id:"vb",extensions:[".vb"],aliases:["Visual Basic","vb"],loader:()=>tt(()=>import("./vb-77962f32.js"),[],import.meta.url)});at({id:"wgsl",extensions:[".wgsl"],aliases:["WebGPU Shading Language","WGSL","wgsl"],loader:()=>tt(()=>import("./wgsl-737d4af2.js"),[],import.meta.url)});at({id:"xml",extensions:[".xml",".xsd",".dtd",".ascx",".csproj",".config",".props",".targets",".wxi",".wxl",".wxs",".xaml",".svg",".svgz",".opf",".xslt",".xsl"],firstLine:"(\\<\\?xml.*)|(\\tt(()=>import("./xml-89a70cb1.js"),[],import.meta.url)});at({id:"yaml",extensions:[".yaml",".yml"],aliases:["YAML","yaml","YML","yml"],mimetypes:["application/x-yaml","text/x-yaml"],loader:()=>tt(()=>import("./yaml-b5381d78.js"),[],import.meta.url)});/*!----------------------------------------------------------------------------- * 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 UPe=Object.defineProperty,jPe=Object.getOwnPropertyDescriptor,KPe=Object.getOwnPropertyNames,qPe=Object.prototype.hasOwnProperty,YU=(n,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of KPe(e))!qPe.call(n,s)&&s!==t&&UPe(n,s,{get:()=>e[s],enumerable:!(i=jPe(e,s))||i.enumerable});return n},GPe=(n,e,t)=>(YU(n,e,"default"),t&&YU(t,e,"default")),R0={};GPe(R0,PS);var x7=class{constructor(e,t,i){an(this,"_onDidChange",new R0.Emitter);an(this,"_options");an(this,"_modeConfiguration");an(this,"_languageId");this._languageId=e,this.setOptions(t),this.setModeConfiguration(i)}get onDidChange(){return this._onDidChange.event}get languageId(){return this._languageId}get modeConfiguration(){return this._modeConfiguration}get diagnosticsOptions(){return this.options}get options(){return this._options}setOptions(e){this._options=e||Object.create(null),this._onDidChange.fire(this)}setDiagnosticsOptions(e){this.setOptions(e)}setModeConfiguration(e){this._modeConfiguration=e||Object.create(null),this._onDidChange.fire(this)}},N7={validate:!0,lint:{compatibleVendorPrefixes:"ignore",vendorPrefix:"warning",duplicateProperties:"warning",emptyRules:"warning",importStatement:"ignore",boxModel:"ignore",universalSelector:"ignore",zeroUnits:"ignore",fontFaceProperties:"warning",hexColorLength:"error",argumentsInColorFunction:"error",unknownProperties:"warning",ieHack:"ignore",unknownVendorSpecificProperties:"ignore",propertyIgnoredDueToDisplay:"warning",important:"ignore",float:"ignore",idSelector:"ignore"},data:{useDefaultDataProvider:!0},format:{newlineBetweenSelectors:!0,newlineBetweenRules:!0,spaceAroundSelectorSeparator:!1,braceStyle:"collapse",maxPreserveNewLines:void 0,preserveNewLines:!0}},A7={completionItems:!0,hovers:!0,documentSymbols:!0,definitions:!0,references:!0,documentHighlights:!0,rename:!0,colors:!0,foldingRanges:!0,diagnostics:!0,selectionRanges:!0,documentFormattingEdits:!0,documentRangeFormattingEdits:!0},Yte=new x7("css",N7,A7),Zte=new x7("scss",N7,A7),Xte=new x7("less",N7,A7);R0.languages.css={cssDefaults:Yte,lessDefaults:Xte,scssDefaults:Zte};function M7(){return tt(()=>import("./cssMode-24dc600b.js"),[],import.meta.url)}R0.languages.onLanguage("less",()=>{M7().then(n=>n.setupMode(Xte))});R0.languages.onLanguage("scss",()=>{M7().then(n=>n.setupMode(Zte))});R0.languages.onLanguage("css",()=>{M7().then(n=>n.setupMode(Yte))});/*!----------------------------------------------------------------------------- + *-----------------------------------------------------------------------------*/var UPe=Object.defineProperty,jPe=Object.getOwnPropertyDescriptor,KPe=Object.getOwnPropertyNames,qPe=Object.prototype.hasOwnProperty,YU=(n,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of KPe(e))!qPe.call(n,s)&&s!==t&&UPe(n,s,{get:()=>e[s],enumerable:!(i=jPe(e,s))||i.enumerable});return n},GPe=(n,e,t)=>(YU(n,e,"default"),t&&YU(t,e,"default")),R0={};GPe(R0,PS);var x7=class{constructor(e,t,i){an(this,"_onDidChange",new R0.Emitter);an(this,"_options");an(this,"_modeConfiguration");an(this,"_languageId");this._languageId=e,this.setOptions(t),this.setModeConfiguration(i)}get onDidChange(){return this._onDidChange.event}get languageId(){return this._languageId}get modeConfiguration(){return this._modeConfiguration}get diagnosticsOptions(){return this.options}get options(){return this._options}setOptions(e){this._options=e||Object.create(null),this._onDidChange.fire(this)}setDiagnosticsOptions(e){this.setOptions(e)}setModeConfiguration(e){this._modeConfiguration=e||Object.create(null),this._onDidChange.fire(this)}},N7={validate:!0,lint:{compatibleVendorPrefixes:"ignore",vendorPrefix:"warning",duplicateProperties:"warning",emptyRules:"warning",importStatement:"ignore",boxModel:"ignore",universalSelector:"ignore",zeroUnits:"ignore",fontFaceProperties:"warning",hexColorLength:"error",argumentsInColorFunction:"error",unknownProperties:"warning",ieHack:"ignore",unknownVendorSpecificProperties:"ignore",propertyIgnoredDueToDisplay:"warning",important:"ignore",float:"ignore",idSelector:"ignore"},data:{useDefaultDataProvider:!0},format:{newlineBetweenSelectors:!0,newlineBetweenRules:!0,spaceAroundSelectorSeparator:!1,braceStyle:"collapse",maxPreserveNewLines:void 0,preserveNewLines:!0}},A7={completionItems:!0,hovers:!0,documentSymbols:!0,definitions:!0,references:!0,documentHighlights:!0,rename:!0,colors:!0,foldingRanges:!0,diagnostics:!0,selectionRanges:!0,documentFormattingEdits:!0,documentRangeFormattingEdits:!0},Yte=new x7("css",N7,A7),Zte=new x7("scss",N7,A7),Xte=new x7("less",N7,A7);R0.languages.css={cssDefaults:Yte,lessDefaults:Xte,scssDefaults:Zte};function M7(){return tt(()=>import("./cssMode-33ee3626.js"),[],import.meta.url)}R0.languages.onLanguage("less",()=>{M7().then(n=>n.setupMode(Xte))});R0.languages.onLanguage("scss",()=>{M7().then(n=>n.setupMode(Zte))});R0.languages.onLanguage("css",()=>{M7().then(n=>n.setupMode(Yte))});/*!----------------------------------------------------------------------------- * 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 YPe=Object.defineProperty,ZPe=Object.getOwnPropertyDescriptor,XPe=Object.getOwnPropertyNames,QPe=Object.prototype.hasOwnProperty,ZU=(n,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of XPe(e))!QPe.call(n,s)&&s!==t&&YPe(n,s,{get:()=>e[s],enumerable:!(i=ZPe(e,s))||i.enumerable});return n},JPe=(n,e,t)=>(ZU(n,e,"default"),t&&ZU(t,e,"default")),sN={};JPe(sN,PS);var eOe=class{constructor(e,t,i){an(this,"_onDidChange",new sN.Emitter);an(this,"_options");an(this,"_modeConfiguration");an(this,"_languageId");this._languageId=e,this.setOptions(t),this.setModeConfiguration(i)}get onDidChange(){return this._onDidChange.event}get languageId(){return this._languageId}get options(){return this._options}get modeConfiguration(){return this._modeConfiguration}setOptions(e){this._options=e||Object.create(null),this._onDidChange.fire(this)}setModeConfiguration(e){this._modeConfiguration=e||Object.create(null),this._onDidChange.fire(this)}},tOe={tabSize:4,insertSpaces:!1,wrapLineLength:120,unformatted:'default": "a, abbr, acronym, b, bdo, big, br, button, cite, code, dfn, em, i, img, input, kbd, label, map, object, q, samp, select, small, span, strong, sub, sup, textarea, tt, var',contentUnformatted:"pre",indentInnerHtml:!1,preserveNewLines:!0,maxPreserveNewLines:void 0,indentHandlebars:!1,endWithNewline:!1,extraLiners:"head, body, /html",wrapAttributes:"auto"},oN={format:tOe,suggest:{},data:{useDefaultDataProvider:!0}};function rN(n){return{completionItems:!0,hovers:!0,documentSymbols:!0,links:!0,documentHighlights:!0,rename:!0,colors:!0,foldingRanges:!0,selectionRanges:!0,diagnostics:n===OC,documentFormattingEdits:n===OC,documentRangeFormattingEdits:n===OC}}var OC="html",XU="handlebars",QU="razor",Qte=aN(OC,oN,rN(OC)),iOe=Qte.defaults,Jte=aN(XU,oN,rN(XU)),nOe=Jte.defaults,eie=aN(QU,oN,rN(QU)),sOe=eie.defaults;sN.languages.html={htmlDefaults:iOe,razorDefaults:sOe,handlebarDefaults:nOe,htmlLanguageService:Qte,handlebarLanguageService:Jte,razorLanguageService:eie,registerHTMLLanguageService:aN};function oOe(){return tt(()=>import("./htmlMode-6a4ef462.js"),[],import.meta.url)}function aN(n,e=oN,t=rN(n)){const i=new eOe(n,e,t);let s;const o=sN.languages.onLanguage(n,async()=>{s=(await oOe()).setupMode(i)});return{defaults:i,dispose(){o.dispose(),s==null||s.dispose(),s=void 0}}}/*!----------------------------------------------------------------------------- + *-----------------------------------------------------------------------------*/var YPe=Object.defineProperty,ZPe=Object.getOwnPropertyDescriptor,XPe=Object.getOwnPropertyNames,QPe=Object.prototype.hasOwnProperty,ZU=(n,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of XPe(e))!QPe.call(n,s)&&s!==t&&YPe(n,s,{get:()=>e[s],enumerable:!(i=ZPe(e,s))||i.enumerable});return n},JPe=(n,e,t)=>(ZU(n,e,"default"),t&&ZU(t,e,"default")),oN={};JPe(oN,PS);var eOe=class{constructor(e,t,i){an(this,"_onDidChange",new oN.Emitter);an(this,"_options");an(this,"_modeConfiguration");an(this,"_languageId");this._languageId=e,this.setOptions(t),this.setModeConfiguration(i)}get onDidChange(){return this._onDidChange.event}get languageId(){return this._languageId}get options(){return this._options}get modeConfiguration(){return this._modeConfiguration}setOptions(e){this._options=e||Object.create(null),this._onDidChange.fire(this)}setModeConfiguration(e){this._modeConfiguration=e||Object.create(null),this._onDidChange.fire(this)}},tOe={tabSize:4,insertSpaces:!1,wrapLineLength:120,unformatted:'default": "a, abbr, acronym, b, bdo, big, br, button, cite, code, dfn, em, i, img, input, kbd, label, map, object, q, samp, select, small, span, strong, sub, sup, textarea, tt, var',contentUnformatted:"pre",indentInnerHtml:!1,preserveNewLines:!0,maxPreserveNewLines:void 0,indentHandlebars:!1,endWithNewline:!1,extraLiners:"head, body, /html",wrapAttributes:"auto"},rN={format:tOe,suggest:{},data:{useDefaultDataProvider:!0}};function aN(n){return{completionItems:!0,hovers:!0,documentSymbols:!0,links:!0,documentHighlights:!0,rename:!0,colors:!0,foldingRanges:!0,selectionRanges:!0,diagnostics:n===OC,documentFormattingEdits:n===OC,documentRangeFormattingEdits:n===OC}}var OC="html",XU="handlebars",QU="razor",Qte=lN(OC,rN,aN(OC)),iOe=Qte.defaults,Jte=lN(XU,rN,aN(XU)),nOe=Jte.defaults,eie=lN(QU,rN,aN(QU)),sOe=eie.defaults;oN.languages.html={htmlDefaults:iOe,razorDefaults:sOe,handlebarDefaults:nOe,htmlLanguageService:Qte,handlebarLanguageService:Jte,razorLanguageService:eie,registerHTMLLanguageService:lN};function oOe(){return tt(()=>import("./htmlMode-cc928c6e.js"),[],import.meta.url)}function lN(n,e=rN,t=aN(n)){const i=new eOe(n,e,t);let s;const o=oN.languages.onLanguage(n,async()=>{s=(await oOe()).setupMode(i)});return{defaults:i,dispose(){o.dispose(),s==null||s.dispose(),s=void 0}}}/*!----------------------------------------------------------------------------- * 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 rOe=Object.defineProperty,aOe=Object.getOwnPropertyDescriptor,lOe=Object.getOwnPropertyNames,cOe=Object.prototype.hasOwnProperty,JU=(n,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of lOe(e))!cOe.call(n,s)&&s!==t&&rOe(n,s,{get:()=>e[s],enumerable:!(i=aOe(e,s))||i.enumerable});return n},dOe=(n,e,t)=>(JU(n,e,"default"),t&&JU(t,e,"default")),OS={};dOe(OS,PS);var uOe=class{constructor(e,t,i){an(this,"_onDidChange",new OS.Emitter);an(this,"_diagnosticsOptions");an(this,"_modeConfiguration");an(this,"_languageId");this._languageId=e,this.setDiagnosticsOptions(t),this.setModeConfiguration(i)}get onDidChange(){return this._onDidChange.event}get languageId(){return this._languageId}get modeConfiguration(){return this._modeConfiguration}get diagnosticsOptions(){return this._diagnosticsOptions}setDiagnosticsOptions(e){this._diagnosticsOptions=e||Object.create(null),this._onDidChange.fire(this)}setModeConfiguration(e){this._modeConfiguration=e||Object.create(null),this._onDidChange.fire(this)}},hOe={validate:!0,allowComments:!0,schemas:[],enableSchemaRequest:!1,schemaRequest:"warning",schemaValidation:"warning",comments:"error",trailingCommas:"error"},fOe={documentFormattingEdits:!0,documentRangeFormattingEdits:!0,completionItems:!0,hovers:!0,documentSymbols:!0,tokens:!0,colors:!0,foldingRanges:!0,diagnostics:!0,selectionRanges:!0},tie=new uOe("json",hOe,fOe);OS.languages.json={jsonDefaults:tie};function gOe(){return tt(()=>import("./jsonMode-b1401d4e.js"),[],import.meta.url)}OS.languages.register({id:"json",extensions:[".json",".bowerrc",".jshintrc",".jscsrc",".eslintrc",".babelrc",".har"],aliases:["JSON","json"],mimetypes:["application/json"]});OS.languages.onLanguage("json",()=>{gOe().then(n=>n.setupMode(tie))});/*!----------------------------------------------------------------------------- + *-----------------------------------------------------------------------------*/var rOe=Object.defineProperty,aOe=Object.getOwnPropertyDescriptor,lOe=Object.getOwnPropertyNames,cOe=Object.prototype.hasOwnProperty,JU=(n,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of lOe(e))!cOe.call(n,s)&&s!==t&&rOe(n,s,{get:()=>e[s],enumerable:!(i=aOe(e,s))||i.enumerable});return n},dOe=(n,e,t)=>(JU(n,e,"default"),t&&JU(t,e,"default")),OS={};dOe(OS,PS);var uOe=class{constructor(e,t,i){an(this,"_onDidChange",new OS.Emitter);an(this,"_diagnosticsOptions");an(this,"_modeConfiguration");an(this,"_languageId");this._languageId=e,this.setDiagnosticsOptions(t),this.setModeConfiguration(i)}get onDidChange(){return this._onDidChange.event}get languageId(){return this._languageId}get modeConfiguration(){return this._modeConfiguration}get diagnosticsOptions(){return this._diagnosticsOptions}setDiagnosticsOptions(e){this._diagnosticsOptions=e||Object.create(null),this._onDidChange.fire(this)}setModeConfiguration(e){this._modeConfiguration=e||Object.create(null),this._onDidChange.fire(this)}},hOe={validate:!0,allowComments:!0,schemas:[],enableSchemaRequest:!1,schemaRequest:"warning",schemaValidation:"warning",comments:"error",trailingCommas:"error"},fOe={documentFormattingEdits:!0,documentRangeFormattingEdits:!0,completionItems:!0,hovers:!0,documentSymbols:!0,tokens:!0,colors:!0,foldingRanges:!0,diagnostics:!0,selectionRanges:!0},tie=new uOe("json",hOe,fOe);OS.languages.json={jsonDefaults:tie};function gOe(){return tt(()=>import("./jsonMode-beb93c45.js"),[],import.meta.url)}OS.languages.register({id:"json",extensions:[".json",".bowerrc",".jshintrc",".jscsrc",".eslintrc",".babelrc",".har"],aliases:["JSON","json"],mimetypes:["application/json"]});OS.languages.onLanguage("json",()=>{gOe().then(n=>n.setupMode(tie))});/*!----------------------------------------------------------------------------- * 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 pOe=Object.defineProperty,mOe=Object.getOwnPropertyDescriptor,_Oe=Object.getOwnPropertyNames,vOe=Object.prototype.hasOwnProperty,ej=(n,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of _Oe(e))!vOe.call(n,s)&&s!==t&&pOe(n,s,{get:()=>e[s],enumerable:!(i=mOe(e,s))||i.enumerable});return n},bOe=(n,e,t)=>(ej(n,e,"default"),t&&ej(t,e,"default")),COe="5.0.2",Kb={};bOe(Kb,PS);var iie=(n=>(n[n.None=0]="None",n[n.CommonJS=1]="CommonJS",n[n.AMD=2]="AMD",n[n.UMD=3]="UMD",n[n.System=4]="System",n[n.ES2015=5]="ES2015",n[n.ESNext=99]="ESNext",n))(iie||{}),nie=(n=>(n[n.None=0]="None",n[n.Preserve=1]="Preserve",n[n.React=2]="React",n[n.ReactNative=3]="ReactNative",n[n.ReactJSX=4]="ReactJSX",n[n.ReactJSXDev=5]="ReactJSXDev",n))(nie||{}),sie=(n=>(n[n.CarriageReturnLineFeed=0]="CarriageReturnLineFeed",n[n.LineFeed=1]="LineFeed",n))(sie||{}),oie=(n=>(n[n.ES3=0]="ES3",n[n.ES5=1]="ES5",n[n.ES2015=2]="ES2015",n[n.ES2016=3]="ES2016",n[n.ES2017=4]="ES2017",n[n.ES2018=5]="ES2018",n[n.ES2019=6]="ES2019",n[n.ES2020=7]="ES2020",n[n.ESNext=99]="ESNext",n[n.JSON=100]="JSON",n[n.Latest=99]="Latest",n))(oie||{}),rie=(n=>(n[n.Classic=1]="Classic",n[n.NodeJs=2]="NodeJs",n))(rie||{}),aie=class{constructor(n,e,t,i,s){an(this,"_onDidChange",new Kb.Emitter);an(this,"_onDidExtraLibsChange",new Kb.Emitter);an(this,"_extraLibs");an(this,"_removedExtraLibs");an(this,"_eagerModelSync");an(this,"_compilerOptions");an(this,"_diagnosticsOptions");an(this,"_workerOptions");an(this,"_onDidExtraLibsChangeTimeout");an(this,"_inlayHintsOptions");an(this,"_modeConfiguration");this._extraLibs=Object.create(null),this._removedExtraLibs=Object.create(null),this._eagerModelSync=!1,this.setCompilerOptions(n),this.setDiagnosticsOptions(e),this.setWorkerOptions(t),this.setInlayHintsOptions(i),this.setModeConfiguration(s),this._onDidExtraLibsChangeTimeout=-1}get onDidChange(){return this._onDidChange.event}get onDidExtraLibsChange(){return this._onDidExtraLibsChange.event}get modeConfiguration(){return this._modeConfiguration}get workerOptions(){return this._workerOptions}get inlayHintsOptions(){return this._inlayHintsOptions}getExtraLibs(){return this._extraLibs}addExtraLib(n,e){let t;if(typeof e>"u"?t="ts:extralib-".concat(Math.random().toString(36).substring(2,15)):t=e,this._extraLibs[t]&&this._extraLibs[t].content===n)return{dispose:()=>{}};let i=1;return this._removedExtraLibs[t]&&(i=this._removedExtraLibs[t]+1),this._extraLibs[t]&&(i=this._extraLibs[t].version+1),this._extraLibs[t]={content:n,version:i},this._fireOnDidExtraLibsChangeSoon(),{dispose:()=>{let s=this._extraLibs[t];s&&s.version===i&&(delete this._extraLibs[t],this._removedExtraLibs[t]=i,this._fireOnDidExtraLibsChangeSoon())}}}setExtraLibs(n){for(const e in this._extraLibs)this._removedExtraLibs[e]=this._extraLibs[e].version;if(this._extraLibs=Object.create(null),n&&n.length>0)for(const e of n){const t=e.filePath||"ts:extralib-".concat(Math.random().toString(36).substring(2,15)),i=e.content;let s=1;this._removedExtraLibs[t]&&(s=this._removedExtraLibs[t]+1),this._extraLibs[t]={content:i,version:s}}this._fireOnDidExtraLibsChangeSoon()}_fireOnDidExtraLibsChangeSoon(){this._onDidExtraLibsChangeTimeout===-1&&(this._onDidExtraLibsChangeTimeout=window.setTimeout(()=>{this._onDidExtraLibsChangeTimeout=-1,this._onDidExtraLibsChange.fire(void 0)},0))}getCompilerOptions(){return this._compilerOptions}setCompilerOptions(n){this._compilerOptions=n||Object.create(null),this._onDidChange.fire(void 0)}getDiagnosticsOptions(){return this._diagnosticsOptions}setDiagnosticsOptions(n){this._diagnosticsOptions=n||Object.create(null),this._onDidChange.fire(void 0)}setWorkerOptions(n){this._workerOptions=n||Object.create(null),this._onDidChange.fire(void 0)}setInlayHintsOptions(n){this._inlayHintsOptions=n||Object.create(null),this._onDidChange.fire(void 0)}setMaximumWorkerIdleTime(n){}setEagerModelSync(n){this._eagerModelSync=n}getEagerModelSync(){return this._eagerModelSync}setModeConfiguration(n){this._modeConfiguration=n||Object.create(null),this._onDidChange.fire(void 0)}},wOe=COe,lie={completionItems:!0,hovers:!0,documentSymbols:!0,definitions:!0,references:!0,documentHighlights:!0,rename:!0,diagnostics:!0,documentRangeFormattingEdits:!0,signatureHelp:!0,onTypeFormattingEdits:!0,codeActions:!0,inlayHints:!0},cie=new aie({allowNonTsExtensions:!0,target:99},{noSemanticValidation:!1,noSyntaxValidation:!1,onlyVisible:!1},{},{},lie),die=new aie({allowNonTsExtensions:!0,allowJs:!0,target:99},{noSemanticValidation:!0,noSyntaxValidation:!1,onlyVisible:!1},{},{},lie),yOe=()=>lN().then(n=>n.getTypeScriptWorker()),SOe=()=>lN().then(n=>n.getJavaScriptWorker());Kb.languages.typescript={ModuleKind:iie,JsxEmit:nie,NewLineKind:sie,ScriptTarget:oie,ModuleResolutionKind:rie,typescriptVersion:wOe,typescriptDefaults:cie,javascriptDefaults:die,getTypeScriptWorker:yOe,getJavaScriptWorker:SOe};function lN(){return tt(()=>import("./tsMode-f12f1309.js"),[],import.meta.url)}Kb.languages.onLanguage("typescript",()=>lN().then(n=>n.setupTypeScript(cie)));Kb.languages.onLanguage("javascript",()=>lN().then(n=>n.setupJavaScript(die)));class LOe extends oa{constructor(){super({id:"diffEditor.toggleCollapseUnchangedRegions",title:{value:m("toggleCollapseUnchangedRegions","Toggle Collapse Unchanged Regions"),original:"Toggle Collapse Unchanged Regions"},icon:Me.map,toggled:fe.has("config.diffEditor.hideUnchangedRegions.enabled"),precondition:fe.has("isInDiffEditor"),menu:{when:fe.has("isInDiffEditor"),id:M.EditorTitle,order:22,group:"navigation"}})}run(e,...t){const i=e.get(zt),s=!i.getValue("diffEditor.hideUnchangedRegions.enabled");i.updateValue("diffEditor.hideUnchangedRegions.enabled",s)}}Ui(LOe);class uie extends oa{constructor(){super({id:"diffEditor.toggleShowMovedCodeBlocks",title:{value:m("toggleShowMovedCodeBlocks","Toggle Show Moved Code Blocks"),original:"Toggle Show Moved Code Blocks"},precondition:fe.has("isInDiffEditor")})}run(e,...t){const i=e.get(zt),s=!i.getValue("diffEditor.experimental.showMoves");i.updateValue("diffEditor.experimental.showMoves",s)}}Ui(uie);class hie extends oa{constructor(){super({id:"diffEditor.toggleUseInlineViewWhenSpaceIsLimited",title:{value:m("toggleUseInlineViewWhenSpaceIsLimited","Toggle Use Inline View When Space Is Limited"),original:"Toggle Use Inline View When Space Is Limited"},precondition:fe.has("isInDiffEditor")})}run(e,...t){const i=e.get(zt),s=!i.getValue("diffEditor.useInlineViewWhenSpaceIsLimited");i.updateValue("diffEditor.useInlineViewWhenSpaceIsLimited",s)}}Ui(hie);Ls.appendMenuItem(M.EditorTitle,{command:{id:new hie().desc.id,title:m("useInlineViewWhenSpaceIsLimited","Use Inline View When Space Is Limited"),toggled:fe.has("config.diffEditor.useInlineViewWhenSpaceIsLimited"),precondition:fe.has("isInDiffEditor")},order:11,group:"1_diff",when:fe.and(O.diffEditorRenderSideBySideInlineBreakpointReached,fe.has("isInDiffEditor"))});Ls.appendMenuItem(M.EditorTitle,{command:{id:new uie().desc.id,title:m("showMoves","Show Moved Code Blocks"),icon:Me.move,toggled:S0.create("config.diffEditor.experimental.showMoves",!0),precondition:fe.has("isInDiffEditor")},order:10,group:"1_diff",when:fe.has("isInDiffEditor")});const cN={value:m("diffEditor","Diff Editor"),original:"Diff Editor"};class kOe extends Cc{constructor(){super({id:"diffEditor.switchSide",title:{value:m("switchSide","Switch Side"),original:"Switch Side"},icon:Me.arrowSwap,precondition:fe.has("isInDiffEditor"),f1:!0,category:cN})}runEditorCommand(e,t,i){const s=O0(e);if(s instanceof vm){if(i&&i.dryRun)return{destinationSelection:s.mapToOtherSide().destinationSelection};s.switchSide()}}}Ui(kOe);class DOe extends Cc{constructor(){super({id:"diffEditor.exitCompareMove",title:{value:m("exitCompareMove","Exit Compare Move"),original:"Exit Compare Move"},icon:Me.close,precondition:O.comparingMovedCode,f1:!1,category:cN,keybinding:{weight:1e4,primary:9}})}runEditorCommand(e,t,...i){const s=O0(e);s instanceof vm&&s.exitCompareMove()}}Ui(DOe);class EOe extends Cc{constructor(){super({id:"diffEditor.collapseAllUnchangedRegions",title:{value:m("collapseAllUnchangedRegions","Collapse All Unchanged Regions"),original:"Collapse All Unchanged Regions"},icon:Me.fold,precondition:fe.has("isInDiffEditor"),f1:!0,category:cN})}runEditorCommand(e,t,...i){const s=O0(e);s instanceof vm&&s.collapseAllUnchangedRegions()}}Ui(EOe);class IOe extends Cc{constructor(){super({id:"diffEditor.showAllUnchangedRegions",title:{value:m("showAllUnchangedRegions","Show All Unchanged Regions"),original:"Show All Unchanged Regions"},icon:Me.unfold,precondition:fe.has("isInDiffEditor"),f1:!0,category:cN})}runEditorCommand(e,t,...i){const s=O0(e);s instanceof vm&&s.showAllUnchangedRegions()}}Ui(IOe);const fie={value:m("accessibleDiffViewer","Accessible Diff Viewer"),original:"Accessible Diff Viewer"};class P0 extends oa{constructor(){super({id:P0.id,title:{value:m("editor.action.accessibleDiffViewer.next","Go to Next Difference"),original:"Go to Next Difference"},category:fie,precondition:fe.has("isInDiffEditor"),keybinding:{primary:65,weight:100},f1:!0})}run(e){const t=O0(e);t==null||t.accessibleDiffViewerNext()}}P0.id="editor.action.accessibleDiffViewer.next";Ls.appendMenuItem(M.EditorTitle,{command:{id:P0.id,title:m("Open Accessible Diff Viewer","Open Accessible Diff Viewer"),precondition:fe.has("isInDiffEditor")},order:10,group:"2_diff",when:fe.and(O.accessibleDiffViewerVisible.negate(),fe.has("isInDiffEditor"))});class FS extends oa{constructor(){super({id:FS.id,title:{value:m("editor.action.accessibleDiffViewer.prev","Go to Previous Difference"),original:"Go to Previous Difference"},category:fie,precondition:fe.has("isInDiffEditor"),keybinding:{primary:1089,weight:100},f1:!0})}run(e){const t=O0(e);t==null||t.accessibleDiffViewerPrev()}}FS.id="editor.action.accessibleDiffViewer.prev";function O0(n){var e;const t=n.get(ai),i=t.listDiffEditors(),s=(e=t.getFocusedCodeEditor())!==null&&e!==void 0?e:t.getActiveCodeEditor();if(!s)return null;for(let r=0,a=i.length;r=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},NOe=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},dN=globalThis&&globalThis.__awaiter||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())})},cF;const uN=new Ve("selectionAnchorSet",!1);let Yu=cF=class{static get(e){return e.getContribution(cF.ID)}constructor(e,t){this.editor=e,this.selectionAnchorSetContextKey=uN.bindTo(t),this.modelChangeListener=e.onDidChangeModel(()=>this.selectionAnchorSetContextKey.reset())}setSelectionAnchor(){if(this.editor.hasModel()){const e=this.editor.getPosition();this.editor.changeDecorations(t=>{this.decorationId&&t.removeDecoration(this.decorationId),this.decorationId=t.addDecoration(Je.fromPositions(e,e),{description:"selection-anchor",stickiness:1,hoverMessage:new Bs().appendText(m("selectionAnchor","Selection Anchor")),className:"selection-anchor"})}),this.selectionAnchorSetContextKey.set(!!this.decorationId),to(m("anchorSet","Anchor set at {0}:{1}",e.lineNumber,e.column))}}goToSelectionAnchor(){if(this.editor.hasModel()&&this.decorationId){const e=this.editor.getModel().getDecorationRange(this.decorationId);e&&this.editor.setPosition(e.getStartPosition())}}selectFromAnchorToCursor(){if(this.editor.hasModel()&&this.decorationId){const e=this.editor.getModel().getDecorationRange(this.decorationId);if(e){const t=this.editor.getPosition();this.editor.setSelection(Je.fromPositions(e.getStartPosition(),t)),this.cancelSelectionAnchor()}}}cancelSelectionAnchor(){if(this.decorationId){const e=this.decorationId;this.editor.changeDecorations(t=>{t.removeDecoration(e),this.decorationId=void 0}),this.selectionAnchorSetContextKey.set(!1)}}dispose(){this.cancelSelectionAnchor(),this.modelChangeListener.dispose()}};Yu.ID="editor.contrib.selectionAnchorController";Yu=cF=xOe([NOe(1,bt)],Yu);class AOe extends Ue{constructor(){super({id:"editor.action.setSelectionAnchor",label:m("setSelectionAnchor","Set Selection Anchor"),alias:"Set Selection Anchor",precondition:void 0,kbOpts:{kbExpr:O.editorTextFocus,primary:qn(2089,2080),weight:100}})}run(e,t){var i;return dN(this,void 0,void 0,function*(){(i=Yu.get(t))===null||i===void 0||i.setSelectionAnchor()})}}class MOe extends Ue{constructor(){super({id:"editor.action.goToSelectionAnchor",label:m("goToSelectionAnchor","Go to Selection Anchor"),alias:"Go to Selection Anchor",precondition:uN})}run(e,t){var i;return dN(this,void 0,void 0,function*(){(i=Yu.get(t))===null||i===void 0||i.goToSelectionAnchor()})}}class ROe extends Ue{constructor(){super({id:"editor.action.selectFromAnchorToCursor",label:m("selectFromAnchorToCursor","Select from Anchor to Cursor"),alias:"Select from Anchor to Cursor",precondition:uN,kbOpts:{kbExpr:O.editorTextFocus,primary:qn(2089,2089),weight:100}})}run(e,t){var i;return dN(this,void 0,void 0,function*(){(i=Yu.get(t))===null||i===void 0||i.selectFromAnchorToCursor()})}}class POe extends Ue{constructor(){super({id:"editor.action.cancelSelectionAnchor",label:m("cancelSelectionAnchor","Cancel Selection Anchor"),alias:"Cancel Selection Anchor",precondition:uN,kbOpts:{kbExpr:O.editorTextFocus,primary:9,weight:100}})}run(e,t){var i;return dN(this,void 0,void 0,function*(){(i=Yu.get(t))===null||i===void 0||i.cancelSelectionAnchor()})}}ti(Yu.ID,Yu,4);De(AOe);De(MOe);De(ROe);De(POe);const OOe=F("editorOverviewRuler.bracketMatchForeground",{dark:"#A0A0A0",light:"#A0A0A0",hcDark:"#A0A0A0",hcLight:"#A0A0A0"},m("overviewRulerBracketMatchForeground","Overview ruler marker color for matching brackets."));class FOe extends Ue{constructor(){super({id:"editor.action.jumpToBracket",label:m("smartSelect.jumpBracket","Go to Bracket"),alias:"Go to Bracket",precondition:void 0,kbOpts:{kbExpr:O.editorTextFocus,primary:3165,weight:100}})}run(e,t){var i;(i=ll.get(t))===null||i===void 0||i.jumpToBracket()}}class BOe extends Ue{constructor(){super({id:"editor.action.selectToBracket",label:m("smartSelect.selectToBracket","Select to Bracket"),alias:"Select to Bracket",precondition:void 0,description:{description:"Select to Bracket",args:[{name:"args",schema:{type:"object",properties:{selectBrackets:{type:"boolean",default:!0}}}}]}})}run(e,t,i){var s;let o=!0;i&&i.selectBrackets===!1&&(o=!1),(s=ll.get(t))===null||s===void 0||s.selectToBracket(o)}}class WOe extends Ue{constructor(){super({id:"editor.action.removeBrackets",label:m("smartSelect.removeBrackets","Remove Brackets"),alias:"Remove Brackets",precondition:void 0,kbOpts:{kbExpr:O.editorTextFocus,primary:2561,weight:100}})}run(e,t){var i;(i=ll.get(t))===null||i===void 0||i.removeBrackets(this.id)}}class VOe{constructor(e,t,i){this.position=e,this.brackets=t,this.options=i}}class ll extends te{static get(e){return e.getContribution(ll.ID)}constructor(e){super(),this._editor=e,this._lastBracketsData=[],this._lastVersionId=0,this._decorations=this._editor.createDecorationsCollection(),this._updateBracketsSoon=this._register(new Si(()=>this._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 Je(r.lineNumber,r.column,r.lineNumber,r.column):new Je(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(I.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 Je(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(Y.compare);const a=[];let l=0,c=0;const d=s.length;for(let u=0,h=o.length;u0&&(t.pushUndoStop(),t.executeCommands(this.id,s),t.pushUndoStop())}}De(UOe);var jOe=globalThis&&globalThis.__awaiter||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 Cm="9_cutcopypaste",KOe=nc||document.queryCommandSupported("cut"),pie=nc||document.queryCommandSupported("copy"),qOe=typeof navigator.clipboard>"u"||Ta?document.queryCommandSupported("paste"):!0;function R7(n){return n.register(),n}const GOe=KOe?R7(new k0({id:"editor.action.clipboardCutAction",precondition:void 0,kbOpts:nc?{primary:2102,win:{primary:2102,secondary:[1044]},weight:100}:void 0,menuOpts:[{menuId:M.MenubarEditMenu,group:"2_ccp",title:m({key:"miCut",comment:["&& denotes a mnemonic"]},"Cu&&t"),order:1},{menuId:M.EditorContext,group:Cm,title:m("actions.clipboard.cutLabel","Cut"),when:O.writable,order:1},{menuId:M.CommandPalette,group:"",title:m("actions.clipboard.cutLabel","Cut"),order:1},{menuId:M.SimpleEditorContext,group:Cm,title:m("actions.clipboard.cutLabel","Cut"),when:O.writable,order:1}]})):void 0,YOe=pie?R7(new k0({id:"editor.action.clipboardCopyAction",precondition:void 0,kbOpts:nc?{primary:2081,win:{primary:2081,secondary:[2067]},weight:100}:void 0,menuOpts:[{menuId:M.MenubarEditMenu,group:"2_ccp",title:m({key:"miCopy",comment:["&& denotes a mnemonic"]},"&&Copy"),order:2},{menuId:M.EditorContext,group:Cm,title:m("actions.clipboard.copyLabel","Copy"),order:2},{menuId:M.CommandPalette,group:"",title:m("actions.clipboard.copyLabel","Copy"),order:1},{menuId:M.SimpleEditorContext,group:Cm,title:m("actions.clipboard.copyLabel","Copy"),order:2}]})):void 0;Ls.appendMenuItem(M.MenubarEditMenu,{submenu:M.MenubarCopy,title:{value:m("copy as","Copy As"),original:"Copy As"},group:"2_ccp",order:3});Ls.appendMenuItem(M.EditorContext,{submenu:M.EditorContextCopy,title:{value:m("copy as","Copy As"),original:"Copy As"},group:Cm,order:3});Ls.appendMenuItem(M.EditorContext,{submenu:M.EditorContextShare,title:{value:m("share","Share"),original:"Share"},group:"11_share",order:-1,when:fe.and(fe.notEquals("resourceScheme","output"),O.editorTextFocus)});Ls.appendMenuItem(M.EditorTitleContext,{submenu:M.EditorTitleContextShare,title:{value:m("share","Share"),original:"Share"},group:"11_share",order:-1});Ls.appendMenuItem(M.ExplorerContext,{submenu:M.ExplorerContextShare,title:{value:m("share","Share"),original:"Share"},group:"11_share",order:-1});const mR=qOe?R7(new k0({id:"editor.action.clipboardPasteAction",precondition:void 0,kbOpts:nc?{primary:2100,win:{primary:2100,secondary:[1043]},linux:{primary:2100,secondary:[1043]},weight:100}:void 0,menuOpts:[{menuId:M.MenubarEditMenu,group:"2_ccp",title:m({key:"miPaste",comment:["&& denotes a mnemonic"]},"&&Paste"),order:4},{menuId:M.EditorContext,group:Cm,title:m("actions.clipboard.pasteLabel","Paste"),when:O.writable,order:4},{menuId:M.CommandPalette,group:"",title:m("actions.clipboard.pasteLabel","Paste"),order:1},{menuId:M.SimpleEditorContext,group:Cm,title:m("actions.clipboard.pasteLabel","Paste"),when:O.writable,order:4}]})):void 0;class ZOe extends Ue{constructor(){super({id:"editor.action.clipboardCopyWithSyntaxHighlightingAction",label:m("actions.clipboard.copyWithSyntaxHighlightingLabel","Copy With Syntax Highlighting"),alias:"Copy With Syntax Highlighting",precondition:void 0,kbOpts:{kbExpr:O.textInputFocus,primary:0,weight:100}})}run(e,t){!t.hasModel()||!t.getOption(37)&&t.getSelection().isEmpty()||(hO.forceCopyWithSyntaxHighlighting=!0,t.focus(),t.getContainerDomNode().ownerDocument.execCommand("copy"),hO.forceCopyWithSyntaxHighlighting=!1)}}function mie(n,e){n&&(n.addImplementation(1e4,"code-editor",(t,i)=>{const s=t.get(ai).getFocusedCodeEditor();if(s&&s.hasTextFocus()){const o=s.getOption(37),r=s.getSelection();return r&&r.isEmpty()&&!o||s.getContainerDomNode().ownerDocument.execCommand(e),!0}return!1}),n.addImplementation(0,"generic-dom",(t,i)=>(nx().execCommand(e),!0)))}mie(GOe,"cut");mie(YOe,"copy");mR&&(mR.addImplementation(1e4,"code-editor",(n,e)=>{const t=n.get(ai),i=n.get(ch),s=t.getFocusedCodeEditor();return s&&s.hasTextFocus()?!s.getContainerDomNode().ownerDocument.execCommand("paste")&&yg?(()=>jOe(void 0,void 0,void 0,function*(){const r=yield i.readText();if(r!==""){const a=Bw.INSTANCE.get(r);let l=!1,c=null,d=null;a&&(l=s.getOption(37)&&!!a.isFromEmptySelection,c=typeof a.multicursorText<"u"?a.multicursorText:null,d=a.mode),s.trigger("keyboard","paste",{text:r,pasteOnNewLine:l,multicursorText:c,mode:d})}}))():!0:!1}),mR.addImplementation(0,"generic-dom",(n,e)=>(nx().execCommand("paste"),!0)));pie&&De(ZOe);var XOe=globalThis&&globalThis.__awaiter||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 pt{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+pt.sep)}intersects(e){return this.contains(e)||e.contains(this)}append(e){return new pt(this.value+pt.sep+e)}}pt.sep=".";pt.None=new pt("@@none@@");pt.Empty=new pt("");pt.QuickFix=new pt("quickfix");pt.Refactor=new pt("refactor");pt.RefactorExtract=pt.Refactor.append("extract");pt.RefactorInline=pt.Refactor.append("inline");pt.RefactorMove=pt.Refactor.append("move");pt.RefactorRewrite=pt.Refactor.append("rewrite");pt.Notebook=new pt("notebook");pt.Source=new pt("source");pt.SourceOrganizeImports=pt.Source.append("organizeImports");pt.SourceFixAll=pt.Source.append("fixAll");pt.SurroundWith=pt.Refactor.append("surround");var Dr;(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"})(Dr||(Dr={}));function QOe(n,e){return!(n.include&&!n.include.intersects(e)||n.excludes&&n.excludes.some(t=>_ie(e,t,n.include))||!n.includeSourceActions&&pt.Source.contains(e))}function JOe(n,e){const t=e.kind?new pt(e.kind):void 0;return!(n.include&&(!t||!n.include.contains(t))||n.excludes&&t&&n.excludes.some(i=>_ie(t,i,n.include))||!n.includeSourceActions&&t&&pt.Source.contains(t)||n.onlyIncludePreferredActions&&!e.isPreferred)}function _ie(n,e,t){return!(!e.contains(n)||t&&e.contains(t))}class Jc{static fromUser(e,t){return!e||typeof e!="object"?new Jc(t.kind,t.apply,!1):new Jc(Jc.getKindFromUser(e,t.kind),Jc.getApplyFromUser(e,t.apply),Jc.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 pt(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 e4e{constructor(e,t,i){this.action=e,this.provider=t,this.highlightRange=i}resolve(e){var t;return XOe(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){Bn(s)}i&&(this.action.edit=i.edit)}return this})}}var MI=globalThis&&globalThis.__awaiter||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 vie="editor.action.codeAction",P7="editor.action.quickFix",bie="editor.action.autoFix",Cie="editor.action.refactor",wie="editor.action.sourceAction",O7="editor.action.organizeImports",F7="editor.action.fixAll";class FC extends te{static codeActionsPreferredComparator(e,t){return e.isPreferred&&!t.isPreferred?-1:!e.isPreferred&&t.isPreferred?1:0}static codeActionsComparator({action:e},{action:t}){return io(e.diagnostics)?io(t.diagnostics)?FC.codeActionsPreferredComparator(e,t):-1:io(t.diagnostics)?1:FC.codeActionsPreferredComparator(e,t)}constructor(e,t,i){super(),this.documentation=t,this._register(i),this.allActions=[...e].sort(FC.codeActionsComparator),this.validActions=this.allActions.filter(({action:s})=>!s.disabled)}get hasAutoFix(){return this.validActions.some(({action:e})=>!!e.kind&&pt.QuickFix.contains(new pt(e.kind))&&!!e.isPreferred)}}const tj={actions:[],documentation:void 0};function BC(n,e,t,i,s,o){var r;return MI(this,void 0,void 0,function*(){const a=i.filter||{},l=Object.assign(Object.assign({},a),{excludes:[...a.excludes||[],pt.Notebook]}),c={only:(r=a.include)===null||r===void 0?void 0:r.value,trigger:i.type},d=new I7(e,o),u=i.type===2,h=t4e(n,e,u?l:a),f=new be,g=h.map(_=>MI(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 tj;const b=((v==null?void 0:v.actions)||[]).filter(w=>w&&JOe(a,w)),C=n4e(_,b,a.include);return{actions:b.map(w=>new e4e(w,_)),documentation:C}}catch(v){if(bc(v))throw v;return Bn(v),tj}})),p=n.onDidChange(()=>{const _=n.all(e);yn(_,h)||d.cancel()});try{const _=yield Promise.all(g),v=_.map(C=>C.actions).flat(),b=[...wd(_.map(C=>C.documentation)),...i4e(n,e,i,v)];return new FC(v,b,f)}finally{p.dispose(),d.dispose()}})}function t4e(n,e,t){return n.all(e).filter(i=>i.providedCodeActionKinds?i.providedCodeActionKinds.some(s=>QOe(t,new pt(s))):!0)}function*i4e(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 n4e(n,e,t){if(!n.documentation)return;const i=n.documentation.map(s=>({kind:new pt(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 pt(s.kind)))return o.command}}var RI;(function(n){n.OnSave="onSave",n.FromProblemsView="fromProblemsView",n.FromCodeActions="fromCodeActions"})(RI||(RI={}));function s4e(n,e,t,i,s=Ft.None){var o;return MI(this,void 0,void 0,function*(){const r=n.get(kS),a=n.get(gn),l=n.get(ra),c=n.get(Nn);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!==RI.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=o4e(d);c.error(typeof u=="string"?u:m("applyCodeActionFailed","An unknown error occurred while applying the code action"))}})}function o4e(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 MI(this,void 0,void 0,function*(){if(!(e instanceof ct))throw La();const{codeActionProvider:o}=n.get(Ze),r=n.get(Zi).getModel(e);if(!r)throw La();const a=Je.isISelection(t)?Je.liftSelection(t):I.isIRange(t)?r.validateRange(t):void 0;if(!a)throw La();const l=typeof i=="string"?new pt(i):void 0,c=yield BC(o,r,a,{type:1,triggerAction:Dr.Default,filter:{includeSourceActions:!0,include:l}},Fu.None,Ft.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 r4e=globalThis&&globalThis.__decorate||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},a4e=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},dF;let PI=dF=class{constructor(e){this.keybindingService=e}getResolver(){const e=new kg(()=>this.keybindingService.getKeybindings().filter(t=>dF.codeActionCommands.indexOf(t.command)>=0).filter(t=>t.resolvedKeybinding).map(t=>{let i=t.commandArgs;return t.command===O7?i={kind:pt.SourceOrganizeImports.value}:t.command===F7&&(i={kind:pt.SourceFixAll.value}),Object.assign({resolvedKeybinding:t.resolvedKeybinding},Jc.fromUser(i,{kind:pt.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 pt(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)}};PI.codeActionCommands=[Cie,vie,wie,O7,F7];PI=dF=r4e([a4e(0,Di)],PI);F("symbolIcon.arrayForeground",{dark:Te,light:Te,hcDark:Te,hcLight:Te},m("symbolIcon.arrayForeground","The foreground color for array symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));F("symbolIcon.booleanForeground",{dark:Te,light:Te,hcDark:Te,hcLight:Te},m("symbolIcon.booleanForeground","The foreground color for boolean symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));F("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."));F("symbolIcon.colorForeground",{dark:Te,light:Te,hcDark:Te,hcLight:Te},m("symbolIcon.colorForeground","The foreground color for color symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));F("symbolIcon.constantForeground",{dark:Te,light:Te,hcDark:Te,hcLight:Te},m("symbolIcon.constantForeground","The foreground color for constant symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));F("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."));F("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."));F("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."));F("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."));F("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."));F("symbolIcon.fileForeground",{dark:Te,light:Te,hcDark:Te,hcLight:Te},m("symbolIcon.fileForeground","The foreground color for file symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));F("symbolIcon.folderForeground",{dark:Te,light:Te,hcDark:Te,hcLight:Te},m("symbolIcon.folderForeground","The foreground color for folder symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));F("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."));F("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."));F("symbolIcon.keyForeground",{dark:Te,light:Te,hcDark:Te,hcLight:Te},m("symbolIcon.keyForeground","The foreground color for key symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));F("symbolIcon.keywordForeground",{dark:Te,light:Te,hcDark:Te,hcLight:Te},m("symbolIcon.keywordForeground","The foreground color for keyword symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));F("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."));F("symbolIcon.moduleForeground",{dark:Te,light:Te,hcDark:Te,hcLight:Te},m("symbolIcon.moduleForeground","The foreground color for module symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));F("symbolIcon.namespaceForeground",{dark:Te,light:Te,hcDark:Te,hcLight:Te},m("symbolIcon.namespaceForeground","The foreground color for namespace symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));F("symbolIcon.nullForeground",{dark:Te,light:Te,hcDark:Te,hcLight:Te},m("symbolIcon.nullForeground","The foreground color for null symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));F("symbolIcon.numberForeground",{dark:Te,light:Te,hcDark:Te,hcLight:Te},m("symbolIcon.numberForeground","The foreground color for number symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));F("symbolIcon.objectForeground",{dark:Te,light:Te,hcDark:Te,hcLight:Te},m("symbolIcon.objectForeground","The foreground color for object symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));F("symbolIcon.operatorForeground",{dark:Te,light:Te,hcDark:Te,hcLight:Te},m("symbolIcon.operatorForeground","The foreground color for operator symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));F("symbolIcon.packageForeground",{dark:Te,light:Te,hcDark:Te,hcLight:Te},m("symbolIcon.packageForeground","The foreground color for package symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));F("symbolIcon.propertyForeground",{dark:Te,light:Te,hcDark:Te,hcLight:Te},m("symbolIcon.propertyForeground","The foreground color for property symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));F("symbolIcon.referenceForeground",{dark:Te,light:Te,hcDark:Te,hcLight:Te},m("symbolIcon.referenceForeground","The foreground color for reference symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));F("symbolIcon.snippetForeground",{dark:Te,light:Te,hcDark:Te,hcLight:Te},m("symbolIcon.snippetForeground","The foreground color for snippet symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));F("symbolIcon.stringForeground",{dark:Te,light:Te,hcDark:Te,hcLight:Te},m("symbolIcon.stringForeground","The foreground color for string symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));F("symbolIcon.structForeground",{dark:Te,light:Te,hcDark:Te,hcLight:Te},m("symbolIcon.structForeground","The foreground color for struct symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));F("symbolIcon.textForeground",{dark:Te,light:Te,hcDark:Te,hcLight:Te},m("symbolIcon.textForeground","The foreground color for text symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));F("symbolIcon.typeParameterForeground",{dark:Te,light:Te,hcDark:Te,hcLight:Te},m("symbolIcon.typeParameterForeground","The foreground color for type parameter symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));F("symbolIcon.unitForeground",{dark:Te,light:Te,hcDark:Te,hcLight:Te},m("symbolIcon.unitForeground","The foreground color for unit symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));F("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 yie=Object.freeze({kind:pt.Empty,title:m("codeAction.widget.id.more","More Actions...")}),l4e=Object.freeze([{kind:pt.QuickFix,title:m("codeAction.widget.id.quickfix","Quick Fix")},{kind:pt.RefactorExtract,title:m("codeAction.widget.id.extract","Extract"),icon:Me.wrench},{kind:pt.RefactorInline,title:m("codeAction.widget.id.inline","Inline"),icon:Me.wrench},{kind:pt.RefactorRewrite,title:m("codeAction.widget.id.convert","Rewrite"),icon:Me.wrench},{kind:pt.RefactorMove,title:m("codeAction.widget.id.move","Move"),icon:Me.wrench},{kind:pt.SurroundWith,title:m("codeAction.widget.id.surround","Surround With"),icon:Me.symbolSnippet},{kind:pt.Source,title:m("codeAction.widget.id.source","Source Action"),icon:Me.symbolFile},yie]);function c4e(n,e,t){if(!e)return n.map(o=>{var r;return{kind:"action",item:o,group:yie,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=l4e.map(o=>({group:o,actions:[]}));for(const o of n){const r=o.action.kind?new pt(o.action.kind):pt.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 d4e=globalThis&&globalThis.__decorate||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},u4e=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},uF,yv;(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})(yv||(yv={}));let wm=uF=class extends te{constructor(e,t){super(),this._editor=e,this._onClick=this._register(new j),this.onClick=this._onClick.event,this._state=yv.Hidden,this._domNode=ye("div.lightBulbWidget"),this._register(Ii.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(Gbe(this._domNode,i=>{if(this.state.type!==1)return;this._editor.focus(),i.preventDefault();const{top:s,height:o}=Un(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(We.runAndSubscribe(t.onDidUpdateKeybindings,()=>{var i,s,o,r;this._preferredKbLabel=(s=(i=t.lookupKeybinding(bie))===null||i===void 0?void 0:i.getLabel())!==null&&s!==void 0?s:void 0,this._quickFixKbLabel=(r=(o=t.lookupKeybinding(P7))===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=kx(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 yv.Showing(e,t,i,{position:{lineNumber:g,column:1},preference:uF._posPref}),this._editor.layoutContentWidget(this)}hide(){this.state!==yv.Hidden&&(this.state=yv.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(...dt.asClassNameArray(Me.lightBulb)),this._domNode.classList.add(...dt.asClassNameArray(Me.lightbulbAutofix)),this._preferredKbLabel)){this.title=m("preferredcodeActionWithKb","Show Code Actions. Preferred Quick Fix Available ({0})",this._preferredKbLabel);return}this._domNode.classList.remove(...dt.asClassNameArray(Me.lightbulbAutofix)),this._domNode.classList.add(...dt.asClassNameArray(Me.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}};wm.ID="editor.contrib.lightbulbWidget";wm._posPref=[0];wm=uF=d4e([u4e(1,Di)],wm);var h4e=globalThis&&globalThis.__decorate||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},ij=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},Sie=globalThis&&globalThis.__awaiter||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())})},hF;let Zu=hF=class{constructor(e,t,i){this._options=e,this._languageService=t,this._openerService=i,this._onDidRenderAsync=new j,this.onDidRenderAsync=this._onDidRenderAsync.event}dispose(){this._onDidRenderAsync.dispose()}render(e,t,i){if(!e)return{element:document.createElement("span"),dispose:()=>{}};const s=new be,o=s.add(Fx(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)=>Sie(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=Yr);const c=yield LEe(this._languageService,s,l),d=document.createElement("span");if(d.innerHTML=(a=(r=hF._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);Vs(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=>Lie(this._openerService,i,e.isTrusted),disposables:t}}}};Zu._ttpTokenizer=sh("tokenizeToString",{createHTML(n){return n}});Zu=hF=h4e([ij(1,qi),ij(2,Ir)],Zu);function Lie(n,e,t){return Sie(this,void 0,void 0,function*(){try{return yield n.open(e,{fromUserGesture:!0,allowContributedOpeners:!0,allowCommands:f4e(t)})}catch(i){return Dt(i),!1}})}function f4e(n){return n===!0?!0:n&&Array.isArray(n.enabledCommands)?n.enabledCommands:!1}var g4e=globalThis&&globalThis.__decorate||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},nj=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},ID;let Sr=ID=class{static get(e){return e.getContribution(ID.ID)}constructor(e,t,i){this._openerService=i,this._messageWidget=new Ts,this._messageListeners=new be,this._mouseOverMessage=!1,this._editor=e,this._visible=ID.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){to(Lf(e)?e.value:e),this._visible.set(!0),this._messageWidget.clear(),this._messageListeners.clear(),this._message=Lf(e)?Fx(e,{actionHandler:{callback:s=>Lie(this._openerService,s,Lf(e)?e.isTrusted:void 0),disposables:this._messageListeners}}):void 0,this._messageWidget.value=new sj(this._editor,t,typeof e=="string"?e:this._message.element),this._messageListeners.add(We.debounce(this._editor.onDidBlurEditorText,(s,o)=>o,0)(()=>{this._mouseOverMessage||this._messageWidget.value&&Ws(al(),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(ce(this._messageWidget.value.getDomNode(),Pe.MOUSE_ENTER,()=>this._mouseOverMessage=!0,!0)),this._messageListeners.add(ce(this._messageWidget.value.getDomNode(),Pe.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 I(t.lineNumber-3,1,s.target.position.lineNumber+3,1))}))}closeMessage(){this._visible.reset(),this._messageListeners.clear(),this._messageWidget.value&&this._messageListeners.add(sj.fadeOut(this._messageWidget.value))}};Sr.ID="editor.contrib.messageController";Sr.MESSAGE_VISIBLE=new Ve("messageVisible",!1,m("messageVisible","Whether the editor is currently showing an inline message"));Sr=ID=g4e([nj(1,bt),nj(2,Ir)],Sr);const p4e=fs.bindToContribution(Sr.get);Re(new p4e({id:"leaveEditorMessage",precondition:Sr.MESSAGE_VISIBLE,handler:n=>n.closeMessage(),kbOpts:{weight:100+30,primary:9}}));let sj=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)}};ti(Sr.ID,Sr,4);var kie=globalThis&&globalThis.__decorate||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},fF=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},m4e=globalThis&&globalThis.__awaiter||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 Die="acceptSelectedCodeAction",Eie="previewSelectedCodeAction";class _4e{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 gF=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 xS(e,$r);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=dt.asClassName(e.group.icon),e.group.icon.color&&(i.icon.style.color=He(e.group.icon.color.id))):(i.icon.className=dt.asClassName(Me.lightBulb),i.icon.style.color="var(--vscode-editorLightBulb-foreground)"),!e.item||!e.label)return;i.text.textContent=Iie(e.label),i.keybinding.set(e.keybinding),o0e(!!e.keybinding,i.keybinding.element);const a=(o=this._keybindingService.lookupKeybinding(Die))===null||o===void 0?void 0:o.getLabel(),l=(r=this._keybindingService.lookupKeybinding(Eie))===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){}};gF=kie([fF(1,Di)],gF);class v4e extends UIEvent{constructor(){super("acceptSelectedAction")}}class oj extends UIEvent{constructor(){super("previewSelectedAction")}}function b4e(n){if(n.kind==="action")return n.label}let pF=class extends te{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 Tn),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 wl(e,this.domNode,a,[new gF(t,this._keybindingService),new _4e],{keyboardSupport:!1,typeNavigationEnabled:!0,keyboardNavigationLabelProvider:{getKeyboardNavigationLabel:b4e},accessibilityProvider:{getAriaLabel:l=>{if(l.kind==="action"){let c=l.label?Iie(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(e_),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="".concat(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 oj:new v4e;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 oj):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 m4e(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([])}};pF=kie([fF(4,rh),fF(5,Di)],pF);function Iie(n){return n.replace(/\r\n|\r|\n/g," ")}var C4e=globalThis&&globalThis.__decorate||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=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};F("actionBar.toggledBackground",{dark:Ip,light:Ip,hcDark:Ip,hcLight:Ip},m("actionBar.toggledBackground","Background color for toggled action items in action bar."));const ym={Visible:new Ve("codeActionMenuVisible",!1,m("codeActionMenuVisible","Whether the action widget list is visible"))},o_=Wt("actionWidgetService");let Sm=class extends te{get isVisible(){return ym.Visible.getValue(this._contextKeyService)||!1}constructor(e,t,i){super(),this._contextViewService=e,this._contextKeyService=t,this._instantiationService=i,this._list=this._register(new Ts)}show(e,t,i,s,o,r,a){const l=ym.Visible.bindTo(this._contextKeyService),c=this._instantiationService.createInstance(pF,e,t,i,s);this._contextViewService.showContextView({getAnchor:()=>o,render:d=>(l.set(!0),this._renderWidget(d,c,a!=null?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 be,a=document.createElement("div"),l=e.appendChild(a);l.classList.add("context-view-block"),r.add(ce(l,Pe.MOUSE_DOWN,g=>g.stopPropagation()));const c=document.createElement("div"),d=e.appendChild(c);d.classList.add("context-view-pointerBlock"),r.add(ce(d,Pe.POINTER_MOVE,()=>d.remove())),r.add(ce(d,Pe.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="".concat(h,"px");const f=r.add(Ld(e));return r.add(f.onDidBlur(()=>this.hide())),r}_createActionBar(e,t){if(!t.length)return;const i=ye(e),s=new Pa(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)}};Sm=C4e([_R(0,rh),_R(1,bt),_R(2,_t)],Sm);Gt(o_,Sm,1);const BS=100+1e3;Ui(class extends oa{constructor(){super({id:"hideCodeActionWidget",title:{value:m("hideCodeActionWidget.title","Hide action widget"),original:"Hide action widget"},precondition:ym.Visible,keybinding:{weight:BS,primary:9,secondary:[1033]}})}run(n){n.get(o_).hide()}});Ui(class extends oa{constructor(){super({id:"selectPrevCodeAction",title:{value:m("selectPrevCodeAction.title","Select previous action"),original:"Select previous action"},precondition:ym.Visible,keybinding:{weight:BS,primary:16,secondary:[2064],mac:{primary:16,secondary:[2064,302]}}})}run(n){const e=n.get(o_);e instanceof Sm&&e.focusPrevious()}});Ui(class extends oa{constructor(){super({id:"selectNextCodeAction",title:{value:m("selectNextCodeAction.title","Select next action"),original:"Select next action"},precondition:ym.Visible,keybinding:{weight:BS,primary:18,secondary:[2066],mac:{primary:18,secondary:[2066,300]}}})}run(n){const e=n.get(o_);e instanceof Sm&&e.focusNext()}});Ui(class extends oa{constructor(){super({id:Die,title:{value:m("acceptSelected.title","Accept selected action"),original:"Accept selected action"},precondition:ym.Visible,keybinding:{weight:BS,primary:3,secondary:[2137]}})}run(n){const e=n.get(o_);e instanceof Sm&&e.acceptSelected()}});Ui(class extends oa{constructor(){super({id:Eie,title:{value:m("previewSelected.title","Preview selected action"),original:"Preview selected action"},precondition:ym.Visible,keybinding:{weight:BS,primary:2051}})}run(n){const e=n.get(o_);e instanceof Sm&&e.acceptSelected(!0)}});var w4e=globalThis&&globalThis.__awaiter||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 Tie=new Ve("supportedCodeAction","");class y4e extends te{constructor(e,t,i,s=250){super(),this._editor=e,this._markerService=t,this._signalChange=i,this._delay=s,this._autoTriggerTimer=this._register(new _l),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=>_9(i,t.uri))&&this._tryAutoTrigger()}_tryAutoTrigger(){this._autoTriggerTimer.cancelAndSet(()=>{this.trigger({type:2,triggerAction:Dr.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 yp;(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(bc(r))return xie;throw r})}cancel(){this._cancellablePromise.cancel()}}n.Triggered=e})(yp||(yp={}));const xie=Object.freeze({allActions:[],validActions:[],dispose:()=>{},documentation:[],hasAutoFix:!1});class S4e extends te{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 Ts),this._state=yp.Empty,this._onDidChangeState=this._register(new j),this.onDidChangeState=this._onDidChangeState.event,this._disposed=!1,this._supportedCodeActions=Tie.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(yp.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(yp.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 y4e(this._editor,this._markerService,i=>{var s;if(!i){this.setState(yp.Empty);return}const o=i.selection.getStartPosition(),r=Xn(a=>w4e(this,void 0,void 0,function*(){var l,c,d,u,h,f;if(this._settingEnabledNearbyQuickfixes()&&i.trigger.type===1&&(i.trigger.triggerAction===Dr.QuickFix||!((c=(l=i.trigger.filter)===null||l===void 0?void 0:l.include)===null||c===void 0)&&c.contains(pt.QuickFix))){const g=yield BC(this._registry,e,i.selection,i.trigger,Fu.None,a);if(a.isCancellationRequested)return xie;if(!((d=g.validActions)===null||d===void 0?void 0:d.some(_=>_.action.kind?pt.QuickFix.contains(new pt(_.action.kind)):!1))){const _=this._markerService.read({resource:e.uri});if(_.length>0){const v=i.selection.getPosition();let b=v,C=Number.MAX_VALUE,w=!1;for(const y of _){const L=y.endColumn,S=y.endLineNumber,k=y.startLineNumber;(S===v.lineNumber||k===v.lineNumber)&&Math.abs(v.column-L){D.highlightRange=D.action.isPreferred}),k.push(...S.validActions)),{validActions:k,allActions:g.allActions,documentation:g.documentation,hasAutoFix:g.hasAutoFix,dispose:()=>{g.dispose()}}}}}}return BC(this._registry,e,i.selection,i.trigger,Fu.None,a)}));i.trigger.type===1&&((s=this._progressService)===null||s===void 0||s.showWhile(r,250)),this.setState(new yp.Triggered(i.trigger,o,r))},void 0),this._codeActionOracle.value.trigger({type:2,triggerAction:Dr.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 L4e=globalThis&&globalThis.__decorate||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},Zd=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},v1=globalThis&&globalThis.__awaiter||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())})},TD;const k4e="quickfix-edit-highlight";let ig=TD=class extends te{static get(e){return e.getContribution(TD.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 Ts),this._showDisabled=!1,this._disposed=!1,this._editor=e,this._model=this._register(new S4e(this._editor,o.codeActionProvider,t,i,r,l)),this._register(this._model.onDidChangeState(u=>this.update(u))),this._lightBulbWidget=new kg(()=>{const u=this._editor.getContribution(wm.ID);return u&&this._register(u.onClick(h=>this.showCodeActionList(h.actions,h,{includeDisabledActions:!1,fromLightbulb:!0}))),u}),this._resolver=s.createInstance(PI),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=Sr.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 v1(this,void 0,void 0,function*(){try{yield this._instantiationService.invokeFunction(s4e,e,RI.FromCodeActions,{preview:i,editor:this._editor})}finally{t&&this._trigger({type:2,triggerAction:Dr.QuickFix,filter:{}})}})}update(e){var t,i,s,o,r,a,l;return v1(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){Dt(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=Sr.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=Sr.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 v1(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=Y.isIPosition(t)?this.toCoords(t):t,l={onSelect:(c,d)=>v1(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)=>v1(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:TD.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;Yf(m("editingNewSelection","Context: {0} at line {1} and column {2}.",g,f.startLineNumber,f.startColumn))}else s.clear()}};this._actionWidgetService.show("codeActionWidget",!0,c4e(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=Un(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}};ig.ID="editor.contrib.codeActionController";ig.DECORATION=kt.register({description:"quickfix-highlight",className:k4e});ig=TD=L4e([Zd(1,zd),Zd(2,bt),Zd(3,_t),Zd(4,Ze),Zd(5,Tg),Zd(6,gn),Zd(7,zt),Zd(8,o_),Zd(9,_t)],ig);bl((n,e)=>{((s,o)=>{o&&e.addRule(".monaco-editor ".concat(s," { background-color: ").concat(o,"; }"))})(".quickfix-edit-highlight",n.getColor(ld));const i=n.getColor(tf);i&&e.addRule(".monaco-editor .quickfix-edit-highlight { border: 1px ".concat(ac(n.type)?"dotted":"solid"," ").concat(i,"; box-sizing: border-box; }"))});function WS(n){return fe.regex(Tie.keys()[0],new RegExp("(\\s|^)"+Xr(n.value)+"\\b"))}const B7={type:"object",defaultSnippets:[{body:{kind:""}}],properties:{kind:{type:"string",description:m("args.schema.kind","Kind of the code action to run.")},apply:{type:"string",description:m("args.schema.apply","Controls when the returned actions are applied."),default:"ifSingle",enum:["first","ifSingle","never"],enumDescriptions:[m("args.schema.apply.first","Always apply the first returned code action."),m("args.schema.apply.ifSingle","Apply the first returned code action if it is the only one."),m("args.schema.apply.never","Do not apply the returned code actions.")]},preferred:{type:"boolean",default:!1,description:m("args.schema.preferred","Controls if only preferred code actions should be returned.")}}};function r_(n,e,t,i,s=Dr.Default){if(n.hasModel()){const o=ig.get(n);o==null||o.manualTriggerAtCurrentPosition(e,s,t,i)}}class D4e extends Ue{constructor(){super({id:P7,label:m("quickfix.trigger.label","Quick Fix..."),alias:"Quick Fix...",precondition:fe.and(O.writable,O.hasCodeActionsProvider),kbOpts:{kbExpr:O.textInputFocus,primary:2137,weight:100}})}run(e,t){return r_(t,m("editor.action.quickFix.noneMessage","No code actions available"),void 0,void 0,Dr.QuickFix)}}class E4e extends fs{constructor(){super({id:vie,precondition:fe.and(O.writable,O.hasCodeActionsProvider),description:{description:"Trigger a code action",args:[{name:"args",schema:B7}]}})}runEditorCommand(e,t,i){const s=Jc.fromUser(i,{kind:pt.Empty,apply:"ifSingle"});return r_(t,typeof(i==null?void 0:i.kind)=="string"?s.preferred?m("editor.action.codeAction.noneMessage.preferred.kind","No preferred code actions for '{0}' available",i.kind):m("editor.action.codeAction.noneMessage.kind","No code actions for '{0}' available",i.kind):s.preferred?m("editor.action.codeAction.noneMessage.preferred","No preferred code actions available"):m("editor.action.codeAction.noneMessage","No code actions available"),{include:s.kind,includeSourceActions:!0,onlyIncludePreferredActions:s.preferred},s.apply)}}class I4e extends Ue{constructor(){super({id:Cie,label:m("refactor.label","Refactor..."),alias:"Refactor...",precondition:fe.and(O.writable,O.hasCodeActionsProvider),kbOpts:{kbExpr:O.textInputFocus,primary:3120,mac:{primary:1328},weight:100},contextMenuOpts:{group:"1_modification",order:2,when:fe.and(O.writable,WS(pt.Refactor))},description:{description:"Refactor...",args:[{name:"args",schema:B7}]}})}run(e,t,i){const s=Jc.fromUser(i,{kind:pt.Refactor,apply:"never"});return r_(t,typeof(i==null?void 0:i.kind)=="string"?s.preferred?m("editor.action.refactor.noneMessage.preferred.kind","No preferred refactorings for '{0}' available",i.kind):m("editor.action.refactor.noneMessage.kind","No refactorings for '{0}' available",i.kind):s.preferred?m("editor.action.refactor.noneMessage.preferred","No preferred refactorings available"):m("editor.action.refactor.noneMessage","No refactorings available"),{include:pt.Refactor.contains(s.kind)?s.kind:pt.None,onlyIncludePreferredActions:s.preferred},s.apply,Dr.Refactor)}}class T4e extends Ue{constructor(){super({id:wie,label:m("source.label","Source Action..."),alias:"Source Action...",precondition:fe.and(O.writable,O.hasCodeActionsProvider),contextMenuOpts:{group:"1_modification",order:2.1,when:fe.and(O.writable,WS(pt.Source))},description:{description:"Source Action...",args:[{name:"args",schema:B7}]}})}run(e,t,i){const s=Jc.fromUser(i,{kind:pt.Source,apply:"never"});return r_(t,typeof(i==null?void 0:i.kind)=="string"?s.preferred?m("editor.action.source.noneMessage.preferred.kind","No preferred source actions for '{0}' available",i.kind):m("editor.action.source.noneMessage.kind","No source actions for '{0}' available",i.kind):s.preferred?m("editor.action.source.noneMessage.preferred","No preferred source actions available"):m("editor.action.source.noneMessage","No source actions available"),{include:pt.Source.contains(s.kind)?s.kind:pt.None,includeSourceActions:!0,onlyIncludePreferredActions:s.preferred},s.apply,Dr.SourceAction)}}class x4e extends Ue{constructor(){super({id:O7,label:m("organizeImports.label","Organize Imports"),alias:"Organize Imports",precondition:fe.and(O.writable,WS(pt.SourceOrganizeImports)),kbOpts:{kbExpr:O.textInputFocus,primary:1581,weight:100}})}run(e,t){return r_(t,m("editor.action.organize.noneMessage","No organize imports action available"),{include:pt.SourceOrganizeImports,includeSourceActions:!0},"ifSingle",Dr.OrganizeImports)}}class N4e extends Ue{constructor(){super({id:F7,label:m("fixAll.label","Fix All"),alias:"Fix All",precondition:fe.and(O.writable,WS(pt.SourceFixAll))})}run(e,t){return r_(t,m("fixAll.noneMessage","No fix all action available"),{include:pt.SourceFixAll,includeSourceActions:!0},"ifSingle",Dr.FixAll)}}class A4e extends Ue{constructor(){super({id:bie,label:m("autoFix.label","Auto Fix..."),alias:"Auto Fix...",precondition:fe.and(O.writable,WS(pt.QuickFix)),kbOpts:{kbExpr:O.textInputFocus,primary:1625,mac:{primary:2649},weight:100}})}run(e,t){return r_(t,m("editor.action.autoFix.noneMessage","No auto fixes available"),{include:pt.QuickFix,onlyIncludePreferredActions:!0},"ifSingle",Dr.AutoFix)}}ti(ig.ID,ig,3);ti(wm.ID,wm,4);De(D4e);De(I4e);De(T4e);De(x4e);De(A4e);De(N4e);Re(new E4e);en.as(wc.Configuration).registerConfiguration(Object.assign(Object.assign({},Ax),{properties:{"editor.codeActionWidget.showHeaders":{type:"boolean",scope:5,description:m("showCodeActionHeaders","Enable/disable showing group headers in the Code Action menu."),default:!0}}}));en.as(wc.Configuration).registerConfiguration(Object.assign(Object.assign({},Ax),{properties:{"editor.codeActionWidget.includeNearbyQuickfixes":{type:"boolean",scope:5,description:m("includeNearbyQuickfixes","Enable/disable showing nearest quickfix within a line when not currently on a diagnostic."),default:!1}}}));var rj=globalThis&&globalThis.__awaiter||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 mF{constructor(){this.lenses=[],this._disposables=new be}dispose(){this._disposables.dispose()}get isDisposed(){return this._disposables.isDisposed}add(e,t){this._disposables.add(e);for(const i of e.lenses)this.lenses.push({symbol:i,provider:t})}}function Nie(n,e,t){return rj(this,void 0,void 0,function*(){const i=n.ordered(e),s=new Map,o=new mF,r=i.map((a,l)=>rj(this,void 0,void 0,function*(){s.set(a,l);try{const c=yield Promise.resolve(a.provideCodeLenses(e,t));c&&o.add(c,a)}catch(c){Bn(c)}}));return yield Promise.all(r),o.lenses=o.lenses.sort((a,l)=>a.symbol.range.startLineNumberl.symbol.range.startLineNumber?1:s.get(a.provider)s.get(l.provider)?1:a.symbol.range.startColumnl.symbol.range.startColumn?1:0),o})}qt.registerCommand("_executeCodeLensProvider",function(n,...e){let[t,i]=e;bi(ct.isUri(t)),bi(typeof i=="number"||!i);const{codeLensProvider:s}=n.get(Ze),o=n.get(Zi).getModel(t);if(!o)throw La();const r=[],a=new be;return Nie(s,o,Ft.None).then(l=>{a.add(l);const c=[];for(const d of l.lenses)i==null||d.symbol.command?r.push(d.symbol):i-- >0&&d.provider.resolveCodeLens&&c.push(Promise.resolve(d.provider.resolveCodeLens(o,d.symbol,Ft.None)).then(u=>r.push(u||d.symbol)));return Promise.all(c)}).then(()=>r).finally(()=>{setTimeout(()=>a.dispose(),100)})});var M4e=globalThis&&globalThis.__decorate||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},R4e=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};const Aie=Wt("ICodeLensCache");class aj{constructor(e,t){this.lineCount=e,this.data=t}}let _F=class{constructor(e){this._fakeProvider=new class{provideCodeLenses(){throw new Error("not supported")}},this._cache=new Dg(20,.75);const t="codelens/cache";yu(()=>e.remove(t,1));const i="codelens/cache2",s=e.get(i,1,"{}");this._deserialize(s),We.once(e.onWillSaveState)(o=>{o.reason===aI.SHUTDOWN&&e.store(i,this._serialize(),1,1)})}put(e,t){const i=t.lenses.map(r=>{var a;return{range:r.symbol.range,command:r.symbol.command&&{id:"",title:(a=r.symbol.command)===null||a===void 0?void 0:a.title}}}),s=new mF;s.add({lenses:i,dispose:()=>{}},this._fakeProvider);const o=new aj(e.getLineCount(),s);this._cache.set(e.uri.toString(),o)}get(e){const t=this._cache.get(e.uri.toString());return t&&t.lineCount===e.getLineCount()?t.data:void 0}delete(e){this._cache.delete(e.uri.toString())}_serialize(){const e=Object.create(null);for(const[t,i]of this._cache){const s=new Set;for(const o of i.data.lenses)s.add(o.symbol.range.startLineNumber);e[t]={lineCount:i.lineCount,lines:[...s.values()]}}return JSON.stringify(e)}_deserialize(e){try{const t=JSON.parse(e);for(const i in t){const s=t[i],o=[];for(const a of s.lines)o.push({range:new I(a,1,a,11)});const r=new mF;r.add({lenses:o,dispose(){}},this._fakeProvider),this._cache.set(i,new aj(s.lineCount,r))}}catch{}}};_F=M4e([R4e(0,yl)],_F);Gt(Aie,_F,1);class P4e{constructor(e,t,i){this.afterColumn=1073741824,this.afterLineNumber=e,this.heightInPx=t,this._onHeight=i,this.suppressMouseDown=!0,this.domNode=document.createElement("div")}onComputedHeight(e){this._lastHeight===void 0?this._lastHeight=e:this._lastHeight!==e&&(this._lastHeight=e,this._onHeight())}isVisible(){return this._lastHeight!==0&&this.domNode.hasAttribute("monaco-visible-view-zone")}}class hN{constructor(e,t){this.allowEditorOverflow=!1,this.suppressMouseDown=!0,this._commands=new Map,this._isEmpty=!0,this._editor=e,this._id="codelens.widget-".concat(hN._idPool++),this.updatePosition(t),this._domNode=document.createElement("span"),this._domNode.className="codelens-decoration"}withCommands(e,t){this._commands.clear();const i=[];let s=!1;for(let o=0;o{c.symbol.command&&l.push(c.symbol),i.addDecoration({range:c.symbol.range,options:lj},u=>this._decorationIds[d]=u),a?a=I.plusRange(a,c.symbol.range):a=I.lift(c.symbol.range)}),this._viewZone=new P4e(a.startLineNumber-1,o,r),this._viewZoneId=s.addZone(this._viewZone),l.length>0&&(this._createContentWidgetIfNecessary(),this._contentWidget.withCommands(l,!1))}_createContentWidgetIfNecessary(){this._contentWidget?this._editor.layoutContentWidget(this._contentWidget):(this._contentWidget=new hN(this._editor,this._viewZone.afterLineNumber+1),this._editor.addContentWidget(this._contentWidget))}dispose(e,t){this._decorationIds.forEach(e.removeDecoration,e),this._decorationIds=[],t==null||t.removeZone(this._viewZoneId),this._contentWidget&&(this._editor.removeContentWidget(this._contentWidget),this._contentWidget=void 0),this._isDisposed=!0}isDisposed(){return this._isDisposed}isValid(){return this._decorationIds.some((e,t)=>{const i=this._editor.getModel().getDecorationRange(e),s=this._data[t].symbol;return!!(i&&I.isEmpty(s.range)===i.isEmpty())})}updateCodeLensSymbols(e,t){this._decorationIds.forEach(t.removeDecoration,t),this._decorationIds=[],this._data=e,this._data.forEach((i,s)=>{t.addDecoration({range:i.symbol.range,options:lj},o=>this._decorationIds[s]=o)})}updateHeight(e,t){this._viewZone.heightInPx=e,t.layoutZone(this._viewZoneId),this._contentWidget&&this._editor.layoutContentWidget(this._contentWidget)}computeIfNecessary(e){if(!this._viewZone.isVisible())return null;for(let t=0;t=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},b1=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},Mie=globalThis&&globalThis.__awaiter||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 qb=class{constructor(e,t,i,s,o,r){this._editor=e,this._languageFeaturesService=t,this._commandService=s,this._notificationService=o,this._codeLensCache=r,this._disposables=new be,this._localToDispose=new be,this._lenses=[],this._oldCodeLensModels=new be,this._provideCodeLensDebounce=i.for(t.codeLensProvider,"CodeLensProvide",{min:250}),this._resolveCodeLensesDebounce=i.for(t.codeLensProvider,"CodeLensResolve",{min:250,salt:"resolve"}),this._resolveCodeLensesScheduler=new Si(()=>this._resolveCodeLensesInViewport(),this._resolveCodeLensesDebounce.default()),this._disposables.add(this._editor.onDidChangeModel(()=>this._onModelChange())),this._disposables.add(this._editor.onDidChangeModelLanguage(()=>this._onModelChange())),this._disposables.add(this._editor.onDidChangeConfiguration(a=>{(a.hasChanged(50)||a.hasChanged(19)||a.hasChanged(18))&&this._updateLensStyle(),a.hasChanged(17)&&this._onModelChange()})),this._disposables.add(t.codeLensProvider.onDidChange(this._onModelChange,this)),this._onModelChange(),this._updateLensStyle()}dispose(){var e;this._localDispose(),this._disposables.dispose(),this._oldCodeLensModels.dispose(),(e=this._currentCodeLensModel)===null||e===void 0||e.dispose()}_getLayoutInfo(){const e=Math.max(1.3,this._editor.getOption(66)/this._editor.getOption(52));let t=this._editor.getOption(19);return(!t||t<5)&&(t=this._editor.getOption(52)*.9|0),{fontSize:t,codeLensHeight:t*e|0}}_updateLensStyle(){const{codeLensHeight:e,fontSize:t}=this._getLayoutInfo(),i=this._editor.getOption(18),s=this._editor.getOption(50),{style:o}=this._editor.getContainerDomNode();o.setProperty("--vscode-editorCodeLens-lineHeight","".concat(e,"px")),o.setProperty("--vscode-editorCodeLens-fontSize","".concat(t,"px")),o.setProperty("--vscode-editorCodeLens-fontFeatureSettings",s.fontFeatureSettings),i&&(o.setProperty("--vscode-editorCodeLens-fontFamily",i),o.setProperty("--vscode-editorCodeLens-fontFamilyDefault",wr.fontFamily)),this._editor.changeViewZones(r=>{for(const a of this._lenses)a.updateHeight(e,r)})}_localDispose(){var e,t,i;(e=this._getCodeLensModelPromise)===null||e===void 0||e.cancel(),this._getCodeLensModelPromise=void 0,(t=this._resolveCodeLensesPromise)===null||t===void 0||t.cancel(),this._resolveCodeLensesPromise=void 0,this._localToDispose.clear(),this._oldCodeLensModels.clear(),(i=this._currentCodeLensModel)===null||i===void 0||i.dispose()}_onModelChange(){this._localDispose();const e=this._editor.getModel();if(!e||!this._editor.getOption(17)||e.isTooLargeForTokenization())return;const t=this._codeLensCache.get(e);if(t&&this._renderCodeLensSymbols(t),!this._languageFeaturesService.codeLensProvider.has(e)){t&&this._localToDispose.add(Kf(()=>{const s=this._codeLensCache.get(e);t===s&&(this._codeLensCache.delete(e),this._onModelChange())},30*1e3));return}for(const s of this._languageFeaturesService.codeLensProvider.all(e))if(typeof s.onDidChange=="function"){const o=s.onDidChange(()=>i.schedule());this._localToDispose.add(o)}const i=new Si(()=>{var s;const o=Date.now();(s=this._getCodeLensModelPromise)===null||s===void 0||s.cancel(),this._getCodeLensModelPromise=Xn(r=>Nie(this._languageFeaturesService.codeLensProvider,e,r)),this._getCodeLensModelPromise.then(r=>{this._currentCodeLensModel&&this._oldCodeLensModels.add(this._currentCodeLensModel),this._currentCodeLensModel=r,this._codeLensCache.put(e,r);const a=this._provideCodeLensDebounce.update(e,Date.now()-o);i.delay=a,this._renderCodeLensSymbols(r),this._resolveCodeLensesInViewportSoon()},Dt)},this._provideCodeLensDebounce.get(e));this._localToDispose.add(i),this._localToDispose.add(vt(()=>this._resolveCodeLensesScheduler.cancel())),this._localToDispose.add(this._editor.onDidChangeModelContent(()=>{var s;this._editor.changeDecorations(o=>{this._editor.changeViewZones(r=>{const a=[];let l=-1;this._lenses.forEach(d=>{!d.isValid()||l===d.getLineNumber()?a.push(d):(d.update(r),l=d.getLineNumber())});const c=new vR;a.forEach(d=>{d.dispose(c,r),this._lenses.splice(this._lenses.indexOf(d),1)}),c.commit(o)})}),i.schedule(),this._resolveCodeLensesScheduler.cancel(),(s=this._resolveCodeLensesPromise)===null||s===void 0||s.cancel(),this._resolveCodeLensesPromise=void 0})),this._localToDispose.add(this._editor.onDidFocusEditorWidget(()=>{i.schedule()})),this._localToDispose.add(this._editor.onDidBlurEditorText(()=>{i.cancel()})),this._localToDispose.add(this._editor.onDidScrollChange(s=>{s.scrollTopChanged&&this._lenses.length>0&&this._resolveCodeLensesInViewportSoon()})),this._localToDispose.add(this._editor.onDidLayoutChange(()=>{this._resolveCodeLensesInViewportSoon()})),this._localToDispose.add(vt(()=>{if(this._editor.getModel()){const s=mc.capture(this._editor);this._editor.changeDecorations(o=>{this._editor.changeViewZones(r=>{this._disposeAllLenses(o,r)})}),s.restore(this._editor)}else this._disposeAllLenses(void 0,void 0)})),this._localToDispose.add(this._editor.onMouseDown(s=>{if(s.target.type!==9)return;let o=s.target.element;if((o==null?void 0:o.tagName)==="SPAN"&&(o=o.parentElement),(o==null?void 0:o.tagName)==="A")for(const r of this._lenses){const a=r.getCommand(o);if(a){this._commandService.executeCommand(a.id,...a.arguments||[]).catch(l=>this._notificationService.error(l));break}}})),i.schedule()}_disposeAllLenses(e,t){const i=new vR;for(const s of this._lenses)s.dispose(i,t);e&&i.commit(e),this._lenses.length=0}_renderCodeLensSymbols(e){if(!this._editor.hasModel())return;const t=this._editor.getModel().getLineCount(),i=[];let s;for(const a of e.lenses){const l=a.symbol.range.startLineNumber;l<1||l>t||(s&&s[s.length-1].symbol.range.startLineNumber===l?s.push(a):(s=[a],i.push(s)))}if(!i.length&&!this._lenses.length)return;const o=mc.capture(this._editor),r=this._getLayoutInfo();this._editor.changeDecorations(a=>{this._editor.changeViewZones(l=>{const c=new vR;let d=0,u=0;for(;uthis._resolveCodeLensesInViewportSoon())),d++,u++)}for(;dthis._resolveCodeLensesInViewportSoon())),u++;c.commit(a)})}),o.restore(this._editor)}_resolveCodeLensesInViewportSoon(){this._editor.getModel()&&this._resolveCodeLensesScheduler.schedule()}_resolveCodeLensesInViewport(){var e;(e=this._resolveCodeLensesPromise)===null||e===void 0||e.cancel(),this._resolveCodeLensesPromise=void 0;const t=this._editor.getModel();if(!t)return;const i=[],s=[];if(this._lenses.forEach(a=>{const l=a.computeIfNecessary(t);l&&(i.push(l),s.push(a))}),i.length===0)return;const o=Date.now(),r=Xn(a=>{const l=i.map((c,d)=>{const u=new Array(c.length),h=c.map((f,g)=>!f.symbol.command&&typeof f.provider.resolveCodeLens=="function"?Promise.resolve(f.provider.resolveCodeLens(t,f.symbol,a)).then(p=>{u[g]=p},Bn):(u[g]=f.symbol,Promise.resolve(void 0)));return Promise.all(h).then(()=>{!a.isCancellationRequested&&!s[d].isDisposed()&&s[d].updateCommands(u)})});return Promise.all(l)});this._resolveCodeLensesPromise=r,this._resolveCodeLensesPromise.then(()=>{const a=this._resolveCodeLensesDebounce.update(t,Date.now()-o);this._resolveCodeLensesScheduler.delay=a,this._currentCodeLensModel&&this._codeLensCache.put(t,this._currentCodeLensModel),this._oldCodeLensModels.clear(),r===this._resolveCodeLensesPromise&&(this._resolveCodeLensesPromise=void 0)},a=>{Dt(a),r===this._resolveCodeLensesPromise&&(this._resolveCodeLensesPromise=void 0)})}getModel(){var e;return Mie(this,void 0,void 0,function*(){return yield this._getCodeLensModelPromise,yield this._resolveCodeLensesPromise,!((e=this._currentCodeLensModel)===null||e===void 0)&&e.isDisposed?void 0:this._currentCodeLensModel})}};qb.ID="css.editor.codeLens";qb=O4e([b1(1,Ze),b1(2,Va),b1(3,gn),b1(4,Nn),b1(5,Aie)],qb);ti(qb.ID,qb,1);De(class extends Ue{constructor(){super({id:"codelens.showLensesInCurrentLine",precondition:O.hasCodeLensProvider,label:m("showLensOnLine","Show CodeLens Commands For Current Line"),alias:"Show CodeLens Commands For Current Line"})}run(e,t){return Mie(this,void 0,void 0,function*(){if(!t.hasModel())return;const i=e.get(yc),s=e.get(gn),o=e.get(Nn),r=t.getSelection().positionLineNumber,a=t.getContribution(qb.ID);if(!a)return;const l=yield a.getModel();if(!l)return;const c=[];for(const h of l.lenses)h.symbol.command&&h.symbol.range.startLineNumber===r&&c.push({label:h.symbol.command.title,command:h.symbol.command});if(c.length===0)return;const d=yield i.pick(c,{canPickMany:!1,placeHolder:m("placeHolder","Select a command")});if(!d)return;let u=d.command;if(l.isDisposed){const h=yield a.getModel(),f=h==null?void 0:h.lenses.find(g=>{var p;return g.symbol.range.startLineNumber===r&&((p=g.symbol.command)===null||p===void 0?void 0:p.title)===u.title});if(!f||!f.symbol.command)return;u=f.symbol.command}try{yield s.executeCommand(u.id,...u.arguments||[])}catch(h){o.error(h)}})}});var F4e=globalThis&&globalThis.__decorate||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=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},B4e=globalThis&&globalThis.__awaiter||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 W7{constructor(e,t){this._editorWorkerClient=new K8(e,!1,"editorWorkerService",t)}provideDocumentColors(e,t){return B4e(this,void 0,void 0,function*(){return this._editorWorkerClient.computeDefaultDocumentColors(e.uri)})}provideColorPresentations(e,t,i){const s=t.range,o=t.color,r=o.alpha,a=new ee(new jt(Math.round(255*o.red),Math.round(255*o.green),Math.round(255*o.blue),r)),l=r?ee.Format.CSS.formatRGB(a):ee.Format.CSS.formatRGBA(a),c=r?ee.Format.CSS.formatHSL(a):ee.Format.CSS.formatHSLA(a),d=r?ee.Format.CSS.formatHex(a):ee.Format.CSS.formatHexA(a),u=[];return u.push({label:l,textEdit:{range:s,text:l}}),u.push({label:c,textEdit:{range:s,text:c}}),u.push({label:d,textEdit:{range:s,text:d}}),u}}let vF=class extends te{constructor(e,t,i){super(),this._register(i.colorProvider.register("*",new W7(e,t)))}};vF=F4e([bR(0,Zi),bR(1,Ni),bR(2,Ze)],vF);Qx(vF);var VS=globalThis&&globalThis.__awaiter||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 Rie(n,e,t,i=!0){return VS(this,void 0,void 0,function*(){return V7(new W4e,n,e,t,i)})}function Pie(n,e,t,i){return Promise.resolve(t.provideColorPresentations(n,e,i))}class W4e{constructor(){}compute(e,t,i,s){return VS(this,void 0,void 0,function*(){const o=yield e.provideDocumentColors(t,i);if(Array.isArray(o))for(const r of o)s.push({colorInfo:r,provider:e});return Array.isArray(o)})}}class V4e{constructor(){}compute(e,t,i,s){return VS(this,void 0,void 0,function*(){const o=yield e.provideDocumentColors(t,i);if(Array.isArray(o))for(const r of o)s.push({range:r.range,color:[r.color.red,r.color.green,r.color.blue,r.color.alpha]});return Array.isArray(o)})}}class H4e{constructor(e){this.colorInfo=e}compute(e,t,i,s){return VS(this,void 0,void 0,function*(){const o=yield e.provideColorPresentations(t,this.colorInfo,Ft.None);return Array.isArray(o)&&s.push(...o),Array.isArray(o)})}}function V7(n,e,t,i,s){return VS(this,void 0,void 0,function*(){let o=!1,r;const a=[],l=e.ordered(t);for(let c=l.length-1;c>=0;c--){const d=l[c];if(d instanceof W7)r=d;else try{(yield n.compute(d,t,i,a))&&(o=!0)}catch(u){Bn(u)}}return o?a:r&&s?(yield n.compute(r,t,i,a),a):[]})}function Oie(n,e){const{colorProvider:t}=n.get(Ze),i=n.get(Zi).getModel(e);if(!i)throw La();const s=n.get(zt).getValue("editor.defaultColorDecorators",{resource:e});return{model:i,colorProviderRegistry:t,isDefaultColorDecoratorsEnabled:s}}qt.registerCommand("_executeDocumentColorProvider",function(n,...e){const[t]=e;if(!(t instanceof ct))throw La();const{model:i,colorProviderRegistry:s,isDefaultColorDecoratorsEnabled:o}=Oie(n,t);return V7(new V4e,s,i,Ft.None,o)});qt.registerCommand("_executeColorPresentationProvider",function(n,...e){const[t,i]=e,{uri:s,range:o}=i;if(!(s instanceof ct)||!Array.isArray(t)||t.length!==4||!I.isIRange(o))throw La();const{model:r,colorProviderRegistry:a,isDefaultColorDecoratorsEnabled:l}=Oie(n,s),[c,d,u,h]=t;return V7(new H4e({range:o,color:{red:c,green:d,blue:u,alpha:h}}),a,r,Ft.None,l)});var $4e=globalThis&&globalThis.__decorate||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},CR=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},dj=globalThis&&globalThis.__awaiter||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())})},bF;const Fie=Object.create({});let ng=bF=class extends te{constructor(e,t,i,s){super(),this._editor=e,this._configurationService=t,this._languageFeaturesService=i,this._localToDispose=this._register(new be),this._decorationsIds=[],this._colorDatas=new Map,this._colorDecoratorIds=this._editor.createDecorationsCollection(),this._ruleFactory=new mS(this._editor),this._decoratorLimitReporter=new z4e,this._colorDecorationClassRefs=this._register(new be),this._debounceInformation=s.for(i.colorProvider,"Document Colors",{min:bF.RECOMPUTE_TIME}),this._register(e.onDidChangeModel(()=>{this._isColorDecoratorsEnabled=this.isEnabled(),this.updateColors()})),this._register(e.onDidChangeModelLanguage(()=>this.updateColors())),this._register(i.colorProvider.onDidChange(()=>this.updateColors())),this._register(e.onDidChangeConfiguration(o=>{const r=this._isColorDecoratorsEnabled;this._isColorDecoratorsEnabled=this.isEnabled(),this._isDefaultColorDecoratorsEnabled=this._editor.getOption(145);const a=r!==this._isColorDecoratorsEnabled||o.hasChanged(21),l=o.hasChanged(145);(a||l)&&(this._isColorDecoratorsEnabled?this.updateColors():this.removeAllDecorations())})),this._timeoutTimer=null,this._computePromise=null,this._isColorDecoratorsEnabled=this.isEnabled(),this._isDefaultColorDecoratorsEnabled=this._editor.getOption(145),this.updateColors()}isEnabled(){const e=this._editor.getModel();if(!e)return!1;const t=e.getLanguageId(),i=this._configurationService.getValue(t);if(i&&typeof i=="object"){const s=i.colorDecorators;if(s&&s.enable!==void 0&&!s.enable)return s.enable}return this._editor.getOption(20)}static get(e){return e.getContribution(this.ID)}dispose(){this.stop(),this.removeAllDecorations(),super.dispose()}updateColors(){if(this.stop(),!this._isColorDecoratorsEnabled)return;const e=this._editor.getModel();!e||!this._languageFeaturesService.colorProvider.has(e)||(this._localToDispose.add(this._editor.onDidChangeModelContent(()=>{this._timeoutTimer||(this._timeoutTimer=new _l,this._timeoutTimer.cancelAndSet(()=>{this._timeoutTimer=null,this.beginCompute()},this._debounceInformation.get(e)))})),this.beginCompute())}beginCompute(){return dj(this,void 0,void 0,function*(){this._computePromise=Xn(e=>dj(this,void 0,void 0,function*(){const t=this._editor.getModel();if(!t)return[];const i=new so(!1),s=yield Rie(this._languageFeaturesService.colorProvider,t,e,this._isDefaultColorDecoratorsEnabled);return this._debounceInformation.update(t,i.elapsed()),s}));try{const e=yield this._computePromise;this.updateDecorations(e),this.updateColorDecorators(e),this._computePromise=null}catch(e){Dt(e)}})}stop(){this._timeoutTimer&&(this._timeoutTimer.cancel(),this._timeoutTimer=null),this._computePromise&&(this._computePromise.cancel(),this._computePromise=null),this._localToDispose.clear()}updateDecorations(e){const t=e.map(i=>({range:{startLineNumber:i.colorInfo.range.startLineNumber,startColumn:i.colorInfo.range.startColumn,endLineNumber:i.colorInfo.range.endLineNumber,endColumn:i.colorInfo.range.endColumn},options:kt.EMPTY}));this._editor.changeDecorations(i=>{this._decorationsIds=i.deltaDecorations(this._decorationsIds,t),this._colorDatas=new Map,this._decorationsIds.forEach((s,o)=>this._colorDatas.set(s,e[o]))})}updateColorDecorators(e){this._colorDecorationClassRefs.clear();const t=[],i=this._editor.getOption(21);for(let o=0;othis._colorDatas.has(s.id));return i.length===0?null:this._colorDatas.get(i[0].id)}isColorDecoration(e){return this._colorDecoratorIds.has(e)}};ng.ID="editor.contrib.colorDetector";ng.RECOMPUTE_TIME=1e3;ng=bF=$4e([CR(1,zt),CR(2,Ze),CR(3,Va)],ng);class z4e{constructor(){this._onDidChange=new j,this._computed=0,this._limited=!1}update(e,t){(e!==this._computed||t!==this._limited)&&(this._computed=e,this._limited=t,this._onDidChange.fire())}}ti(ng.ID,ng,1);class U4e{get color(){return this._color}set color(e){this._color.equals(e)||(this._color=e,this._onDidChangeColor.fire(e))}get presentation(){return this.colorPresentations[this.presentationIndex]}get colorPresentations(){return this._colorPresentations}set colorPresentations(e){this._colorPresentations=e,this.presentationIndex>e.length-1&&(this.presentationIndex=0),this._onDidChangePresentation.fire(this.presentation)}constructor(e,t,i){this.presentationIndex=i,this._onColorFlushed=new j,this.onColorFlushed=this._onColorFlushed.event,this._onDidChangeColor=new j,this.onDidChangeColor=this._onDidChangeColor.event,this._onDidChangePresentation=new j,this.onDidChangePresentation=this._onDidChangePresentation.event,this.originalColor=e,this._color=e,this._colorPresentations=t}selectNextColorPresentation(){this.presentationIndex=(this.presentationIndex+1)%this.colorPresentations.length,this.flushColor(),this._onDidChangePresentation.fire(this.presentation)}guessColorPresentation(e,t){let i=-1;for(let s=0;s{this.backgroundColor=r.getColor(AE)||ee.white})),this._register(ce(this._pickedColorNode,Pe.CLICK,()=>this.model.selectNextColorPresentation())),this._register(ce(this._originalColorNode,Pe.CLICK,()=>{this.model.color=this.model.originalColor,this.model.flushColor()})),this._register(t.onDidChangeColor(this.onDidChangeColor,this)),this._register(t.onDidChangePresentation(this.onDidChangePresentation,this)),this._pickedColorNode.style.backgroundColor=ee.Format.CSS.format(t.color)||"",this._pickedColorNode.classList.toggle("light",t.color.rgba.a<.5?this.backgroundColor.isLighter():t.color.isLighter()),this.onDidChangeColor(this.model.color),this.showingStandaloneColorPicker&&(this._domNode.classList.add("standalone-colorpicker"),this._closeButton=this._register(new K4e(this._domNode)))}get closeButton(){return this._closeButton}get pickedColorNode(){return this._pickedColorNode}get originalColorNode(){return this._originalColorNode}onDidChangeColor(e){this._pickedColorNode.style.backgroundColor=ee.Format.CSS.format(e)||"",this._pickedColorNode.classList.toggle("light",e.rgba.a<.5?this.backgroundColor.isLighter():e.isLighter()),this.onDidChangePresentation()}onDidChangePresentation(){this._pickedColorPresentation.textContent=this.model.presentation?this.model.presentation.label:""}}class K4e extends te{constructor(e){super(),this._onClicked=this._register(new j),this.onClicked=this._onClicked.event,this._button=document.createElement("div"),this._button.classList.add("close-button"),ge(e,this._button);const t=document.createElement("div");t.classList.add("close-button-inner-div"),ge(this._button,t),ge(t,Hr(".button"+dt.asCSSSelector(Sn("color-picker-close",Me.close,m("closeIcon","Icon to close the color picker"))))).classList.add("close-icon"),this._button.onclick=()=>{this._onClicked.fire()}}}class q4e extends te{constructor(e,t,i,s=!1){super(),this.model=t,this.pixelRatio=i,this._insertButton=null,this._domNode=Hr(".colorpicker-body"),ge(e,this._domNode),this._saturationBox=new G4e(this._domNode,this.model,this.pixelRatio),this._register(this._saturationBox),this._register(this._saturationBox.onDidChange(this.onDidSaturationValueChange,this)),this._register(this._saturationBox.onColorFlushed(this.flushColor,this)),this._opacityStrip=new Y4e(this._domNode,this.model,s),this._register(this._opacityStrip),this._register(this._opacityStrip.onDidChange(this.onDidOpacityChange,this)),this._register(this._opacityStrip.onColorFlushed(this.flushColor,this)),this._hueStrip=new Z4e(this._domNode,this.model,s),this._register(this._hueStrip),this._register(this._hueStrip.onDidChange(this.onDidHueChange,this)),this._register(this._hueStrip.onColorFlushed(this.flushColor,this)),s&&(this._insertButton=this._register(new X4e(this._domNode)),this._domNode.classList.add("standalone-colorpicker"))}flushColor(){this.model.flushColor()}onDidSaturationValueChange({s:e,v:t}){const i=this.model.color.hsva;this.model.color=new ee(new id(i.h,e,t,i.a))}onDidOpacityChange(e){const t=this.model.color.hsva;this.model.color=new ee(new id(t.h,t.s,t.v,e))}onDidHueChange(e){const t=this.model.color.hsva,i=(1-e)*360;this.model.color=new ee(new id(i===360?0:i,t.s,t.v,t.a))}get domNode(){return this._domNode}get saturationBox(){return this._saturationBox}get enterButton(){return this._insertButton}layout(){this._saturationBox.layout(),this._opacityStrip.layout(),this._hueStrip.layout()}}class G4e extends te{constructor(e,t,i){super(),this.model=t,this.pixelRatio=i,this._onDidChange=new j,this.onDidChange=this._onDidChange.event,this._onColorFlushed=new j,this.onColorFlushed=this._onColorFlushed.event,this._domNode=Hr(".saturation-wrap"),ge(e,this._domNode),this._canvas=document.createElement("canvas"),this._canvas.className="saturation-box",ge(this._domNode,this._canvas),this.selection=Hr(".saturation-selection"),ge(this._domNode,this.selection),this.layout(),this._register(ce(this._domNode,Pe.POINTER_DOWN,s=>this.onPointerDown(s))),this._register(this.model.onDidChangeColor(this.onDidChangeColor,this)),this.monitor=null}get domNode(){return this._domNode}onPointerDown(e){if(!e.target||!(e.target instanceof Element))return;this.monitor=this._register(new I0);const t=Un(this._domNode);e.target!==this.selection&&this.onDidChangePosition(e.offsetX,e.offsetY),this.monitor.startMonitoring(e.target,e.pointerId,e.buttons,s=>this.onDidChangePosition(s.pageX-t.left,s.pageY-t.top),()=>null);const i=ce(e.target.ownerDocument,Pe.POINTER_UP,()=>{this._onColorFlushed.fire(),i.dispose(),this.monitor&&(this.monitor.stopMonitoring(!0),this.monitor=null)},!0)}onDidChangePosition(e,t){const i=Math.max(0,Math.min(1,e/this.width)),s=Math.max(0,Math.min(1,1-t/this.height));this.paintSelection(i,s),this._onDidChange.fire({s:i,v:s})}layout(){this.width=this._domNode.offsetWidth,this.height=this._domNode.offsetHeight,this._canvas.width=this.width*this.pixelRatio,this._canvas.height=this.height*this.pixelRatio,this.paint();const e=this.model.color.hsva;this.paintSelection(e.s,e.v)}paint(){const e=this.model.color.hsva,t=new ee(new id(e.h,1,1,1)),i=this._canvas.getContext("2d"),s=i.createLinearGradient(0,0,this._canvas.width,0);s.addColorStop(0,"rgba(255, 255, 255, 1)"),s.addColorStop(.5,"rgba(255, 255, 255, 0.5)"),s.addColorStop(1,"rgba(255, 255, 255, 0)");const o=i.createLinearGradient(0,0,0,this._canvas.height);o.addColorStop(0,"rgba(0, 0, 0, 0)"),o.addColorStop(1,"rgba(0, 0, 0, 1)"),i.rect(0,0,this._canvas.width,this._canvas.height),i.fillStyle=ee.Format.CSS.format(t),i.fill(),i.fillStyle=s,i.fill(),i.fillStyle=o,i.fill()}paintSelection(e,t){this.selection.style.left="".concat(e*this.width,"px"),this.selection.style.top="".concat(this.height-t*this.height,"px")}onDidChangeColor(e){if(this.monitor&&this.monitor.isMonitoring())return;this.paint();const t=e.hsva;this.paintSelection(t.s,t.v)}}class Bie extends te{constructor(e,t,i=!1){super(),this.model=t,this._onDidChange=new j,this.onDidChange=this._onDidChange.event,this._onColorFlushed=new j,this.onColorFlushed=this._onColorFlushed.event,i?(this.domNode=ge(e,Hr(".standalone-strip")),this.overlay=ge(this.domNode,Hr(".standalone-overlay"))):(this.domNode=ge(e,Hr(".strip")),this.overlay=ge(this.domNode,Hr(".overlay"))),this.slider=ge(this.domNode,Hr(".slider")),this.slider.style.top="0px",this._register(ce(this.domNode,Pe.POINTER_DOWN,s=>this.onPointerDown(s))),this._register(t.onDidChangeColor(this.onDidChangeColor,this)),this.layout()}layout(){this.height=this.domNode.offsetHeight-this.slider.offsetHeight;const e=this.getValue(this.model.color);this.updateSliderPosition(e)}onDidChangeColor(e){const t=this.getValue(e);this.updateSliderPosition(t)}onPointerDown(e){if(!e.target||!(e.target instanceof Element))return;const t=this._register(new I0),i=Un(this.domNode);this.domNode.classList.add("grabbing"),e.target!==this.slider&&this.onDidChangeTop(e.offsetY),t.startMonitoring(e.target,e.pointerId,e.buttons,o=>this.onDidChangeTop(o.pageY-i.top),()=>null);const s=ce(e.target.ownerDocument,Pe.POINTER_UP,()=>{this._onColorFlushed.fire(),s.dispose(),t.stopMonitoring(!0),this.domNode.classList.remove("grabbing")},!0)}onDidChangeTop(e){const t=Math.max(0,Math.min(1,1-e/this.height));this.updateSliderPosition(t),this._onDidChange.fire(t)}updateSliderPosition(e){this.slider.style.top="".concat((1-e)*this.height,"px")}}class Y4e extends Bie{constructor(e,t,i=!1){super(e,t,i),this.domNode.classList.add("opacity-strip"),this.onDidChangeColor(this.model.color)}onDidChangeColor(e){super.onDidChangeColor(e);const{r:t,g:i,b:s}=e.rgba,o=new ee(new jt(t,i,s,1)),r=new ee(new jt(t,i,s,0));this.overlay.style.background="linear-gradient(to bottom, ".concat(o," 0%, ").concat(r," 100%)")}getValue(e){return e.hsva.a}}class Z4e extends Bie{constructor(e,t,i=!1){super(e,t,i),this.domNode.classList.add("hue-strip")}getValue(e){return 1-e.hsva.h/360}}class X4e extends te{constructor(e){super(),this._onClicked=this._register(new j),this.onClicked=this._onClicked.event,this._button=ge(e,document.createElement("button")),this._button.classList.add("insert-button"),this._button.textContent="Insert",this._button.onclick=t=>{this._onClicked.fire()}}get button(){return this._button}}class Q4e extends vl{constructor(e,t,i,s,o=!1){super(),this.model=t,this.pixelRatio=i,this._register(vw.onDidChange(()=>this.layout()));const r=Hr(".colorpicker-widget");e.appendChild(r),this.header=this._register(new j4e(r,this.model,s,o)),this.body=this._register(new q4e(r,this.model,this.pixelRatio,o))}layout(){this.body.layout()}}var Wie=globalThis&&globalThis.__decorate||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},Vie=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},Gb=globalThis&&globalThis.__awaiter||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 J4e{constructor(e,t,i,s){this.owner=e,this.range=t,this.model=i,this.provider=s,this.forceShowAtRange=!0}isValidForHoverAnchor(e){return e.type===1&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}}let OI=class{constructor(e,t){this._editor=e,this._themeService=t,this.hoverOrdinal=2}computeSync(e,t){return[]}computeAsync(e,t,i){return Mn.fromPromise(this._computeAsync(e,t,i))}_computeAsync(e,t,i){return Gb(this,void 0,void 0,function*(){if(!this._editor.hasModel())return[];const s=ng.get(this._editor);if(!s)return[];for(const o of t){if(!s.isColorDecoration(o))continue;const r=s.getColorData(o.range.getStartPosition());if(r)return[yield Hie(this,this._editor.getModel(),r.colorInfo,r.provider)]}return[]})}renderHoverParts(e,t){return $ie(this,this._editor,this._themeService,t,e)}};OI=Wie([Vie(1,os)],OI);class eFe{constructor(e,t,i,s){this.owner=e,this.range=t,this.model=i,this.provider=s}}let my=class{constructor(e,t){this._editor=e,this._themeService=t,this._color=null}createColorHover(e,t,i){return Gb(this,void 0,void 0,function*(){if(!this._editor.hasModel()||!ng.get(this._editor))return null;const o=yield Rie(i,this._editor.getModel(),Ft.None);let r=null,a=null;for(const u of o){const h=u.colorInfo;I.containsRange(h.range,e.range)&&(r=h,a=u.provider)}const l=r!=null?r:e,c=a!=null?a:t,d=!!r;return{colorHover:yield Hie(this,this._editor.getModel(),l,c),foundInEditor:d}})}updateEditorModel(e){return Gb(this,void 0,void 0,function*(){if(!this._editor.hasModel())return;const t=e.model;let i=new I(e.range.startLineNumber,e.range.startColumn,e.range.endLineNumber,e.range.endColumn);this._color&&(yield xD(this._editor.getModel(),t,this._color,i,e),i=zie(this._editor,i,t))})}renderHoverParts(e,t){return $ie(this,this._editor,this._themeService,t,e)}set color(e){this._color=e}get color(){return this._color}};my=Wie([Vie(1,os)],my);function Hie(n,e,t,i){return Gb(this,void 0,void 0,function*(){const s=e.getValueInRange(t.range),{red:o,green:r,blue:a,alpha:l}=t.color,c=new jt(Math.round(o*255),Math.round(r*255),Math.round(a*255),l),d=new ee(c),u=yield Pie(e,t,i,Ft.None),h=new U4e(d,[],0);return h.colorPresentations=u||[],h.guessColorPresentation(d,s),n instanceof OI?new J4e(n,I.lift(t.range),h,i):new eFe(n,I.lift(t.range),h,i)})}function $ie(n,e,t,i,s){if(i.length===0||!e.hasModel())return te.None;if(s.setMinimumDimensions){const h=e.getOption(66)+8;s.setMinimumDimensions(new ii(302,h))}const o=new be,r=i[0],a=e.getModel(),l=r.model,c=o.add(new Q4e(s.fragment,l,e.getOption(141),t,n instanceof my));s.setColorPicker(c);let d=!1,u=new I(r.range.startLineNumber,r.range.startColumn,r.range.endLineNumber,r.range.endColumn);if(n instanceof my){const h=i[0].model.color;n.color=h,xD(a,l,h,u,r),o.add(l.onColorFlushed(f=>{n.color=f}))}else o.add(l.onColorFlushed(h=>Gb(this,void 0,void 0,function*(){yield xD(a,l,h,u,r),d=!0,u=zie(e,u,l,s)})));return o.add(l.onDidChangeColor(h=>{xD(a,l,h,u,r)})),o.add(e.onDidChangeModelContent(h=>{d?d=!1:(s.hide(),e.focus())})),o}function zie(n,e,t,i){let s,o;if(t.presentation.textEdit){s=[t.presentation.textEdit],o=new I(t.presentation.textEdit.range.startLineNumber,t.presentation.textEdit.range.startColumn,t.presentation.textEdit.range.endLineNumber,t.presentation.textEdit.range.endColumn);const r=n.getModel()._setTrackedRange(null,o,3);n.pushUndoStop(),n.executeEdits("colorpicker",s),o=n.getModel()._getTrackedRange(r)||o}else s=[{range:e,text:t.presentation.label,forceMoveMarkers:!1}],o=e.setEndPosition(e.endLineNumber,e.startColumn+t.presentation.label.length),n.pushUndoStop(),n.executeEdits("colorpicker",s);return t.presentation.additionalTextEdits&&(s=[...t.presentation.additionalTextEdits],n.executeEdits("colorpicker",s),i&&i.hide()),n.pushUndoStop(),o}function xD(n,e,t,i,s){return Gb(this,void 0,void 0,function*(){const o=yield Pie(n,{range:i,color:{red:t.rgba.r/255,green:t.rgba.g/255,blue:t.rgba.b/255,alpha:t.rgba.a}},s.provider,Ft.None);e.colorPresentations=o||[]})}function CF(n,e){return!!n[e]}class wR{constructor(e,t){this.target=e.target,this.isLeftClick=e.event.leftButton,this.isMiddleClick=e.event.middleButton,this.isRightClick=e.event.rightButton,this.hasTriggerModifier=CF(e.event,t.triggerModifier),this.hasSideBySideModifier=CF(e.event,t.triggerSideBySideModifier),this.isNoneOrSingleMouseDown=e.event.detail<=1}}class uj{constructor(e,t){this.keyCodeIsTriggerKey=e.keyCode===t.triggerKey,this.keyCodeIsSideBySideKey=e.keyCode===t.triggerSideBySideKey,this.hasTriggerModifier=CF(e,t.triggerModifier)}}class ok{constructor(e,t,i,s){this.triggerKey=e,this.triggerModifier=t,this.triggerSideBySideKey=i,this.triggerSideBySideModifier=s}equals(e){return this.triggerKey===e.triggerKey&&this.triggerModifier===e.triggerModifier&&this.triggerSideBySideKey===e.triggerSideBySideKey&&this.triggerSideBySideModifier===e.triggerSideBySideModifier}}function hj(n){return n==="altKey"?Kt?new ok(57,"metaKey",6,"altKey"):new ok(5,"ctrlKey",6,"altKey"):Kt?new ok(6,"altKey",57,"metaKey"):new ok(6,"altKey",5,"ctrlKey")}class fN extends te{constructor(e,t){var i;super(),this._onMouseMoveOrRelevantKeyDown=this._register(new j),this.onMouseMoveOrRelevantKeyDown=this._onMouseMoveOrRelevantKeyDown.event,this._onExecute=this._register(new j),this.onExecute=this._onExecute.event,this._onCancel=this._register(new j),this.onCancel=this._onCancel.event,this._editor=e,this._extractLineNumberFromMouseEvent=(i=t==null?void 0:t.extractLineNumberFromMouseEvent)!==null&&i!==void 0?i:s=>s.target.position?s.target.position.lineNumber:0,this._opts=hj(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=hj(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 wR(s,this._opts)))),this._register(this._editor.onMouseDown(s=>this._onEditorMouseDown(new wR(s,this._opts)))),this._register(this._editor.onMouseUp(s=>this._onEditorMouseUp(new wR(s,this._opts)))),this._register(this._editor.onKeyDown(s=>this._onEditorKeyDown(new uj(s,this._opts)))),this._register(this._editor.onKeyUp(s=>this._onEditorKeyUp(new uj(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 tFe=globalThis&&globalThis.__decorate||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},Xd=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let sg=class extends Ob{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){zT(this._overwriteOptions,e,!0),super.updateOptions(this._overwriteOptions)}};sg=tFe([Xd(4,_t),Xd(5,ai),Xd(6,gn),Xd(7,bt),Xd(8,os),Xd(9,Nn),Xd(10,oh),Xd(11,Ni),Xd(12,Ze)],sg);const fj=new ee(new jt(0,122,204)),iFe={showArrow:!0,showFrame:!0,className:"",frameColor:fj,arrowColor:fj,keepEditorSelection:!1},nFe="vs.editor.contrib.zoneWidget";class sFe{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 oFe{constructor(e,t){this._id=e,this._domNode=t}getId(){return this._id}getDomNode(){return this._domNode}getPosition(){return null}}class gN{constructor(e){this._editor=e,this._ruleName=gN._IdGenerator.nextId(),this._decorations=this._editor.createDecorationsCollection(),this._color=null,this._height=-1}dispose(){this.hide(),sH(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(){sH(this._ruleName),UP(".monaco-editor ".concat(this._ruleName),"border-style: solid; border-color: transparent; border-bottom-color: ".concat(this._color,"; border-width: ").concat(this._height,"px; bottom: -").concat(this._height,"px; margin-left: -").concat(this._height,"px; "))}show(e){e.column===1&&(e={lineNumber:e.lineNumber,column:2}),this._decorations.set([{range:I.fromPositions(e),options:{description:"zone-widget-arrow",className:this._ruleName,stickiness:1}}])}hide(){this._decorations.clear()}}gN._IdGenerator=new K9(".arrow-decoration-");class rFe{constructor(e,t={}){this._arrow=null,this._overlayWidget=null,this._resizeSash=null,this._viewZone=null,this._disposables=new be,this.container=null,this._isShowing=!1,this.editor=e,this._positionMarkerId=this.editor.createDecorationsCollection(),this.options=du(t),zT(this.options,iFe,!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 gN(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="".concat(e,"px"),this.container){const i=e-this._decoratingElementsHeight();this.container.style.height="".concat(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=I.isIRange(e)?I.lift(e):I.fromPositions(e);this._isShowing=!0,this._showImpl(i,t),this._isShowing=!1,this._positionMarkerId.set([{range:i,options:kt.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="".concat(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 sFe(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 oFe(nFe+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 I(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 qs(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 Uie=globalThis&&globalThis.__decorate||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},jie=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};const Kie=Wt("IPeekViewService");Gt(Kie,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 tr;(function(n){n.inPeekEditor=new Ve("inReferenceSearchEditor",!0,m("inReferenceSearchEditor","Whether the current code editor is embedded inside peek")),n.notInPeekEditor=n.inPeekEditor.toNegated()})(tr||(tr={}));let _y=class{constructor(e,t){e instanceof sg&&tr.inPeekEditor.bindTo(t)}dispose(){}};_y.ID="editor.contrib.referenceController";_y=Uie([jie(1,bt)],_y);ti(_y.ID,_y,0);function aFe(n){const e=n.get(ai).getFocusedCodeEditor();return e instanceof sg?e.getParentEditor():e}const lFe={headerBackgroundColor:ee.white,primaryHeadingColor:ee.fromHex("#333333"),secondaryHeadingColor:ee.fromHex("#6c6c6cb3")};let FI=class extends rFe{constructor(e,t,i){super(e,t),this.instantiationService=i,this._onDidClose=new j,this.onDidClose=this._onDidClose.event,zT(this.options,lFe,!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=ye(".head"),this._bodyElement=ye(".body"),this._fillHead(this._headElement),this._fillBody(this._bodyElement),e.appendChild(this._headElement),e.appendChild(this._bodyElement)}_fillHead(e,t){this._titleElement=ye(".peekview-title"),this.options.supportOnTitleClick&&(this._titleElement.classList.add("clickable"),In(this._titleElement,"click",o=>this._onTitleClick(o))),ge(this._headElement,this._titleElement),this._fillTitleIcon(this._titleElement),this._primaryHeading=ye("span.filename"),this._secondaryHeading=ye("span.dirname"),this._metaHeading=ye("span.meta"),ge(this._titleElement,this._primaryHeading,this._secondaryHeading,this._metaHeading);const i=ye(".peekview-actions");ge(this._headElement,i);const s=this._getActionBarOptions();this._actionbarWidget=new Pa(i,s),this._disposables.add(this._actionbarWidget),t||this._actionbarWidget.push(new Ro("peekview.close",m("label.close","Close"),dt.asClassName(Me.close),!0,()=>(this.dispose(),Promise.resolve())),{label:!1,icon:!0})}_fillTitleIcon(e){}_getActionBarOptions(){return{actionViewItemProvider:cNe.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:Ds(this._secondaryHeading))}setMetaTitle(e){this._metaHeading&&(e?(this._metaHeading.innerText=e,mr(this._metaHeading)):Lo(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="".concat(e,"px"),this._headElement.style.lineHeight=this._headElement.style.height)}_doLayoutBody(e,t){this._bodyElement&&(this._bodyElement.style.height="".concat(e,"px"))}};FI=Uie([jie(2,_t)],FI);const cFe=F("peekViewTitle.background",{dark:"#252526",light:"#F3F3F3",hcDark:ee.black,hcLight:ee.white},m("peekViewTitleBackground","Background color of the peek view title area.")),qie=F("peekViewTitleLabel.foreground",{dark:ee.white,light:ee.black,hcDark:ee.white,hcLight:Ja},m("peekViewTitleForeground","Color of the peek view title.")),Gie=F("peekViewTitleDescription.foreground",{dark:"#ccccccb3",light:"#616161",hcDark:"#FFFFFF99",hcLight:"#292929"},m("peekViewTitleInfoForeground","Color of the peek view title info.")),dFe=F("peekView.border",{dark:Xo,light:Xo,hcDark:$t,hcLight:$t},m("peekViewBorder","Color of the peek view borders and arrow.")),uFe=F("peekViewResult.background",{dark:"#252526",light:"#F3F3F3",hcDark:ee.black,hcLight:ee.white},m("peekViewResultsBackground","Background color of the peek view result list."));F("peekViewResult.lineForeground",{dark:"#bbbbbb",light:"#646465",hcDark:ee.white,hcLight:Ja},m("peekViewResultsMatchForeground","Foreground color for line nodes in the peek view result list."));F("peekViewResult.fileForeground",{dark:ee.white,light:"#1E1E1E",hcDark:ee.white,hcLight:Ja},m("peekViewResultsFileForeground","Foreground color for file nodes in the peek view result list."));F("peekViewResult.selectionBackground",{dark:"#3399ff33",light:"#3399ff33",hcDark:null,hcLight:null},m("peekViewResultsSelectionBackground","Background color of the selected entry in the peek view result list."));F("peekViewResult.selectionForeground",{dark:ee.white,light:"#6C6C6C",hcDark:ee.white,hcLight:Ja},m("peekViewResultsSelectionForeground","Foreground color of the selected entry in the peek view result list."));const lf=F("peekViewEditor.background",{dark:"#001F33",light:"#F2F8FC",hcDark:ee.black,hcLight:ee.white},m("peekViewEditorBackground","Background color of the peek view editor."));F("peekViewEditorGutter.background",{dark:lf,light:lf,hcDark:lf,hcLight:lf},m("peekViewEditorGutterBackground","Background color of the gutter in the peek view editor."));F("peekViewEditorStickyScroll.background",{dark:lf,light:lf,hcDark:lf,hcLight:lf},m("peekViewEditorStickScrollBackground","Background color of sticky scroll in the peek view editor."));F("peekViewResult.matchHighlightBackground",{dark:"#ea5c004d",light:"#ea5c004d",hcDark:null,hcLight:null},m("peekViewResultsMatchHighlight","Match highlight color in the peek view result list."));F("peekViewEditor.matchHighlightBackground",{dark:"#ff8f0099",light:"#f5d802de",hcDark:null,hcLight:null},m("peekViewEditorMatchHighlight","Match highlight color in the peek view editor."));F("peekViewEditor.matchHighlightBorder",{dark:null,light:null,hcDark:$i,hcLight:$i},m("peekViewEditorMatchHighlightBorder","Match highlight border in the peek view editor."));var hFe=globalThis&&globalThis.__awaiter||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 og{constructor(e,t,i,s){this.isProviderFirst=e,this.parent=t,this.link=i,this._rangeCallback=s,this.id=t4.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,Ra(this.uri),this.range.startLineNumber,this.range.startColumn):m("aria.oneReference","in {0} on line {1} at column {2}",Ra(this.uri),this.range.startLineNumber,this.range.startColumn)}}class fFe{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 I(s,l.startColumn,s,o),d=new I(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 vy{constructor(e,t){this.parent=e,this.uri=t,this.children=[],this._previews=new Js}dispose(){fi(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}",Ra(this.uri),this.uri.fsPath):m("aria.fileReferences.N","{0} symbols in {1}, full path {2}",e,Ra(this.uri),this.uri.fsPath)}resolve(e){return hFe(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 fFe(i))}catch(i){Dt(i)}return this})}}class Lr{constructor(e,t){this.groups=[],this.references=[],this._onDidChangeReferenceRange=new j,this.onDidChangeReferenceRange=this._onDidChangeReferenceRange.event,this._links=e,this._title=t;const[i]=e;e.sort(Lr._compareReferences);let s;for(const o of e)if((!s||!zi.isEqual(s.uri,o.uri,!0))&&(s=new vy(this,o.uri),this.groups.push(s)),s.children.length===0||Lr._compareReferences(o,s.children[s.children.length-1])!==0){const r=new og(i===o,s,o,a=>this._onDidChangeReferenceRange.fire(a));this.references.push(r),s.children.push(r)}}dispose(){fi(this.groups),this._onDidChangeReferenceRange.dispose(),this.groups.length=0}clone(){return new Lr(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:om(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()&&I.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 zi.compare(e.uri,t.uri)||I.compareRangesUsingStarts(e.range,t.range)}}var pN=globalThis&&globalThis.__decorate||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},mN=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},wF;let yF=class{constructor(e){this._resolverService=e}hasChildren(e){return e instanceof Lr||e instanceof vy}getChildren(e){if(e instanceof Lr)return e.groups;if(e instanceof vy)return e.resolve(this._resolverService).then(t=>t.children);throw new Error("bad tree")}};yF=pN([mN(0,sr)],yF);class gFe{getHeight(){return 23}getTemplateId(e){return e instanceof vy?by.id:HS.id}}let SF=class{constructor(e){this._keybindingService=e}getKeyboardNavigationLabel(e){var t;if(e instanceof og){const i=(t=e.parent.getPreview(e))===null||t===void 0?void 0:t.preview(e.range);if(i)return i.value}return Ra(e.uri)}};SF=pN([mN(0,Di)],SF);class pFe{getId(e){return e instanceof og?e.id:e.uri}}let LF=class extends te{constructor(e,t){super(),this._labelService=t;const i=document.createElement("div");i.classList.add("reference-file"),this.file=this._register(new wI(i,{supportHighlights:!0})),this.badge=new k4(ge(i,ye(".count")),{},Mee),e.appendChild(i)}set(e,t){const i=Ex(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))}};LF=pN([mN(1,Fb)],LF);let by=wF=class{constructor(e){this._instantiationService=e,this.templateId=wF.id}renderTemplate(e){return this._instantiationService.createInstance(LF,e)}renderElement(e,t,i){i.set(e.element,DS(e.filterData))}disposeTemplate(e){e.dispose()}};by.id="FileReferencesRenderer";by=wF=pN([mN(0,_t)],by);class mFe{constructor(e){this.label=new Ef(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("".concat(Ra(e.uri),":").concat(e.range.startLineNumber+1,":").concat(e.range.startColumn+1));else{const{value:o,highlight:r}=s;t&&!lc.isDefault(t)?(this.label.element.classList.toggle("referenceMatch",!1),this.label.set(o,DS(t))):(this.label.element.classList.toggle("referenceMatch",!0),this.label.set(o,[r]))}}}class HS{constructor(){this.templateId=HS.id}renderTemplate(e){return new mFe(e)}renderElement(e,t,i){i.set(e.element,e.filterData)}disposeTemplate(){}}HS.id="OneReferenceRenderer";class _Fe{getWidgetAriaLabel(){return m("treeAriaLabel","References")}getAriaLabel(e){return e.ariaMessage}}var vFe=globalThis&&globalThis.__decorate||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},Qd=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},gj=globalThis&&globalThis.__awaiter||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 _N{constructor(e,t){this._editor=e,this._model=t,this._decorations=new Map,this._decorationIgnoreSet=new Set,this._callOnDispose=new be,this._callOnModelChange=new be,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(CFe,"ReferencesWidget",this._treeContainer,new gFe,[this._instantiationService.createInstance(by),this._instantiationService.createInstance(HS)],this._instantiationService.createInstance(yF),i),this._splitView.addView({onDidChange:We.None,element:this._previewContainer,minimumSize:200,maximumSize:Number.MAX_VALUE,layout:o=>{this._preview.layout({height:this._dim.height,width:o})}},_I.Distribute),this._splitView.addView({onDidChange:We.None,element:this._treeContainer,minimumSize:100,maximumSize:Number.MAX_VALUE,layout:o=>{this._treeContainer.style.height="".concat(this._dim.height,"px"),this._treeContainer.style.width="".concat(o,"px"),this._tree.layout(this._dim.height,o)}},_I.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 og&&(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")}),Lo(this._treeContainer)}_onWidth(e){this._dim&&this._doLayoutBody(this._dim.height,e)}_doLayoutBody(e,t){super._doLayoutBody(e,t),this._dim=new ii(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"),mr(this._messageContainer),Promise.resolve(void 0)):(Lo(this._messageContainer),this._decorationsManager=new _N(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"),mr(this._treeContainer),mr(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 og)return e;if(e instanceof vy&&e.children.length>0)return e.children[0]}revealReference(e){return gj(this,void 0,void 0,function*(){yield this._revealReference(e,!1),this._onDidSelectReference.fire({element:e,kind:"goto",source:"tree"})})}_revealReference(e,t){return gj(this,void 0,void 0,function*(){if(this._revealedReference===e)return;this._revealedReference=e,e.uri.scheme!==Nt.inMemory?this.setTitle(Xke(e.uri),this._uriLabel.getUriLabel(Ex(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}fi(this._previewModelReference);const o=s.object;if(o){const r=this._preview.getModel()===o.textEditorModel?0:1,a=I.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()})}};kF=vFe([Qd(3,os),Qd(4,sr),Qd(5,_t),Qd(6,Kie),Qd(7,Fb),Qd(8,Ix),Qd(9,Di),Qd(10,qi),Qd(11,Ni)],kF);var wFe=globalThis&&globalThis.__decorate||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},N_=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},pj=globalThis&&globalThis.__awaiter||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())})},ND;const a_=new Ve("referenceSearchVisible",!1,m("referenceSearchVisible","Whether reference peek is visible, like 'Peek References' or 'Peek Definition'"));let rg=ND=class{static get(e){return e.getContribution(ND.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 be,this._requestIdPool=0,this._ignoreModelChangeEvent=!1,this._referenceSearchVisible=a_.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=bFe.fromJSON(this._storageService.get(o,0,"{}"));this._widget=this._instantiationService.createInstance(kF,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 Y(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 pj(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 pj(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=I.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=ND.get(o),l=this._model.clone();this.closeWidget(),o.focus(),a==null||a.toggleWidget(s,Xn(c=>Promise.resolve(l)),(r=this._peekMode)!==null&&r!==void 0?r:!1)}},o=>{this._ignoreModelChangeEvent=!1,Dt(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)}};rg.ID="editor.contrib.referencesController";rg=ND=wFe([N_(2,bt),N_(3,ai),N_(4,Nn),N_(5,_t),N_(6,yl),N_(7,zt)],rg);function l_(n,e){const t=aFe(n);if(!t)return;const i=rg.get(t);i&&e(i)}er.registerCommandAndKeybindingRule({id:"togglePeekWidgetFocus",weight:100,primary:qn(2089,60),when:fe.or(a_,tr.inPeekEditor),handler(n){l_(n,e=>{e.changeFocusBetweenPreviewAndReferences()})}});er.registerCommandAndKeybindingRule({id:"goToNextReference",weight:100-10,primary:62,secondary:[70],when:fe.or(a_,tr.inPeekEditor),handler(n){l_(n,e=>{e.goToNextOrPreviousReference(!0)})}});er.registerCommandAndKeybindingRule({id:"goToPreviousReference",weight:100-10,primary:1086,secondary:[1094],when:fe.or(a_,tr.inPeekEditor),handler(n){l_(n,e=>{e.goToNextOrPreviousReference(!1)})}});qt.registerCommandAlias("goToNextReferenceFromEmbeddedEditor","goToNextReference");qt.registerCommandAlias("goToPreviousReferenceFromEmbeddedEditor","goToPreviousReference");qt.registerCommandAlias("closeReferenceSearchEditor","closeReferenceSearch");qt.registerCommand("closeReferenceSearch",n=>l_(n,e=>e.closeWidget()));er.registerKeybindingRule({id:"closeReferenceSearch",weight:100-101,primary:9,secondary:[1033],when:fe.and(tr.inPeekEditor,fe.not("config.editor.stablePeek"))});er.registerKeybindingRule({id:"closeReferenceSearch",weight:200+50,primary:9,secondary:[1033],when:fe.and(a_,fe.not("config.editor.stablePeek"))});er.registerCommandAndKeybindingRule({id:"revealReference",weight:200,primary:3,mac:{primary:3,secondary:[2066]},when:fe.and(a_,ete,l7.negate(),c7.negate()),handler(n){var e;const i=(e=n.get($a).lastFocusedList)===null||e===void 0?void 0:e.getFocus();Array.isArray(i)&&i[0]instanceof og&&l_(n,s=>s.revealReference(i[0]))}});er.registerCommandAndKeybindingRule({id:"openReferenceToSide",weight:100,primary:2051,mac:{primary:259},when:fe.and(a_,ete,l7.negate(),c7.negate()),handler(n){var e;const i=(e=n.get($a).lastFocusedList)===null||e===void 0?void 0:e.getFocus();Array.isArray(i)&&i[0]instanceof og&&l_(n,s=>s.openReference(i[0],!0,!0))}});qt.registerCommand("openReference",n=>{var e;const i=(e=n.get($a).lastFocusedList)===null||e===void 0?void 0:e.getFocus();Array.isArray(i)&&i[0]instanceof og&&l_(n,s=>s.openReference(i[0],!1,!0))});var Yie=globalThis&&globalThis.__decorate||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},J1=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};const H7=new Ve("hasSymbols",!1,m("hasSymbols","Whether there are symbol locations that can be navigated via keyboard-only.")),vN=Wt("ISymbolNavigationService");let DF=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=H7.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 EF(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(_9(u.uri,a.uri))c=!0,d=d||I.containsPosition(u.range,l);else if(c)break;(!c||!d)&&this.reset()});this._currentState=rl(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:I.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)}};DF=Yie([J1(0,bt),J1(1,ai),J1(2,Nn),J1(3,Di)],DF);Gt(vN,DF,1);Re(new class extends fs{constructor(){super({id:"editor.gotoNextSymbolFromResult",precondition:H7,kbOpts:{weight:100,primary:70}})}runEditorCommand(n,e){return n.get(vN).revealNext(e)}});er.registerCommandAndKeybindingRule({id:"editor.gotoNextSymbolFromResult.cancel",weight:100,when:H7,primary:9,handler(n){n.get(vN).reset()}});let EF=class{constructor(e){this._listener=new Map,this._disposables=new be,this._onDidChange=new j,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(),fi(this._listener.values())}_onDidAddEditor(e){this._listener.set(e,rl(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)}};EF=Yie([J1(0,ai)],EF);var $7=globalThis&&globalThis.__awaiter||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 $S(n,e,t,i){return $7(this,void 0,void 0,function*(){const o=t.ordered(n).map(a=>Promise.resolve(i(a,n,e)).then(void 0,l=>{Bn(l)})),r=yield Promise.all(o);return wd(r.flat())})}function bN(n,e,t,i){return $S(e,t,n,(s,o,r)=>s.provideDefinition(o,r,i))}function Zie(n,e,t,i){return $S(e,t,n,(s,o,r)=>s.provideDeclaration(o,r,i))}function Xie(n,e,t,i){return $S(e,t,n,(s,o,r)=>s.provideImplementation(o,r,i))}function Qie(n,e,t,i){return $S(e,t,n,(s,o,r)=>s.provideTypeDefinition(o,r,i))}function CN(n,e,t,i,s){return $S(e,t,n,(o,r,a)=>$7(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 zS(n){return $7(this,void 0,void 0,function*(){const e=yield n(),t=new Lr(e,""),i=t.references.map(s=>s.link);return t.dispose(),i})}$d("_executeDefinitionProvider",(n,e,t)=>{const i=n.get(Ze),s=bN(i.definitionProvider,e,t,Ft.None);return zS(()=>s)});$d("_executeTypeDefinitionProvider",(n,e,t)=>{const i=n.get(Ze),s=Qie(i.typeDefinitionProvider,e,t,Ft.None);return zS(()=>s)});$d("_executeDeclarationProvider",(n,e,t)=>{const i=n.get(Ze),s=Zie(i.declarationProvider,e,t,Ft.None);return zS(()=>s)});$d("_executeReferenceProvider",(n,e,t)=>{const i=n.get(Ze),s=CN(i.referenceProvider,e,t,!1,Ft.None);return zS(()=>s)});$d("_executeImplementationProvider",(n,e,t)=>{const i=n.get(Ze),s=Xie(i.implementationProvider,e,t,Ft.None);return zS(()=>s)});var cl=globalThis&&globalThis.__awaiter||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())})},C1,w1,y1,rk,ak,lk,ck,dk;Ls.appendMenuItem(M.EditorContext,{submenu:M.EditorContextPeek,title:m("peek.submenu","Peek"),group:"navigation",order:100});class Yb{static is(e){return!e||typeof e!="object"?!1:!!(e instanceof Yb||Y.isIPosition(e.position)&&e.model)}constructor(e,t){this.model=e,this.position=t}}class mo extends Cc{static all(){return mo._allSymbolNavigationCommands.values()}static _patchConfig(e){const t=Object.assign(Object.assign({},e),{f1:!0});if(t.menu)for(const i of Pt.wrap(t.menu))(i.id===M.EditorContext||i.id===M.EditorContextPeek)&&(i.when=fe.and(e.precondition,i.when));return t}constructor(e,t){super(mo._patchConfig(t)),this.configuration=e,mo._allSymbolNavigationCommands.set(t.id,this)}runEditorCommand(e,t,i,s){if(!t.hasModel())return Promise.resolve(void 0);const o=e.get(Nn),r=e.get(ai),a=e.get(Tg),l=e.get(vN),c=e.get(Ze),d=e.get(_t),u=t.getModel(),h=t.getPosition(),f=Yb.is(i)?i:new Yb(u,h),g=new tg(t,5),p=ox(this._getLocationModel(c,f.model,f.position,g.token),g.token).then(_=>cl(this,void 0,void 0,function*(){var v;if(!_||g.token.isCancellationRequested)return;to(_.ariaMessage);let b;if(_.referenceAt(u.uri,h)){const w=this._getAlternativeCommand(t);!mo._activeAlternativeCommands.has(w)&&mo._allSymbolNavigationCommands.has(w)&&(b=mo._allSymbolNavigationCommands.get(w))}const C=_.references.length;if(C===0){if(!this.configuration.muteMessage){const w=u.getWordAtPosition(h);(v=Sr.get(t))===null||v===void 0||v.showMessage(this._getNoResultFoundMessage(w),h)}}else if(C===1&&b)mo._activeAlternativeCommands.add(this.desc.id),d.invokeFunction(w=>b.runEditorCommand(w,t,i,s).finally(()=>{mo._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 cl(this,void 0,void 0,function*(){const r=this._getGoToPreference(i);if(!(i instanceof sg)&&(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 cl(this,void 0,void 0,function*(){let r;if(mve(i)&&(r=i.targetSelectionRange),r||(r=i.range),!r)return;const a=yield t.openCodeEditor({resource:i.uri,options:{selection:I.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=rg.get(e);s&&e.hasModel()?s.toggleWidget(i!=null?i:e.getSelection(),Xn(o=>Promise.resolve(t)),this.configuration.openInPeek):t.dispose()}}mo._allSymbolNavigationCommands=new Map;mo._activeAlternativeCommands=new Set;class US extends mo{_getLocationModel(e,t,i,s){return cl(this,void 0,void 0,function*(){return new Lr(yield bN(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}}Ui((C1=class extends US{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:C1.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:fe.and(O.hasDefinitionProvider,O.isInWalkThroughSnippet.toNegated()),keybinding:[{when:O.editorTextFocus,primary:70,weight:100},{when:fe.and(O.editorTextFocus,Xee),primary:2118,weight:100}],menu:[{id:M.EditorContext,group:"navigation",order:1.1},{id:M.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:2}]}),qt.registerCommandAlias("editor.action.goToDeclaration",C1.id)}},C1.id="editor.action.revealDefinition",C1));Ui((w1=class extends US{constructor(){super({openToSide:!0,openInPeek:!1,muteMessage:!1},{id:w1.id,title:{value:m("actions.goToDeclToSide.label","Open Definition to the Side"),original:"Open Definition to the Side"},precondition:fe.and(O.hasDefinitionProvider,O.isInWalkThroughSnippet.toNegated()),keybinding:[{when:O.editorTextFocus,primary:qn(2089,70),weight:100},{when:fe.and(O.editorTextFocus,Xee),primary:qn(2089,2118),weight:100}]}),qt.registerCommandAlias("editor.action.openDeclarationToTheSide",w1.id)}},w1.id="editor.action.revealDefinitionAside",w1));Ui((y1=class extends US{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:y1.id,title:{value:m("actions.previewDecl.label","Peek Definition"),original:"Peek Definition"},precondition:fe.and(O.hasDefinitionProvider,tr.notInPeekEditor,O.isInWalkThroughSnippet.toNegated()),keybinding:{when:O.editorTextFocus,primary:582,linux:{primary:3140},weight:100},menu:{id:M.EditorContextPeek,group:"peek",order:2}}),qt.registerCommandAlias("editor.action.previewDeclaration",y1.id)}},y1.id="editor.action.peekDefinition",y1));class Jie extends mo{_getLocationModel(e,t,i,s){return cl(this,void 0,void 0,function*(){return new Lr(yield Zie(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}}Ui((rk=class extends Jie{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:rk.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:fe.and(O.hasDeclarationProvider,O.isInWalkThroughSnippet.toNegated()),menu:[{id:M.EditorContext,group:"navigation",order:1.3},{id:M.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")}},rk.id="editor.action.revealDeclaration",rk));Ui(class extends Jie{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:"editor.action.peekDeclaration",title:{value:m("actions.peekDecl.label","Peek Declaration"),original:"Peek Declaration"},precondition:fe.and(O.hasDeclarationProvider,tr.notInPeekEditor,O.isInWalkThroughSnippet.toNegated()),menu:{id:M.EditorContextPeek,group:"peek",order:3}})}});class ene extends mo{_getLocationModel(e,t,i,s){return cl(this,void 0,void 0,function*(){return new Lr(yield Qie(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}}Ui((ak=class extends ene{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:ak.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:fe.and(O.hasTypeDefinitionProvider,O.isInWalkThroughSnippet.toNegated()),keybinding:{when:O.editorTextFocus,primary:0,weight:100},menu:[{id:M.EditorContext,group:"navigation",order:1.4},{id:M.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:3}]})}},ak.ID="editor.action.goToTypeDefinition",ak));Ui((lk=class extends ene{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:lk.ID,title:{value:m("actions.peekTypeDefinition.label","Peek Type Definition"),original:"Peek Type Definition"},precondition:fe.and(O.hasTypeDefinitionProvider,tr.notInPeekEditor,O.isInWalkThroughSnippet.toNegated()),menu:{id:M.EditorContextPeek,group:"peek",order:4}})}},lk.ID="editor.action.peekTypeDefinition",lk));class tne extends mo{_getLocationModel(e,t,i,s){return cl(this,void 0,void 0,function*(){return new Lr(yield Xie(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}}Ui((ck=class extends tne{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:ck.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:fe.and(O.hasImplementationProvider,O.isInWalkThroughSnippet.toNegated()),keybinding:{when:O.editorTextFocus,primary:2118,weight:100},menu:[{id:M.EditorContext,group:"navigation",order:1.45},{id:M.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:4}]})}},ck.ID="editor.action.goToImplementation",ck));Ui((dk=class extends tne{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:dk.ID,title:{value:m("actions.peekImplementation.label","Peek Implementations"),original:"Peek Implementations"},precondition:fe.and(O.hasImplementationProvider,tr.notInPeekEditor,O.isInWalkThroughSnippet.toNegated()),keybinding:{when:O.editorTextFocus,primary:3142,weight:100},menu:{id:M.EditorContextPeek,group:"peek",order:5}})}},dk.ID="editor.action.peekImplementation",dk));class ine extends mo{_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}}Ui(class extends ine{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:fe.and(O.hasReferenceProvider,tr.notInPeekEditor,O.isInWalkThroughSnippet.toNegated()),keybinding:{when:O.editorTextFocus,primary:1094,weight:100},menu:[{id:M.EditorContext,group:"navigation",order:1.45},{id:M.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:5}]})}_getLocationModel(e,t,i,s){return cl(this,void 0,void 0,function*(){return new Lr(yield CN(e.referenceProvider,t,i,!0,s),m("ref.title","References"))})}});Ui(class extends ine{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:fe.and(O.hasReferenceProvider,tr.notInPeekEditor,O.isInWalkThroughSnippet.toNegated()),menu:{id:M.EditorContextPeek,group:"peek",order:6}})}_getLocationModel(e,t,i,s){return cl(this,void 0,void 0,function*(){return new Lr(yield CN(e.referenceProvider,t,i,!1,s),m("ref.title","References"))})}});class yFe extends mo{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:fe.and(tr.notInPeekEditor,O.isInWalkThroughSnippet.toNegated())}),this._references=t,this._gotoMultipleBehaviour=i}_getLocationModel(e,t,i,s){return cl(this,void 0,void 0,function*(){return new Lr(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:ct},{name:"position",description:"The position at which to start",constraint:Y.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)=>cl(void 0,void 0,void 0,function*(){bi(ct.isUri(e)),bi(Y.isIPosition(t)),bi(Array.isArray(i)),bi(typeof s>"u"||typeof s=="string"),bi(typeof r>"u"||typeof r=="boolean");const a=n.get(ai),l=yield a.openCodeEditor({resource:e},a.getFocusedCodeEditor());if(Ad(l))return l.setPosition(t),l.revealPositionInCenterIfOutsideViewport(t,0),l.invokeWithinContext(c=>{const d=new class extends yFe{_getNoResultFoundMessage(u){return o||super._getNoResultFoundMessage(u)}}({muteMessage:!o,openInPeek:!!r,openToSide:!1},i,s);c.get(_t).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:ct},{name:"position",description:"The position at which to start",constraint:Y.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)=>cl(void 0,void 0,void 0,function*(){n.get(gn).executeCommand("editor.action.goToLocations",e,t,i,s,void 0,!0)})});qt.registerCommand({id:"editor.action.findReferences",handler:(n,e,t)=>{bi(ct.isUri(e)),bi(Y.isIPosition(t));const i=n.get(Ze),s=n.get(ai);return s.openCodeEditor({resource:e},s.getFocusedCodeEditor()).then(o=>{if(!Ad(o)||!o.hasModel())return;const r=rg.get(o);if(!r)return;const a=Xn(c=>CN(i.referenceProvider,o.getModel(),Y.lift(t),!1,c).then(d=>new Lr(d,m("ref.title","References")))),l=new I(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 SFe=globalThis&&globalThis.__decorate||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},yR=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},mj=globalThis&&globalThis.__awaiter||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())})},eC;let Lm=eC=class{constructor(e,t,i,s){this.textModelResolverService=t,this.languageService=i,this.languageFeaturesService=s,this.toUnhook=new be,this.toUnhookForKeyboard=new be,this.currentWordAtPosition=null,this.previousPromise=null,this.editor=e,this.linkDecorations=this.editor.createDecorationsCollection();const o=new fN(e);this.toUnhook.add(o),this.toUnhook.add(o.onMouseMoveOrRelevantKeyDown(([r,a])=>{this.startFindDefinitionFromMouse(r,a!=null?a:void 0)})),this.toUnhook.add(o.onExecute(r=>{this.isEnabled(r)&&this.gotoDefinition(r.target.position,r.hasSideBySideModifier).catch(a=>{Dt(a)}).finally(()=>{this.removeLinkDecorations()})})),this.toUnhook.add(o.onCancel(()=>{this.removeLinkDecorations(),this.currentWordAtPosition=null}))}static get(e){return e.getContribution(eC.ID)}startFindDefinitionFromCursor(e){return mj(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 mj(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 Wte(this.editor,15);this.previousPromise&&(this.previousPromise.cancel(),this.previousPromise=null),this.previousPromise=Xn(a=>this.findDefinition(e,a));let o;try{o=yield this.previousPromise}catch(a){Dt(a);return}if(!o||!o.length||!s.validate(this.editor)){this.removeLinkDecorations();return}const r=o[0].originSelectionRange?I.lift(o[0].originSelectionRange):new I(e.lineNumber,i.startColumn,e.lineNumber,i.endColumn);if(o.length>1){let a=r;for(const{originSelectionRange:l}of o)l&&(a=I.plusRange(a,l));this.addDecoration(a,new Bs().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 Bs().appendCodeblock(h||"",u):void 0),l.dispose()})}})}getPreviewValue(e,t,i){let s=i.range;return s.endLineNumber-s.startLineNumber>=eC.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 US({openToSide:t,openInPeek:s,muteMessage:!0},{title:{value:"",original:""},id:"",precondition:void 0}).run(i)})}isInPeekEditor(e){const t=e.get(bt);return tr.inPeekEditor.getValue(t)}dispose(){this.toUnhook.dispose(),this.toUnhookForKeyboard.dispose()}};Lm.ID="editor.contrib.gotodefinitionatposition";Lm.MAX_SOURCE_PREVIEW_LINES=8;Lm=eC=SFe([yR(1,sr),yR(2,qi),yR(3,Ze)],Lm);ti(Lm.ID,Lm,2);const uk=ye;class nne extends te{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 bS(this.contentsDomNode,{consumeMouseWheelIfScrollbarIsNeeded:!0})),this.containerDomNode.appendChild(this.scrollbar.getDomNode())}onContentsChanged(){this.scrollbar.scanDomNode()}}class z7 extends te{static render(e,t,i){return new z7(e,t,i)}constructor(e,t,i){super(),this.actionContainer=ge(e,uk("div.action-container")),this.actionContainer.setAttribute("tabindex","0"),this.action=ge(this.actionContainer,uk("a.action")),this.action.setAttribute("role","button"),t.iconClass&&ge(this.action,uk("span.icon.".concat(t.iconClass)));const s=ge(this.action,uk("span"));s.textContent=i?"".concat(t.label," (").concat(i,")"):t.label,this._register(ce(this.actionContainer,Pe.CLICK,o=>{o.stopPropagation(),o.preventDefault(),t.run(this.actionContainer)})),this._register(ce(this.actionContainer,Pe.KEY_DOWN,o=>{const r=new Oi(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 LFe(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 kFe=globalThis&&globalThis.__awaiter||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())})},DFe=globalThis&&globalThis.__asyncValues||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 EFe=class{constructor(e,t,i){this.value=e,this.isComplete=t,this.hasLoadingMessage=i}};class sne extends te{constructor(e,t){super(),this._editor=e,this._computer=t,this._onResult=this._register(new j),this.onResult=this._onResult.event,this._firstWaitScheduler=this._register(new Si(()=>this._triggerAsyncComputation(),0)),this._secondWaitScheduler=this._register(new Si(()=>this._triggerSyncComputation(),0)),this._loadingMessageScheduler=this._register(new Si(()=>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=v0e(e=>this._computer.computeAsync(e)),kFe(this,void 0,void 0,function*(){var e,t,i,s;try{try{for(var o=!0,r=DFe(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){Dt(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 EFe(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 SR{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}}class AD{constructor(e,t,i,s,o,r){this.priority=e,this.owner=t,this.range=i,this.initialMousePosX=s,this.initialMousePosY=o,this.supportsMarkerHover=r,this.type=2}equals(e){return e.type===2&&this.owner===e.owner}canAdoptVisibleHover(e,t){return e.type===2&&this.owner===e.owner}}const c_=new class{constructor(){this._participants=[]}register(e){this._participants.push(e)}getAll(){return this._participants}};class U7{constructor(){this._onDidWillResize=new j,this.onDidWillResize=this._onDidWillResize.event,this._onDidResize=new j,this.onDidResize=this._onDidResize.event,this._sashListener=new be,this._size=new ii(0,0),this._minSize=new ii(0,0),this._maxSize=new ii(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER),this.domNode=document.createElement("div"),this._eastSash=new qs(this.domNode,{getVerticalSashLeft:()=>this._size.width},{orientation:0}),this._westSash=new qs(this.domNode,{getVerticalSashLeft:()=>0},{orientation:0}),this._northSash=new qs(this.domNode,{getHorizontalSashTop:()=>0},{orientation:1,orthogonalEdge:pI.North}),this._southSash=new qs(this.domNode,{getHorizontalSashTop:()=>this._size.height},{orientation:1,orthogonalEdge:pI.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(We.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(We.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(We.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(We.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 ii(t,e);ii.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 IFe=30,TFe=24;class xFe extends te{constructor(e,t=new ii(10,10)){super(),this._editor=e,this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this._resizableNode=this._register(new U7),this._contentPosition=null,this._isResizing=!1,this._resizableNode.domNode.style.position="absolute",this._resizableNode.minSize=ii.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 ii(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?Y.lift(this._contentPosition.position):void 0}_availableVerticalSpaceAbove(e){const t=this._editor.getDomNode(),i=this._editor.getScrolledVisiblePosition(e);return!t||!i?void 0:Un(t).top+i.top-IFe}_availableVerticalSpaceBelow(e){const t=this._editor.getDomNode(),i=this._editor.getScrolledVisiblePosition(e);if(!t||!i)return;const s=Un(t),o=L0(t.ownerDocument.body),r=s.top+i.top+i.height;return o.height-r-TFe}_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 j7=globalThis&&globalThis.__decorate||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},Pp=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},MD,Mc;const _j=ye;let BI=MD=class extends te{constructor(e,t,i){super(),this._editor=e,this._instantiationService=t,this._keybindingService=i,this._currentResult=null,this._widget=this._register(this._instantiationService.createInstance(xf,this._editor)),this._participants=[];for(const s of c_.getAll())this._participants.push(this._instantiationService.createInstance(s,this._editor));this._participants.sort((s,o)=>s.hoverOrdinal-o.hoverOrdinal),this._computer=new VI(this._editor,this._participants),this._hoverOperation=this._register(new sne(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 one(this._computer.anchor,o,s.isComplete))})),this._register(In(this._widget.getDomNode(),"keydown",s=>{s.equals(9)&&this.hide()})),this._register(nn.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 SR(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 SR(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}=MD.computeHoverRanges(this._editor,e.range,t),r=new be,a=r.add(new WI(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:MD._DECORATION_OPTIONS}]),r.add(vt(()=>{h.clear()}))}this._widget.showAt(l,new AFe(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 Y(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=I.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 Y(o,t.startColumn),showAtSecondaryPosition:l?l.getStartPosition():new Y(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()}};BI._DECORATION_OPTIONS=kt.register({description:"content-hover-highlight",className:"hoverHighlight"});BI=MD=j7([Pp(1,_t),Pp(2,Di)],BI);class one{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 NFe(this,this.anchor,t,this.isComplete)}}class NFe extends one{constructor(e,t,i,s){super(t,i,s),this.original=e}filter(e){return this.original.filter(e)}}class AFe{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 vj=30,LR=10,MFe=6;let xf=Mc=class extends xFe{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 ii(a,r);super(e,l),this._configurationService=i,this._accessibilityService=s,this._keybindingService=o,this._hover=this._register(new nne),this._minimumSize=l,this._hoverVisibleKey=O.hoverVisible.bindTo(t),this._hoverFocusedKey=O.hoverFocused.bindTo(t),ge(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(Ld(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 Mc.ID}static _applyDimensions(e,t,i){const s=typeof t=="number"?"".concat(t,"px"):t,o=typeof i=="number"?"".concat(i,"px"):i;e.style.width=s,e.style.height=o}_setContentsDomNodeDimensions(e,t){const i=this._hover.contentsDomNode;return Mc._applyDimensions(i,e,t)}_setContainerDomNodeDimensions(e,t){const i=this._hover.containerDomNode;return Mc._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"?"".concat(t,"px"):t,o=typeof i=="number"?"".concat(i,"px"):i;e.style.maxWidth=s,e.style.maxHeight=o}_setHoverWidgetMaxDimensions(e,t){Mc._applyMaxDimensions(this._hover.contentsDomNode,e,t),Mc._applyMaxDimensions(this._hover.containerDomNode,e,t),this._hover.containerDomNode.style.setProperty("--vscode-hover-maxWidth",typeof e=="number"?"".concat(e,"px"):e),this._layoutContentWidget()}_hasHorizontalScrollbar(){const e=this._hover.scrollbar.getScrollDimensions();return e.scrollWidth>e.width}_adjustContentsBottomPadding(){const e=this._hover.contentsDomNode,t="".concat(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-LR))}_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 ii(i,s),this._setHoverWidgetMaxDimensions(i,s)}_resize(e){var t,i;Mc._lastDimensions=new ii(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=MFe;return Array.from(this._hover.contentsDomNode.children).forEach(i=>{t+=i.clientHeight}),this._hasHorizontalScrollbar()&&(t+=LR),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=Un(this.getDomNode());typeof this._visibleData.closestMouseDistance>"u"&&(this._visibleData.closestMouseDistance=bj(this._visibleData.initialMousePosX,this._visibleData.initialMousePosY,i.left,i.top,i.width,i.height));const s=bj(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="".concat(e,"px"),i.style.lineHeight="".concat(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,Mc._lastDimensions.height),t=Math.max(this._editor.getLayoutInfo().width*.66,500,Mc._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=Ep(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=LFe(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 ii(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(Ko(i),Math.min(o,e)),this._setContentsDomNodeDimensions(Ko(s),Math.min(o,e-LR))}setMinimumDimensions(e){this._minimumSize=new ii(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 ii(e,this._minimumSize.height)}onContentsChanged(){var e;this._removeConstraintsRenderNormally();const t=this._hover.containerDomNode;let i=Ep(t),s=Ko(t);if(this._resizableNode.layout(i,s),this._setHoverWidgetDimensions(s,i),i=Ep(t),s=Ko(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=Ep(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-vj})}scrollRight(){const e=this._hover.scrollbar.getScrollPosition().scrollLeft;this._hover.scrollbar.setScrollPosition({scrollLeft:e+vj})}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})}};xf.ID="editor.contrib.resizableContentHoverWidget";xf._lastDimensions=new ii(0,0);xf=Mc=j7([Pp(1,bt),Pp(2,zt),Pp(3,oh),Pp(4,Di)],xf);let WI=class extends te{get hasContent(){return this._hasContent}constructor(e){super(),this._keybindingService=e,this._hasContent=!1,this.hoverElement=_j("div.hover-row.status-bar"),this.actionsElement=ge(this.hoverElement,_j("div.actions"))}addAction(e){const t=this._keybindingService.lookupKeybinding(e.commandId),i=t?t.getLabel():null;return this._hasContent=!0,this._register(z7.render(this.actionsElement,e,i))}append(e){const t=ge(this.actionsElement,e);return this._hasContent=!0,t}};WI=j7([Pp(0,Di)],WI);class VI{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 Mn.EMPTY;const i=VI._getLineDecorations(this._editor,t);return Mn.merge(this._participants.map(s=>s.computeAsync?s.computeAsync(t,i,e):Mn.EMPTY))}computeSync(){if(!this._editor.hasModel()||!this._anchor)return[];const e=VI._getLineDecorations(this._editor,this._anchor);let t=[];for(const i of this._participants)t=t.concat(i.computeSync(this._anchor,e));return wd(t)}}function bj(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 Cj=ye;class rb extends te{constructor(e,t,i){super(),this._renderDisposeables=this._register(new be),this._editor=e,this._isVisible=!1,this._messages=[],this._hover=this._register(new nne),this._hover.containerDomNode.classList.toggle("hidden",!this._isVisible),this._markdownRenderer=this._register(new Zu({editor:this._editor},t,i)),this._computer=new RFe(this._editor),this._hoverOperation=this._register(new sne(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 rb.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=Cj("div.hover-row.markdown-hover"),r=ge(o,Cj("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="".concat(t.glyphMarginLeft+t.glyphMarginWidth,"px"),this._hover.containerDomNode.style.top="".concat(Math.max(Math.round(a),0),"px")}}rb.ID="editor.contrib.modesGlyphHoverWidget";class RFe{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||Vb(o)||i.push(...u8(o).map(e))}return i}}var PFe=globalThis&&globalThis.__awaiter||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 OFe{constructor(e,t,i){this.provider=e,this.hover=t,this.ordinal=i}}function FFe(n,e,t,i,s){return PFe(this,void 0,void 0,function*(){try{const o=yield Promise.resolve(n.provideHover(t,i,s));if(o&&WFe(o))return new OFe(n,o,e)}catch(o){Bn(o)}})}function K7(n,e,t,i){const o=n.ordered(e).map((r,a)=>FFe(r,a,e,t,i));return Mn.fromPromises(o).coalesce()}function BFe(n,e,t,i){return K7(n,e,t,i).map(s=>s.hover).toPromise()}$d("_executeHoverProvider",(n,e,t)=>{const i=n.get(Ze);return BFe(i.hoverProvider,e,t,Ft.None)});function WFe(n){const e=typeof n.range<"u",t=typeof n.contents<"u"&&n.contents&&n.contents.length>0;return e&&t}var VFe=globalThis&&globalThis.__decorate||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},hk=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};const wj=ye;class Yl{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 HI=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 Yl(this,e.range,[new Bs().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 Yl(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 Yl(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||Vb(v))continue;g.options.beforeContentClassName&&(f=!0);const b=new I(e.range.startLineNumber,p,e.range.startLineNumber,_);r.push(new Yl(this,b,u8(v),f,a++))}return r}computeAsync(e,t,i){if(!this._editor.hasModel()||e.type!==1)return Mn.EMPTY;const s=this._editor.getModel();if(!this._languageFeaturesService.hoverProvider.has(s))return Mn.EMPTY;const o=new Y(e.range.startLineNumber,e.range.startColumn);return K7(this._languageFeaturesService.hoverProvider,s,o,i).filter(r=>!Vb(r.hover.contents)).map(r=>{const a=r.hover.range?I.lift(r.hover.range):e.range;return new Yl(this,a,r.hover.contents,!1,r.ordinal)})}renderHoverParts(e,t){return rne(e,t,this._editor,this._languageService,this._openerService)}};HI=VFe([hk(1,qi),hk(2,Ir),hk(3,zt),hk(4,Ze)],HI);function rne(n,e,t,i,s){e.sort((r,a)=>r.ordinal-a.ordinal);const o=new be;for(const r of e)for(const a of r.contents){if(Vb(a))continue;const l=wj("div.hover-row.markdown-hover"),c=ge(l,wj("div.hover-contents")),d=o.add(new Zu({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 ane=globalThis&&globalThis.__decorate||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},$I=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};class yj{constructor(e,t,i){this.marker=e,this.index=t,this.total=i}}let IF=class{constructor(e,t,i){this._markerService=t,this._configService=i,this._onDidChange=new j,this.onDidChange=this._onDidChange.event,this._dispoables=new be,this._markers=[],this._nextIdx=-1,ct.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=_w(a.resource.toString(),l.resource.toString());return c===0&&(s==="position"?c=I.compareRangesUsingStarts(a,l)||rn.compare(a.severity,l.severity):c=rn.compare(a.severity,l.severity)||I.compareRangesUsingStarts(a,l)),c},r=()=>{this._markers=this._markerService.read({resource:ct.isUri(e)?e:void 0,severities:rn.Error|rn.Warning|rn.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 yj(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=cw(this._markers,{resource:e.uri},(r,a)=>_w(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},A_=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},NF;class $Fe{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 be,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(In(this._relatedBlock,"click",a=>{a.preventDefault();const l=this._relatedDiagnostics.get(a.target);l&&i(l)})),this._scrollable=new tJ(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="-".concat(a.scrollLeft,"px"),r.style.top="-".concat(a.scrollTop,"px")})),this._disposables.add(this._scrollable)}dispose(){fi(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=Sd(i);this._lines=a.length,this._longestLineLength=0;for(const h of a)this._longestLineLength=Math.max(h.length+r,this._longestLineLength);Ds(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="(".concat(o,")"),f.classList.add("code"),h.appendChild(f)}else{this._codeLink=ye("a.code-link"),this._codeLink.setAttribute("href","".concat(o.target.toString())),this._codeLink.onclick=g=>{this._openerService.open(o.target,{allowCommands:!0}),g.preventDefault(),g.stopPropagation()};const f=ge(this._codeLink,ye("span"));f.innerText=o.value,h.appendChild(this._codeLink)}}if(Ds(this._relatedBlock),this._editor.applyFontInfo(this._relatedBlock),io(s)){const h=this._relatedBlock.appendChild(document.createElement("div"));h.style.paddingTop="".concat(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="".concat(this._labelService.getUriBasenameLabel(f.resource),"(").concat(f.startLineNumber,", ").concat(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="".concat(e,"px"),this._scrollable.getDomNode().style.width="".concat(t,"px"),this._scrollable.setScrollDimensions({width:t,height:e})}getHeightInLines(){return Math.min(17,this._lines)}getAriaLabel(e){let t="";switch(e.severity){case rn.Error:t=m("Error","Error");break;case rn.Warning:t=m("Warning","Warning");break;case rn.Info:t=m("Info","Info");break;case rn.Hint:t=m("Hint","Hint");break}let i=m("marker aria","{0} at {1}. ",t,e.startLineNumber+":"+e.startColumn);const s=this._editor.getModel();if(s&&e.startLineNumber<=s.getLineCount()&&e.startLineNumber>=1){const o=s.getLineContent(e.startLineNumber);i="".concat(o,", ").concat(i)}return i}}let Zb=NF=class extends FI{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 be,this._onDidSelectRelatedInformation=new j,this.onDidSelectRelatedInformation=this._onDidSelectRelatedInformation.event,this._severity=rn.Warning,this._backgroundColor=ee.white,this._applyTheme(t.getColorTheme()),this._callOnDispose.add(t.onDidColorThemeChange(this._applyTheme.bind(this))),this.create()}_applyTheme(e){this._backgroundColor=e.getColor(KFe);let t=AF,i=zFe;this._severity===rn.Warning?(t=RD,i=UFe):this._severity===rn.Info&&(t=MF,i=jFe);const s=e.getColor(t),o=e.getColor(i);this.style({arrowColor:s,frameColor:s,headerBackgroundColor:o,primaryHeadingColor:e.getColor(qie),secondaryHeadingColor:e.getColor(Gie)})}_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(NF.TitleMenu,this._contextKeyService);Pee(i,void 0,t),this._actionbarWidget.push(t,{label:!1,icon:!0,index:0}),i.dispose()}_fillTitleIcon(e){this._icon=ge(e,ye(""))}_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 $Fe(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=I.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(Ra(a.uri),l)}this._icon.className="codicon ".concat(xF.className(rn.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="".concat(e,"px")}_onWidth(e){this._message.layout(this._heightInPixel,e)}_relayout(){super._relayout(this.computeRequiredHeight())}computeRequiredHeight(){return 3+this._message.getHeightInLines()}};Zb.TitleMenu=new M("gotoErrorTitleMenu");Zb=NF=HFe([A_(1,os),A_(2,Ir),A_(3,Vd),A_(4,_t),A_(5,bt),A_(6,Fb)],Zb);const Sj=Pw(od,Nwe),Lj=Pw(Ur,Mw),kj=Pw(Xo,Rw),AF=F("editorMarkerNavigationError.background",{dark:Sj,light:Sj,hcDark:$t,hcLight:$t},m("editorMarkerNavigationError","Editor marker navigation widget error color.")),zFe=F("editorMarkerNavigationError.headerBackground",{dark:nt(AF,.1),light:nt(AF,.1),hcDark:null,hcLight:null},m("editorMarkerNavigationErrorHeaderBackground","Editor marker navigation widget error heading background.")),RD=F("editorMarkerNavigationWarning.background",{dark:Lj,light:Lj,hcDark:$t,hcLight:$t},m("editorMarkerNavigationWarning","Editor marker navigation widget warning color.")),UFe=F("editorMarkerNavigationWarning.headerBackground",{dark:nt(RD,.1),light:nt(RD,.1),hcDark:"#0C141F",hcLight:nt(RD,.2)},m("editorMarkerNavigationWarningBackground","Editor marker navigation widget warning heading background.")),MF=F("editorMarkerNavigationInfo.background",{dark:kj,light:kj,hcDark:$t,hcLight:$t},m("editorMarkerNavigationInfo","Editor marker navigation widget info color.")),jFe=F("editorMarkerNavigationInfo.headerBackground",{dark:nt(MF,.1),light:nt(MF,.1),hcDark:null,hcLight:null},m("editorMarkerNavigationInfoHeaderBackground","Editor marker navigation widget info heading background.")),KFe=F("editorMarkerNavigation.background",{dark:is,light:is,hcDark:is,hcLight:is},m("editorMarkerNavigationBackground","Editor marker navigation widget background."));var qFe=globalThis&&globalThis.__decorate||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},fk=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},cne=globalThis&&globalThis.__awaiter||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;let ag=tC=class{static get(e){return e.getContribution(tC.ID)}constructor(e,t,i,s,o){this._markerNavigationService=t,this._contextKeyService=i,this._editorService=s,this._instantiationService=o,this._sessionDispoables=new be,this._editor=e,this._widgetVisible=dne.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(Zb,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)||!I.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:I.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 Y(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 cne(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=tC.get(r))===null||i===void 0||i.close(),(s=tC.get(r))===null||s===void 0||s.nagivate(e,t))}else this._widget.showAtMarker(o.selected.marker,o.selected.index,o.selected.total)}})}};ag.ID="editor.contrib.markerController";ag=tC=qFe([fk(1,lne),fk(2,bt),fk(3,ai),fk(4,_t)],ag);class wN extends Ue{constructor(e,t,i){super(i),this._next=e,this._multiFile=t}run(e,t){var i;return cne(this,void 0,void 0,function*(){t.hasModel()&&((i=ag.get(t))===null||i===void 0||i.nagivate(this._next,this._multiFile))})}}class Nf extends wN{constructor(){super(!0,!1,{id:Nf.ID,label:Nf.LABEL,alias:"Go to Next Problem (Error, Warning, Info)",precondition:void 0,kbOpts:{kbExpr:O.focus,primary:578,weight:100},menuOpts:{menuId:Zb.TitleMenu,title:Nf.LABEL,icon:Sn("marker-navigation-next",Me.arrowDown,m("nextMarkerIcon","Icon for goto next marker.")),group:"navigation",order:1}})}}Nf.ID="editor.action.marker.next";Nf.LABEL=m("markerAction.next.label","Go to Next Problem (Error, Warning, Info)");class Zp extends wN{constructor(){super(!1,!1,{id:Zp.ID,label:Zp.LABEL,alias:"Go to Previous Problem (Error, Warning, Info)",precondition:void 0,kbOpts:{kbExpr:O.focus,primary:1602,weight:100},menuOpts:{menuId:Zb.TitleMenu,title:Zp.LABEL,icon:Sn("marker-navigation-previous",Me.arrowUp,m("previousMarkerIcon","Icon for goto previous marker.")),group:"navigation",order:2}})}}Zp.ID="editor.action.marker.prev";Zp.LABEL=m("markerAction.previous.label","Go to Previous Problem (Error, Warning, Info)");class GFe extends wN{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:O.focus,primary:66,weight:100},menuOpts:{menuId:M.MenubarGoMenu,title:m({key:"miGotoNextProblem",comment:["&& denotes a mnemonic"]},"Next &&Problem"),group:"6_problem_nav",order:1}})}}class YFe extends wN{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:O.focus,primary:1090,weight:100},menuOpts:{menuId:M.MenubarGoMenu,title:m({key:"miGotoPreviousProblem",comment:["&& denotes a mnemonic"]},"Previous &&Problem"),group:"6_problem_nav",order:2}})}}ti(ag.ID,ag,4);De(Nf);De(Zp);De(GFe);De(YFe);const dne=new Ve("markersNavigationVisible",!1),ZFe=fs.bindToContribution(ag.get);Re(new ZFe({id:"closeMarkersNavigation",precondition:dne,handler:n=>n.close(),kbOpts:{weight:100+50,kbExpr:O.focus,primary:9,secondary:[1033]}}));var XFe=globalThis&&globalThis.__decorate||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},kR=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};const Ka=ye;class QFe{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 Dj={type:1,filter:{include:pt.QuickFix},triggerAction:Dr.QuickFixHover};let RF=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 I(e.range.startLineNumber,l,e.range.startLineNumber,c);r.push(new QFe(this,u,d))}return r}renderHoverParts(e,t){if(!t.length)return te.None;const i=new be;t.forEach(o=>e.fragment.appendChild(this.renderMarkerHover(o,i)));const s=t.length===1?t[0]:t.sort((o,r)=>rn.compare(o.marker.severity,r.marker.severity))[0];return this.renderMarkerStatusbar(e,s,i),i}renderMarkerHover(e,t){const i=Ka("div.hover-row"),s=ge(i,Ka("div.marker.hover-contents")),{source:o,message:r,code:a,relatedInformation:l}=e.marker;this._editor.applyFontInfo(s);const c=ge(s,Ka("span"));if(c.style.whiteSpace="pre-wrap",c.innerText=r,o||a)if(a&&typeof a!="string"){const d=Ka("span");if(o){const g=ge(d,Ka("span"));g.innerText=o}const u=ge(d,Ka("a.code-link"));u.setAttribute("href",a.target.toString()),t.add(ce(u,"click",g=>{this._openerService.open(a.target,{allowCommands:!0}),g.preventDefault(),g.stopPropagation()}));const h=ge(u,Ka("span"));h.innerText=a.value;const f=ge(s,d);f.style.opacity="0.6",f.style.paddingLeft="6px"}else{const d=ge(s,Ka("span"));d.style.opacity="0.6",d.style.paddingLeft="6px",d.innerText=o&&a?"".concat(o,"(").concat(a,")"):o||"(".concat(a,")")}if(io(l))for(const{message:d,resource:u,startLineNumber:h,startColumn:f}of l){const g=ge(s,Ka("div"));g.style.marginTop="8px";const p=ge(g,Ka("a"));p.innerText="".concat(Ra(u),"(").concat(h,", ").concat(f,"): "),p.style.cursor="pointer",t.add(ce(p,"click",v=>{v.stopPropagation(),v.preventDefault(),this._openerService&&this._openerService.open(u,{fromUserGesture:!0,editorOptions:{selection:{startLineNumber:h,startColumn:f}}}).catch(Dt)}));const _=ge(g,Ka("span"));_.innerText=d,this._editor.applyFontInfo(_)}return i}renderMarkerStatusbar(e,t,i){if((t.marker.severity===rn.Error||t.marker.severity===rn.Warning||t.marker.severity===rn.Info)&&e.statusBar.addAction({label:m("view problem","View Problem"),commandId:Nf.ID,run:()=>{var s;e.hide(),(s=ag.get(this._editor))===null||s===void 0||s.showAtMarker(t.marker),this._editor.focus()}}),!this._editor.getOption(90)){const s=e.statusBar.append(Ka("div"));this.recentMarkerCodeActionsInfo&&(fI.makeKey(this.recentMarkerCodeActionsInfo.marker)===fI.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?te.None:i.add(Kf(()=>s.textContent=m("checkingForQuickFixes","Checking for quick fixes..."),200));s.textContent||(s.textContent=String.fromCharCode(160));const r=this.getCodeActions(t.marker);i.add(vt(()=>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(vt(()=>{l||a.dispose()})),e.statusBar.addAction({label:m("quick fixes","Quick Fix..."),commandId:P7,run:c=>{l=!0;const d=ig.get(this._editor),u=Un(c);e.hide(),d==null||d.showCodeActions(Dj,a,{x:u.left,y:u.top,width:u.width,height:u.height})}})},Dt)}}getCodeActions(e){return Xn(t=>BC(this._languageFeaturesService.codeActionProvider,this._editor.getModel(),new I(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn),Dj,Fu.None,t))}};RF=XFe([kR(1,X8),kR(2,Ir),kR(3,Ze)],RF);const une="editor.action.inlineSuggest.commit",hne="editor.action.inlineSuggest.showPrevious",fne="editor.action.inlineSuggest.showNext";var JFe=globalThis&&globalThis.__awaiter||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 e5e extends te{constructor(e,t,i={orientation:0}){super(),this.submenuActionViewItems=[],this.hasSecondaryActions=!1,this._onDidChangeDropdownVisibility=this._register(new K_e),this.onDidChangeDropdownVisibility=this._onDidChangeDropdownVisibility.event,this.disposables=this._register(new be),this.options=i,this.lookupKeybindings=typeof this.options.getKeyBinding=="function",this.toggleMenuAction=this._register(new Cy(()=>{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 Pa(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===Cy.ID)return this.toggleMenuActionViewItem=new rI(s,s.menuActions,t,{actionViewItemProvider:this.options.actionViewItemProvider,actionRunner:this.actionRunner,keybindingProvider:this.options.getKeyBinding,classNames:dt.asClassNameArray((r=i.moreIcon)!==null&&r!==void 0?r:Me.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 Sb){const a=new rI(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 Cy extends Ro{constructor(e,t){t=t||m("moreActions","More Actions..."),super(Cy.ID,t,void 0,!0),this._menuActions=[],this.toggleDropdownMenu=e}run(){return JFe(this,void 0,void 0,function*(){this.toggleDropdownMenu()})}get menuActions(){return this._menuActions}set menuActions(e){this._menuActions=e}}Cy.ID="toolbar.toggle.more";var t5e=globalThis&&globalThis.__decorate||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},S1=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let PF=class extends e5e{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 be);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))}}xV(a),xV(u),super.setActions(a,hs.join(u,l)),c.length>0&&this._sessionDisposables.add(ce(this.getElement(),"contextmenu",f=>{var g,p,_,v,b;const C=new ba(f),w=this.getItemAction(C.target);if(!w)return;C.preventDefault(),C.stopPropagation();let y=!1;if(d===1&&((g=this._options)===null||g===void 0?void 0:g.hiddenItemStrategy)===0){y=!0;for(let k=0;kthis._menuService.resetHiddenStates(i)}))),this._contextMenuService.showContextMenu({getAnchor:()=>C,getActions:()=>S,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})}))}};PF=t5e([S1(2,Vd),S1(3,bt),S1(4,Cl),S1(5,Di),S1(6,ra)],PF);var q7=globalThis&&globalThis.__decorate||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},Zl=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},PD;let OF=class extends te{constructor(e,t,i){super(),this.editor=e,this.model=t,this.instantiationService=i,this.alwaysShowToolbar=ks(this.editor.onDidChangeConfiguration,()=>this.editor.getOption(62).showToolbar==="always"),this.sessionPosition=void 0,this.position=Ut(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 Y(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(pr((s,o)=>{const r=this.model.read(s);if(!r||!this.alwaysShowToolbar.read(s))return;const a=o.add(this.instantiationService.createInstance(lg,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(vt(()=>e.removeContentWidget(a))),o.add(xi(l=>{this.position.read(l)&&r.lastTriggerKind.read(l)!==Ru.Explicit&&r.triggerExplicitly()}))}))}};OF=q7([Zl(2,_t)],OF);const i5e=Sn("inline-suggestion-hints-next",Me.chevronRight,m("parameterHintsNextIcon","Icon for show next parameter hint.")),n5e=Sn("inline-suggestion-hints-previous",Me.chevronLeft,m("parameterHintsPreviousIcon","Icon for show previous parameter hint."));let lg=PD=class extends te{static get dropDownVisible(){return this._dropDownVisible}createCommandAction(e,t,i){const s=new Ro(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".concat(PD.id++),this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this.nodes=vs("div.inlineSuggestionsHints",{className:this.withBorder?".withBorder":""},[vs("div@toolBar")]),this.previousAction=this.createCommandAction(hne,m("previous","Previous"),dt.asClassName(n5e)),this.availableSuggestionCountAction=new Ro("inlineSuggestionHints.availableSuggestionCount","",void 0,!1),this.nextAction=this.createCommandAction(fne,m("next","Next"),dt.asClassName(i5e)),this.inlineCompletionsActionsMenus=this._register(this._menuService.createMenu(M.InlineCompletionsActions,this._contextKeyService)),this.clearAvailableSuggestionCountLabelDebounced=this._register(new Si(()=>{this.availableSuggestionCountAction.label=""},100)),this.disableButtonsDebounced=this._register(new Si(()=>{this.previousAction.enabled=this.nextAction.enabled=!1},100)),this.lastCommands=[],this.toolBar=this._register(l.createInstance(FF,this.nodes.toolBar,M.InlineSuggestionToolbar,{menuOptions:{renderShortTitle:!0},toolbarOptions:{primaryGroup:h=>h.startsWith("primary")},actionViewItemProvider:(h,f)=>{if(h instanceof fl)return l.createInstance(o5e,h,void 0);if(h===this.availableSuggestionCountAction){const g=new s5e(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=>{PD._dropDownVisible=h})),this._register(xi(h=>{this._position.read(h),this.editor.layoutContentWidget(this)})),this._register(xi(h=>{const f=this._suggestionCount.read(h),g=this._currentSuggestionIdx.read(h);f!==void 0?(this.clearAvailableSuggestionCountLabelDebounced.cancel(),this.availableSuggestionCountAction.label="".concat(g+1,"/").concat(f)):this.clearAvailableSuggestionCountLabelDebounced.schedule(),f!==void 0&&f>1?(this.disableButtonsDebounced.cancel(),this.previousAction.enabled=this.nextAction.enabled=!0):this.disableButtonsDebounced.schedule()})),this._register(xi(h=>{const f=this._extraCommands.read(h);if(yn(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 fl&&g.push(v);g.length>0&&g.unshift(new hs),this.toolBar.setAdditionalSecondaryActions(g)}))}getId(){return this.id}getDomNode(){return this.nodes.root}getPosition(){return{position:this._position.get(),preference:[1,2],positionAffinity:3}}};lg._dropDownVisible=!1;lg.id=0;lg=PD=q7([Zl(6,gn),Zl(7,_t),Zl(8,Di),Zl(9,bt),Zl(10,Vd)],lg);class s5e extends Hb{constructor(){super(...arguments),this._className=void 0}setClass(e){this._className=e}render(e){super.render(e),this._className&&e.classList.add(this._className)}}let o5e=class extends gm{updateLabel(){const e=this._keybindingService.lookupKeybinding(this._action.id,this._contextKeyService);if(!e)return super.updateLabel();if(this.label){const t=vs("div.keybinding").root;new xS(t,$r,Object.assign({disableTitle:!0},RAe)).set(e),this.label.textContent=this._action.label,this.label.appendChild(t),this.label.classList.add("inlineSuggestionStatusBarItemLabel")}}},FF=class extends PF{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=[];Pee(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){yn(this.prependedPrimaryActions,e,(t,i)=>t===i)||(this.prependedPrimaryActions=e,this.updateToolbar())}setAdditionalSecondaryActions(e){yn(this.additionalActions,e,(t,i)=>t===i)||(this.additionalActions=e,this.updateToolbar())}};FF=q7([Zl(3,Vd),Zl(4,bt),Zl(5,Cl),Zl(6,Di),Zl(7,ra)],FF);var r5e=globalThis&&globalThis.__decorate||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},gk=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},BF;const a5e=!1;let ir=BF=class extends te{static get(e){return e.getContribution(BF.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 be,this._hoverActivatedByColorDecoratorClick=!1,this._isMouseDown=!1,this._hoverClicked=!1,this._contentWidget=null,this._glyphWidget=null,this._reactToEditorMouseMoveRunner=this._register(new Si(()=>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===xf.ID){this._hoverClicked=!0;return}i.type===12&&i.detail===rb.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===xf.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===xf.ID&&(!((r=this._contentWidget)===null||r===void 0)&&r.isColorPickerVisible)||this._isHoverSticky&&a.type===12&&a.detail===rb.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&&!a5e||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 rb(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)||lg.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(BI,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()}};ir.ID="editor.contrib.hover";ir=BF=r5e([gk(1,_t),gk(2,Ir),gk(3,qi),gk(4,Di)],ir);class l5e extends Ue{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:O.editorTextFocus,primary:qn(2089,2087),weight:100}})}run(e,t,i){if(!t.hasModel())return;const s=ir.get(t);if(!s)return;const o=t.getPosition(),r=new I(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 c5e extends Ue{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=ir.get(t);if(!i)return;const s=t.getPosition();if(!s)return;const o=new I(s.lineNumber,s.column,s.lineNumber,s.column),r=Lm.get(t);if(!r)return;r.startFindDefinitionFromCursor(s).then(()=>{i.showContentHover(o,1,1,!0)})}}class d5e extends Ue{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:O.hoverFocused,kbOpts:{kbExpr:O.hoverFocused,primary:16,weight:100}})}run(e,t){const i=ir.get(t);i&&i.scrollUp()}}class u5e extends Ue{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:O.hoverFocused,kbOpts:{kbExpr:O.hoverFocused,primary:18,weight:100}})}run(e,t){const i=ir.get(t);i&&i.scrollDown()}}class h5e extends Ue{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:O.hoverFocused,kbOpts:{kbExpr:O.hoverFocused,primary:15,weight:100}})}run(e,t){const i=ir.get(t);i&&i.scrollLeft()}}class f5e extends Ue{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:O.hoverFocused,kbOpts:{kbExpr:O.hoverFocused,primary:17,weight:100}})}run(e,t){const i=ir.get(t);i&&i.scrollRight()}}class g5e extends Ue{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:O.hoverFocused,kbOpts:{kbExpr:O.hoverFocused,primary:11,secondary:[528],weight:100}})}run(e,t){const i=ir.get(t);i&&i.pageUp()}}class p5e extends Ue{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:O.hoverFocused,kbOpts:{kbExpr:O.hoverFocused,primary:12,secondary:[530],weight:100}})}run(e,t){const i=ir.get(t);i&&i.pageDown()}}class m5e extends Ue{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:O.hoverFocused,kbOpts:{kbExpr:O.hoverFocused,primary:14,secondary:[2064],weight:100}})}run(e,t){const i=ir.get(t);i&&i.goToTop()}}class _5e extends Ue{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:O.hoverFocused,kbOpts:{kbExpr:O.hoverFocused,primary:13,secondary:[2066],weight:100}})}run(e,t){const i=ir.get(t);i&&i.goToBottom()}}ti(ir.ID,ir,2);De(l5e);De(c5e);De(d5e);De(u5e);De(h5e);De(f5e);De(g5e);De(p5e);De(m5e);De(_5e);c_.register(HI);c_.register(RF);bl((n,e)=>{const t=n.getColor(Kwe);t&&(e.addRule(".monaco-editor .monaco-hover .hover-row:not(:first-child):not(:empty) { border-top: 1px solid ".concat(t.transparent(.5),"; }")),e.addRule(".monaco-editor .monaco-hover hr { border-top: 1px solid ".concat(t.transparent(.5),"; }")),e.addRule(".monaco-editor .monaco-hover hr { border-bottom: 0px solid ".concat(t.transparent(.5),"; }")))});class WF extends te{constructor(e){super(),this._editor=e,this._register(e.onMouseDown(t=>this.onMouseDown(t)))}dispose(){super.dispose()}onMouseDown(e){const t=this._editor.getOption(146);if(t!=="click"&&t!=="clickAndHover")return;const i=e.target;if(i.type!==6||!i.detail.injectedText||i.detail.injectedText.options.attachedData!==Fie||!i.range)return;const s=this._editor.getContribution(ir.ID);if(s&&!s.isColorPickerVisible){const o=new I(i.range.startLineNumber,i.range.startColumn+1,i.range.endLineNumber,i.range.endColumn+1);s.showContentHover(o,1,0,!1,!0)}}}WF.ID="editor.contrib.colorContribution";ti(WF.ID,WF,2);c_.register(OI);var gne=globalThis&&globalThis.__decorate||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},jl=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},Ej=globalThis&&globalThis.__awaiter||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())})},VF,HF;let cg=VF=class extends te{constructor(e,t,i,s,o,r,a){super(),this._editor=e,this._modelService=i,this._keybindingService=s,this._instantiationService=o,this._languageFeatureService=r,this._languageConfigurationService=a,this._standaloneColorPickerWidget=null,this._standaloneColorPickerVisible=O.standaloneColorPickerVisible.bindTo(t),this._standaloneColorPickerFocused=O.standaloneColorPickerFocused.bindTo(t)}showOrFocus(){var e;this._editor.hasModel()&&(this._standaloneColorPickerVisible.get()?this._standaloneColorPickerFocused.get()||(e=this._standaloneColorPickerWidget)===null||e===void 0||e.focus():this._standaloneColorPickerWidget=new zI(this._editor,this._standaloneColorPickerVisible,this._standaloneColorPickerFocused,this._instantiationService,this._modelService,this._keybindingService,this._languageFeatureService,this._languageConfigurationService))}hide(){var e;this._standaloneColorPickerFocused.set(!1),this._standaloneColorPickerVisible.set(!1),(e=this._standaloneColorPickerWidget)===null||e===void 0||e.hide(),this._editor.focus()}insertColor(){var e;(e=this._standaloneColorPickerWidget)===null||e===void 0||e.updateEditor(),this.hide()}static get(e){return e.getContribution(VF.ID)}};cg.ID="editor.contrib.standaloneColorPickerController";cg=VF=gne([jl(1,bt),jl(2,Zi),jl(3,Di),jl(4,_t),jl(5,Ze),jl(6,Ni)],cg);ti(cg.ID,cg,1);const Ij=8,v5e=22;let zI=HF=class extends te{constructor(e,t,i,s,o,r,a,l){var c;super(),this._editor=e,this._standaloneColorPickerVisible=t,this._standaloneColorPickerFocused=i,this._modelService=o,this._keybindingService=r,this._languageFeaturesService=a,this._languageConfigurationService=l,this.allowEditorOverflow=!0,this._position=void 0,this._body=document.createElement("div"),this._colorHover=null,this._selectionSetInEditor=!1,this._onResult=this._register(new j),this.onResult=this._onResult.event,this._standaloneColorPickerVisible.set(!0),this._standaloneColorPickerParticipant=s.createInstance(my,this._editor),this._position=(c=this._editor._getViewModel())===null||c===void 0?void 0:c.getPrimaryCursorState().modelState.position;const d=this._editor.getSelection(),u=d?{startLineNumber:d.startLineNumber,startColumn:d.startColumn,endLineNumber:d.endLineNumber,endColumn:d.endColumn}:{startLineNumber:0,endLineNumber:0,endColumn:0,startColumn:0},h=this._register(Ld(this._body));this._register(h.onDidBlur(f=>{this.hide()})),this._register(h.onDidFocus(f=>{this.focus()})),this._register(this._editor.onDidChangeCursorPosition(()=>{this._selectionSetInEditor?this._selectionSetInEditor=!1:this.hide()})),this._register(this._editor.onMouseMove(f=>{var g;const p=(g=f.target.element)===null||g===void 0?void 0:g.classList;p&&p.contains("colorpicker-color-decoration")&&this.hide()})),this._register(this.onResult(f=>{this._render(f.value,f.foundInEditor)})),this._start(u),this._body.style.zIndex="50",this._editor.addContentWidget(this)}updateEditor(){this._colorHover&&this._standaloneColorPickerParticipant.updateEditorModel(this._colorHover)}getId(){return HF.ID}getDomNode(){return this._body}getPosition(){if(!this._position)return null;const e=this._editor.getOption(60).above;return{position:this._position,secondaryPosition:this._position,preference:e?[1,2]:[2,1],positionAffinity:2}}hide(){this.dispose(),this._standaloneColorPickerVisible.set(!1),this._standaloneColorPickerFocused.set(!1),this._editor.removeContentWidget(this),this._editor.focus()}focus(){this._standaloneColorPickerFocused.set(!0),this._body.focus()}_start(e){return Ej(this,void 0,void 0,function*(){const t=yield this._computeAsync(e);t&&this._onResult.fire(new b5e(t.result,t.foundInEditor))})}_computeAsync(e){return Ej(this,void 0,void 0,function*(){if(!this._editor.hasModel())return null;const t={range:e,color:{red:0,green:0,blue:0,alpha:1}},i=yield this._standaloneColorPickerParticipant.createColorHover(t,new W7(this._modelService,this._languageConfigurationService),this._languageFeaturesService.colorProvider);return i?{result:i.colorHover,foundInEditor:i.foundInEditor}:null})}_render(e,t){const i=document.createDocumentFragment(),s=this._register(new WI(this._keybindingService));let o;const r={fragment:i,statusBar:s,setColorPicker:p=>o=p,onContentsChanged:()=>{},hide:()=>this.hide()};if(this._colorHover=e,this._register(this._standaloneColorPickerParticipant.renderHoverParts(r,[e])),o===void 0)return;this._body.classList.add("standalone-colorpicker-body"),this._body.style.maxHeight=Math.max(this._editor.getLayoutInfo().height/4,250)+"px",this._body.style.maxWidth=Math.max(this._editor.getLayoutInfo().width*.66,500)+"px",this._body.tabIndex=0,this._body.appendChild(i),o.layout();const a=o.body,l=a.saturationBox.domNode.clientWidth,c=a.domNode.clientWidth-l-v5e-Ij,d=o.body.enterButton;d==null||d.onClicked(()=>{this.updateEditor(),this.hide()});const u=o.header,h=u.pickedColorNode;h.style.width=l+Ij+"px";const f=u.originalColorNode;f.style.width=c+"px";const g=o.header.closeButton;g==null||g.onClicked(()=>{this.hide()}),t&&(d&&(d.button.textContent="Replace"),this._selectionSetInEditor=!0,this._editor.setSelection(e.range)),this._editor.layoutContentWidget(this)}};zI.ID="editor.contrib.standaloneColorPickerWidget";zI=HF=gne([jl(3,_t),jl(4,Zi),jl(5,Di),jl(6,Ze),jl(7,Ni)],zI);class b5e{constructor(e,t){this.value=e,this.foundInEditor=t}}class C5e extends Cc{constructor(){super({id:"editor.action.showOrFocusStandaloneColorPicker",title:{value:m("showOrFocusStandaloneColorPicker","Show or Focus Standalone Color Picker"),mnemonicTitle:m({key:"mishowOrFocusStandaloneColorPicker",comment:["&& denotes a mnemonic"]},"&&Show or Focus Standalone Color Picker"),original:"Show or Focus Standalone Color Picker"},precondition:void 0,menu:[{id:M.CommandPalette}]})}runEditorCommand(e,t){var i;(i=cg.get(t))===null||i===void 0||i.showOrFocus()}}class w5e extends Ue{constructor(){super({id:"editor.action.hideColorPicker",label:m({key:"hideColorPicker",comment:["Action that hides the color picker"]},"Hide the Color Picker"),alias:"Hide the Color Picker",precondition:O.standaloneColorPickerVisible.isEqualTo(!0),kbOpts:{primary:9,weight:100}})}run(e,t){var i;(i=cg.get(t))===null||i===void 0||i.hide()}}class y5e extends Ue{constructor(){super({id:"editor.action.insertColorWithStandaloneColorPicker",label:m({key:"insertColorWithStandaloneColorPicker",comment:["Action that inserts color with standalone color picker"]},"Insert Color with Standalone Color Picker"),alias:"Insert Color with Standalone Color Picker",precondition:O.standaloneColorPickerFocused.isEqualTo(!0),kbOpts:{primary:3,weight:100}})}run(e,t){var i;(i=cg.get(t))===null||i===void 0||i.insertColor()}}De(w5e);De(y5e);Ui(C5e);class cf{constructor(e,t,i){this.languageConfigurationService=i,this._selection=e,this._insertSpace=t,this._usedEndToken=null}static _haystackHasNeedleAtOffset(e,t,i){if(i<0)return!1;const s=t.length,o=e.length;if(i+s>o)return!1;for(let r=0;r=65&&a<=90&&a+32===l)&&!(l>=65&&l<=90&&l+32===a))return!1}return!0}_createOperationsForBlockComment(e,t,i,s,o,r){const a=e.startLineNumber,l=e.startColumn,c=e.endLineNumber,d=e.endColumn,u=o.getLineContent(a),h=o.getLineContent(c);let f=u.lastIndexOf(t,l-1+t.length),g=h.indexOf(i,d-1-i.length);if(f!==-1&&g!==-1)if(a===c)u.substring(f+t.length,g).indexOf(i)>=0&&(f=-1,g=-1);else{const _=u.substring(f+t.length),v=h.substring(0,g);(_.indexOf(i)>=0||v.indexOf(i)>=0)&&(f=-1,g=-1)}let p;f!==-1&&g!==-1?(s&&f+t.length0&&h.charCodeAt(g-1)===32&&(i=" "+i,g-=1),p=cf._createRemoveBlockCommentOperations(new I(a,f+t.length+1,c,g+1),t,i)):(p=cf._createAddBlockCommentOperations(e,t,i,this._insertSpace),this._usedEndToken=p.length===1?i:null);for(const _ of p)r.addTrackedEditOperation(_.range,_.text)}static _createRemoveBlockCommentOperations(e,t,i){const s=[];return I.isEmpty(e)?s.push(Yi.delete(new I(e.startLineNumber,e.startColumn-t.length,e.endLineNumber,e.endColumn+i.length))):(s.push(Yi.delete(new I(e.startLineNumber,e.startColumn-t.length,e.startLineNumber,e.startColumn))),s.push(Yi.delete(new I(e.endLineNumber,e.endColumn,e.endLineNumber,e.endColumn+i.length)))),s}static _createAddBlockCommentOperations(e,t,i,s){const o=[];return I.isEmpty(e)?o.push(Yi.replace(new I(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn),t+" "+i)):(o.push(Yi.insert(new Y(e.startLineNumber,e.startColumn),t+(s?" ":""))),o.push(Yi.insert(new Y(e.endLineNumber,e.endColumn),(s?" ":"")+i))),o}getEditOperations(e,t){const i=this._selection.startLineNumber,s=this._selection.startColumn;e.tokenization.tokenizeIfCheap(i);const o=e.getLanguageIdAtPosition(i,s),r=this.languageConfigurationService.getLanguageConfiguration(o).comments;!r||!r.blockCommentStartToken||!r.blockCommentEndToken||this._createOperationsForBlockComment(this._selection,r.blockCommentStartToken,r.blockCommentEndToken,this._insertSpace,e,t)}computeCursorState(e,t){const i=t.getInverseEditOperations();if(i.length===2){const s=i[0],o=i[1];return new Je(s.range.endLineNumber,s.range.endColumn,o.range.startLineNumber,o.range.startColumn)}else{const s=i[0].range,o=this._usedEndToken?-this._usedEndToken.length-1:0;return new Je(s.endLineNumber,s.endColumn+o,s.endLineNumber,s.endColumn+o)}}}class lu{constructor(e,t,i,s,o,r,a){this.languageConfigurationService=e,this._selection=t,this._tabSize=i,this._type=s,this._insertSpace=o,this._selectionId=null,this._deltaColumn=0,this._moveEndPositionDown=!1,this._ignoreEmptyLines=r,this._ignoreFirstLine=a||!1}static _gatherPreflightCommentStrings(e,t,i,s){e.tokenization.tokenizeIfCheap(t);const o=e.getLanguageIdAtPosition(t,1),r=s.getLanguageConfiguration(o).comments,a=r?r.lineCommentToken:null;if(!a)return null;const l=[];for(let c=0,d=i-t+1;co?t[l].commentStrOffset=r-1:t[l].commentStrOffset=r}}}class G7 extends Ue{constructor(e,t){super(t),this._type=e}run(e,t){const i=e.get(Ni);if(!t.hasModel())return;const s=t.getModel(),o=[],r=s.getOptions(),a=t.getOption(23),l=t.getSelections().map((d,u)=>({selection:d,index:u,ignoreFirstLine:!1}));l.sort((d,u)=>I.compareRangesUsingStarts(d.selection,u.selection));let c=l[0];for(let d=1;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},Xg=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},$F;let Xb=$F=class{static get(e){return e.getContribution($F.ID)}constructor(e,t,i,s,o,r,a,l){this._contextMenuService=t,this._contextViewService=i,this._contextKeyService=s,this._keybindingService=o,this._menuService=r,this._configurationService=a,this._workspaceContextService=l,this._toDispose=new be,this._contextMenuIsBeingShownCount=0,this._editor=e,this._toDispose.add(this._editor.onContextMenu(c=>this._onContextMenu(c))),this._toDispose.add(this._editor.onMouseWheel(c=>{if(this._contextMenuIsBeingShownCount>0){const d=this._contextViewService.getContextViewElement(),u=c.srcElement;u.shadowRoot&&cm(d)===u.shadowRoot||this._contextViewService.hideContextView()}})),this._toDispose.add(this._editor.onKeyDown(c=>{this._editor.getOption(24)&&c.keyCode===58&&(c.preventDefault(),c.stopPropagation(),this.showContextMenu())}))}_onContextMenu(e){if(!this._editor.hasModel())return;if(!this._editor.getOption(24)){this._editor.focus(),e.target.position&&!this._editor.getSelection().containsPosition(e.target.position)&&this._editor.setPosition(e.target.position);return}if(e.target.type===12||e.target.type===6&&e.target.detail.injectedText)return;if(e.event.preventDefault(),e.event.stopPropagation(),e.target.type===11)return this._showScrollbarContextMenu(e.event);if(e.target.type!==6&&e.target.type!==7&&e.target.type!==1)return;if(this._editor.focus(),e.target.position){let i=!1;for(const s of this._editor.getSelections())if(s.containsPosition(e.target.position)){i=!0;break}i||this._editor.setPosition(e.target.position)}let t=null;e.target.type!==1&&(t=e.event),this.showContextMenu(t)}showContextMenu(e){if(!this._editor.getOption(24)||!this._editor.hasModel())return;const t=this._getMenuActions(this._editor.getModel(),this._editor.isSimpleWidget?M.SimpleEditorContext:M.EditorContext);t.length>0&&this._doShowContextMenu(t,e)}_getMenuActions(e,t){const i=[],s=this._menuService.createMenu(t,this._contextKeyService),o=s.getActions({arg:e.uri});s.dispose();for(const r of o){const[,a]=r;let l=0;for(const c of a)if(c instanceof ww){const d=this._getMenuActions(e,c.item.submenu);d.length>0&&(i.push(new Sb(c.id,c.label,d)),l++)}else i.push(c),l++;l&&i.push(new hs)}return i.length&&i.pop(),i}_doShowContextMenu(e,t=null){if(!this._editor.hasModel())return;const i=this._editor.getOption(60);this._editor.updateOptions({hover:{enabled:!1}});let s=t;if(!s){this._editor.revealPosition(this._editor.getPosition(),1),this._editor.render();const r=this._editor.getScrolledVisiblePosition(this._editor.getPosition()),a=Un(this._editor.getDomNode()),l=a.left+r.left,c=a.top+r.top+r.height;s={x:l,y:c}}const o=this._editor.getOption(126)&&!uc;this._contextMenuIsBeingShownCount++,this._contextMenuService.showContextMenu({domForShadowRoot:o?this._editor.getDomNode():void 0,getAnchor:()=>s,getActions:()=>e,getActionViewItem:r=>{const a=this._keybindingFor(r);if(a)return new Hb(r,r,{label:!0,keybinding:a.getLabel(),isMenu:!0});const l=r;return typeof l.getActionViewItem=="function"?l.getActionViewItem():new Hb(r,r,{icon:!0,label:!0,isMenu:!0})},getKeyBinding:r=>this._keybindingFor(r),onHide:r=>{this._contextMenuIsBeingShownCount--,this._editor.updateOptions({hover:i})}})}_showScrollbarContextMenu(e){if(!this._editor.hasModel()||fTe(this._workspaceContextService.getWorkspace()))return;const t=this._editor.getOption(72);let i=0;const s=c=>({id:"menu-action-".concat(++i),label:c.label,tooltip:"",class:void 0,enabled:typeof c.enabled>"u"?!0:c.enabled,checked:c.checked,run:c.run}),o=(c,d)=>new Sb("menu-action-".concat(++i),c,d,void 0),r=(c,d,u,h,f)=>{if(!d)return s({label:c,enabled:d,run:()=>{}});const g=_=>()=>{this._configurationService.updateValue(u,_)},p=[];for(const _ of f)p.push(s({label:_.label,checked:h===_.value,run:g(_.value)}));return o(c,p)},a=[];a.push(s({label:m("context.minimap.minimap","Minimap"),checked:t.enabled,run:()=>{this._configurationService.updateValue("editor.minimap.enabled",!t.enabled)}})),a.push(new hs),a.push(s({label:m("context.minimap.renderCharacters","Render Characters"),enabled:t.enabled,checked:t.renderCharacters,run:()=>{this._configurationService.updateValue("editor.minimap.renderCharacters",!t.renderCharacters)}})),a.push(r(m("context.minimap.size","Vertical size"),t.enabled,"editor.minimap.size",t.size,[{label:m("context.minimap.size.proportional","Proportional"),value:"proportional"},{label:m("context.minimap.size.fill","Fill"),value:"fill"},{label:m("context.minimap.size.fit","Fit"),value:"fit"}])),a.push(r(m("context.minimap.slider","Slider"),t.enabled,"editor.minimap.showSlider",t.showSlider,[{label:m("context.minimap.slider.mouseover","Mouse Over"),value:"mouseover"},{label:m("context.minimap.slider.always","Always"),value:"always"}]));const l=this._editor.getOption(126)&&!uc;this._contextMenuIsBeingShownCount++,this._contextMenuService.showContextMenu({domForShadowRoot:l?this._editor.getDomNode():void 0,getAnchor:()=>e,getActions:()=>a,onHide:c=>{this._contextMenuIsBeingShownCount--,this._editor.focus()}})}_keybindingFor(e){return this._keybindingService.lookupKeybinding(e.id)}dispose(){this._contextMenuIsBeingShownCount>0&&this._contextViewService.hideContextView(),this._toDispose.dispose()}};Xb.ID="editor.contrib.contextmenu";Xb=$F=E5e([Xg(1,Cl),Xg(2,rh),Xg(3,bt),Xg(4,Di),Xg(5,Vd),Xg(6,zt),Xg(7,hm)],Xb);class I5e extends Ue{constructor(){super({id:"editor.action.showContextMenu",label:m("action.showContextMenu.label","Show Editor Context Menu"),alias:"Show Editor Context Menu",precondition:void 0,kbOpts:{kbExpr:O.textInputFocus,primary:1092,weight:100}})}run(e,t){var i;(i=Xb.get(t))===null||i===void 0||i.showContextMenu()}}ti(Xb.ID,Xb,2);De(I5e);class DR{constructor(e){this.selections=e}equals(e){const t=this.selections.length,i=e.selections.length;if(t!==i)return!1;for(let s=0;s{this._undoStack=[],this._redoStack=[]})),this._register(e.onDidChangeModelContent(t=>{this._undoStack=[],this._redoStack=[]})),this._register(e.onDidChangeCursorSelection(t=>{if(this._isCursorUndoRedo||!t.oldSelections||t.oldModelVersionId!==t.modelVersionId)return;const i=new DR(t.oldSelections);this._undoStack.length>0&&this._undoStack[this._undoStack.length-1].cursorState.equals(i)||(this._undoStack.push(new ER(i,e.getScrollTop(),e.getScrollLeft())),this._redoStack=[],this._undoStack.length>50&&this._undoStack.shift())}))}cursorUndo(){!this._editor.hasModel()||this._undoStack.length===0||(this._redoStack.push(new ER(new DR(this._editor.getSelections()),this._editor.getScrollTop(),this._editor.getScrollLeft())),this._applyState(this._undoStack.pop()))}cursorRedo(){!this._editor.hasModel()||this._redoStack.length===0||(this._undoStack.push(new ER(new DR(this._editor.getSelections()),this._editor.getScrollTop(),this._editor.getScrollLeft())),this._applyState(this._redoStack.pop()))}_applyState(e){this._isCursorUndoRedo=!0,this._editor.setSelections(e.cursorState.selections),this._editor.setScrollPosition({scrollTop:e.scrollTop,scrollLeft:e.scrollLeft}),this._isCursorUndoRedo=!1}}km.ID="editor.contrib.cursorUndoRedoController";class T5e extends Ue{constructor(){super({id:"cursorUndo",label:m("cursor.undo","Cursor Undo"),alias:"Cursor Undo",precondition:void 0,kbOpts:{kbExpr:O.textInputFocus,primary:2099,weight:100}})}run(e,t,i){var s;(s=km.get(t))===null||s===void 0||s.cursorUndo()}}class x5e extends Ue{constructor(){super({id:"cursorRedo",label:m("cursor.redo","Cursor Redo"),alias:"Cursor Redo",precondition:void 0})}run(e,t,i){var s;(s=km.get(t))===null||s===void 0||s.cursorRedo()}}ti(km.ID,km,0);De(T5e);De(x5e);class N5e{constructor(e,t,i){this.selection=e,this.targetPosition=t,this.copy=i,this.targetSelection=null}getEditOperations(e,t){const i=e.getValueInRange(this.selection);if(this.copy||t.addEditOperation(this.selection,null),t.addEditOperation(new I(this.targetPosition.lineNumber,this.targetPosition.column,this.targetPosition.lineNumber,this.targetPosition.column),i),this.selection.containsPosition(this.targetPosition)&&!(this.copy&&(this.selection.getEndPosition().equals(this.targetPosition)||this.selection.getStartPosition().equals(this.targetPosition)))){this.targetSelection=this.selection;return}if(this.copy){this.targetSelection=new Je(this.targetPosition.lineNumber,this.targetPosition.column,this.selection.endLineNumber-this.selection.startLineNumber+this.targetPosition.lineNumber,this.selection.startLineNumber===this.selection.endLineNumber?this.targetPosition.column+this.selection.endColumn-this.selection.startColumn:this.selection.endColumn);return}if(this.targetPosition.lineNumber>this.selection.endLineNumber){this.targetSelection=new Je(this.targetPosition.lineNumber-this.selection.endLineNumber+this.selection.startLineNumber,this.targetPosition.column,this.targetPosition.lineNumber,this.selection.startLineNumber===this.selection.endLineNumber?this.targetPosition.column+this.selection.endColumn-this.selection.startColumn:this.selection.endColumn);return}if(this.targetPosition.lineNumberthis._onEditorMouseDown(t))),this._register(this._editor.onMouseUp(t=>this._onEditorMouseUp(t))),this._register(this._editor.onMouseDrag(t=>this._onEditorMouseDrag(t))),this._register(this._editor.onMouseDrop(t=>this._onEditorMouseDrop(t))),this._register(this._editor.onMouseDropCanceled(()=>this._onEditorMouseDropCanceled())),this._register(this._editor.onKeyDown(t=>this.onEditorKeyDown(t))),this._register(this._editor.onKeyUp(t=>this.onEditorKeyUp(t))),this._register(this._editor.onDidBlurEditorWidget(()=>this.onEditorBlur())),this._register(this._editor.onDidBlurEditorText(()=>this.onEditorBlur())),this._mouseDown=!1,this._modifierPressed=!1,this._dragSelection=null}onEditorBlur(){this._removeDecoration(),this._dragSelection=null,this._mouseDown=!1,this._modifierPressed=!1}onEditorKeyDown(e){!this._editor.getOption(35)||this._editor.getOption(22)||(M_(e)&&(this._modifierPressed=!0),this._mouseDown&&M_(e)&&this._editor.updateOptions({mouseStyle:"copy"}))}onEditorKeyUp(e){!this._editor.getOption(35)||this._editor.getOption(22)||(M_(e)&&(this._modifierPressed=!1),this._mouseDown&&e.keyCode===Vu.TRIGGER_KEY_VALUE&&this._editor.updateOptions({mouseStyle:"default"}))}_onEditorMouseDown(e){this._mouseDown=!0}_onEditorMouseUp(e){this._mouseDown=!1,this._editor.updateOptions({mouseStyle:"text"})}_onEditorMouseDrag(e){const t=e.target;if(this._dragSelection===null){const s=(this._editor.getSelections()||[]).filter(o=>t.position&&o.containsPosition(t.position));if(s.length===1)this._dragSelection=s[0];else return}M_(e.event)?this._editor.updateOptions({mouseStyle:"copy"}):this._editor.updateOptions({mouseStyle:"default"}),t.position&&(this._dragSelection.containsPosition(t.position)?this._removeDecoration():this.showAt(t.position))}_onEditorMouseDropCanceled(){this._editor.updateOptions({mouseStyle:"text"}),this._removeDecoration(),this._dragSelection=null,this._mouseDown=!1}_onEditorMouseDrop(e){if(e.target&&(this._hitContent(e.target)||this._hitMargin(e.target))&&e.target.position){const t=new Y(e.target.position.lineNumber,e.target.position.column);if(this._dragSelection===null){let i=null;if(e.event.shiftKey){const s=this._editor.getSelection();if(s){const{selectionStartLineNumber:o,selectionStartColumn:r}=s;i=[new Je(o,r,t.lineNumber,t.column)]}}else i=(this._editor.getSelections()||[]).map(s=>s.containsPosition(t)?new Je(t.lineNumber,t.column,t.lineNumber,t.column):s);this._editor.setSelections(i||[],"mouse",3)}else(!this._dragSelection.containsPosition(t)||(M_(e.event)||this._modifierPressed)&&(this._dragSelection.getEndPosition().equals(t)||this._dragSelection.getStartPosition().equals(t)))&&(this._editor.pushUndoStop(),this._editor.executeCommand(Vu.ID,new N5e(this._dragSelection,t,M_(e.event)||this._modifierPressed)),this._editor.pushUndoStop())}this._editor.updateOptions({mouseStyle:"text"}),this._removeDecoration(),this._dragSelection=null,this._mouseDown=!1}showAt(e){this._dndDecorationIds.set([{range:new I(e.lineNumber,e.column,e.lineNumber,e.column),options:Vu._DECORATION_OPTIONS}]),this._editor.revealPosition(e,1)}_removeDecoration(){this._dndDecorationIds.clear()}_hitContent(e){return e.type===6||e.type===7}_hitMargin(e){return e.type===2||e.type===3||e.type===4}dispose(){this._removeDecoration(),this._dragSelection=null,this._mouseDown=!1,this._modifierPressed=!1,super.dispose()}}Vu.ID="editor.contrib.dragAndDrop";Vu.TRIGGER_KEY_VALUE=Kt?6:5;Vu._DECORATION_OPTIONS=kt.register({description:"dnd-target",className:"dnd-target"});ti(Vu.ID,Vu,2);const yN=function(){if(typeof crypto=="object"&&typeof crypto.randomUUID=="function")return crypto.randomUUID.bind(crypto);let n;typeof crypto=="object"&&typeof crypto.getRandomValues=="function"?n=crypto.getRandomValues.bind(crypto):n=function(i){for(let s=0;spne(this,void 0,void 0,function*(){return n}),asFile:()=>{},value:typeof n=="string"?n:void 0}}function A5e(n,e,t){const i={id:yN(),name:n,uri:e,data:t};return{asString:()=>pne(this,void 0,void 0,function*(){return""}),asFile:()=>i,value:void 0}}class mne{constructor(){this._entries=new Map}get size(){let e=0;for(const t of this._entries)e++;return e}has(e){return this._entries.has(this.toKey(e))}matches(e){const t=[...this._entries.keys()];return Pt.some(this,([i,s])=>s.asFile())&&t.push("files"),vne(UI(e),t)}get(e){var t;return(t=this._entries.get(this.toKey(e)))===null||t===void 0?void 0:t[0]}append(e,t){const i=this._entries.get(e);i?i.push(t):this._entries.set(this.toKey(e),[t])}replace(e,t){this._entries.set(this.toKey(e),[t])}delete(e){this._entries.delete(this.toKey(e))}*[Symbol.iterator](){for(const[e,t]of this._entries)for(const i of t)yield[e,i]}toKey(e){return UI(e)}}function UI(n){return n.toLowerCase()}function _ne(n,e){return vne(UI(n),e.map(UI))}function vne(n,e){if(n==="*/*")return e.length>0;if(e.includes(n))return!0;const t=n.match(/^([a-z]+)\/([a-z]+|\*)$/i);if(!t)return!1;const[i,s,o]=t;return o==="*"?e.some(r=>r.startsWith(s+"/")):!1}const SN=Object.freeze({create:n=>Vf(n.map(e=>e.toString())).join("\r\n"),split:n=>n.split("\r\n"),parse:n=>SN.split(n).filter(e=>!e.startsWith("#"))}),Tj={EDITORS:"CodeEditors",FILES:"CodeFiles"};class M5e{}const R5e={DragAndDropContribution:"workbench.contributions.dragAndDrop"};en.add(R5e.DragAndDropContribution,new M5e);class wy{constructor(){}static getInstance(){return wy.INSTANCE}hasData(e){return e&&e===this.proto}getData(e){if(this.hasData(e))return this.data}}wy.INSTANCE=new wy;var P5e=globalThis&&globalThis.__awaiter||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 bne(n){const e=new mne;for(const t of n.items){const i=t.type;if(t.kind==="string"){const s=new Promise(o=>t.getAsString(o));e.append(i,Y7(s))}else if(t.kind==="file"){const s=t.getAsFile();s&&e.append(i,O5e(s))}}return e}function O5e(n){const e=n.path?ct.parse(n.path):void 0;return A5e(n.name,e,()=>P5e(this,void 0,void 0,function*(){return new Uint8Array(yield n.arrayBuffer())}))}const F5e=Object.freeze([Tj.EDITORS,Tj.FILES,Jw.RESOURCES,Jw.INTERNAL_URI_LIST]);function Cne(n,e=!1){const t=bne(n),i=t.get(Jw.INTERNAL_URI_LIST);if(i)t.replace(wn.uriList,i);else if(e||!t.has(wn.uriList)){const s=[];for(const o of n.items){const r=o.getAsFile();if(r){const a=r.path;try{a?s.push(ct.file(a).toString()):s.push(ct.parse(r.name,!0).toString())}catch{}}}s.length&&t.replace(wn.uriList,Y7(SN.create(s)))}for(const s of F5e)t.delete(s);return t}function B5e(n,e,t){var i,s;return{edits:[...e.map(o=>new Ou(n,typeof t.insertText=="string"?{range:o,text:t.insertText,insertAsSnippet:!1}:{range:o,text:t.insertText.snippet,insertAsSnippet:!0})),...(s=(i=t.additionalEdit)===null||i===void 0?void 0:i.edits)!==null&&s!==void 0?s:[]]}}function wne(n){var e;function t(a,l){return"providerId"in a&&a.providerId===l.providerId||"mimeType"in a&&a.mimeType===l.handledMimeType}const i=new Map;for(const a of n)for(const l of(e=a.yieldTo)!==null&&e!==void 0?e:[])for(const c of n)if(c!==a&&t(l,c)){let d=i.get(a);d||(d=[],i.set(a,d)),d.push(c)}if(!i.size)return Array.from(n);const s=new Set,o=[];function r(a){if(!a.length)return[];const l=a[0];if(o.includes(l))return console.warn("Yield to cycle detected for ".concat(l.providerId)),a;if(s.has(l))return r(a.slice(1));let c=[];const d=i.get(l);return d&&(o.push(l),c=r(d),o.pop()),s.add(l),[...c,l,...r(a.slice(1))]}return r(Array.from(n))}var W5e=globalThis&&globalThis.__decorate||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},V5e=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},H5e=globalThis&&globalThis.__awaiter||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 $5e=kt.register({description:"inline-progress-widget",stickiness:1,showIfCollapsed:!0,after:{content:xX,inlineClassName:"inline-editor-progress-decoration",inlineClassNameAffectsLetterSpacing:!0}});class LN extends te{constructor(e,t,i,s,o){super(),this.typeId=e,this.editor=t,this.range=i,this.delegate=o,this.allowEditorOverflow=!1,this.suppressMouseDown=!0,this.create(s),this.editor.addContentWidget(this),this.editor.layoutContentWidget(this)}create(e){this.domNode=ye(".inline-progress-widget"),this.domNode.role="button",this.domNode.title=e;const t=ye("span.icon");this.domNode.append(t),t.classList.add(...dt.asClassNameArray(Me.loading),"codicon-modifier-spin");const i=()=>{const s=this.editor.getOption(66);this.domNode.style.height="".concat(s,"px"),this.domNode.style.width="".concat(Math.ceil(.8*s),"px")};i(),this._register(this.editor.onDidChangeConfiguration(s=>{(s.hasChanged(52)||s.hasChanged(66))&&i()})),this._register(ce(this.domNode,Pe.CLICK,s=>{this.delegate.cancel()}))}getId(){return LN.baseId+"."+this.typeId}getDomNode(){return this.domNode}getPosition(){return{position:{lineNumber:this.range.startLineNumber,column:this.range.startColumn},preference:[0]}}dispose(){super.dispose(),this.editor.removeContentWidget(this)}}LN.baseId="editor.widget.inlineProgressWidget";let jI=class extends te{constructor(e,t,i){super(),this.id=e,this._editor=t,this._instantiationService=i,this._showDelay=500,this._showPromise=this._register(new Ts),this._currentWidget=new Ts,this._operationIdPool=0,this._currentDecorations=t.createDecorationsCollection()}showWhile(e,t,i){return H5e(this,void 0,void 0,function*(){const s=this._operationIdPool++;this._currentOperation=s,this.clear(),this._showPromise.value=Kf(()=>{const o=I.fromPositions(e);this._currentDecorations.set([{range:o,options:$5e}]).length>0&&(this._currentWidget.value=this._instantiationService.createInstance(LN,this.id,this._editor,o,t,i))},this._showDelay);try{return yield i}finally{this._currentOperation===s&&(this.clear(),this._currentOperation=void 0)}})}clear(){this._showPromise.clear(),this._currentDecorations.clear(),this._currentWidget.clear()}};jI=W5e([V5e(2,_t)],jI);var yne=globalThis&&globalThis.__decorate||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},WC=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},xj=globalThis&&globalThis.__awaiter||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())})},zF;let KI=zF=class extends te{constructor(e,t,i,s,o,r,a,l,c,d){super(),this.typeId=e,this.editor=t,this.showCommand=s,this.range=o,this.edits=r,this.onSelectNewEdit=a,this._contextMenuService=l,this._keybindingService=d,this.allowEditorOverflow=!0,this.suppressMouseDown=!0,this.create(),this.visibleContext=i.bindTo(c),this.visibleContext.set(!0),this._register(vt(()=>this.visibleContext.reset())),this.editor.addContentWidget(this),this.editor.layoutContentWidget(this),this._register(vt(()=>this.editor.removeContentWidget(this))),this._register(this.editor.onDidChangeCursorPosition(u=>{o.containsPosition(u.position)||this.dispose()})),this._register(We.runAndSubscribe(d.onDidUpdateKeybindings,()=>{this._updateButtonTitle()}))}_updateButtonTitle(){var e;const t=(e=this._keybindingService.lookupKeybinding(this.showCommand.id))===null||e===void 0?void 0:e.getLabel();this.button.element.title=this.showCommand.label+(t?" (".concat(t,")"):"")}create(){this.domNode=ye(".post-edit-widget"),this.button=this._register(new L4(this.domNode,{supportIcons:!0})),this.button.label="$(insert)",this._register(ce(this.domNode,Pe.CLICK,()=>this.showSelector()))}getId(){return zF.baseId+"."+this.typeId}getDomNode(){return this.domNode}getPosition(){return{position:this.range.getEndPosition(),preference:[2]}}showSelector(){this._contextMenuService.showContextMenu({getAnchor:()=>{const e=Un(this.button.element);return{x:e.left+e.width,y:e.top+e.height}},getActions:()=>this.edits.allEdits.map((e,t)=>Bv({id:"",label:e.label,checked:t===this.edits.activeEditIndex,run:()=>{if(t!==this.edits.activeEditIndex)return this.onSelectNewEdit(t)}}))})}};KI.baseId="editor.widget.postEditWidget";KI=zF=yne([WC(7,Cl),WC(8,bt),WC(9,Di)],KI);let qI=class extends te{constructor(e,t,i,s,o,r){super(),this._id=e,this._editor=t,this._visibleContext=i,this._showCommand=s,this._instantiationService=o,this._bulkEditService=r,this._currentWidget=this._register(new Ts),this._register(We.any(t.onDidChangeModel,t.onDidChangeModelContent)(()=>this.clear()))}applyEditAndShowIfNeeded(e,t,i,s){var o,r;return xj(this,void 0,void 0,function*(){const a=this._editor.getModel();if(!a||!e.length)return;const l=t.allEdits[t.activeEditIndex];if(!l)return;let c=[];(typeof l.insertText=="string"?l.insertText==="":l.insertText.snippet==="")?c=[]:c=e.map(_=>new Ou(a.uri,typeof l.insertText=="string"?{range:_,text:l.insertText,insertAsSnippet:!1}:{range:_,text:l.insertText.snippet,insertAsSnippet:!0}));const u={edits:[...c,...(r=(o=l.additionalEdit)===null||o===void 0?void 0:o.edits)!==null&&r!==void 0?r:[]]},h=e[0],f=a.deltaDecorations([],[{range:h,options:{description:"paste-line-suffix",stickiness:0}}]);let g,p;try{g=yield this._bulkEditService.apply(u,{editor:this._editor,token:s}),p=a.getDecorationRange(f[0])}finally{a.deltaDecorations(f,[])}i&&g.isApplied&&t.allEdits.length>1&&this.show(p!=null?p:h,t,_=>xj(this,void 0,void 0,function*(){const v=this._editor.getModel();v&&(yield v.undo(),this.applyEditAndShowIfNeeded(e,{activeEditIndex:_,allEdits:t.allEdits},i,s))}))})}show(e,t,i){this.clear(),this._editor.hasModel()&&(this._currentWidget.value=this._instantiationService.createInstance(KI,this._id,this._editor,this._visibleContext,this._showCommand,e,t,i))}clear(){this._currentWidget.clear()}tryShowSelector(){var e;(e=this._currentWidget.value)===null||e===void 0||e.showSelector()}};qI=yne([WC(4,_t),WC(5,kS)],qI);var z5e=globalThis&&globalThis.__decorate||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_=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},Jd=globalThis&&globalThis.__awaiter||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())})},UF;const Sne="editor.changePasteType",Lne=new Ve("pasteWidgetVisible",!1,m("pasteWidgetVisible","Whether the paste widget is showing")),IR="application/vnd.code.copyMetadata";let Dm=UF=class extends te{static get(e){return e.getContribution(UF.ID)}constructor(e,t,i,s,o,r,a){super(),this._bulkEditService=i,this._clipboardService=s,this._languageFeaturesService=o,this._quickInputService=r,this._progressService=a,this._editor=e;const l=e.getContainerDomNode();this._register(ce(l,"copy",c=>this.handleCopy(c))),this._register(ce(l,"cut",c=>this.handleCopy(c))),this._register(ce(l,"paste",c=>this.handlePaste(c),!0)),this._pasteProgressManager=this._register(new jI("pasteIntoEditor",e,t)),this._postPasteWidgetManager=this._register(t.createInstance(qI,"pasteIntoEditor",e,Lne,{id:Sne,label:m("postPasteWidgetTitle","Show paste options...")}))}changePasteType(){this._postPasteWidgetManager.tryShowSelector()}pasteAs(e){this._editor.focus();try{this._pasteAsActionContext={preferredId:e},nx().execCommand("paste")}finally{this._pasteAsActionContext=void 0}}isPasteAsEnabled(){return this._editor.getOption(84).enabled&&!this._editor.getOption(90)}handleCopy(e){var t,i;if(!this._editor.hasTextFocus()||(yg&&this._clipboardService.writeResources([]),!e.clipboardData||!this.isPasteAsEnabled()))return;const s=this._editor.getModel(),o=this._editor.getSelections();if(!s||!(o!=null&&o.length))return;const r=this._editor.getOption(37);let a=o;const l=o.length===1&&o[0].isEmpty();if(l){if(!r)return;a=[new I(a[0].startLineNumber,1,a[0].startLineNumber,1+s.getLineLength(a[0].startLineNumber))]}const c=(t=this._editor._getViewModel())===null||t===void 0?void 0:t.getPlainTextToCopy(o,r,zs),u={multicursorText:Array.isArray(c)?c:null,pasteOnNewLine:l,mode:null},h=this._languageFeaturesService.documentPasteEditProvider.ordered(s).filter(v=>!!v.prepareDocumentPaste);if(!h.length){this.setCopyMetadata(e.clipboardData,{defaultPastePayload:u});return}const f=bne(e.clipboardData),g=h.flatMap(v=>{var b;return(b=v.copyMimeTypes)!==null&&b!==void 0?b:[]}),p=yN();this.setCopyMetadata(e.clipboardData,{id:p,providerCopyMimeTypes:g,defaultPastePayload:u});const _=Xn(v=>Jd(this,void 0,void 0,function*(){const b=wd(yield Promise.all(h.map(C=>Jd(this,void 0,void 0,function*(){try{return yield C.prepareDocumentPaste(s,a,f,v)}catch(w){console.error(w);return}}))));b.reverse();for(const C of b)for(const[w,y]of C)f.replace(w,y);return f}));(i=this._currentCopyOperation)===null||i===void 0||i.dataTransferPromise.cancel(),this._currentCopyOperation={handle:p,dataTransferPromise:_}}handlePaste(e){var t,i;return Jd(this,void 0,void 0,function*(){if(!e.clipboardData||!this._editor.hasTextFocus())return;(t=this._currentPasteOperation)===null||t===void 0||t.cancel(),this._currentPasteOperation=void 0;const s=this._editor.getModel(),o=this._editor.getSelections();if(!(o!=null&&o.length)||!s||!this.isPasteAsEnabled())return;const r=this.fetchCopyMetadata(e),a=Cne(e.clipboardData);a.delete(IR);const l=[...e.clipboardData.types,...(i=r==null?void 0:r.providerCopyMimeTypes)!==null&&i!==void 0?i:[],wn.uriList],c=this._languageFeaturesService.documentPasteEditProvider.ordered(s).filter(d=>{var u;return(u=d.pasteMimeTypes)===null||u===void 0?void 0:u.some(h=>_ne(h,l))});c.length&&(e.preventDefault(),e.stopImmediatePropagation(),this._pasteAsActionContext?this.showPasteAsPick(this._pasteAsActionContext.preferredId,c,o,a,r):this.doPasteInline(c,o,a,r))})}doPasteInline(e,t,i,s){const o=Xn(r=>Jd(this,void 0,void 0,function*(){const a=this._editor;if(!a.hasModel())return;const l=a.getModel(),c=new tg(a,3,void 0,r);try{if(yield this.mergeInDataFromCopy(i,s,c.token),c.token.isCancellationRequested)return;const d=e.filter(h=>Nj(h,i));if(!d.length||d.length===1&&d[0].id==="text"){yield this.applyDefaultPasteHandler(i,s,c.token);return}const u=yield this.getPasteEdits(d,i,l,t,c.token);if(c.token.isCancellationRequested)return;if(u.length===1&&u[0].providerId==="text"){yield this.applyDefaultPasteHandler(i,s,c.token);return}if(u.length){const h=a.getOption(84).showPasteSelector==="afterPaste";return this._postPasteWidgetManager.applyEditAndShowIfNeeded(t,{activeEditIndex:0,allEdits:u},h,c.token)}yield this.applyDefaultPasteHandler(i,s,c.token)}finally{c.dispose(),this._currentPasteOperation===o&&(this._currentPasteOperation=void 0)}}));this._pasteProgressManager.showWhile(t[0].getEndPosition(),m("pasteIntoEditorProgress","Running paste handlers. Click to cancel"),o),this._currentPasteOperation=o}showPasteAsPick(e,t,i,s,o){const r=Xn(a=>Jd(this,void 0,void 0,function*(){const l=this._editor;if(!l.hasModel())return;const c=l.getModel(),d=new tg(l,3,void 0,a);try{if(yield this.mergeInDataFromCopy(s,o,d.token),d.token.isCancellationRequested)return;let u=t.filter(p=>Nj(p,s));e&&(u=u.filter(p=>p.id===e));const h=yield this.getPasteEdits(u,s,c,i,d.token);if(d.token.isCancellationRequested||!h.length)return;let f;if(e)f=h.at(0);else{const p=yield this._quickInputService.pick(h.map(_=>({label:_.label,description:_.providerId,detail:_.detail,edit:_})),{placeHolder:m("pasteAsPickerPlaceholder","Select Paste Action")});f=p==null?void 0:p.edit}if(!f)return;const g=B5e(c.uri,i,f);yield this._bulkEditService.apply(g,{editor:this._editor})}finally{d.dispose(),this._currentPasteOperation===r&&(this._currentPasteOperation=void 0)}}));this._progressService.withProgress({location:10,title:m("pasteAsProgress","Running paste handlers")},()=>r)}setCopyMetadata(e,t){e.setData(IR,JSON.stringify(t))}fetchCopyMetadata(e){var t;if(!e.clipboardData)return;const i=e.clipboardData.getData(IR);if(i)try{return JSON.parse(i)}catch{return}const[s,o]=fO.getTextData(e.clipboardData);if(o)return{defaultPastePayload:{mode:o.mode,multicursorText:(t=o.multicursorText)!==null&&t!==void 0?t:null,pasteOnNewLine:!!o.isFromEmptySelection}}}mergeInDataFromCopy(e,t,i){var s;return Jd(this,void 0,void 0,function*(){if(t!=null&&t.id&&((s=this._currentCopyOperation)===null||s===void 0?void 0:s.handle)===t.id){const o=yield this._currentCopyOperation.dataTransferPromise;if(i.isCancellationRequested)return;for(const[r,a]of o)e.replace(r,a)}if(!e.has(wn.uriList)){const o=yield this._clipboardService.readResources();if(i.isCancellationRequested)return;o.length&&e.append(wn.uriList,Y7(SN.create(o)))}})}getPasteEdits(e,t,i,s,o){return Jd(this,void 0,void 0,function*(){const r=yield ox(Promise.all(e.map(l=>Jd(this,void 0,void 0,function*(){var c;try{const d=yield(c=l.provideDocumentPasteEdits)===null||c===void 0?void 0:c.call(l,i,s,t,o);if(d)return Object.assign(Object.assign({},d),{providerId:l.id})}catch(d){console.error(d)}}))),o),a=wd(r!=null?r:[]);return wne(a)})}applyDefaultPasteHandler(e,t,i){var s,o,r;return Jd(this,void 0,void 0,function*(){const a=(s=e.get(wn.text))!==null&&s!==void 0?s:e.get("text");if(!a)return;const l=yield a.asString();if(i.isCancellationRequested)return;const c={text:l,pasteOnNewLine:(o=t==null?void 0:t.defaultPastePayload.pasteOnNewLine)!==null&&o!==void 0?o:!1,multicursorText:(r=t==null?void 0:t.defaultPastePayload.multicursorText)!==null&&r!==void 0?r:null,mode:null};this._editor.trigger("keyboard","paste",c)})}};Dm.ID="editor.contrib.copyPasteActionController";Dm=UF=z5e([R_(1,_t),R_(2,kS),R_(3,ch),R_(4,Ze),R_(5,yc),R_(6,cee)],Dm);function Nj(n,e){var t;return!!(!((t=n.pasteMimeTypes)===null||t===void 0)&&t.some(i=>e.matches(i)))}var Z7=globalThis&&globalThis.__decorate||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},yy=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},Qb=globalThis&&globalThis.__awaiter||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 X7=m("builtIn","Built-in");class Q7{provideDocumentPasteEdits(e,t,i,s){return Qb(this,void 0,void 0,function*(){const o=yield this.getEdit(i,s);return o?{insertText:o.insertText,label:o.label,detail:o.detail,handledMimeType:o.handledMimeType,yieldTo:o.yieldTo}:void 0})}provideDocumentOnDropEdits(e,t,i,s){return Qb(this,void 0,void 0,function*(){const o=yield this.getEdit(i,s);return o?{insertText:o.insertText,label:o.label,handledMimeType:o.handledMimeType,yieldTo:o.yieldTo}:void 0})}}class kne extends Q7{constructor(){super(...arguments),this.id="text",this.dropMimeTypes=[wn.text],this.pasteMimeTypes=[wn.text]}getEdit(e,t){return Qb(this,void 0,void 0,function*(){const i=e.get(wn.text);if(!i||e.has(wn.uriList))return;const s=yield i.asString();return{handledMimeType:wn.text,label:m("text.label","Insert Plain Text"),detail:X7,insertText:s}})}}class Dne extends Q7{constructor(){super(...arguments),this.id="uri",this.dropMimeTypes=[wn.uriList],this.pasteMimeTypes=[wn.uriList]}getEdit(e,t){return Qb(this,void 0,void 0,function*(){const i=yield Ene(e);if(!i.length||t.isCancellationRequested)return;let s=0;const o=i.map(({uri:a,originalText:l})=>a.scheme===Nt.file?a.fsPath:(s++,l)).join(" ");let r;return s>0?r=i.length>1?m("defaultDropProvider.uriList.uris","Insert Uris"):m("defaultDropProvider.uriList.uri","Insert Uri"):r=i.length>1?m("defaultDropProvider.uriList.paths","Insert Paths"):m("defaultDropProvider.uriList.path","Insert Path"),{handledMimeType:wn.uriList,insertText:o,label:r,detail:X7}})}}let GI=class extends Q7{constructor(e){super(),this._workspaceContextService=e,this.id="relativePath",this.dropMimeTypes=[wn.uriList],this.pasteMimeTypes=[wn.uriList]}getEdit(e,t){return Qb(this,void 0,void 0,function*(){const i=yield Ene(e);if(!i.length||t.isCancellationRequested)return;const s=wd(i.map(({uri:o})=>{const r=this._workspaceContextService.getWorkspaceFolder(o);return r?tDe(r.uri,o):void 0}));if(s.length)return{handledMimeType:wn.uriList,insertText:s.join(" "),label:i.length>1?m("defaultDropProvider.uriList.relativePaths","Insert Relative Paths"):m("defaultDropProvider.uriList.relativePath","Insert Relative Path"),detail:X7}})}};GI=Z7([yy(0,hm)],GI);function Ene(n){return Qb(this,void 0,void 0,function*(){const e=n.get(wn.uriList);if(!e)return[];const t=yield e.asString(),i=[];for(const s of SN.parse(t))try{i.push({uri:ct.parse(s),originalText:s})}catch{}return i})}let jF=class extends te{constructor(e,t){super(),this._register(e.documentOnDropEditProvider.register("*",new kne)),this._register(e.documentOnDropEditProvider.register("*",new Dne)),this._register(e.documentOnDropEditProvider.register("*",new GI(t)))}};jF=Z7([yy(0,Ze),yy(1,hm)],jF);let KF=class extends te{constructor(e,t){super(),this._register(e.documentPasteEditProvider.register("*",new kne)),this._register(e.documentPasteEditProvider.register("*",new Dne)),this._register(e.documentPasteEditProvider.register("*",new GI(t)))}};KF=Z7([yy(0,Ze),yy(1,hm)],KF);ti(Dm.ID,Dm,0);Qx(KF);Re(new class extends fs{constructor(){super({id:Sne,precondition:Lne,kbOpts:{weight:100,primary:2137}})}runEditorCommand(n,e,t){var i;return(i=Dm.get(e))===null||i===void 0?void 0:i.changePasteType()}});De(class extends Ue{constructor(){super({id:"editor.action.pasteAs",label:m("pasteAs","Paste As..."),alias:"Paste As...",precondition:void 0,description:{description:"Paste as",args:[{name:"args",schema:{type:"object",properties:{id:{type:"string",description:m("pasteAs.id","The id of the paste edit to try applying. If not provided, the editor will show a picker.")}}}}]}})}run(n,e,t){var i;const s=typeof(t==null?void 0:t.id)=="string"?t.id:void 0;return(i=Dm.get(e))===null||i===void 0?void 0:i.pasteAs(s)}});class U5e{constructor(){this._dragOperations=new Map}removeDragOperationTransfer(e){if(e&&this._dragOperations.has(e)){const t=this._dragOperations.get(e);return this._dragOperations.delete(e),t}}}class Aj{constructor(e){this.identifier=e}}const Ine=Wt("treeViewsDndService");Gt(Ine,U5e,1);var j5e=globalThis&&globalThis.__decorate||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},pk=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},L1=globalThis&&globalThis.__awaiter||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())})},qF;const Tne="editor.experimental.dropIntoEditor.defaultProvider",xne="editor.changeDropType",Nne=new Ve("dropWidgetVisible",!1,m("dropWidgetVisible","Whether the drop widget is showing"));let Jb=qF=class extends te{static get(e){return e.getContribution(qF.ID)}constructor(e,t,i,s,o){super(),this._configService=i,this._languageFeaturesService=s,this._treeViewsDragAndDropService=o,this.treeItemsTransfer=wy.getInstance(),this._dropProgressManager=this._register(t.createInstance(jI,"dropIntoEditor",e)),this._postDropWidgetManager=this._register(t.createInstance(qI,"dropIntoEditor",e,Nne,{id:xne,label:m("postDropWidgetTitle","Show drop options...")})),this._register(e.onDropIntoEditor(r=>this.onDropIntoEditor(e,r.position,r.event)))}changeDropType(){this._postDropWidgetManager.tryShowSelector()}onDropIntoEditor(e,t,i){var s;return L1(this,void 0,void 0,function*(){if(!i.dataTransfer||!e.hasModel())return;(s=this._currentOperation)===null||s===void 0||s.cancel(),e.focus(),e.setPosition(t);const o=Xn(r=>L1(this,void 0,void 0,function*(){const a=new tg(e,1,void 0,r);try{const l=yield this.extractDataTransferData(i);if(l.size===0||a.token.isCancellationRequested)return;const c=e.getModel();if(!c)return;const d=this._languageFeaturesService.documentOnDropEditProvider.ordered(c).filter(h=>h.dropMimeTypes?h.dropMimeTypes.some(f=>l.matches(f)):!0),u=yield this.getDropEdits(d,c,t,l,a);if(a.token.isCancellationRequested)return;if(u.length){const h=this.getInitialActiveEditIndex(c,u),f=e.getOption(36).showDropSelector==="afterDrop";yield this._postDropWidgetManager.applyEditAndShowIfNeeded([I.fromPositions(t)],{activeEditIndex:h,allEdits:u},f,r)}}finally{a.dispose(),this._currentOperation===o&&(this._currentOperation=void 0)}}));this._dropProgressManager.showWhile(t,m("dropIntoEditorProgress","Running drop handlers. Click to cancel"),o),this._currentOperation=o})}getDropEdits(e,t,i,s,o){return L1(this,void 0,void 0,function*(){const r=yield ox(Promise.all(e.map(l=>L1(this,void 0,void 0,function*(){try{const c=yield l.provideDocumentOnDropEdits(t,i,s,o.token);if(c)return Object.assign(Object.assign({},c),{providerId:l.id})}catch(c){console.error(c)}}))),o.token),a=wd(r!=null?r:[]);return wne(a)})}getInitialActiveEditIndex(e,t){const i=this._configService.getValue(Tne,{resource:e.uri});for(const[s,o]of Object.entries(i)){const r=t.findIndex(a=>o===a.providerId&&a.handledMimeType&&_ne(s,[a.handledMimeType]));if(r>=0)return r}return 0}extractDataTransferData(e){return L1(this,void 0,void 0,function*(){if(!e.dataTransfer)return new mne;const t=Cne(e.dataTransfer);if(this.treeItemsTransfer.hasData(Aj.prototype)){const i=this.treeItemsTransfer.getData(Aj.prototype);if(Array.isArray(i))for(const s of i){const o=yield this._treeViewsDragAndDropService.removeDragOperationTransfer(s.identifier);if(o)for(const[r,a]of o)t.replace(r,a)}}return t})}};Jb.ID="editor.contrib.dropIntoEditorController";Jb=qF=j5e([pk(1,_t),pk(2,zt),pk(3,Ze),pk(4,Ine)],Jb);ti(Jb.ID,Jb,2);Re(new class extends fs{constructor(){super({id:xne,precondition:Nne,kbOpts:{weight:100,primary:2137}})}runEditorCommand(n,e,t){var i;(i=Jb.get(e))===null||i===void 0||i.changeDropType()}});Qx(jF);en.as(wc.Configuration).registerConfiguration(Object.assign(Object.assign({},Ax),{properties:{[Tne]:{type:"object",scope:5,description:m("defaultProviderDescription","Configures the default drop provider to use for content of a given mime type."),default:{},additionalProperties:{type:"string"}}}}));class go{constructor(e){this._editor=e,this._decorations=[],this._overviewRulerApproximateDecorations=[],this._findScopeDecorationIds=[],this._rangeHighlightDecorationId=null,this._highlightedDecorationId=null,this._startPosition=this._editor.getPosition()}dispose(){this._editor.removeDecorations(this._allDecorations()),this._decorations=[],this._overviewRulerApproximateDecorations=[],this._findScopeDecorationIds=[],this._rangeHighlightDecorationId=null,this._highlightedDecorationId=null}reset(){this._decorations=[],this._overviewRulerApproximateDecorations=[],this._findScopeDecorationIds=[],this._rangeHighlightDecorationId=null,this._highlightedDecorationId=null}getCount(){return this._decorations.length}getFindScope(){return this._findScopeDecorationIds[0]?this._editor.getModel().getDecorationRange(this._findScopeDecorationIds[0]):null}getFindScopes(){if(this._findScopeDecorationIds.length){const e=this._findScopeDecorationIds.map(t=>this._editor.getModel().getDecorationRange(t)).filter(t=>!!t);if(e.length)return e}return null}getStartPosition(){return this._startPosition}setStartPosition(e){this._startPosition=e,this.setCurrentFindMatch(null)}_getDecorationIndex(e){const t=this._decorations.indexOf(e);return t>=0?t+1:1}getDecorationRangeAt(e){const t=e{if(this._highlightedDecorationId!==null&&(s.changeDecorationOptions(this._highlightedDecorationId,go._FIND_MATCH_DECORATION),this._highlightedDecorationId=null),t!==null&&(this._highlightedDecorationId=t,s.changeDecorationOptions(this._highlightedDecorationId,go._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 I(o.startLineNumber,o.startColumn,r,a)}this._rangeHighlightDecorationId=s.addDecoration(o,go._RANGE_HIGHLIGHT_DECORATION)}}),i}set(e,t){this._editor.changeDecorations(i=>{let s=go._FIND_MATCH_DECORATION;const o=[];if(e.length>1e3){s=go._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 I(u,1,h,1),options:go._FIND_MATCH_ONLY_OVERVIEW_DECORATION}),u=p.startLineNumber,h=p.endLineNumber)}o.push({range:new I(u,1,h,1),options:go._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,go._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;rI.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 Mj(n,e,t){return n[0].indexOf(t)!==-1&&e.indexOf(t)!==-1&&n[0].split(t).length===e.split(t).length}function Rj(n,e,t){const i=e.split(t),s=n[0].split(t);let o="";return i.forEach((r,a)=>{o+=Ane([s[a]],r)+t}),o.slice(0,-1)}class Pj{constructor(e){this.staticValue=e,this.kind=0}}class q5e{constructor(e){this.pieces=e,this.kind=1}}class e0{static fromStaticValue(e){return new e0([Xp.staticValue(e)])}get hasReplacementPatterns(){return this._state.kind===1}constructor(e){!e||e.length===0?this._state=new Pj(""):e.length===1&&e[0].staticValue!==null?this._state=new Pj(e[0].staticValue):this._state=new q5e(e)}buildReplaceString(e,t){if(this._state.kind===0)return t?Ane(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("\n",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,fi(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)},Z5e)):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 I(a.startLineNumber,1,l,this._editor.getModel().getLineMaxColumn(l))}return a}));const s=this._findMatches(i,!1,df);this._decorations.set(s,i);const o=this._editor.getSelection();let r=this._decorations.getCurrentMatchesPosition(o);if(r===0&&s.length>0){const a=Ew(s.map(l=>l.range),l=>I.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 Y(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 Y(i,s)}_moveToNextMatch(e){if(!this._state.canNavigateForward()){const i=this._decorations.matchBeforePosition(e);i&&this._setCurrentFindMatch(i);return}if(this._decorations.getCount()VC._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>=df?this._largeReplaceAll():this._regularReplaceAll(e),this.research(!1)}_largeReplaceAll(){const t=new ip(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 u9(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 Je(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:He(e9),inputActiveOptionForeground:He(t9),inputActiveOptionBackground:He(Ip)};this.caseSensitive=this._register(new Vee(Object.assign({appendTitle:this._keybindingLabelFor(Ai.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 Hee(Object.assign({appendTitle:this._keybindingLabelFor(Ai.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 $ee(Object.assign({appendTitle:this._keybindingLabelFor(Ai.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(ce(this._domNode,Pe.MOUSE_LEAVE,o=>this._onMouseLeave())),this._register(ce(this._domNode,"mouseover",o=>this._onMouseOver()))}_keybindingLabelFor(e){const t=this._keybindingService.lookupKeybinding(e);return t?" (".concat(t.getLabel(),")"):""}dispose(){this._editor.removeOverlayWidget(this),super.dispose()}getId(){return DN.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")}}DN.ID="editor.contrib.findOptionsWidget";function wk(n,e){return n===1?!0:n===2?!1:e}class X5e extends te{get searchString(){return this._searchString}get replaceString(){return this._replaceString}get isRevealed(){return this._isRevealed}get isReplaceRevealed(){return this._isReplaceRevealed}get isRegex(){return wk(this._isRegexOverride,this._isRegex)}get wholeWord(){return wk(this._wholeWordOverride,this._wholeWord)}get matchCase(){return wk(this._matchCaseOverride,this._matchCase)}get preserveCase(){return wk(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 j),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"&&(I.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=>!I.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=df}}const Q5e=m("defaultLabel","input"),J5e=m("label.preserveCaseToggle","Preserve Case");class e3e extends M0{constructor(e){super({icon:Me.preserveCase,title:J5e+e.appendTitle,isChecked:e.isChecked,inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class t3e extends vl{constructor(e,t,i,s){super(),this._showOptionButtons=i,this.fixFocusOnOptionClickEnabled=!0,this.cachedOptionsWidth=0,this._onDidOptionChange=this._register(new j),this.onDidOptionChange=this._onDidOptionChange.event,this._onKeyDown=this._register(new j),this.onKeyDown=this._onKeyDown.event,this._onMouseDown=this._register(new j),this._onInput=this._register(new j),this._onKeyUp=this._register(new j),this._onPreserveCaseKeyDown=this._register(new j),this.onPreserveCaseKeyDown=this._onPreserveCaseKeyDown.event,this.contextViewProvider=t,this.placeholder=s.placeholder||"",this.validation=s.validation,this.label=s.label||Q5e;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 zee(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 e3e(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(),xt.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 Mne=globalThis&&globalThis.__decorate||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},Rne=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};const e6=new Ve("suggestWidgetVisible",!1,m("suggestWidgetVisible","Whether suggestion are visible")),t6="historyNavigationWidgetFocus",Pne="historyNavigationForwardsEnabled",One="historyNavigationBackwardsEnabled";let Hu;const yk=[];function Fne(n,e){if(yk.includes(e))throw new Error("Cannot register the same widget multiple times");yk.push(e);const t=new be,i=new Ve(t6,!1).bindTo(n),s=new Ve(Pne,!0).bindTo(n),o=new Ve(One,!0).bindTo(n),r=()=>{i.set(!0),Hu=e},a=()=>{i.set(!1),Hu===e&&(Hu=void 0)};return e.element===document.activeElement&&r(),t.add(e.onDidFocus(()=>r())),t.add(e.onDidBlur(()=>a())),t.add(vt(()=>{yk.splice(yk.indexOf(e),1),a()})),{historyNavigationForwardsEnablement:s,historyNavigationBackwardsEnablement:o,dispose(){t.dispose()}}}let GF=class extends Uee{constructor(e,t,i,s){super(e,t,i);const o=this._register(s.createScoped(this.inputBox.element));this._register(Fne(o,this.inputBox))}};GF=Mne([Rne(3,bt)],GF);let YF=class extends t3e{constructor(e,t,i,s,o=!1){super(e,t,o,i);const r=this._register(s.createScoped(this.inputBox.element));this._register(Fne(r,this.inputBox))}};YF=Mne([Rne(3,bt)],YF);er.registerCommandAndKeybindingRule({id:"history.showPrevious",weight:200,when:fe.and(fe.has(t6),fe.equals(One,!0),fe.not("isComposing"),e6.isEqualTo(!1)),primary:16,secondary:[528],handler:n=>{Hu==null||Hu.showPreviousValue()}});er.registerCommandAndKeybindingRule({id:"history.showNext",weight:200,when:fe.and(fe.has(t6),fe.equals(Pne,!0),fe.not("isComposing"),e6.isEqualTo(!1)),primary:18,secondary:[530],handler:n=>{Hu==null||Hu.showNextValue()}});function Oj(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 i3e=globalThis&&globalThis.__awaiter||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 n3e=Sn("find-selection",Me.selection,m("findSelectionIcon","Icon for 'Find in Selection' in the editor find widget.")),Fj=Sn("find-collapsed",Me.chevronRight,m("findCollapsedIcon","Icon to indicate that the editor find widget is collapsed.")),Bj=Sn("find-expanded",Me.chevronDown,m("findExpandedIcon","Icon to indicate that the editor find widget is expanded.")),s3e=Sn("find-replace",Me.replace,m("findReplaceIcon","Icon for 'Replace' in the editor find widget.")),o3e=Sn("find-replace-all",Me.replaceAll,m("findReplaceAllIcon","Icon for 'Replace All' in the editor find widget.")),r3e=Sn("find-previous-match",Me.arrowUp,m("findPreviousMatchIcon","Icon for 'Find Previous' in the editor find widget.")),a3e=Sn("find-next-match",Me.arrowDown,m("findNextMatchIcon","Icon for 'Find Next' in the editor find widget.")),l3e=m("label.findDialog","Find / Replace"),c3e=m("label.find","Find"),d3e=m("placeholder.find","Find"),u3e=m("label.previousMatchButton","Previous Match"),h3e=m("label.nextMatchButton","Next Match"),f3e=m("label.toggleSelectionFind","Find in Selection"),g3e=m("label.closeButton","Close"),p3e=m("label.replace","Replace"),m3e=m("placeholder.replace","Replace"),_3e=m("label.replaceButton","Replace"),v3e=m("label.replaceAllButton","Replace All"),b3e=m("label.toggleReplaceButton","Toggle Replace"),C3e=m("title.matchesCountLimit","Only the first {0} results are highlighted, but all find operations work on the entire text.",df),w3e=m("label.matchesLocation","{0} of {1}"),Wj=m("label.noResults","No results"),Tc=419,y3e=275,S3e=y3e-54;let k1=69;const L3e=33,Vj="ctrlEnterReplaceAll.windows.donotask",Hj=Kt?256:2048;class TR{constructor(e){this.afterLineNumber=e,this.heightInPx=L3e,this.suppressMouseDown=!1,this.domNode=document.createElement("div"),this.domNode.className="dock-find-viewzone"}}function $j(n,e,t){const i=!!e.match(/\n/);if(t&&i&&t.selectionStart>0){n.stopPropagation();return}}function zj(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 TR(0),this._showViewZone()),!h&&this._viewZone&&this._removeViewZone()}})),this.updateAccessibilitySupport(),this._register(this._codeEditor.onDidChangeCursorSelection(()=>{this._isVisible&&this._updateToggleSelectionFindButton()})),this._register(this._codeEditor.onDidFocusEditorWidget(()=>i3e(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=kN.bindTo(r),this._findFocusTracker=this._register(Ld(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=J7.bindTo(r),this._replaceFocusTracker=this._register(Ld(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 TR(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 EN.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=Ko(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,Dt)}_updateHistory(){this._state.searchString&&this._findInput.inputBox.addToHistory(),this._state.replaceString&&this._replaceInput.inputBox.addToHistory()}_updateMatchesCount(){this._matchesCount.style.minWidth=k1+"px",this._state.matchesCount>=df?this._matchesCount.title=C3e: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>=df&&(t+="+");let i=String(this._state.matchesPosition);i==="0"&&(i="?"),e=sm(w3e,i,t)}else e=Wj;this._matchesCount.appendChild(document.createTextNode(e)),to(this._getAriaLabel(e,this._state.currentMatch,this._state.searchString)),k1=Math.max(k1,this._matchesCount.clientWidth)}_getAriaLabel(e,t,i){if(e===Wj)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();if(o&&t.startLineNumber<=o.getLineCount()&&t.startLineNumber>=1){const r=o.getLineContent(t.startLineNumber);return"".concat(r,", ").concat(s)}return 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=Un(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=ZX(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 TR(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||!O8(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&&Ko(this._domNode)>Tc){this._domNode.style.maxWidth="".concat(i-28-s-15,"px"),this._replaceInput.width=Ko(this._findInput.domNode);return}if(Tc+28+s>=i&&(r=!0),Tc+28+s-k1>=i&&(a=!0),Tc+28+s-k1>=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="".concat(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=Ko(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="".concat(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&&!I.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(Hj|3))if(this._keybindingService.dispatchEvent(e,e.target)){e.preventDefault();return}else{this._findInput.inputBox.insertAtCursor("\n"),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 $j(e,this._findInput.getValue(),this._findInput.domNode.querySelector("textarea"));if(e.equals(18))return zj(e,this._findInput.getValue(),this._findInput.domNode.querySelector("textarea"))}_onReplaceInputKeyDown(e){if(e.equals(Hj|3))if(this._keybindingService.dispatchEvent(e,e.target)){e.preventDefault();return}else{zs&&nc&&!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(Vj,!0,0,0)),this._replaceInput.inputBox.insertAtCursor("\n"),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 $j(e,this._replaceInput.inputBox.value,this._replaceInput.inputBox.element.querySelector("textarea"));if(e.equals(18))return zj(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?" (".concat(t.getLabel(),")"):""}_buildDomNode(){this._findInput=this._register(new GF(null,this._contextViewProvider,{width:S3e,label:c3e,placeholder:d3e,appendCaseSensitiveLabel:this._keybindingLabelFor(Ai.ToggleCaseSensitiveCommand),appendWholeWordsLabel:this._keybindingLabelFor(Ai.ToggleWholeWordCommand),appendRegexLabel:this._keybindingLabelFor(Ai.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:()=>Oj(this._keybindingService),inputBoxStyles:cI,toggleStyles:lI},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()})),Co&&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 P_({label:u3e+this._keybindingLabelFor(Ai.PreviousMatchFindAction),icon:r3e,onTrigger:()=>{kp(this._codeEditor.getAction(Ai.PreviousMatchFindAction)).run().then(void 0,Dt)}})),this._nextBtn=this._register(new P_({label:h3e+this._keybindingLabelFor(Ai.NextMatchFindAction),icon:a3e,onTrigger:()=>{kp(this._codeEditor.getAction(Ai.NextMatchFindAction)).run().then(void 0,Dt)}}));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 M0({icon:n3e,title:f3e+this._keybindingLabelFor(Ai.ToggleSearchScopeCommand),isChecked:!1,inputActiveOptionBackground:He(Ip),inputActiveOptionBorder:He(e9),inputActiveOptionForeground:He(t9)})),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 P_({label:g3e+this._keybindingLabelFor(Ai.CloseFindWidgetCommand),icon:fte,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 YF(null,void 0,{label:p3e,placeholder:m3e,appendPreserveCaseLabel:this._keybindingLabelFor(Ai.TogglePreserveCaseCommand),history:[],flexibleHeight:!0,flexibleWidth:!0,flexibleMaxHeight:118,showHistoryHint:()=>Oj(this._keybindingService),inputBoxStyles:cI,toggleStyles:lI},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 P_({label:_3e+this._keybindingLabelFor(Ai.ReplaceOneAction),icon:s3e,onTrigger:()=>{this._controller.replace()},onKeyDown:l=>{l.equals(1026)&&(this._closeBtn.focus(),l.preventDefault())}})),this._replaceAllBtn=this._register(new P_({label:v3e+this._keybindingLabelFor(Ai.ReplaceAllAction),icon:o3e,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 P_({label:b3e,className:"codicon toggle left",onTrigger:()=>{this._state.change({isReplaceRevealed:!this._isReplaceVisible},!1),this._isReplaceVisible&&(this._replaceInput.width=Ko(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=l3e,this._domNode.role="dialog",this._domNode.style.width="".concat(Tc,"px"),this._domNode.appendChild(this._toggleReplaceBtn.domNode),this._domNode.appendChild(i),this._domNode.appendChild(this._closeBtn.domNode),this._domNode.appendChild(o),this._resizeSash=new qs(this._domNode,this,{orientation:0,size:2}),this._resized=!1;let a=Tc;this._register(this._resizeSash.onDidStart(()=>{a=Ko(this._domNode)})),this._register(this._resizeSash.onDidChange(l=>{this._resized=!0;const c=a+l.startX-l.currentX;if(cd||(this._domNode.style.width="".concat(c,"px"),this._isReplaceVisible&&(this._replaceInput.width=Ko(this._findInput.domNode)),this._findInput.inputBox.layout(),this._tryUpdateHeight())})),this._register(this._resizeSash.onDidReset(()=>{const l=Ko(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(...dt.asClassNameArray(Fj)),this._domNode.classList.add(...dt.asClassNameArray(Bj))):(this._domNode.classList.remove(...dt.asClassNameArray(Bj)),this._domNode.classList.add(...dt.asClassNameArray(Fj)))}}bl((n,e)=>{const t=(p,_)=>{_&&e.addRule(".monaco-editor ".concat(p," { background-color: ").concat(_,"; }"))};t(".findMatch",n.getColor(ld)),t(".currentFindMatch",n.getColor($we)),t(".findScope",n.getColor(zwe));const i=n.getColor(un);t(".find-widget",i);const s=n.getColor(nd);s&&e.addRule(".monaco-editor .find-widget { box-shadow: 0 0 8px 2px ".concat(s,"; }"));const o=n.getColor(J8);o&&e.addRule(".monaco-editor .find-widget { border-left: 1px solid ".concat(o,"; border-right: 1px solid ").concat(o,"; border-bottom: 1px solid ").concat(o,"; }"));const r=n.getColor(tf);r&&e.addRule(".monaco-editor .findMatch { border: 1px ".concat(ac(n.type)?"dotted":"solid"," ").concat(r,"; box-sizing: border-box; }"));const a=n.getColor(Uwe);a&&e.addRule(".monaco-editor .currentFindMatch { border: 2px solid ".concat(a,"; padding: 1px; box-sizing: border-box; }"));const l=n.getColor(jwe);l&&e.addRule(".monaco-editor .findScope { border: 1px ".concat(ac(n.type)?"dashed":"solid"," ").concat(l,"; }"));const c=n.getColor($t);c&&e.addRule(".monaco-editor .find-widget { border: 1px solid ".concat(c,"; }"));const d=n.getColor(rd);d&&e.addRule(".monaco-editor .find-widget { color: ".concat(d,"; }"));const u=n.getColor(uwe);u&&e.addRule(".monaco-editor .find-widget.no-results .matchesCount { color: ".concat(u,"; }"));const h=n.getColor(Mwe);if(h)e.addRule(".monaco-editor .find-widget .monaco-sash { background-color: ".concat(h,"; }"));else{const p=n.getColor(ad);p&&e.addRule(".monaco-editor .find-widget .monaco-sash { background-color: ".concat(p,"; }"))}const f=n.getColor(uO);f&&e.addRule("\n .monaco-editor .find-widget .button:not(.disabled):hover,\n .monaco-editor .find-widget .codicon-find-selection:hover {\n background-color: ".concat(f," !important;\n }\n "));const g=n.getColor(zr);g&&e.addRule(".monaco-editor .find-widget .monaco-inputbox.synthetic-focus { outline-color: ".concat(g,"; }"))});var Bne=globalThis&&globalThis.__decorate||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},Wl=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},Em=globalThis&&globalThis.__awaiter||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())})},ZF;const k3e=524288;function XF(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!!kN.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=Xr(e)),this._state.change({searchString:e},!1)}highlightFindOptions(e=!1){}_start(e,t){return Em(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=XF(this._editor,e.seedSearchStringFromSelection,e.seedSearchStringFromNonEmptySelection);s&&(this._state.isRegex?i.searchString=Xr(s):i.searchString=s)}else if(e.seedSearchStringFromSelection==="multiple"&&!e.updateSearchScope){const s=XF(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 VC(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 Em(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)}};Oo.ID="editor.contrib.findController";Oo=ZF=Bne([Wl(1,bt),Wl(2,yl),Wl(3,ch),Wl(4,Nn)],Oo);let QF=class extends Oo{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 Em(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 EN(this._editor,this,this._state,this._contextViewService,this._keybindingService,this._contextKeyService,this._themeService,this._storageService,this._notificationService)),this._findOptionsWidget=this._register(new DN(this._editor,this._state,this._keybindingService))}};QF=Bne([Wl(1,rh),Wl(2,bt),Wl(3,Di),Wl(4,os),Wl(5,Nn),Wl(6,yl),Wl(7,ch)],QF);const D3e=sQ(new nQ({id:Ai.StartFindAction,label:m("startFindAction","Find"),alias:"Find",precondition:fe.or(O.focus,fe.has("editorIsOpen")),kbOpts:{kbExpr:null,primary:2084,weight:100},menuOpts:{menuId:M.MenubarEditMenu,group:"3_find",title:m({key:"miFind",comment:["&& denotes a mnemonic"]},"&&Find"),order:1}}));D3e.addImplementation(0,(n,e,t)=>{const i=Oo.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 E3e={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.\nThe flag will not be saved for the future.\n0: Do Nothing\n1: True\n2: False')},wholeWord:{type:"boolean"},wholeWordOverride:{type:"number",description:m("actions.find.wholeWordOverride",'Overrides "Match Whole Word" flag.\nThe flag will not be saved for the future.\n0: Do Nothing\n1: True\n2: False')},matchCase:{type:"boolean"},matchCaseOverride:{type:"number",description:m("actions.find.matchCaseOverride",'Overrides "Math Case" flag.\nThe flag will not be saved for the future.\n0: Do Nothing\n1: True\n2: False')},preserveCase:{type:"boolean"},preserveCaseOverride:{type:"number",description:m("actions.find.preserveCaseOverride",'Overrides "Preserve Case" flag.\nThe flag will not be saved for the future.\n0: Do Nothing\n1: True\n2: False')},findInSelection:{type:"boolean"}}}}]};class I3e extends Ue{constructor(){super({id:Ai.StartFindWithArgs,label:m("startFindWithArgsAction","Find With Arguments"),alias:"Find With Arguments",precondition:void 0,kbOpts:{kbExpr:null,primary:0,weight:100},description:E3e})}run(e,t,i){return Em(this,void 0,void 0,function*(){const s=Oo.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 T3e extends Ue{constructor(){super({id:Ai.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 Em(this,void 0,void 0,function*(){const i=Oo.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 Wne extends Ue{run(e,t){return Em(this,void 0,void 0,function*(){const i=Oo.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 x3e extends Wne{constructor(){super({id:Ai.NextMatchFindAction,label:m("findNextMatchAction","Find Next"),alias:"Find Next",precondition:void 0,kbOpts:[{kbExpr:O.focus,primary:61,mac:{primary:2085,secondary:[61]},weight:100},{kbExpr:fe.and(O.focus,kN),primary:3,weight:100}]})}_run(e){return e.moveToNextMatch()?(e.editor.pushUndoStop(),!0):!1}}class N3e extends Wne{constructor(){super({id:Ai.PreviousMatchFindAction,label:m("findPreviousMatchAction","Find Previous"),alias:"Find Previous",precondition:void 0,kbOpts:[{kbExpr:O.focus,primary:1085,mac:{primary:3109,secondary:[1085]},weight:100},{kbExpr:fe.and(O.focus,kN),primary:1027,weight:100}]})}_run(e){return e.moveToPrevMatch()}}class A3e extends Ue{constructor(){super({id:Ai.GoToMatchFindAction,label:m("findMatchAction.goToMatch","Go to Match..."),alias:"Go to Match...",precondition:dh}),this._highlightDecorations=[]}run(e,t,i){const s=Oo.get(t);if(!s)return;const o=s.getState().matchesCount;if(o<1){e.get(Nn).notify({severity:xx.Warning,message:m("findMatchAction.noResults","No matches. Try searching for something else.")});return}const a=e.get(yc).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(rJ),position:Qr.Full}}}])})}}class Vne extends Ue{run(e,t){return Em(this,void 0,void 0,function*(){const i=Oo.get(t);if(!i)return;const s=XF(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 M3e extends Vne{constructor(){super({id:Ai.NextSelectionMatchFindAction,label:m("nextSelectionMatchFindAction","Find Next Selection"),alias:"Find Next Selection",precondition:void 0,kbOpts:{kbExpr:O.focus,primary:2109,weight:100}})}_run(e){return e.moveToNextMatch()}}class R3e extends Vne{constructor(){super({id:Ai.PreviousSelectionMatchFindAction,label:m("previousSelectionMatchFindAction","Find Previous Selection"),alias:"Find Previous Selection",precondition:void 0,kbOpts:{kbExpr:O.focus,primary:3133,weight:100}})}_run(e){return e.moveToPrevMatch()}}const P3e=sQ(new nQ({id:Ai.StartFindReplaceAction,label:m("startReplace","Replace"),alias:"Replace",precondition:fe.or(O.focus,fe.has("editorIsOpen")),kbOpts:{kbExpr:null,primary:2086,mac:{primary:2596},weight:100},menuOpts:{menuId:M.MenubarEditMenu,group:"3_find",title:m({key:"miReplace",comment:["&& denotes a mnemonic"]},"&&Replace"),order:2}}));P3e.addImplementation(0,(n,e,t)=>{if(!e.hasModel()||e.getOption(90))return!1;const i=Oo.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})});ti(Oo.ID,QF,0);De(I3e);De(T3e);De(x3e);De(N3e);De(A3e);De(M3e);De(R3e);const Sc=fs.bindToContribution(Oo.get);Re(new Sc({id:Ai.CloseFindWidgetCommand,precondition:dh,handler:n=>n.closeFindWidget(),kbOpts:{weight:100+5,kbExpr:fe.and(O.focus,fe.not("isComposing")),primary:9,secondary:[1033]}}));Re(new Sc({id:Ai.ToggleCaseSensitiveCommand,precondition:void 0,handler:n=>n.toggleCaseSensitive(),kbOpts:{weight:100+5,kbExpr:O.focus,primary:mk.primary,mac:mk.mac,win:mk.win,linux:mk.linux}}));Re(new Sc({id:Ai.ToggleWholeWordCommand,precondition:void 0,handler:n=>n.toggleWholeWords(),kbOpts:{weight:100+5,kbExpr:O.focus,primary:_k.primary,mac:_k.mac,win:_k.win,linux:_k.linux}}));Re(new Sc({id:Ai.ToggleRegexCommand,precondition:void 0,handler:n=>n.toggleRegex(),kbOpts:{weight:100+5,kbExpr:O.focus,primary:vk.primary,mac:vk.mac,win:vk.win,linux:vk.linux}}));Re(new Sc({id:Ai.ToggleSearchScopeCommand,precondition:void 0,handler:n=>n.toggleSearchScope(),kbOpts:{weight:100+5,kbExpr:O.focus,primary:bk.primary,mac:bk.mac,win:bk.win,linux:bk.linux}}));Re(new Sc({id:Ai.TogglePreserveCaseCommand,precondition:void 0,handler:n=>n.togglePreserveCase(),kbOpts:{weight:100+5,kbExpr:O.focus,primary:Ck.primary,mac:Ck.mac,win:Ck.win,linux:Ck.linux}}));Re(new Sc({id:Ai.ReplaceOneAction,precondition:dh,handler:n=>n.replace(),kbOpts:{weight:100+5,kbExpr:O.focus,primary:3094}}));Re(new Sc({id:Ai.ReplaceOneAction,precondition:dh,handler:n=>n.replace(),kbOpts:{weight:100+5,kbExpr:fe.and(O.focus,J7),primary:3}}));Re(new Sc({id:Ai.ReplaceAllAction,precondition:dh,handler:n=>n.replaceAll(),kbOpts:{weight:100+5,kbExpr:O.focus,primary:2563}}));Re(new Sc({id:Ai.ReplaceAllAction,precondition:dh,handler:n=>n.replaceAll(),kbOpts:{weight:100+5,kbExpr:fe.and(O.focus,J7),primary:void 0,mac:{primary:2051}}}));Re(new Sc({id:Ai.SelectAllMatchesAction,precondition:dh,handler:n=>n.selectAllMatches(),kbOpts:{weight:100+5,kbExpr:O.focus,primary:515}}));const O3e={0:" ",1:"u",2:"r"},Uj=65535,Vl=16777215,jj=4278190080;class xR{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<Uj)throw new Error("invalid startIndexes or endIndexes size");this._startIndexes=e,this._endIndexes=t,this._collapseStates=new xR(e.length),this._userDefinedStates=new xR(e.length),this._recoveredStates=new xR(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;iVl||r>Vl)throw new Error("startLineNumber or endLineNumber must not exceed "+Vl);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]&Vl}getEndLineNumber(e){return this._endIndexes[e]&Vl}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]&jj)>>>16);return t===Uj?-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 F3e{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 B3e{get regions(){return this._regions}get textModel(){return this._textModel}constructor(e,t){this._updateEventEmitter=new j,this.onDidChange=this._updateEventEmitter.event,this._textModel=e,this._decorationProvider=t,this._regions=new Or(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=Or.sanitizeAndMerge(this._regions,s,o);this.updatePost(Or.fromFoldRanges(r))}_getLinesChecksum(e,t){return SQ(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 W3e(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 V3e(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 zne(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 i6(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 n6(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 H3e(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 $3e(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 z3e(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||Xf(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 Kj(this._hiddenRanges,e)!==null}adjustSelections(e){let t=!1;const i=this._foldingModel.textModel;let s=null;const o=r=>((!s||!j3e(r,s))&&(s=Kj(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 j3e(n,e){return n>=e.startLineNumber&&n<=e.endLineNumber}function Kj(n,e){const t=Ew(n,i=>e=0&&n[t].endLineNumber>=e?n[t]:null}const K3e=5e3,q3e="indent";class s6{constructor(e,t,i){this.editorModel=e,this.languageConfigurationService=t,this.foldingRangesLimit=i,this.id=q3e}dispose(){}compute(e){const t=this.languageConfigurationService.getLanguageConfiguration(this.editorModel.getLanguageId()).foldingRules,i=t&&!!t.offSide,s=t&&t.markers;return Promise.resolve(Z3e(this.editorModel,i,s,this.foldingRangesLimit))}}let G3e=class{constructor(e){this._startIndexes=[],this._endIndexes=[],this._indentOccurrences=[],this._length=0,this._foldingRangesLimit=e}insertFirst(e,t,i){if(e>Vl||t>Vl)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 Or(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=kx(u,o);(h{}};function Z3e(n,e,t,i=Y3e){const s=n.getOptions().tabSize,o=new G3e(i);let r;t&&(r=new RegExp("(".concat(t.start.source,")|(?:").concat(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=kx(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 X3e=F("editor.foldBackground",{light:nt(ef,.3),dark:nt(ef,.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);F("editorGutter.foldingControlForeground",{dark:Jh,light:Jh,hcDark:Jh,hcLight:Jh},m("editorGutter.foldingControlForeground","Color of the folding control in the editor gutter."));const IN=Sn("folding-expanded",Me.chevronDown,m("foldingExpandedIcon","Icon for expanded ranges in the editor glyph margin.")),TN=Sn("folding-collapsed",Me.chevronRight,m("foldingCollapsedIcon","Icon for collapsed ranges in the editor glyph margin.")),Une=Sn("folding-manual-collapsed",TN,m("foldingManualCollapedIcon","Icon for manually collapsed ranges in the editor glyph margin.")),jne=Sn("folding-manual-expanded",IN,m("foldingManualExpandedIcon","Icon for manually expanded ranges in the editor glyph margin.")),o6={color:sn(X3e),position:yr.Inline};class An{constructor(e){this.editor=e,this.showFoldingControls="mouseover",this.showFoldingHighlights=!0}getDecorationOption(e,t,i){return t?An.HIDDEN_RANGE_DECORATION:this.showFoldingControls==="never"?e?this.showFoldingHighlights?An.NO_CONTROLS_COLLAPSED_HIGHLIGHTED_RANGE_DECORATION:An.NO_CONTROLS_COLLAPSED_RANGE_DECORATION:An.NO_CONTROLS_EXPANDED_RANGE_DECORATION:e?i?this.showFoldingHighlights?An.MANUALLY_COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION:An.MANUALLY_COLLAPSED_VISUAL_DECORATION:this.showFoldingHighlights?An.COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION:An.COLLAPSED_VISUAL_DECORATION:this.showFoldingControls==="mouseover"?i?An.MANUALLY_EXPANDED_AUTO_HIDE_VISUAL_DECORATION:An.EXPANDED_AUTO_HIDE_VISUAL_DECORATION:i?An.MANUALLY_EXPANDED_VISUAL_DECORATION:An.EXPANDED_VISUAL_DECORATION}changeDecorations(e){return this.editor.changeDecorations(e)}removeDecorations(e){this.editor.removeDecorations(e)}}An.COLLAPSED_VISUAL_DECORATION=kt.register({description:"folding-collapsed-visual-decoration",stickiness:0,afterContentClassName:"inline-folded",isWholeLine:!0,firstLineDecorationClassName:dt.asClassName(TN)});An.COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION=kt.register({description:"folding-collapsed-highlighted-visual-decoration",stickiness:0,afterContentClassName:"inline-folded",className:"folded-background",minimap:o6,isWholeLine:!0,firstLineDecorationClassName:dt.asClassName(TN)});An.MANUALLY_COLLAPSED_VISUAL_DECORATION=kt.register({description:"folding-manually-collapsed-visual-decoration",stickiness:0,afterContentClassName:"inline-folded",isWholeLine:!0,firstLineDecorationClassName:dt.asClassName(Une)});An.MANUALLY_COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION=kt.register({description:"folding-manually-collapsed-highlighted-visual-decoration",stickiness:0,afterContentClassName:"inline-folded",className:"folded-background",minimap:o6,isWholeLine:!0,firstLineDecorationClassName:dt.asClassName(Une)});An.NO_CONTROLS_COLLAPSED_RANGE_DECORATION=kt.register({description:"folding-no-controls-range-decoration",stickiness:0,afterContentClassName:"inline-folded",isWholeLine:!0});An.NO_CONTROLS_COLLAPSED_HIGHLIGHTED_RANGE_DECORATION=kt.register({description:"folding-no-controls-range-decoration",stickiness:0,afterContentClassName:"inline-folded",className:"folded-background",minimap:o6,isWholeLine:!0});An.EXPANDED_VISUAL_DECORATION=kt.register({description:"folding-expanded-visual-decoration",stickiness:1,isWholeLine:!0,firstLineDecorationClassName:"alwaysShowFoldIcons "+dt.asClassName(IN)});An.EXPANDED_AUTO_HIDE_VISUAL_DECORATION=kt.register({description:"folding-expanded-auto-hide-visual-decoration",stickiness:1,isWholeLine:!0,firstLineDecorationClassName:dt.asClassName(IN)});An.MANUALLY_EXPANDED_VISUAL_DECORATION=kt.register({description:"folding-manually-expanded-visual-decoration",stickiness:0,isWholeLine:!0,firstLineDecorationClassName:"alwaysShowFoldIcons "+dt.asClassName(jne)});An.MANUALLY_EXPANDED_AUTO_HIDE_VISUAL_DECORATION=kt.register({description:"folding-manually-expanded-auto-hide-visual-decoration",stickiness:0,isWholeLine:!0,firstLineDecorationClassName:dt.asClassName(jne)});An.NO_CONTROLS_EXPANDED_RANGE_DECORATION=kt.register({description:"folding-no-controls-range-decoration",stickiness:0,isWholeLine:!0});An.HIDDEN_RANGE_DECORATION=kt.register({description:"folding-hidden-range-decoration",stickiness:1});const Q3e={},J3e="syntax";class r6{constructor(e,t,i,s,o){this.editorModel=e,this.providers=t,this.handleFoldingRangesChange=i,this.foldingRangesLimit=s,this.fallbackRangeProvider=o,this.id=J3e,this.disposables=new be,o&&this.disposables.add(o);for(const r of t)typeof r.onDidChange=="function"&&this.disposables.add(r.onDidChange(i))}compute(e){return eBe(this.providers,this.editorModel,e).then(t=>{var i,s;return t?iBe(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 eBe(n,e,t){let i=null;const s=n.map((o,r)=>Promise.resolve(o.provideFoldingRanges(e,Q3e,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})}},Bn));return Promise.all(s).then(o=>i)}class tBe{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>Vl||t>Vl)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 tBe(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 nBe=globalThis&&globalThis.__decorate||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},D1=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},sBe=globalThis&&globalThis.__awaiter||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())})},Y_;const ro=new Ve("foldingEnabled",!1);let Md=Y_=class extends te{static get(e){return e.getContribution(Y_.ID)}static getFoldingRangeProviders(e,t){var i,s;const o=e.foldingRangeProvider.ordered(t);return(s=(i=Y_._foldingRangeSelector)===null||i===void 0?void 0:i.call(Y_,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 be),this.editor=e,this._foldingLimitReporter=new Kne(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 An(e),this.foldingDecorationProvider.showFoldingControls=a.get(109),this.foldingDecorationProvider.showFoldingHighlights=a.get(45),this.foldingEnabled=ro.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 B3e(e,this.foldingDecorationProvider),this.localToDispose.add(this.foldingModel),this.hiddenRangeModel=new U3e(this.foldingModel),this.localToDispose.add(this.hiddenRangeModel),this.localToDispose.add(this.hiddenRangeModel.onDidChange(t=>this.onHiddenRangesChanges(t))),this.updateScheduler=new pl(this.updateDebounceInfo.get(e)),this.cursorChangedScheduler=new Si(()=>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 s6(e,this.languageConfigurationService,this._foldingLimitReporter);if(this.rangeProvider=t,this._useFoldingProviders&&this.foldingModel){const i=Y_.getFoldingRangeProviders(this.languageFeaturesService,e);i.length>0&&(this.rangeProvider=new r6(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 so,i=this.getRangeProvider(e.textModel),s=this.foldingRegionPromise=Xn(o=>i.compute(o));return s.then(o=>{if(o&&s===this.foldingRegionPromise){let r;if(this._foldingImportsByDefault&&!this._currentModelHasFoldedImports){const d=o.setCollapsedAllOfType(xo.Imports.value,!0);d&&(r=mc.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=>(Dt(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,Dt)}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)}};Md.ID="editor.contrib.folding";Md=Y_=nBe([D1(1,bt),D1(2,Ni),D1(3,Nn),D1(4,Va),D1(5,Ze)],Md);class Kne{constructor(e){this.editor=e,this._onDidChange=new j,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 wo extends Ue{runEditorCommand(e,t,i){const s=e.get(Ni),o=Md.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 qne(n){if(!_r(n)){if(!Io(n))return!1;const e=n;if(!_r(e.levels)&&!Hf(e.levels)||!_r(e.direction)&&!Mo(e.direction)||!_r(e.selectionLines)&&(!Array.isArray(e.selectionLines)||!e.selectionLines.every(Hf)))return!1}return!0}class oBe extends wo{constructor(){super({id:"editor.unfold",label:m("unfoldAction.label","Unfold"),alias:"Unfold",precondition:ro,kbOpts:{kbExpr:O.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:\n * 'levels': Number of levels to unfold. If not set, defaults to 1.\n * 'direction': If 'up', unfold given number of levels up otherwise unfolds down.\n * '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.\n ",constraint:qne,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"?$ne(t,!1,o,r):F0(t,!1,o,r)}}class rBe extends wo{constructor(){super({id:"editor.unfoldRecursively",label:m("unFoldRecursivelyAction.label","Unfold Recursively"),alias:"Unfold Recursively",precondition:ro,kbOpts:{kbExpr:O.editorTextFocus,primary:qn(2089,2142),weight:100}})}invoke(e,t,i,s){F0(t,!1,Number.MAX_VALUE,this.getSelectedLines(i))}}class aBe extends wo{constructor(){super({id:"editor.fold",label:m("foldAction.label","Fold"),alias:"Fold",precondition:ro,kbOpts:{kbExpr:O.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:\n * 'levels': Number of levels to fold.\n * 'direction': If 'up', folds given number of levels up otherwise folds down.\n * '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.\n If no levels or direction is set, folds the region at the locations or if already collapsed, the first uncollapsed parent instead.\n ",constraint:qne,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"?W3e(t,!0,o):a==="up"?$ne(t,!0,r||1,o):F0(t,!0,r||1,o)}}class lBe extends wo{constructor(){super({id:"editor.toggleFold",label:m("toggleFoldAction.label","Toggle Fold"),alias:"Toggle Fold",precondition:ro,kbOpts:{kbExpr:O.editorTextFocus,primary:qn(2089,2090),weight:100}})}invoke(e,t,i){const s=this.getSelectedLines(i);Hne(t,1,s)}}class cBe extends wo{constructor(){super({id:"editor.foldRecursively",label:m("foldRecursivelyAction.label","Fold Recursively"),alias:"Fold Recursively",precondition:ro,kbOpts:{kbExpr:O.editorTextFocus,primary:qn(2089,2140),weight:100}})}invoke(e,t,i){const s=this.getSelectedLines(i);F0(t,!0,Number.MAX_VALUE,s)}}class dBe extends wo{constructor(){super({id:"editor.foldAllBlockComments",label:m("foldAllBlockComments.label","Fold All Block Comments"),alias:"Fold All Block Comments",precondition:ro,kbOpts:{kbExpr:O.editorTextFocus,primary:qn(2089,2138),weight:100}})}invoke(e,t,i,s,o){if(t.regions.hasTypes())n6(t,xo.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*"+Xr(a.blockCommentStartToken));i6(t,l,!0)}}}}class uBe extends wo{constructor(){super({id:"editor.foldAllMarkerRegions",label:m("foldAllMarkerRegions.label","Fold All Regions"),alias:"Fold All Regions",precondition:ro,kbOpts:{kbExpr:O.editorTextFocus,primary:qn(2089,2077),weight:100}})}invoke(e,t,i,s,o){if(t.regions.hasTypes())n6(t,xo.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);i6(t,l,!0)}}}}class hBe extends wo{constructor(){super({id:"editor.unfoldAllMarkerRegions",label:m("unfoldAllMarkerRegions.label","Unfold All Regions"),alias:"Unfold All Regions",precondition:ro,kbOpts:{kbExpr:O.editorTextFocus,primary:qn(2089,2078),weight:100}})}invoke(e,t,i,s,o){if(t.regions.hasTypes())n6(t,xo.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);i6(t,l,!1)}}}}class fBe extends wo{constructor(){super({id:"editor.foldAllExcept",label:m("foldAllExcept.label","Fold All Except Selected"),alias:"Fold All Except Selected",precondition:ro,kbOpts:{kbExpr:O.editorTextFocus,primary:qn(2089,2136),weight:100}})}invoke(e,t,i){const s=this.getSelectedLines(i);zne(t,!0,s)}}class gBe extends wo{constructor(){super({id:"editor.unfoldAllExcept",label:m("unfoldAllExcept.label","Unfold All Except Selected"),alias:"Unfold All Except Selected",precondition:ro,kbOpts:{kbExpr:O.editorTextFocus,primary:qn(2089,2134),weight:100}})}invoke(e,t,i){const s=this.getSelectedLines(i);zne(t,!1,s)}}class pBe extends wo{constructor(){super({id:"editor.foldAll",label:m("foldAllAction.label","Fold All"),alias:"Fold All",precondition:ro,kbOpts:{kbExpr:O.editorTextFocus,primary:qn(2089,2069),weight:100}})}invoke(e,t,i){F0(t,!0)}}class mBe extends wo{constructor(){super({id:"editor.unfoldAll",label:m("unfoldAllAction.label","Unfold All"),alias:"Unfold All",precondition:ro,kbOpts:{kbExpr:O.editorTextFocus,primary:qn(2089,2088),weight:100}})}invoke(e,t,i){F0(t,!1)}}class Im extends wo{getFoldingLevel(){return parseInt(this.id.substr(Im.ID_PREFIX.length))}invoke(e,t,i){V3e(t,this.getFoldingLevel(),!0,this.getSelectedLines(i))}}Im.ID_PREFIX="editor.foldLevel";Im.ID=n=>Im.ID_PREFIX+n;class _Be extends wo{constructor(){super({id:"editor.gotoParentFold",label:m("gotoParentFold.label","Go to Parent Fold"),alias:"Go to Parent Fold",precondition:ro,kbOpts:{kbExpr:O.editorTextFocus,weight:100}})}invoke(e,t,i){const s=this.getSelectedLines(i);if(s.length>0){const o=H3e(s[0],t);o!==null&&i.setSelection({startLineNumber:o,startColumn:1,endLineNumber:o,endColumn:1})}}}class vBe extends wo{constructor(){super({id:"editor.gotoPreviousFold",label:m("gotoPreviousFold.label","Go to Previous Folding Range"),alias:"Go to Previous Folding Range",precondition:ro,kbOpts:{kbExpr:O.editorTextFocus,weight:100}})}invoke(e,t,i){const s=this.getSelectedLines(i);if(s.length>0){const o=$3e(s[0],t);o!==null&&i.setSelection({startLineNumber:o,startColumn:1,endLineNumber:o,endColumn:1})}}}class bBe extends wo{constructor(){super({id:"editor.gotoNextFold",label:m("gotoNextFold.label","Go to Next Folding Range"),alias:"Go to Next Folding Range",precondition:ro,kbOpts:{kbExpr:O.editorTextFocus,weight:100}})}invoke(e,t,i){const s=this.getSelectedLines(i);if(s.length>0){const o=z3e(s[0],t);o!==null&&i.setSelection({startLineNumber:o,startColumn:1,endLineNumber:o,endColumn:1})}}}class CBe extends wo{constructor(){super({id:"editor.createFoldingRangeFromSelection",label:m("createManualFoldRange.label","Create Folding Range from Selection"),alias:"Create Folding Range from Selection",precondition:ro,kbOpts:{kbExpr:O.editorTextFocus,primary:qn(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=Or.sanitizeAndMerge(t.regions,o,(s=i.getModel())===null||s===void 0?void 0:s.getLineCount());t.updatePost(Or.fromFoldRanges(a))}}}}class wBe extends wo{constructor(){super({id:"editor.removeManualFoldingRanges",label:m("removeManualFoldingRanges.label","Remove Manual Folding Ranges"),alias:"Remove Manual Folding Ranges",precondition:ro,kbOpts:{kbExpr:O.editorTextFocus,primary:qn(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()}}}ti(Md.ID,Md,0);De(oBe);De(rBe);De(aBe);De(cBe);De(pBe);De(mBe);De(dBe);De(uBe);De(hBe);De(fBe);De(gBe);De(lBe);De(_Be);De(vBe);De(bBe);De(CBe);De(wBe);for(let n=1;n<=7;n++)u0e(new Im({id:Im.ID(n),label:m("foldLevelAction.label","Fold Level {0}",n),alias:"Fold Level ".concat(n),precondition:ro,kbOpts:{kbExpr:O.editorTextFocus,primary:qn(2089,2048|21+n),weight:100}}));qt.registerCommand("_executeFoldingRangeProvider",function(n,...e){return sBe(this,void 0,void 0,function*(){const[t]=e;if(!(t instanceof ct))throw La();const i=n.get(Ze),s=n.get(Zi).getModel(t);if(!s)throw La();const o=n.get(zt);if(!o.getValue("editor.folding",{resource:t}))return[];const r=n.get(Ni),a=o.getValue("editor.foldingStrategy",{resource:t}),l={get limit(){return o.getValue("editor.foldingMaximumRegions",{resource:t})},update:(f,g)=>{}},c=new s6(s,r,l);let d=c;if(a!=="indentation"){const f=Md.getFoldingRangeProviders(i,s);f.length&&(d=new r6(s,f,()=>{},l,c))}const u=yield d.compute(Ft.None),h=[];try{if(u)for(let f=0;f=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},YI=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},a6=globalThis&&globalThis.__awaiter||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 Sy=class{constructor(e,t,i){this._editor=e,this._languageFeaturesService=t,this._workerService=i,this._disposables=new be,this._sessionDisposables=new be,this._disposables.add(t.onTypeFormattingEditProvider.onDidChange(this._update,this)),this._disposables.add(e.onDidChangeModel(()=>this._update())),this._disposables.add(e.onDidChangeModelLanguage(()=>this._update())),this._disposables.add(e.onDidChangeConfiguration(s=>{s.hasChanged(56)&&this._update()})),this._update()}dispose(){this._disposables.dispose(),this._sessionDisposables.dispose()}_update(){if(this._sessionDisposables.clear(),!this._editor.getOption(56)||!this._editor.hasModel())return;const e=this._editor.getModel(),[t]=this._languageFeaturesService.onTypeFormattingEditProvider.ordered(e);if(!t||!t.autoFormatTriggerCharacters)return;const i=new LE;for(const s of t.autoFormatTriggerCharacters)i.add(s.charCodeAt(0));this._sessionDisposables.add(this._editor.onDidType(s=>{const o=s.charCodeAt(s.length-1);i.has(o)&&this._trigger(String.fromCharCode(o))}))}_trigger(e){if(!this._editor.hasModel()||this._editor.getSelections().length>1||!this._editor.getSelection().isEmpty())return;const t=this._editor.getModel(),i=this._editor.getPosition(),s=new Tn,o=this._editor.onDidChangeModelContent(r=>{if(r.isFlush){s.cancel(),o.dispose();return}for(let a=0,l=r.changes.length;a{s.token.isCancellationRequested||io(r)&&(jb.execute(this._editor,r,!0),T7(r))}).finally(()=>{o.dispose()})}};Sy.ID="editor.contrib.autoFormat";Sy=Gne([YI(1,Ze),YI(2,Sl)],Sy);let Ly=class{constructor(e,t,i){this.editor=e,this._languageFeaturesService=t,this._instantiationService=i,this._callOnDispose=new be,this._callOnModel=new be,this._callOnDispose.add(e.onDidChangeConfiguration(()=>this._update())),this._callOnDispose.add(e.onDidChangeModel(()=>this._update())),this._callOnDispose.add(e.onDidChangeModelLanguage(()=>this._update())),this._callOnDispose.add(t.documentRangeFormattingEditProvider.onDidChange(this._update,this))}dispose(){this._callOnDispose.dispose(),this._callOnModel.dispose()}_update(){this._callOnModel.clear(),this.editor.getOption(55)&&this.editor.hasModel()&&this._languageFeaturesService.documentRangeFormattingEditProvider.has(this.editor.getModel())&&this._callOnModel.add(this.editor.onDidPaste(({range:e})=>this._trigger(e)))}_trigger(e){this.editor.hasModel()&&(this.editor.getSelections().length>1||this._instantiationService.invokeFunction(zte,this.editor,e,2,Fu.None,Ft.None).catch(Dt))}};Ly.ID="editor.contrib.formatOnPaste";Ly=Gne([YI(1,Ze),YI(2,_t)],Ly);class kBe extends Ue{constructor(){super({id:"editor.action.formatDocument",label:m("formatDocument.label","Format Document"),alias:"Format Document",precondition:fe.and(O.notInCompositeEditor,O.writable,O.hasDocumentFormattingProvider),kbOpts:{kbExpr:O.editorTextFocus,primary:1572,linux:{primary:3111},weight:100},contextMenuOpts:{group:"1_modification",order:1.3}})}run(e,t){return a6(this,void 0,void 0,function*(){if(t.hasModel()){const i=e.get(_t);yield e.get(Tg).showWhile(i.invokeFunction(SPe,t,1,Fu.None,Ft.None),250)}})}}class DBe extends Ue{constructor(){super({id:"editor.action.formatSelection",label:m("formatSelection.label","Format Selection"),alias:"Format Selection",precondition:fe.and(O.writable,O.hasDocumentSelectionFormattingProvider),kbOpts:{kbExpr:O.editorTextFocus,primary:qn(2089,2084),weight:100},contextMenuOpts:{when:O.hasNonEmptySelection,group:"1_modification",order:1.31}})}run(e,t){return a6(this,void 0,void 0,function*(){if(!t.hasModel())return;const i=e.get(_t),s=t.getModel(),o=t.getSelections().map(a=>a.isEmpty()?new I(a.startLineNumber,1,a.startLineNumber,s.getLineMaxColumn(a.startLineNumber)):a);yield e.get(Tg).showWhile(i.invokeFunction(zte,t,o,1,Fu.None,Ft.None),250)})}}ti(Sy.ID,Sy,2);ti(Ly.ID,Ly,2);De(kBe);De(DBe);qt.registerCommand("editor.action.format",n=>a6(void 0,void 0,void 0,function*(){const e=n.get(ai).getFocusedCodeEditor();if(!e||!e.hasModel())return;const t=n.get(gn);e.getSelection().isEmpty()?yield t.executeCommand("editor.action.formatDocument"):yield t.executeCommand("editor.action.formatSelection")}));var EBe=globalThis&&globalThis.__decorate||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},NR=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},IBe=globalThis&&globalThis.__awaiter||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 Sv{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="".concat(t.id,"/").concat(e):(i="".concat(t.id,"/").concat(e.name),t.children.get(i)!==void 0&&(i="".concat(t.id,"/").concat(e.name,"_").concat(e.range.startLineNumber,"_").concat(e.range.startColumn)));let s=i;for(let o=0;t.children.get(s)!==void 0;o++)s="".concat(i,"_").concat(o);return s}static empty(e){return e.children.size===0}}class JF extends Sv{constructor(e,t,i){super(),this.id=e,this.parent=t,this.symbol=i,this.children=new Map}}class Yne extends Sv{constructor(e,t,i,s){super(),this.id=e,this.parent=t,this.label=i,this.order=s,this.children=new Map}}class gu extends Sv{static create(e,t,i){const s=new Tn(i),o=new gu(t.uri),r=e.ordered(t),a=r.map((c,d)=>{var u;const h=Sv.findId("provider_".concat(d),o),f=new Yne(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||[])gu._makeOutlineElement(p,f);return f},g=>(Bn(g),f)).then(g=>{Sv.empty(g)?g.remove():o._groups.set(h,g)})}),l=e.onDidChange(()=>{const c=e.ordered(t);yn(c,r)||s.cancel()});return Promise.all(a).then(()=>s.token.isCancellationRequested&&!i.isCancellationRequested?gu.create(e,t,i):o._compact()).finally(()=>{s.dispose(),l.dispose(),s.dispose()})}static _makeOutlineElement(e,t){const i=Sv.findId(e,t),s=new JF(i,t,e);if(e.children)for(const o of e.children)gu._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=Pt.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 JF?e.push(t.symbol):e.push(...Pt.map(t.children.values(),i=>i.symbol));return e.sort((t,i)=>I.compareRangesUsingStarts(t.range,i.range))}asListOfDocumentSymbols(){const e=this.getTopLevelSymbols(),t=[];return gu._flattenDocumentSymbols(t,e,""),t.sort((i,s)=>Y.compare(I.getStartPosition(i.range),I.getStartPosition(s.range))||Y.compare(I.getEndPosition(s.range),I.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&&gu._flattenDocumentSymbols(e,s.children,s.name)}}const xN=Wt("IOutlineModelService");let e5=class{constructor(e,t,i){this._languageFeaturesService=e,this._disposables=new be,this._cache=new Dg(10,.7),this._debounceInformation=t.for(e.documentSymbolProvider,"DocumentSymbols",{min:350}),this._disposables.add(i.onModelRemoved(s=>{this._cache.delete(s.id)}))}dispose(){this._disposables.dispose()}getOrCreate(e,t){return IBe(this,void 0,void 0,function*(){const i=this._languageFeaturesService.documentSymbolProvider,s=i.ordered(e);let o=this._cache.get(e.id);if(!o||o.versionId!==e.getVersionId()||!yn(o.provider,s)){const a=new Tn;o={versionId:e.getVersionId(),provider:s,promiseCnt:0,source:a,promise:gu.create(i,e,a.token),model:void 0},this._cache.set(e.id,o);const l=Date.now();o.promise.then(c=>{o.model=c,this._debounceInformation.update(e,Date.now()-l)}).catch(c=>{this._cache.delete(e.id)})}if(o.model)return o.model;o.promiseCnt+=1;const r=t.onCancellationRequested(()=>{--o.promiseCnt===0&&(o.source.cancel(),this._cache.delete(e.id))});try{return yield o.promise}finally{r.dispose()}})}};e5=EBe([NR(0,Ze),NR(1,Va),NR(2,Zi)],e5);Gt(xN,e5,1);var TBe=globalThis&&globalThis.__awaiter||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())})};qt.registerCommand("_executeDocumentSymbolProvider",function(n,...e){return TBe(this,void 0,void 0,function*(){const[t]=e;bi(ct.isUri(t));const i=n.get(xN),o=yield n.get(sr).createModelReference(t);try{return(yield i.getOrCreate(o.object.textEditorModel,Ft.None)).getTopLevelSymbols()}finally{o.dispose()}})});class us extends te{constructor(e,t){super(),this.contextKeyService=e,this.model=t,this.inlineCompletionVisible=us.inlineSuggestionVisible.bindTo(this.contextKeyService),this.inlineCompletionSuggestsIndentation=us.inlineSuggestionHasIndentation.bindTo(this.contextKeyService),this.inlineCompletionSuggestsIndentationLessThanTabSize=us.inlineSuggestionHasIndentationLessThanTabSize.bindTo(this.contextKeyService),this.suppressSuggestions=us.suppressSuggestions.bindTo(this.contextKeyService),this._register(xi(i=>{const s=this.model.read(i),o=s==null?void 0:s.state.read(i),r=!!(o!=null&&o.inlineCompletion)&&(o==null?void 0:o.ghostText)!==void 0&&!(o!=null&&o.ghostText.isEmpty());this.inlineCompletionVisible.set(r),o!=null&&o.ghostText&&(o!=null&&o.inlineCompletion)&&this.suppressSuggestions.set(o.inlineCompletion.inlineCompletion.source.inlineCompletions.suppressSuggestions)})),this._register(xi(i=>{const s=this.model.read(i);let o=!1,r=!0;const a=s==null?void 0:s.ghostText.read(i);if(s!=null&&s.selectedSuggestItem&&a&&a.parts.length>0){const{column:l,lines:c}=a.parts[0],d=c[0],u=s.textModel.getLineIndentColumn(a.lineNumber);if(l<=u){let f=bo(d);f===-1&&(f=d.length-1),o=f>0;const g=s.textModel.getOptions().tabSize;r=Zn.visibleColumnFromColumn(d,f+1,g){const o=I.lift(s.range);return{startOffset:t.getOffset(o.getStartPosition()),endOffset:t.getOffset(o.getEndPosition()),text:s.text}});i.sort((s,o)=>o.startOffset-s.startOffset);for(const s of i)n=n.substring(0,s.startOffset)+s.text+n.substring(s.endOffset);return n}class NBe{constructor(e){this.lineStartOffsetByLineIdx=[],this.lineStartOffsetByLineIdx.push(0);for(let t=0;tt)throw new Rn("startColumn ".concat(e," cannot be after endColumnExclusive ").concat(t))}toRange(e){return new I(e,this.startColumn,e,this.endColumnExclusive)}equals(e){return this.startColumn===e.startColumn&&this.endColumnExclusive===e.endColumnExclusive}}function PBe(n,e){const t=new be,i=n.createDecorationsCollection();return t.add(b7({debugName:()=>"Apply decorations from ".concat(e.debugName)},s=>{const o=e.read(s);i.set(o)})),t.add({dispose:()=>{i.clear()}}),t}function t5(n,e){return new Y(n.lineNumber+e.lineNumber-1,e.lineNumber===1?n.column+e.column-1:e.column)}function i5(n){let e=1,t=1;for(const i of n)i==="\n"?(e++,t=1):t++;return new Y(e,t)}class ZI{constructor(e,t){this.lineNumber=e,this.parts=t}equals(e){return this.lineNumber===e.lineNumber&&this.parts.length===e.parts.length&&this.parts.every((t,i)=>t.equals(e.parts[i]))}renderForScreenReader(e){if(this.parts.length===0)return"";const t=this.parts[this.parts.length-1],i=e.substr(0,t.column-1);return xBe(i,this.parts.map(o=>({range:{startLineNumber:1,endLineNumber:1,startColumn:o.column,endColumn:o.column},text:o.lines.join("\n")}))).substring(this.parts[0].column-1)}isEmpty(){return this.parts.every(e=>e.lines.length===0)}get lineCount(){return 1+this.parts.reduce((e,t)=>e+t.lines.length-1,0)}}class n5{constructor(e,t,i){this.column=e,this.lines=t,this.preview=i}equals(e){return this.column===e.column&&this.lines.length===e.lines.length&&this.lines.every((t,i)=>t===e.lines[i])}}class s5{constructor(e,t,i,s=0){this.lineNumber=e,this.columnRange=t,this.newLines=i,this.additionalReservedLineCount=s,this.parts=[new n5(this.columnRange.endColumnExclusive,this.newLines,!1)]}renderForScreenReader(e){return this.newLines.join("\n")}get lineCount(){return this.newLines.length}isEmpty(){return this.parts.every(e=>e.lines.length===0)}equals(e){return this.lineNumber===e.lineNumber&&this.columnRange.equals(e.columnRange)&&this.newLines.length===e.newLines.length&&this.newLines.every((t,i)=>t===e.newLines[i])&&this.additionalReservedLineCount===e.additionalReservedLineCount}}function qj(n,e){return n===e?!0:!n||!e?!1:n instanceof ZI&&e instanceof ZI||n instanceof s5&&e instanceof s5?n.equals(e):!1}var OBe=globalThis&&globalThis.__decorate||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},FBe=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};const Gj="ghost-text";let o5=class extends te{constructor(e,t,i){super(),this.editor=e,this.model=t,this.languageService=i,this.isDisposed=Pi(this,!1),this.currentTextModel=ks(this.editor.onDidChangeModel,()=>this.editor.getModel()),this.uiState=Ut(this,s=>{if(this.isDisposed.read(s))return;const o=this.currentTextModel.read(s);if(o!==this.model.targetTextModel.read(s))return;const r=this.model.ghostText.read(s);if(!r)return;const a=r instanceof s5?r.columnRange:void 0,l=[],c=[];function d(p,_){if(c.length>0){const v=c[c.length-1];_&&v.decorations.push(new br(v.content.length+1,v.content.length+1+p[0].length,_,0)),v.content+=p[0],p=p.slice(1)}for(const v of p)c.push({content:v,decorations:_?[new br(1,v.length+1,_,0)]:[]})}const u=o.getLineContent(r.lineNumber);let h,f=0;for(const p of r.parts){let _=p.lines;h===void 0?(l.push({column:p.column,text:_[0],preview:p.preview}),_=_.slice(1)):d([u.substring(f,p.column-1)],void 0),_.length>0&&(d(_,Gj),h===void 0&&p.column<=u.length&&(h=p.column)),f=p.column-1}h!==void 0&&d([u.substring(f)],void 0);const g=h!==void 0?new RBe(h,u.length+1):void 0;return{replacedRange:a,inlineTexts:l,additionalLines:c,hiddenRange:g,lineNumber:r.lineNumber,additionalReservedLineCount:this.model.minReservedLineCount.read(s),targetTextModel:o}}),this.decorations=Ut(this,s=>{const o=this.uiState.read(s);if(!o)return[];const r=[];o.replacedRange&&r.push({range:o.replacedRange.toRange(o.lineNumber),options:{inlineClassName:"inline-completion-text-to-replace",description:"GhostTextReplacement"}}),o.hiddenRange&&r.push({range:o.hiddenRange.toRange(o.lineNumber),options:{inlineClassName:"ghost-text-hidden",description:"ghost-text-hidden"}});for(const a of o.inlineTexts)r.push({range:I.fromPositions(new Y(o.lineNumber,a.column)),options:{description:Gj,after:{content:a.text,inlineClassName:a.preview?"ghost-text-decoration-preview":"ghost-text-decoration",cursorStops:Jl.Left},showIfCollapsed:!0}});return r}),this.additionalLinesWidget=this._register(new BBe(this.editor,this.languageService.languageIdCodec,Ut(s=>{const o=this.uiState.read(s);return o?{lineNumber:o.lineNumber,additionalLines:o.additionalLines,minReservedLineCount:o.additionalReservedLineCount,targetTextModel:o.targetTextModel}:void 0}))),this._register(vt(()=>{this.isDisposed.set(!0,void 0)})),this._register(PBe(this.editor,this.decorations))}ownsViewZone(e){return this.additionalLinesWidget.viewZoneId===e}};o5=OBe([FBe(2,qi)],o5);class BBe extends te{get viewZoneId(){return this._viewZoneId}constructor(e,t,i){super(),this.editor=e,this.languageIdCodec=t,this.lines=i,this._viewZoneId=void 0,this.editorOptionsChanged=Vr("editorOptionChanged",We.filter(this.editor.onDidChangeConfiguration,s=>s.hasChanged(33)||s.hasChanged(116)||s.hasChanged(98)||s.hasChanged(93)||s.hasChanged(51)||s.hasChanged(50)||s.hasChanged(66))),this._register(xi(s=>{const o=this.lines.read(s);this.editorOptionsChanged.read(s),o?this.updateLines(o.lineNumber,o.additionalLines,o.minReservedLineCount):this.clear()}))}dispose(){super.dispose(),this.clear()}clear(){this.editor.changeViewZones(e=>{this._viewZoneId&&(e.removeZone(this._viewZoneId),this._viewZoneId=void 0)})}updateLines(e,t,i){const s=this.editor.getModel();if(!s)return;const{tabSize:o}=s.getOptions();this.editor.changeViewZones(r=>{this._viewZoneId&&(r.removeZone(this._viewZoneId),this._viewZoneId=void 0);const a=Math.max(t.length,i);if(a>0){const l=document.createElement("div");WBe(l,o,t,this.editor.getOptions(),this.languageIdCodec),this._viewZoneId=r.addZone({afterLineNumber:e,heightInLines:a,domNode:l,afterColumnAffinity:1})}})}}function WBe(n,e,t,i,s){const o=i.get(33),r=i.get(116),a="none",l=i.get(93),c=i.get(51),d=i.get(50),u=i.get(66),h=new D0(1e4);h.appendString('
    ');for(let p=0,_=t.length;p<_;p++){const v=t[p],b=v.content;h.appendString('
    ');const C=cS(b),w=Cb(b),y=ts.createEmpty(b,s);gS(new Eg(d.isMonospace&&!o,d.canUseHalfwidthRightwardsArrow,b,!1,C,w,0,y,v.decorations,e,0,d.spaceWidth,d.middotWidth,d.wsmiddotWidth,r,a,l,c!==Br.OFF,null),h),h.appendString("
    ")}h.appendString("
    "),Vs(n,d);const f=h.build(),g=Yj?Yj.createHTML(f):f;n.innerHTML=g}const Yj=sh("editorGhostText",{createHTML:n=>n});function VBe(n,e){const t=new DJ,i=new IJ(t,c=>e.getLanguageConfiguration(c)),s=new EJ(new HBe([n]),i),o=bO(s,[],void 0,!0);let r="";const a=n.getLineContent();function l(c,d){if(c.kind===2)if(l(c.openingBracket,d),d=on(d,c.openingBracket.length),c.child&&(l(c.child,d),d=on(d,c.child.length)),c.closingBracket)l(c.closingBracket,d),d=on(d,c.closingBracket.length);else{const h=i.getSingleLanguageBracketTokens(c.openingBracket.languageId).findClosingTokenText(c.openingBracket.bracketIds);r+=h}else if(c.kind!==3){if(c.kind===0||c.kind===1)r+=a.substring(d,on(d,c.length));else if(c.kind===4)for(const u of c.children)l(u,d),d=on(d,u.length)}}return l(o,No),r}class HBe{constructor(e){this.lines=e,this.tokenization={getLineTokens:t=>this.lines[t-1]}}getLineCount(){return this.lines.length}getLineLength(e){return this.lines[e-1].getLineContent().length}}class Ya{constructor(){this.value="",this.pos=0}static isDigitCharacter(e){return e>=48&&e<=57}static isVariableCharacter(e){return e===95||e>=97&&e<=122||e>=65&&e<=90}text(e){this.value=e,this.pos=0}tokenText(e){return this.value.substr(e.pos,e.len)}next(){if(this.pos>=this.value.length)return{type:14,pos:this.pos,len:0};const e=this.pos;let t=0,i=this.value.charCodeAt(e),s;if(s=Ya._table[i],typeof s=="number")return this.pos+=1,{type:s,pos:e,len:1};if(Ya.isDigitCharacter(i)){s=8;do t+=1,i=this.value.charCodeAt(e+t);while(Ya.isDigitCharacter(i));return this.pos+=t,{type:s,pos:e,len:t}}if(Ya.isVariableCharacter(i)){s=9;do i=this.value.charCodeAt(e+ ++t);while(Ya.isVariableCharacter(i)||Ya.isDigitCharacter(i));return this.pos+=t,{type:s,pos:e,len:t}}s=10;do t+=1,i=this.value.charCodeAt(e+t);while(!isNaN(i)&&typeof Ya._table[i]>"u"&&!Ya.isDigitCharacter(i)&&!Ya.isVariableCharacter(i));return this.pos+=t,{type:s,pos:e,len:t}}}Ya._table={36:0,58:1,44:2,123:3,125:4,92:5,47:6,124:7,43:11,45:12,63:13};class B0{constructor(){this._children=[]}appendChild(e){return e instanceof Do&&this._children[this._children.length-1]instanceof Do?this._children[this._children.length-1].value+=e.value:(e.parent=this,this._children.push(e)),this}replace(e,t){const{parent:i}=e,s=i.children.indexOf(e),o=i.children.slice(0);o.splice(s,1,...t),i._children=o,function r(a,l){for(const c of a)c.parent=l,r(c.children,c)}(t,i)}get children(){return this._children}get rightMostDescendant(){return this._children.length>0?this._children[this._children.length-1].rightMostDescendant:this}get snippet(){let e=this;for(;;){if(!e)return;if(e instanceof jS)return e;e=e.parent}}toString(){return this.children.reduce((e,t)=>e+t.toString(),"")}len(){return 0}}class Do extends B0{constructor(e){super(),this.value=e}toString(){return this.value}len(){return this.value.length}clone(){return new Do(this.value)}}class Zne extends B0{}class pa extends Zne{static compareByIndex(e,t){return e.index===t.index?0:e.isFinalTabstop?1:t.isFinalTabstop||e.indext.index?1:0}constructor(e){super(),this.index=e}get isFinalTabstop(){return this.index===0}get choice(){return this._children.length===1&&this._children[0]instanceof W0?this._children[0]:void 0}clone(){const e=new pa(this.index);return this.transform&&(e.transform=this.transform.clone()),e._children=this.children.map(t=>t.clone()),e}}class W0 extends B0{constructor(){super(...arguments),this.options=[]}appendChild(e){return e instanceof Do&&(e.parent=this,this.options.push(e)),this}toString(){return this.options[0].value}len(){return this.options[0].len()}clone(){const e=new W0;return this.options.forEach(e.appendChild,e),e}}class l6 extends B0{constructor(){super(...arguments),this.regexp=new RegExp("")}resolve(e){const t=this;let i=!1,s=e.replace(this.regexp,function(){return i=!0,t._replace(Array.prototype.slice.call(arguments,0,-2))});return!i&&this._children.some(o=>o instanceof Hl&&!!o.elseValue)&&(s=this._replace([])),s}_replace(e){let t="";for(const i of this._children)if(i instanceof Hl){let s=e[i.index]||"";s=i.resolve(s),t+=s}else t+=i.toString();return t}toString(){return""}clone(){const e=new l6;return e.regexp=new RegExp(this.regexp.source,(this.regexp.ignoreCase?"i":"")+(this.regexp.global?"g":"")),e._children=this.children.map(t=>t.clone()),e}}class Hl extends B0{constructor(e,t,i,s){super(),this.index=e,this.shorthandName=t,this.ifValue=i,this.elseValue=s}resolve(e){return this.shorthandName==="upcase"?e?e.toLocaleUpperCase():"":this.shorthandName==="downcase"?e?e.toLocaleLowerCase():"":this.shorthandName==="capitalize"?e?e[0].toLocaleUpperCase()+e.substr(1):"":this.shorthandName==="pascalcase"?e?this._toPascalCase(e):"":this.shorthandName==="camelcase"?e?this._toCamelCase(e):"":e&&typeof this.ifValue=="string"?this.ifValue:!e&&typeof this.elseValue=="string"?this.elseValue:e||""}_toPascalCase(e){const t=e.match(/[a-z0-9]+/gi);return t?t.map(i=>i.charAt(0).toUpperCase()+i.substr(1)).join(""):e}_toCamelCase(e){const t=e.match(/[a-z0-9]+/gi);return t?t.map((i,s)=>s===0?i.charAt(0).toLowerCase()+i.substr(1):i.charAt(0).toUpperCase()+i.substr(1)).join(""):e}clone(){return new Hl(this.index,this.shorthandName,this.ifValue,this.elseValue)}}class ky extends Zne{constructor(e){super(),this.name=e}resolve(e){let t=e.resolve(this);return this.transform&&(t=this.transform.resolve(t||"")),t!==void 0?(this._children=[new Do(t)],!0):!1}clone(){const e=new ky(this.name);return this.transform&&(e.transform=this.transform.clone()),e._children=this.children.map(t=>t.clone()),e}}function Zj(n,e){const t=[...n];for(;t.length>0;){const i=t.shift();if(!e(i))break;t.unshift(...i.children)}}class jS extends B0{get placeholderInfo(){if(!this._placeholders){const e=[];let t;this.walk(function(i){return i instanceof pa&&(e.push(i),t=!t||t.indexs===e?(i=!0,!1):(t+=s.len(),!0)),i?t:-1}fullLen(e){let t=0;return Zj([e],i=>(t+=i.len(),!0)),t}enclosingPlaceholders(e){const t=[];let{parent:i}=e;for(;i;)i instanceof pa&&t.push(i),i=i.parent;return t}resolveVariables(e){return this.walk(t=>(t instanceof ky&&t.resolve(e)&&(this._placeholders=void 0),!0)),this}appendChild(e){return this._placeholders=void 0,super.appendChild(e)}replace(e,t){return this._placeholders=void 0,super.replace(e,t)}clone(){const e=new jS;return this._children=this.children.map(t=>t.clone()),e}walk(e){Zj(this.children,e)}}class t0{constructor(){this._scanner=new Ya,this._token={type:14,pos:0,len:0}}static escape(e){return e.replace(/\$|}|\\/g,"\\$&")}static guessNeedsClipboard(e){return/\${?CLIPBOARD/.test(e)}parse(e,t,i){const s=new jS;return this.parseFragment(e,s),this.ensureFinalTabstop(s,i!=null?i:!1,t!=null?t:!1),s}parseFragment(e,t){const i=t.children.length;for(this._scanner.text(e),this._token=this._scanner.next();this._parse(t););const s=new Map,o=[];t.walk(l=>(l instanceof pa&&(l.isFinalTabstop?s.set(0,void 0):!s.has(l.index)&&l.children.length>0?s.set(l.index,l.children):o.push(l)),!0));const r=(l,c)=>{const d=s.get(l.index);if(!d)return;const u=new pa(l.index);u.transform=l.transform;for(const h of d){const f=h.clone();u.appendChild(f),f instanceof pa&&s.has(f.index)&&!c.has(f.index)&&(c.add(f.index),r(f,c),c.delete(f.index))}t.replace(l,[u])},a=new Set;for(const l of o)r(l,a);return t.children.slice(i)}ensureFinalTabstop(e,t,i){(t||i&&e.placeholders.length>0)&&(e.placeholders.find(o=>o.index===0)||e.appendChild(new pa(0)))}_accept(e,t){if(e===void 0||this._token.type===e){const i=t?this._scanner.tokenText(this._token):!0;return this._token=this._scanner.next(),i}return!1}_backTo(e){return this._scanner.pos=e.pos+e.len,this._token=e,!1}_until(e){const t=this._token;for(;this._token.type!==e;){if(this._token.type===14)return!1;if(this._token.type===5){const s=this._scanner.next();if(s.type!==0&&s.type!==4&&s.type!==5)return!1}this._token=this._scanner.next()}const i=this._scanner.value.substring(t.pos,this._token.pos).replace(/\\(\$|}|\\)/g,"$1");return this._token=this._scanner.next(),i}_parse(e){return this._parseEscaped(e)||this._parseTabstopOrVariableName(e)||this._parseComplexPlaceholder(e)||this._parseComplexVariable(e)||this._parseAnything(e)}_parseEscaped(e){let t;return(t=this._accept(5,!0))?(t=this._accept(0,!0)||this._accept(4,!0)||this._accept(5,!0)||t,e.appendChild(new Do(t)),!0):!1}_parseTabstopOrVariableName(e){let t;const i=this._token;return this._accept(0)&&(t=this._accept(9,!0)||this._accept(8,!0))?(e.appendChild(/^\d+$/.test(t)?new pa(Number(t)):new ky(t)),!0):this._backTo(i)}_parseComplexPlaceholder(e){let t;const i=this._token;if(!(this._accept(0)&&this._accept(3)&&(t=this._accept(8,!0))))return this._backTo(i);const o=new pa(Number(t));if(this._accept(1))for(;;){if(this._accept(4))return e.appendChild(o),!0;if(!this._parse(o))return e.appendChild(new Do("${"+t+":")),o.children.forEach(e.appendChild,e),!0}else if(o.index>0&&this._accept(7)){const r=new W0;for(;;){if(this._parseChoiceElement(r)){if(this._accept(2))continue;if(this._accept(7)&&(o.appendChild(r),this._accept(4)))return e.appendChild(o),!0}return this._backTo(i),!1}}else return this._accept(6)?this._parseTransform(o)?(e.appendChild(o),!0):(this._backTo(i),!1):this._accept(4)?(e.appendChild(o),!0):this._backTo(i)}_parseChoiceElement(e){const t=this._token,i=[];for(;!(this._token.type===2||this._token.type===7);){let s;if((s=this._accept(5,!0))?s=this._accept(2,!0)||this._accept(7,!0)||this._accept(5,!0)||s:s=this._accept(void 0,!0),!s)return this._backTo(t),!1;i.push(s)}return i.length===0?(this._backTo(t),!1):(e.appendChild(new Do(i.join(""))),!0)}_parseComplexVariable(e){let t;const i=this._token;if(!(this._accept(0)&&this._accept(3)&&(t=this._accept(9,!0))))return this._backTo(i);const o=new ky(t);if(this._accept(1))for(;;){if(this._accept(4))return e.appendChild(o),!0;if(!this._parse(o))return e.appendChild(new Do("${"+t+":")),o.children.forEach(e.appendChild,e),!0}else return this._accept(6)?this._parseTransform(o)?(e.appendChild(o),!0):(this._backTo(i),!1):this._accept(4)?(e.appendChild(o),!0):this._backTo(i)}_parseTransform(e){const t=new l6;let i="",s="";for(;!this._accept(6);){let o;if(o=this._accept(5,!0)){o=this._accept(6,!0)||o,i+=o;continue}if(this._token.type!==14){i+=this._accept(void 0,!0);continue}return!1}for(;!this._accept(6);){let o;if(o=this._accept(5,!0)){o=this._accept(5,!0)||this._accept(6,!0)||o,t.appendChild(new Do(o));continue}if(!(this._parseFormatString(t)||this._parseAnything(t)))return!1}for(;!this._accept(4);){if(this._token.type!==14){s+=this._accept(void 0,!0);continue}return!1}try{t.regexp=new RegExp(i,s)}catch{return!1}return e.transform=t,!0}_parseFormatString(e){const t=this._token;if(!this._accept(0))return!1;let i=!1;this._accept(3)&&(i=!0);const s=this._accept(8,!0);if(s)if(i){if(this._accept(4))return e.appendChild(new Hl(Number(s))),!0;if(!this._accept(1))return this._backTo(t),!1}else return e.appendChild(new Hl(Number(s))),!0;else return this._backTo(t),!1;if(this._accept(6)){const o=this._accept(9,!0);return!o||!this._accept(4)?(this._backTo(t),!1):(e.appendChild(new Hl(Number(s),o)),!0)}else if(this._accept(11)){const o=this._until(4);if(o)return e.appendChild(new Hl(Number(s),void 0,o,void 0)),!0}else if(this._accept(12)){const o=this._until(4);if(o)return e.appendChild(new Hl(Number(s),void 0,void 0,o)),!0}else if(this._accept(13)){const o=this._until(1);if(o){const r=this._until(4);if(r)return e.appendChild(new Hl(Number(s),void 0,o,r)),!0}}else{const o=this._until(4);if(o)return e.appendChild(new Hl(Number(s),void 0,void 0,o)),!0}return this._backTo(t),!1}_parseAnything(e){return this._token.type!==14?(e.appendChild(new Do(this._scanner.tokenText(this._token))),this._accept(void 0),!0):!1}}var AR=globalThis&&globalThis.__awaiter||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 $Be(n,e,t,i,s=Ft.None,o){return AR(this,void 0,void 0,function*(){const r=jBe(e,t),a=n.all(t),l=new z8;for(const v of a)v.groupId&&l.add(v.groupId,v);function c(v){if(!v.yieldsToGroupIds)return[];const b=[];for(const C of v.yieldsToGroupIds||[]){const w=l.get(C);for(const y of w)b.push(y)}return b}const d=new Map,u=new Set;function h(v,b){if(b=[...b,v],u.has(v))return b;u.add(v);try{const C=c(v);for(const w of C){const y=h(w,b);if(y)return y}}finally{u.delete(v)}}function f(v){const b=d.get(v);if(b)return b;const C=h(v,[]);C&&Bn(new Error("Inline completions: cyclic yield-to dependency detected. Path: ".concat(C.map(y=>y.toString?y.toString():""+y).join(" -> "))));const w=new rx;return d.set(v,w.p),(()=>AR(this,void 0,void 0,function*(){if(!C){const y=c(v);for(const L of y){const S=yield f(L);if(S&&S.items.length>0)return}}try{return yield v.provideInlineCompletions(t,e,i,s)}catch(y){Bn(y);return}}))().then(y=>w.complete(y),y=>w.error(y)),w.p}const g=yield Promise.all(a.map(v=>AR(this,void 0,void 0,function*(){return{provider:v,completions:yield f(v)}}))),p=new Map,_=[];for(const v of g){const b=v.completions;if(!b)continue;const C=new UBe(b,v.provider);_.push(C);for(const w of b.items){const y=XI.from(w,C,r,t,o);p.set(y.hash(),y)}}return new zBe(Array.from(p.values()),new Set(p.keys()),_)})}class zBe{constructor(e,t,i){this.completions=e,this.hashs=t,this.providerResults=i}has(e){return this.hashs.has(e.hash())}dispose(){for(const e of this.providerResults)e.removeRef()}}class UBe{constructor(e,t){this.inlineCompletions=e,this.provider=t,this.refCount=1}addRef(){this.refCount++}removeRef(){this.refCount--,this.refCount===0&&this.provider.freeInlineCompletions(this.inlineCompletions)}}class XI{static from(e,t,i,s,o){let r,a,l=e.range?I.lift(e.range):i;if(typeof e.insertText=="string"){if(r=e.insertText,o&&e.completeBracketPairs){r=Xj(r,l.getStartPosition(),s,o);const c=r.length-e.insertText.length;c!==0&&(l=new I(l.startLineNumber,l.startColumn,l.endLineNumber,l.endColumn+c))}a=void 0}else if("snippet"in e.insertText){const c=e.insertText.snippet.length;if(o&&e.completeBracketPairs){e.insertText.snippet=Xj(e.insertText.snippet,l.getStartPosition(),s,o);const u=e.insertText.snippet.length-c;u!==0&&(l=new I(l.startLineNumber,l.startColumn,l.endLineNumber,l.endColumn+u))}const d=new t0().parse(e.insertText.snippet);d.children.length===1&&d.children[0]instanceof Do?(r=d.children[0].value,a=void 0):(r=d.toString(),a={snippet:e.insertText.snippet,range:l})}else tx(e.insertText);return new XI(r,e.command,l,r,a,e.additionalTextEdits||MBe(),e,t)}constructor(e,t,i,s,o,r,a,l){this.filterText=e,this.command=t,this.range=i,this.insertText=s,this.snippetInfo=o,this.additionalTextEdits=r,this.sourceInlineCompletion=a,this.source=l,e=e.replace(/\r\n|\r/g,"\n"),s=e.replace(/\r\n|\r/g,"\n")}withRange(e){return new XI(this.filterText,this.command,e,this.insertText,this.snippetInfo,this.additionalTextEdits,this.sourceInlineCompletion,this.source)}hash(){return JSON.stringify({insertText:this.insertText,range:this.range.toString()})}}function jBe(n,e){const t=e.getWordAtPosition(n),i=e.getLineMaxColumn(n.lineNumber);return t?new I(n.lineNumber,t.startColumn,n.lineNumber,i):I.fromPositions(n,n.with(void 0,i))}function Xj(n,e,t,i){const o=t.getLineContent(e.lineNumber).substring(0,e.column-1)+n,r=t.tokenization.tokenizeLineWithEdit(e,o.length-(e.column-1),n),a=r==null?void 0:r.sliceAndInflate(e.column-1,o.length,0);return a?VBe(a,i):n}class i0{constructor(e,t){this.range=e,this.text=t}removeCommonPrefix(e,t){const i=t?this.range.intersectRanges(t):this.range;if(!i)return this;const s=e.getValueInRange(i,1),o=om(s,this.text),r=t5(this.range.getStartPosition(),i5(s.substring(0,o))),a=this.text.substring(o),l=I.fromPositions(r,this.range.getEndPosition());return new i0(l,a)}augments(e){return this.text.startsWith(e.text)&&KBe(this.range,e.range)}computeGhostText(e,t,i,s=0){let o=this.removeCommonPrefix(e);if(o.range.endLineNumber!==o.range.startLineNumber)return;const r=e.getLineContent(o.range.startLineNumber),a=ki(r).length;if(o.range.startColumn-1<=a){const g=ki(o.text).length,p=r.substring(o.range.startColumn-1,a),[_,v]=[o.range.getStartPosition(),o.range.getEndPosition()],b=_.column+p.length<=v.column?_.delta(0,p.length):v,C=I.fromPositions(b,v),w=o.text.startsWith(p)?o.text.substring(p.length):o.text.substring(g);o=new i0(C,w)}const c=e.getValueInRange(o.range),d=qBe(c,o.text);if(!d)return;const u=o.range.startLineNumber,h=new Array;if(t==="prefix"){const g=d.filter(p=>p.originalLength===0);if(g.length>1||g.length===1&&g[0].originalStart!==c.length)return}const f=o.text.length-s;for(const g of d){const p=o.range.startColumn+g.originalStart+g.originalLength;if(t==="subwordSmart"&&i&&i.lineNumber===o.range.startLineNumber&&p0)return;if(g.modifiedLength===0)continue;const _=g.modifiedStart+g.modifiedLength,v=Math.max(g.modifiedStart,Math.min(_,f)),b=o.text.substring(g.modifiedStart,v),C=o.text.substring(v,Math.max(g.modifiedStart,_));if(b.length>0){const w=Sd(b);h.push(new n5(p,w,!1))}if(C.length>0){const w=Sd(C);h.push(new n5(p,w,!0))}}return new ZI(u,h)}}function KBe(n,e){return e.getStartPosition().equals(n.getStartPosition())&&e.getEndPosition().isBeforeOrEqual(n.getEndPosition())}let xc;function qBe(n,e){if((xc==null?void 0:xc.originalValue)===n&&(xc==null?void 0:xc.newValue)===e)return xc==null?void 0:xc.changes;{let t=Jj(n,e,!0);if(t){const i=Qj(t);if(i>0){const s=Jj(n,e,!1);s&&Qj(s)5e3||e.length>5e3)return;function i(c){let d=0;for(let u=0,h=c.length;ud&&(d=f)}return d}const s=Math.max(i(n),i(e));function o(c){if(c<0)throw new Error("unexpected");return s+c+1}function r(c){let d=0,u=0;const h=new Int32Array(c.length);for(let f=0,g=c.length;fa},{getElements:()=>l}).ComputeDiff(!1).changes}var GBe=globalThis&&globalThis.__decorate||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=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},YBe=globalThis&&globalThis.__awaiter||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 r5=class extends te{constructor(e,t,i,s,o){super(),this.textModel=e,this.versionId=t,this._debounceValue=i,this.languageFeaturesService=s,this.languageConfigurationService=o,this._updateOperation=this._register(new Ts),this.inlineCompletions=kI("inlineCompletions",void 0),this.suggestWidgetInlineCompletions=kI("suggestWidgetInlineCompletions",void 0),this._register(this.textModel.onDidChangeContent(()=>{this._updateOperation.clear()}))}fetch(e,t,i){var s,o;const r=new XBe(e,t,this.textModel.getVersionId()),a=t.selectedSuggestionInfo?this.suggestWidgetInlineCompletions:this.inlineCompletions;if(!((s=this._updateOperation.value)===null||s===void 0)&&s.request.satisfies(r))return this._updateOperation.value.promise;if(!((o=a.get())===null||o===void 0)&&o.request.satisfies(r))return Promise.resolve(!0);const l=!!this._updateOperation.value;this._updateOperation.clear();const c=new Tn,d=(()=>YBe(this,void 0,void 0,function*(){if((l||t.triggerKind===Ru.Automatic)&&(yield ZBe(this._debounceValue.get(this.textModel))),c.token.isCancellationRequested||this.textModel.getVersionId()!==r.versionId)return!1;const f=new Date,g=yield $Be(this.languageFeaturesService.inlineCompletionsProvider,e,this.textModel,t,c.token,this.languageConfigurationService);if(c.token.isCancellationRequested||this.textModel.getVersionId()!==r.versionId)return!1;const p=new Date;this._debounceValue.update(this.textModel,p.getTime()-f.getTime());const _=new e8e(g,r,this.textModel,this.versionId);if(i){const v=i.toInlineCompletion(void 0);i.canBeReused(this.textModel,e)&&!g.has(v)&&_.prepend(i.inlineCompletion,v.range,!0)}return this._updateOperation.clear(),Gi(v=>{a.set(_,v)}),!0}))(),u=new JBe(r,c,d);return this._updateOperation.value=u,d}clear(e){this._updateOperation.clear(),this.inlineCompletions.set(void 0,e),this.suggestWidgetInlineCompletions.set(void 0,e)}clearSuggestWidgetInlineCompletions(e){var t;!((t=this._updateOperation.value)===null||t===void 0)&&t.request.context.selectedSuggestionInfo&&this._updateOperation.clear(),this.suggestWidgetInlineCompletions.set(void 0,e)}cancelUpdate(){this._updateOperation.clear()}};r5=GBe([eK(3,Ze),eK(4,Ni)],r5);function ZBe(n,e){return new Promise(t=>{let i;const s=setTimeout(()=>{i&&i.dispose(),t()},n);e&&(i=e.onCancellationRequested(()=>{clearTimeout(s),i&&i.dispose(),t()}))})}class XBe{constructor(e,t,i){this.position=e,this.context=t,this.versionId=i}satisfies(e){return this.position.equals(e.position)&&QBe(this.context.selectedSuggestionInfo,e.context.selectedSuggestionInfo,(t,i)=>t.equals(i))&&(e.context.triggerKind===Ru.Automatic||this.context.triggerKind===Ru.Explicit)&&this.versionId===e.versionId}}function QBe(n,e,t){return!n||!e?n===e:t(n,e)}class JBe{constructor(e,t,i){this.request=e,this.cancellationTokenSource=t,this.promise=i}dispose(){this.cancellationTokenSource.cancel()}}class e8e{get inlineCompletions(){return this._inlineCompletions}constructor(e,t,i,s){this.inlineCompletionProviderResult=e,this.request=t,this.textModel=i,this.versionId=s,this._refCount=1,this._prependedInlineCompletionItems=[],this._rangeVersionIdValue=0,this._rangeVersionId=Ut(this,r=>{this.versionId.read(r);let a=!1;for(const l of this._inlineCompletions)a=a||l._updateRange(this.textModel);return a&&this._rangeVersionIdValue++,this._rangeVersionIdValue});const o=i.deltaDecorations([],e.completions.map(r=>({range:r.range,options:{description:"inline-completion-tracking-range"}})));this._inlineCompletions=e.completions.map((r,a)=>new tK(r,o[a],this._rangeVersionId))}clone(){return this._refCount++,this}dispose(){if(this._refCount--,this._refCount===0){setTimeout(()=>{this.textModel.isDisposed()||this.textModel.deltaDecorations(this._inlineCompletions.map(e=>e.decorationId),[])},0),this.inlineCompletionProviderResult.dispose();for(const e of this._prependedInlineCompletionItems)e.source.removeRef()}}prepend(e,t,i){i&&e.source.addRef();const s=this.textModel.deltaDecorations([],[{range:t,options:{description:"inline-completion-tracking-range"}}])[0];this._inlineCompletions.unshift(new tK(e,s,this._rangeVersionId,t)),this._prependedInlineCompletionItems.push(e)}}class tK{get forwardStable(){var e;return(e=this.inlineCompletion.source.inlineCompletions.enableForwardStability)!==null&&e!==void 0?e:!1}constructor(e,t,i,s){this.inlineCompletion=e,this.decorationId=t,this.rangeVersion=i,this.semanticId=JSON.stringify([this.inlineCompletion.filterText,this.inlineCompletion.insertText,this.inlineCompletion.range.getStartPosition().toString()]),this._isValid=!0,this._updatedRange=s!=null?s:e.range}toInlineCompletion(e){return this.inlineCompletion.withRange(this._getUpdatedRange(e))}toSingleTextEdit(e){return new i0(this._getUpdatedRange(e),this.inlineCompletion.insertText)}isVisible(e,t,i){const s=this._toFilterTextReplacement(i).removeCommonPrefix(e);if(!this._isValid||!this.inlineCompletion.range.getStartPosition().equals(this._getUpdatedRange(i).getStartPosition())||t.lineNumber!==s.range.startLineNumber)return!1;const o=e.getValueInRange(s.range,1).toLowerCase(),r=s.text.toLowerCase(),a=Math.max(0,t.column-s.range.startColumn);let l=r.substring(0,a),c=r.substring(a),d=o.substring(0,a),u=o.substring(a);const h=e.getLineIndentColumn(s.range.startLineNumber);return s.range.startColumn<=h&&(d=d.trimStart(),d.length===0&&(u=u.trimStart()),l=l.trimStart(),l.length===0&&(c=c.trimStart())),l.startsWith(d)&&!!pee(u,c)}canBeReused(e,t){return this._isValid&&this._getUpdatedRange(void 0).containsPosition(t)&&this.isVisible(e,t,void 0)&&!this._isSmallerThanOriginal(void 0)}_toFilterTextReplacement(e){return new i0(this._getUpdatedRange(e),this.inlineCompletion.filterText)}_isSmallerThanOriginal(e){return iK(this._getUpdatedRange(e)).isBefore(iK(this.inlineCompletion.range))}_getUpdatedRange(e){return this.rangeVersion.read(e),this._updatedRange}_updateRange(e){const t=e.getDecorationRange(this.decorationId);return t?this._updatedRange.equalsRange(t)?!1:(this._updatedRange=t,!0):(this._isValid=!1,!0)}}function iK(n){return n.startLineNumber===n.endLineNumber?new Y(1,1+n.endColumn-n.startColumn):new Y(1+n.endLineNumber-n.startLineNumber,n.endColumn)}var HC=globalThis&&globalThis.__awaiter||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 Tt={Visible:e6,HasFocusedSuggestion:new Ve("suggestWidgetHasFocusedSuggestion",!1,m("suggestWidgetHasSelection","Whether any suggestion is focused")),DetailsVisible:new Ve("suggestWidgetDetailsVisible",!1,m("suggestWidgetDetailsVisible","Whether suggestion details are visible")),MultipleSuggestions:new Ve("suggestWidgetMultipleSuggestions",!1,m("suggestWidgetMultipleSuggestions","Whether there are multiple suggestions to pick from")),MakesTextEdit:new Ve("suggestionMakesTextEdit",!0,m("suggestionMakesTextEdit","Whether inserting the current suggestion yields in a change or has everything already been typed")),AcceptSuggestionsOnEnter:new Ve("acceptSuggestionOnEnter",!0,m("acceptSuggestionOnEnter","Whether suggestions are inserted when pressing Enter")),HasInsertAndReplaceRange:new Ve("suggestionHasInsertAndReplaceRange",!1,m("suggestionHasInsertAndReplaceRange","Whether the current suggestion has insert and replace behaviour")),InsertMode:new Ve("suggestionInsertMode",void 0,{type:"string",description:m("suggestionInsertMode","Whether the default behaviour is to insert or replace")}),CanResolve:new Ve("suggestionCanResolve",!1,m("suggestionCanResolve","Whether the current suggestion supports to resolve further details"))},Af=new M("suggestWidgetStatusBar");class t8e{constructor(e,t,i,s){var o;this.position=e,this.completion=t,this.container=i,this.provider=s,this.isInvalid=!1,this.score=lc.Default,this.distance=0,this.textLabel=typeof t.label=="string"?t.label:(o=t.label)===null||o===void 0?void 0:o.label,this.labelLow=this.textLabel.toLowerCase(),this.isInvalid=!this.textLabel,this.sortTextLow=t.sortText&&t.sortText.toLowerCase(),this.filterTextLow=t.filterText&&t.filterText.toLowerCase(),this.extensionId=t.extensionId,I.isIRange(t.range)?(this.editStart=new Y(t.range.startLineNumber,t.range.startColumn),this.editInsertEnd=new Y(t.range.endLineNumber,t.range.endColumn),this.editReplaceEnd=new Y(t.range.endLineNumber,t.range.endColumn),this.isInvalid=this.isInvalid||I.spansMultipleLines(t.range)||t.range.startLineNumber!==e.lineNumber):(this.editStart=new Y(t.range.insert.startLineNumber,t.range.insert.startColumn),this.editInsertEnd=new Y(t.range.insert.endLineNumber,t.range.insert.endColumn),this.editReplaceEnd=new Y(t.range.replace.endLineNumber,t.range.replace.endColumn),this.isInvalid=this.isInvalid||I.spansMultipleLines(t.range.insert)||I.spansMultipleLines(t.range.replace)||t.range.insert.startLineNumber!==e.lineNumber||t.range.replace.startLineNumber!==e.lineNumber||t.range.insert.startColumn!==t.range.replace.startColumn),typeof s.resolveCompletionItem!="function"&&(this._resolveCache=Promise.resolve(),this._resolveDuration=0)}get isResolved(){return this._resolveDuration!==void 0}get resolveDuration(){return this._resolveDuration!==void 0?this._resolveDuration:-1}resolve(e){return HC(this,void 0,void 0,function*(){if(!this._resolveCache){const t=e.onCancellationRequested(()=>{this._resolveCache=void 0,this._resolveDuration=void 0}),i=new so(!0);this._resolveCache=Promise.resolve(this.provider.resolveCompletionItem(this.completion,e)).then(s=>{Object.assign(this.completion,s),this._resolveDuration=i.elapsed()},s=>{bc(s)&&(this._resolveCache=void 0,this._resolveDuration=void 0)}).finally(()=>{t.dispose()})}return this._resolveCache})}}class Dy{constructor(e=2,t=new Set,i=new Set,s=new Map,o=!0){this.snippetSortOrder=e,this.kindFilter=t,this.providerFilter=i,this.providerItemsToReuse=s,this.showDeprecated=o}}Dy.default=new Dy;let i8e;function n8e(){return i8e}class s8e{constructor(e,t,i,s){this.items=e,this.needsClipboard=t,this.durations=i,this.disposable=s}}function c6(n,e,t,i=Dy.default,s={triggerKind:0},o=Ft.None){return HC(this,void 0,void 0,function*(){const r=new so;t=t.clone();const a=e.getWordAtPosition(t),l=a?new I(t.lineNumber,a.startColumn,t.lineNumber,a.endColumn):I.fromPositions(t),c={replace:l,insert:l.setEndPosition(t.lineNumber,t.column)},d=[],u=new be,h=[];let f=!1;const g=(_,v,b)=>{var C,w,y;let L=!1;if(!v)return L;for(const S of v.suggestions)if(!i.kindFilter.has(S.kind)){if(!i.showDeprecated&&(!((C=S==null?void 0:S.tags)===null||C===void 0)&&C.includes(1)))continue;S.range||(S.range=c),S.sortText||(S.sortText=typeof S.label=="string"?S.label:S.label.label),!f&&S.insertTextRules&&S.insertTextRules&4&&(f=t0.guessNeedsClipboard(S.insertText)),d.push(new t8e(t,S,v,_)),L=!0}return _8(v)&&u.add(v),h.push({providerName:(w=_._debugDisplayName)!==null&&w!==void 0?w:"unknown_provider",elapsedProvider:(y=v.duration)!==null&&y!==void 0?y:-1,elapsedOverall:b.elapsed()}),L},p=(()=>HC(this,void 0,void 0,function*(){}))();for(const _ of n.orderedGroups(e)){let v=!1;if(yield Promise.all(_.map(b=>HC(this,void 0,void 0,function*(){if(i.providerItemsToReuse.has(b)){const C=i.providerItemsToReuse.get(b);C.forEach(w=>d.push(w)),v=v||C.length>0;return}if(!(i.providerFilter.size>0&&!i.providerFilter.has(b)))try{const C=new so,w=yield b.provideCompletionItems(e,t,s,o);v=g(b,w,C)||v}catch(C){Bn(C)}}))),v||o.isCancellationRequested)break}return yield p,o.isCancellationRequested?(u.dispose(),Promise.reject(new Sg)):new s8e(d.sort(a8e(i.snippetSortOrder)),f,{entries:h,elapsed:r.elapsed()},u)})}function d6(n,e){if(n.sortTextLow&&e.sortTextLow){if(n.sortTextLowe.sortTextLow)return 1}return n.textLabele.textLabel?1:n.completion.kind-e.completion.kind}function o8e(n,e){if(n.completion.kind!==e.completion.kind){if(n.completion.kind===27)return-1;if(e.completion.kind===27)return 1}return d6(n,e)}function r8e(n,e){if(n.completion.kind!==e.completion.kind){if(n.completion.kind===27)return 1;if(e.completion.kind===27)return-1}return d6(n,e)}const NN=new Map;NN.set(0,o8e);NN.set(2,r8e);NN.set(1,d6);function a8e(n){return NN.get(n)}qt.registerCommand("_executeCompletionItemProvider",(n,...e)=>HC(void 0,void 0,void 0,function*(){const[t,i,s,o]=e;bi(ct.isUri(t)),bi(Y.isIPosition(i)),bi(typeof s=="string"||!s),bi(typeof o=="number"||!o);const{completionProvider:r}=n.get(Ze),a=yield n.get(sr).createModelReference(t);try{const l={incomplete:!1,suggestions:[]},c=[],d=a.object.textEditorModel.validatePosition(i),u=yield c6(r,a.object.textEditorModel,d,void 0,{triggerCharacter:s!=null?s:void 0,triggerKind:s?1:0});for(const h of u.items)c.length<(o!=null?o:0)&&c.push(h.resolve(Ft.None)),l.incomplete=l.incomplete||h.container.incomplete,l.suggestions.push(h.completion);try{return yield Promise.all(c),l}finally{setTimeout(()=>u.disposable.dispose(),100)}}finally{a.dispose()}}));function l8e(n,e){var t;(t=n.getContribution("editor.contrib.suggestController"))===null||t===void 0||t.triggerSuggest(new Set().add(e),void 0,!0)}class Lv{static isAllOff(e){return e.other==="off"&&e.comments==="off"&&e.strings==="off"}static isAllOn(e){return e.other==="on"&&e.comments==="on"&&e.strings==="on"}static valueFor(e,t){switch(t){case 1:return e.comments;case 2:return e.strings;default:return e.other}}}function nK(n,e=zs){return Yke(n,e)?n.charAt(0).toUpperCase()+n.slice(1):n}var c8e=globalThis&&globalThis.__decorate||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},d8e=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};class sK{constructor(e){this._delegates=e}resolve(e){for(const t of this._delegates){const i=t.resolve(e);if(i!==void 0)return i}}}class oK{constructor(e,t,i,s){this._model=e,this._selection=t,this._selectionIdx=i,this._overtypingCapturer=s}resolve(e){const{name:t}=e;if(t==="SELECTION"||t==="TM_SELECTED_TEXT"){let i=this._model.getValueInRange(this._selection)||void 0,s=this._selection.startLineNumber!==this._selection.endLineNumber;if(!i&&this._overtypingCapturer){const o=this._overtypingCapturer.getLastOvertypedInfo(this._selectionIdx);o&&(i=o.value,s=o.multiline)}if(i&&s&&e.snippet){const o=this._model.getLineContent(this._selection.startLineNumber),r=ki(o,0,this._selection.startColumn-1);let a=r;e.snippet.walk(c=>c===e?!1:(c instanceof Do&&(a=ki(Sd(c.value).pop())),!0));const l=om(a,r);i=i.replace(/(\r\n|\r|\n)(.*)/g,(c,d,u)=>"".concat(d).concat(a.substr(l)).concat(u))}return i}else{if(t==="TM_CURRENT_LINE")return this._model.getLineContent(this._selection.positionLineNumber);if(t==="TM_CURRENT_WORD"){const i=this._model.getWordAtPosition({lineNumber:this._selection.positionLineNumber,column:this._selection.positionColumn});return i&&i.word||void 0}else{if(t==="TM_LINE_INDEX")return String(this._selection.positionLineNumber-1);if(t==="TM_LINE_NUMBER")return String(this._selection.positionLineNumber);if(t==="CURSOR_INDEX")return String(this._selectionIdx);if(t==="CURSOR_NUMBER")return String(this._selectionIdx+1)}}}}class rK{constructor(e,t){this._labelService=e,this._model=t}resolve(e){const{name:t}=e;if(t==="TM_FILENAME")return bf(this._model.uri.fsPath);if(t==="TM_FILENAME_BASE"){const i=bf(this._model.uri.fsPath),s=i.lastIndexOf(".");return s<=0?i:i.slice(0,s)}else{if(t==="TM_DIRECTORY")return mX(this._model.uri.fsPath)==="."?"":this._labelService.getUriLabel(Ex(this._model.uri));if(t==="TM_FILEPATH")return this._labelService.getUriLabel(this._model.uri);if(t==="RELATIVE_FILEPATH")return this._labelService.getUriLabel(this._model.uri,{relative:!0,noPrefix:!0})}}}class aK{constructor(e,t,i,s){this._readClipboardText=e,this._selectionIdx=t,this._selectionCount=i,this._spread=s}resolve(e){if(e.name!=="CLIPBOARD")return;const t=this._readClipboardText();if(t){if(this._spread){const i=t.split(/\r\n|\n|\r/).filter(s=>!SX(s));if(i.length===this._selectionCount)return i[this._selectionIdx]}return t}}}let QI=class{constructor(e,t,i){this._model=e,this._selection=t,this._languageConfigurationService=i}resolve(e){const{name:t}=e,i=this._model.getLanguageIdAtPosition(this._selection.selectionStartLineNumber,this._selection.selectionStartColumn),s=this._languageConfigurationService.getLanguageConfiguration(i).comments;if(s){if(t==="LINE_COMMENT")return s.lineCommentToken||void 0;if(t==="BLOCK_COMMENT_START")return s.blockCommentStartToken||void 0;if(t==="BLOCK_COMMENT_END")return s.blockCommentEndToken||void 0}}};QI=c8e([d8e(2,Ni)],QI);class ec{constructor(){this._date=new Date}resolve(e){const{name:t}=e;if(t==="CURRENT_YEAR")return String(this._date.getFullYear());if(t==="CURRENT_YEAR_SHORT")return String(this._date.getFullYear()).slice(-2);if(t==="CURRENT_MONTH")return String(this._date.getMonth().valueOf()+1).padStart(2,"0");if(t==="CURRENT_DATE")return String(this._date.getDate().valueOf()).padStart(2,"0");if(t==="CURRENT_HOUR")return String(this._date.getHours().valueOf()).padStart(2,"0");if(t==="CURRENT_MINUTE")return String(this._date.getMinutes().valueOf()).padStart(2,"0");if(t==="CURRENT_SECOND")return String(this._date.getSeconds().valueOf()).padStart(2,"0");if(t==="CURRENT_DAY_NAME")return ec.dayNames[this._date.getDay()];if(t==="CURRENT_DAY_NAME_SHORT")return ec.dayNamesShort[this._date.getDay()];if(t==="CURRENT_MONTH_NAME")return ec.monthNames[this._date.getMonth()];if(t==="CURRENT_MONTH_NAME_SHORT")return ec.monthNamesShort[this._date.getMonth()];if(t==="CURRENT_SECONDS_UNIX")return String(Math.floor(this._date.getTime()/1e3));if(t==="CURRENT_TIMEZONE_OFFSET"){const i=this._date.getTimezoneOffset(),s=i>0?"-":"+",o=Math.trunc(Math.abs(i/60)),r=o<10?"0"+o:o,a=Math.abs(i)-o*60,l=a<10?"0"+a:a;return s+r+":"+l}}}ec.dayNames=[m("Sunday","Sunday"),m("Monday","Monday"),m("Tuesday","Tuesday"),m("Wednesday","Wednesday"),m("Thursday","Thursday"),m("Friday","Friday"),m("Saturday","Saturday")];ec.dayNamesShort=[m("SundayShort","Sun"),m("MondayShort","Mon"),m("TuesdayShort","Tue"),m("WednesdayShort","Wed"),m("ThursdayShort","Thu"),m("FridayShort","Fri"),m("SaturdayShort","Sat")];ec.monthNames=[m("January","January"),m("February","February"),m("March","March"),m("April","April"),m("May","May"),m("June","June"),m("July","July"),m("August","August"),m("September","September"),m("October","October"),m("November","November"),m("December","December")];ec.monthNamesShort=[m("JanuaryShort","Jan"),m("FebruaryShort","Feb"),m("MarchShort","Mar"),m("AprilShort","Apr"),m("MayShort","May"),m("JuneShort","Jun"),m("JulyShort","Jul"),m("AugustShort","Aug"),m("SeptemberShort","Sep"),m("OctoberShort","Oct"),m("NovemberShort","Nov"),m("DecemberShort","Dec")];class lK{constructor(e){this._workspaceService=e}resolve(e){if(!this._workspaceService)return;const t=dTe(this._workspaceService.getWorkspace());if(!aTe(t)){if(e.name==="WORKSPACE_NAME")return this._resolveWorkspaceName(t);if(e.name==="WORKSPACE_FOLDER")return this._resoveWorkspacePath(t)}}_resolveWorkspaceName(e){if(HO(e))return bf(e.uri.path);let t=bf(e.configPath.path);return t.endsWith($O)&&(t=t.substr(0,t.length-$O.length-1)),t}_resoveWorkspacePath(e){if(HO(e))return nK(e.uri.fsPath);const t=bf(e.configPath.path);let i=e.configPath.fsPath;return i.endsWith(t)&&(i=i.substr(0,i.length-t.length-1)),i?nK(i):"/"}}class cK{resolve(e){const{name:t}=e;if(t==="RANDOM")return Math.random().toString().slice(-6);if(t==="RANDOM_HEX")return Math.random().toString(16).slice(-6);if(t==="UUID")return yN()}}var u8e=globalThis&&globalThis.__decorate||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},h8e=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},Ml;class ga{constructor(e,t,i){this._editor=e,this._snippet=t,this._snippetLineLeadingWhitespace=i,this._offset=-1,this._nestingLevel=1,this._placeholderGroups=TV(t.placeholders,pa.compareByIndex),this._placeholderGroupsIdx=-1}initialize(e){this._offset=e.newPosition}dispose(){this._placeholderDecorations&&this._editor.removeDecorations([...this._placeholderDecorations.values()]),this._placeholderGroups.length=0}_initDecorations(){if(this._offset===-1)throw new Error("Snippet not initialized!");if(this._placeholderDecorations)return;this._placeholderDecorations=new Map;const e=this._editor.getModel();this._editor.changeDecorations(t=>{for(const i of this._snippet.placeholders){const s=this._snippet.offset(i),o=this._snippet.fullLen(i),r=I.fromPositions(e.getPositionAt(this._offset+s),e.getPositionAt(this._offset+s+o)),a=i.isFinalTabstop?ga._decor.inactiveFinal:ga._decor.inactive,l=t.addDecoration(r,a);this._placeholderDecorations.set(i,l)}})}move(e){if(!this._editor.hasModel())return[];if(this._initDecorations(),this._placeholderGroupsIdx>=0){const s=[];for(const o of this._placeholderGroups[this._placeholderGroupsIdx])if(o.transform){const r=this._placeholderDecorations.get(o),a=this._editor.getModel().getDecorationRange(r),l=this._editor.getModel().getValueInRange(a),c=o.transform.resolve(l).split(/\r\n|\r|\n/);for(let d=1;d0&&this._editor.executeEdits("snippet.placeholderTransform",s)}let t=!1;e===!0&&this._placeholderGroupsIdx0&&(this._placeholderGroupsIdx-=1,t=!0);const i=this._editor.getModel().changeDecorations(s=>{const o=new Set,r=[];for(const a of this._placeholderGroups[this._placeholderGroupsIdx]){const l=this._placeholderDecorations.get(a),c=this._editor.getModel().getDecorationRange(l);r.push(new Je(c.startLineNumber,c.startColumn,c.endLineNumber,c.endColumn)),t=t&&this._hasPlaceholderBeenCollapsed(a),s.changeDecorationOptions(l,a.isFinalTabstop?ga._decor.activeFinal:ga._decor.active),o.add(a);for(const d of this._snippet.enclosingPlaceholders(a)){const u=this._placeholderDecorations.get(d);s.changeDecorationOptions(u,d.isFinalTabstop?ga._decor.activeFinal:ga._decor.active),o.add(d)}}for(const[a,l]of this._placeholderDecorations)o.has(a)||s.changeDecorationOptions(l,a.isFinalTabstop?ga._decor.inactiveFinal:ga._decor.inactive);return r});return t?this.move(e):i!=null?i:[]}_hasPlaceholderBeenCollapsed(e){let t=e;for(;t;){if(t instanceof pa){const i=this._placeholderDecorations.get(t);if(this._editor.getModel().getDecorationRange(i).isEmpty()&&t.toString().length>0)return!0}t=t.parent}return!1}get isAtFirstPlaceholder(){return this._placeholderGroupsIdx<=0||this._placeholderGroups.length===0}get isAtLastPlaceholder(){return this._placeholderGroupsIdx===this._placeholderGroups.length-1}get hasPlaceholder(){return this._snippet.placeholders.length>0}get isTrivialSnippet(){if(this._snippet.placeholders.length===0)return!0;if(this._snippet.placeholders.length===1){const[e]=this._snippet.placeholders;if(e.isFinalTabstop&&this._snippet.rightMostDescendant===e)return!0}return!1}computePossibleSelections(){const e=new Map;for(const t of this._placeholderGroups){let i;for(const s of t){if(s.isFinalTabstop)break;i||(i=[],e.set(s.index,i));const o=this._placeholderDecorations.get(s),r=this._editor.getModel().getDecorationRange(o);if(!r){e.delete(s.index);break}i.push(r)}}return e}get activeChoice(){if(!this._placeholderDecorations)return;const e=this._placeholderGroups[this._placeholderGroupsIdx][0];if(!(e!=null&&e.choice))return;const t=this._placeholderDecorations.get(e);if(!t)return;const i=this._editor.getModel().getDecorationRange(t);if(i)return{range:i,choice:e.choice}}get hasChoice(){let e=!1;return this._snippet.walk(t=>(e=t instanceof W0,!e)),e}merge(e){const t=this._editor.getModel();this._nestingLevel*=10,this._editor.changeDecorations(i=>{for(const s of this._placeholderGroups[this._placeholderGroupsIdx]){const o=e.shift();console.assert(o._offset!==-1),console.assert(!o._placeholderDecorations);const r=o._snippet.placeholderInfo.last.index;for(const l of o._snippet.placeholderInfo.all)l.isFinalTabstop?l.index=s.index+(r+1)/this._nestingLevel:l.index=s.index+l.index/this._nestingLevel;this._snippet.replace(s,o._snippet.children);const a=this._placeholderDecorations.get(s);i.removeDecoration(a),this._placeholderDecorations.delete(s);for(const l of o._snippet.placeholders){const c=o._snippet.offset(l),d=o._snippet.fullLen(l),u=I.fromPositions(t.getPositionAt(o._offset+c),t.getPositionAt(o._offset+c+d)),h=i.addDecoration(u,ga._decor.inactive);this._placeholderDecorations.set(l,h)}}this._placeholderGroups=TV(this._snippet.placeholders,pa.compareByIndex)})}}ga._decor={active:kt.register({description:"snippet-placeholder-1",stickiness:0,className:"snippet-placeholder"}),inactive:kt.register({description:"snippet-placeholder-2",stickiness:1,className:"snippet-placeholder"}),activeFinal:kt.register({description:"snippet-placeholder-3",stickiness:1,className:"finish-snippet-placeholder"}),inactiveFinal:kt.register({description:"snippet-placeholder-4",stickiness:1,className:"finish-snippet-placeholder"})};const dK={overwriteBefore:0,overwriteAfter:0,adjustWhitespace:!0,clipboardText:void 0,overtypingCapturer:void 0};let JI=Ml=class{static adjustWhitespace(e,t,i,s,o){const r=e.getLineContent(t.lineNumber),a=ki(r,0,t.column-1);let l;return s.walk(c=>{if(!(c instanceof Do)||c.parent instanceof W0||o&&!o.has(c))return!0;const d=c.value.split(/\r\n|\r|\n/);if(i){const h=s.offset(c);if(h===0)d[0]=e.normalizeIndentation(d[0]);else{l=l!=null?l:s.toString();const f=l.charCodeAt(h-1);(f===10||f===13)&&(d[0]=e.normalizeIndentation(a+d[0]))}for(let f=1;fw.get(hm)),g=e.invokeWithinContext(w=>new rK(w.get(Fb),h)),p=()=>a,_=h.getValueInRange(Ml.adjustSelection(h,e.getSelection(),i,0)),v=h.getValueInRange(Ml.adjustSelection(h,e.getSelection(),0,s)),b=h.getLineFirstNonWhitespaceColumn(e.getSelection().positionLineNumber),C=e.getSelections().map((w,y)=>({selection:w,idx:y})).sort((w,y)=>I.compareRangesUsingStarts(w.selection,y.selection));for(const{selection:w,idx:y}of C){let L=Ml.adjustSelection(h,w,i,0),S=Ml.adjustSelection(h,w,0,s);_!==h.getValueInRange(L)&&(L=w),v!==h.getValueInRange(S)&&(S=w);const k=w.setStartPosition(L.startLineNumber,L.startColumn).setEndPosition(S.endLineNumber,S.endColumn),D=new t0().parse(t,!0,o),x=k.getStartPosition(),A=Ml.adjustWhitespace(h,x,r||y>0&&b!==h.getLineFirstNonWhitespaceColumn(w.positionLineNumber),D);D.resolveVariables(new sK([g,new aK(p,y,C.length,e.getOption(78)==="spread"),new oK(h,w,y,l),new QI(h,w,c),new ec,new lK(f),new cK])),d[y]=Yi.replace(k,D.toString()),d[y].identifier={major:y,minor:0},d[y]._isTracked=!0,u[y]=new ga(e,D,A)}return{edits:d,snippets:u}}static createEditsAndSnippetsFromEdits(e,t,i,s,o,r,a){if(!e.hasModel()||t.length===0)return{edits:[],snippets:[]};const l=[],c=e.getModel(),d=new t0,u=new jS,h=new sK([e.invokeWithinContext(g=>new rK(g.get(Fb),c)),new aK(()=>o,0,e.getSelections().length,e.getOption(78)==="spread"),new oK(c,e.getSelection(),0,r),new QI(c,e.getSelection(),a),new ec,new lK(e.invokeWithinContext(g=>g.get(hm))),new cK]);t=t.sort((g,p)=>I.compareRangesUsingStarts(g.range,p.range));let f=0;for(let g=0;g0){const y=t[g-1].range,L=I.fromPositions(y.getEndPosition(),p.getStartPosition()),S=new Do(c.getValueInRange(L));u.appendChild(S),f+=S.value.length}const v=d.parseFragment(_,u);Ml.adjustWhitespace(c,p.getStartPosition(),!0,u,new Set(v)),u.resolveVariables(h);const b=u.toString(),C=b.slice(f);f=b.length;const w=Yi.replace(p,C);w.identifier={major:g,minor:0},w._isTracked=!0,l.push(w)}return d.ensureFinalTabstop(u,i,!0),{edits:l,snippets:[new ga(e,u,"")]}}constructor(e,t,i=dK,s){this._editor=e,this._template=t,this._options=i,this._languageConfigurationService=s,this._templateMerges=[],this._snippets=[]}dispose(){fi(this._snippets)}_logInfo(){return'template="'.concat(this._template,'", merged_templates="').concat(this._templateMerges.join(" -> "),'"')}insert(){if(!this._editor.hasModel())return;const{edits:e,snippets:t}=typeof this._template=="string"?Ml.createEditsAndSnippetsFromSelections(this._editor,this._template,this._options.overwriteBefore,this._options.overwriteAfter,!1,this._options.adjustWhitespace,this._options.clipboardText,this._options.overtypingCapturer,this._languageConfigurationService):Ml.createEditsAndSnippetsFromEdits(this._editor,this._template,!1,this._options.adjustWhitespace,this._options.clipboardText,this._options.overtypingCapturer,this._languageConfigurationService);this._snippets=t,this._editor.executeEdits("snippet",e,i=>{const s=i.filter(o=>!!o.identifier);for(let o=0;oJe.fromPositions(o.range.getEndPosition()))}),this._editor.revealRange(this._editor.getSelections()[0])}merge(e,t=dK){if(!this._editor.hasModel())return;this._templateMerges.push([this._snippets[0]._nestingLevel,this._snippets[0]._placeholderGroupsIdx,e]);const{edits:i,snippets:s}=Ml.createEditsAndSnippetsFromSelections(this._editor,e,t.overwriteBefore,t.overwriteAfter,!0,t.adjustWhitespace,t.clipboardText,t.overtypingCapturer,this._languageConfigurationService);this._editor.executeEdits("snippet",i,o=>{const r=o.filter(l=>!!l.identifier);for(let l=0;lJe.fromPositions(l.range.getEndPosition()))})}next(){const e=this._move(!0);this._editor.setSelections(e),this._editor.revealPositionInCenterIfOutsideViewport(e[0].getPosition())}prev(){const e=this._move(!1);this._editor.setSelections(e),this._editor.revealPositionInCenterIfOutsideViewport(e[0].getPosition())}_move(e){const t=[];for(const i of this._snippets){const s=i.move(e);t.push(...s)}return t}get isAtFirstPlaceholder(){return this._snippets[0].isAtFirstPlaceholder}get isAtLastPlaceholder(){return this._snippets[0].isAtLastPlaceholder}get hasPlaceholder(){return this._snippets[0].hasPlaceholder}get hasChoice(){return this._snippets[0].hasChoice}get activeChoice(){return this._snippets[0].activeChoice}isSelectionWithinPlaceholders(){if(!this.hasPlaceholder)return!1;const e=this._editor.getSelections();if(e.length{o.push(...s.get(r))})}e.sort(I.compareRangesUsingStarts);for(const[i,s]of t){if(s.length!==e.length){t.delete(i);continue}s.sort(I.compareRangesUsingStarts);for(let o=0;o0}};JI=Ml=u8e([h8e(3,Ni)],JI);var f8e=globalThis&&globalThis.__decorate||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},Sk=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},Z_;const uK={overwriteBefore:0,overwriteAfter:0,undoStopBefore:!0,undoStopAfter:!0,adjustWhitespace:!0,clipboardText:void 0,overtypingCapturer:void 0};let xs=Z_=class{static get(e){return e.getContribution(Z_.ID)}constructor(e,t,i,s,o){this._editor=e,this._logService=t,this._languageFeaturesService=i,this._languageConfigurationService=o,this._snippetListener=new be,this._modelVersionId=-1,this._inSnippet=Z_.InSnippetMode.bindTo(s),this._hasNextTabstop=Z_.HasNextTabstop.bindTo(s),this._hasPrevTabstop=Z_.HasPrevTabstop.bindTo(s)}dispose(){var e;this._inSnippet.reset(),this._hasPrevTabstop.reset(),this._hasNextTabstop.reset(),(e=this._session)===null||e===void 0||e.dispose(),this._snippetListener.dispose()}insert(e,t){try{this._doInsert(e,typeof t>"u"?uK:Object.assign(Object.assign({},uK),t))}catch(i){this.cancel(),this._logService.error(i),this._logService.error("snippet_error"),this._logService.error("insert_template=",e),this._logService.error("existing_template=",this._session?this._session._logInfo():"")}}_doInsert(e,t){var i;if(this._editor.hasModel()){if(this._snippetListener.clear(),t.undoStopBefore&&this._editor.getModel().pushStackElement(),this._session&&typeof e!="string"&&this.cancel(),this._session?(bi(typeof e=="string"),this._session.merge(e,t)):(this._modelVersionId=this._editor.getModel().getAlternativeVersionId(),this._session=new JI(this._editor,e,t,this._languageConfigurationService),this._session.insert()),t.undoStopAfter&&this._editor.getModel().pushStackElement(),!((i=this._session)===null||i===void 0)&&i.hasChoice){const s={_debugDisplayName:"snippetChoiceCompletions",provideCompletionItems:(d,u)=>{if(!this._session||d!==this._editor.getModel()||!Y.equals(this._editor.getPosition(),u))return;const{activeChoice:h}=this._session;if(!h||h.choice.options.length===0)return;const f=d.getValueInRange(h.range),g=!!h.choice.options.find(_=>_.value===f),p=[];for(let _=0;_{r==null||r.dispose(),a=!1},c=()=>{a||(r=this._languageFeaturesService.completionProvider.register({language:o.getLanguageId(),pattern:o.uri.fsPath,scheme:o.uri.scheme,exclusive:!0},s),this._snippetListener.add(r),a=!0)};this._choiceCompletions={provider:s,enable:c,disable:l}}this._updateState(),this._snippetListener.add(this._editor.onDidChangeModelContent(s=>s.isFlush&&this.cancel())),this._snippetListener.add(this._editor.onDidChangeModel(()=>this.cancel())),this._snippetListener.add(this._editor.onDidChangeCursorSelection(()=>this._updateState()))}}_updateState(){if(!(!this._session||!this._editor.hasModel())){if(this._modelVersionId===this._editor.getModel().getAlternativeVersionId())return this.cancel();if(!this._session.hasPlaceholder)return this.cancel();if(this._session.isAtLastPlaceholder||!this._session.isSelectionWithinPlaceholders())return this._editor.getModel().pushStackElement(),this.cancel();this._inSnippet.set(!0),this._hasPrevTabstop.set(!this._session.isAtFirstPlaceholder),this._hasNextTabstop.set(!this._session.isAtLastPlaceholder),this._handleChoice()}}_handleChoice(){var e;if(!this._session||!this._editor.hasModel()){this._currentChoice=void 0;return}const{activeChoice:t}=this._session;if(!t||!this._choiceCompletions){(e=this._choiceCompletions)===null||e===void 0||e.disable(),this._currentChoice=void 0;return}this._currentChoice!==t.choice&&(this._currentChoice=t.choice,this._choiceCompletions.enable(),queueMicrotask(()=>{l8e(this._editor,this._choiceCompletions.provider)}))}finish(){for(;this._inSnippet.get();)this.next()}cancel(e=!1){var t;this._inSnippet.reset(),this._hasPrevTabstop.reset(),this._hasNextTabstop.reset(),this._snippetListener.clear(),this._currentChoice=void 0,(t=this._session)===null||t===void 0||t.dispose(),this._session=void 0,this._modelVersionId=-1,e&&this._editor.setSelections([this._editor.getSelection()])}prev(){var e;(e=this._session)===null||e===void 0||e.prev(),this._updateState()}next(){var e;(e=this._session)===null||e===void 0||e.next(),this._updateState()}isInSnippet(){return!!this._inSnippet.get()}};xs.ID="snippetController2";xs.InSnippetMode=new Ve("inSnippetMode",!1,m("inSnippetMode","Whether the editor in current in snippet mode"));xs.HasNextTabstop=new Ve("hasNextTabstop",!1,m("hasNextTabstop","Whether there is a next tab stop when in snippet mode"));xs.HasPrevTabstop=new Ve("hasPrevTabstop",!1,m("hasPrevTabstop","Whether there is a previous tab stop when in snippet mode"));xs=Z_=f8e([Sk(1,aa),Sk(2,Ze),Sk(3,bt),Sk(4,Ni)],xs);ti(xs.ID,xs,4);const AN=fs.bindToContribution(xs.get);Re(new AN({id:"jumpToNextSnippetPlaceholder",precondition:fe.and(xs.InSnippetMode,xs.HasNextTabstop),handler:n=>n.next(),kbOpts:{weight:100+30,kbExpr:O.editorTextFocus,primary:2}}));Re(new AN({id:"jumpToPrevSnippetPlaceholder",precondition:fe.and(xs.InSnippetMode,xs.HasPrevTabstop),handler:n=>n.prev(),kbOpts:{weight:100+30,kbExpr:O.editorTextFocus,primary:1026}}));Re(new AN({id:"leaveSnippet",precondition:xs.InSnippetMode,handler:n=>n.cancel(!0),kbOpts:{weight:100+30,kbExpr:O.editorTextFocus,primary:9,secondary:[1033]}}));Re(new AN({id:"acceptSnippet",precondition:xs.InSnippetMode,handler:n=>n.finish()}));var g8e=globalThis&&globalThis.__decorate||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},MR=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},eu=globalThis&&globalThis.__awaiter||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())})},Rr;(function(n){n[n.Undo=0]="Undo",n[n.Redo=1]="Redo",n[n.AcceptWord=2]="AcceptWord",n[n.Other=3]="Other"})(Rr||(Rr={}));let a5=class extends te{get isAcceptingPartially(){return this._isAcceptingPartially}constructor(e,t,i,s,o,r,a,l,c,d,u,h){super(),this.textModel=e,this.selectedSuggestItem=t,this.cursorPosition=i,this.textModelVersionId=s,this._debounceValue=o,this._suggestPreviewEnabled=r,this._suggestPreviewMode=a,this._inlineSuggestMode=l,this._enabled=c,this._instantiationService=d,this._commandService=u,this._languageConfigurationService=h,this._source=this._register(this._instantiationService.createInstance(r5,this.textModel,this.textModelVersionId,this._debounceValue)),this._isActive=Pi(this,!1),this._forceUpdate=Lte("forceUpdate"),this._selectedInlineCompletionId=Pi(this,void 0),this._isAcceptingPartially=!1,this._preserveCurrentCompletionReasons=new Set([Rr.Redo,Rr.Undo,Rr.AcceptWord]),this._fetchInlineCompletions=YMe({owner:this,createEmptyChangeSummary:()=>({preserveCurrentCompletion:!1,inlineCompletionTriggerKind:Ru.Automatic}),handleChange:(g,p)=>(g.didChange(this.textModelVersionId)&&this._preserveCurrentCompletionReasons.has(g.change)?p.preserveCurrentCompletion=!0:g.didChange(this._forceUpdate)&&(p.inlineCompletionTriggerKind=g.change),!0)},(g,p)=>{if(this._forceUpdate.read(g),!(this._enabled.read(g)&&this.selectedSuggestItem.read(g)||this._isActive.read(g))){this._source.cancelUpdate();return}this.textModelVersionId.read(g);const v=this.selectedInlineCompletion.get(),b=p.preserveCurrentCompletion||v!=null&&v.forwardStable?v:void 0,C=this._source.suggestWidgetInlineCompletions.get(),w=this.selectedSuggestItem.read(g);if(C&&!w){const S=this._source.inlineCompletions.get();Gi(k=>{S&&C.request.versionId>S.request.versionId&&this._source.inlineCompletions.set(C.clone(),k),this._source.clearSuggestWidgetInlineCompletions(k)})}const y=this.cursorPosition.read(g),L={triggerKind:p.inlineCompletionTriggerKind,selectedSuggestionInfo:w==null?void 0:w.toSelectedSuggestionInfo()};return this._source.fetch(y,L,b)}),this._filteredInlineCompletionItems=Ut(this,g=>{const p=this._source.inlineCompletions.read(g);if(!p)return[];const _=this.cursorPosition.read(g);return p.inlineCompletions.filter(b=>b.isVisible(this.textModel,_,g))}),this.selectedInlineCompletionIndex=Ut(this,g=>{const p=this._selectedInlineCompletionId.read(g),_=this._filteredInlineCompletionItems.read(g),v=this._selectedInlineCompletionId===void 0?-1:_.findIndex(b=>b.semanticId===p);return v===-1?(this._selectedInlineCompletionId.set(void 0,void 0),0):v}),this.selectedInlineCompletion=Ut(this,g=>{const p=this._filteredInlineCompletionItems.read(g),_=this.selectedInlineCompletionIndex.read(g);return p[_]}),this.lastTriggerKind=this._source.inlineCompletions.map(g=>g==null?void 0:g.request.context.triggerKind),this.inlineCompletionsCount=Ut(this,g=>{if(this.lastTriggerKind.read(g)===Ru.Explicit)return this._filteredInlineCompletionItems.read(g).length}),this.state=wU({owner:this,equalityComparer:(g,p)=>!g||!p?g===p:qj(g.ghostText,p.ghostText)&&g.inlineCompletion===p.inlineCompletion&&g.suggestItem===p.suggestItem},g=>{var p;const _=this.textModel,v=this.selectedSuggestItem.read(g);if(v){const b=v.toSingleTextEdit().removeCommonPrefix(_),C=this._computeAugmentedCompletion(b,g);if(!this._suggestPreviewEnabled.read(g)&&!C)return;const y=(p=C==null?void 0:C.edit)!==null&&p!==void 0?p:b,L=C?C.edit.text.length-b.text.length:0,S=this._suggestPreviewMode.read(g),k=this.cursorPosition.read(g),D=y.computeGhostText(_,S,k,L);return{ghostText:D!=null?D:new ZI(y.range.endLineNumber,[]),inlineCompletion:C==null?void 0:C.completion,suggestItem:v}}else{if(!this._isActive.read(g))return;const b=this.selectedInlineCompletion.read(g);if(!b)return;const C=b.toSingleTextEdit(g),w=this._inlineSuggestMode.read(g),y=this.cursorPosition.read(g),L=C.computeGhostText(_,w,y);return L?{ghostText:L,inlineCompletion:b,suggestItem:void 0}:void 0}}),this.ghostText=wU({owner:this,equalityComparer:qj},g=>{const p=this.state.read(g);if(p)return p.ghostText}),this._register(gy(this._fetchInlineCompletions));let f;this._register(xi(g=>{var p,_;const v=this.state.read(g),b=v==null?void 0:v.inlineCompletion;if((b==null?void 0:b.semanticId)!==(f==null?void 0:f.semanticId)&&(f=b,b)){const C=b.inlineCompletion,w=C.source;(_=(p=w.provider).handleItemDidShow)===null||_===void 0||_.call(p,w.inlineCompletions,C.sourceInlineCompletion,C.insertText)}}))}trigger(e){return eu(this,void 0,void 0,function*(){this._isActive.set(!0,e),yield this._fetchInlineCompletions.get()})}triggerExplicitly(e){return eu(this,void 0,void 0,function*(){j4(e,t=>{this._isActive.set(!0,t),this._forceUpdate.trigger(t,Ru.Explicit)}),yield this._fetchInlineCompletions.get()})}stop(e){j4(e,t=>{this._isActive.set(!1,t),this._source.clear(t)})}_computeAugmentedCompletion(e,t){const i=this.textModel,s=this._source.suggestWidgetInlineCompletions.read(t),o=s?s.inlineCompletions:[this.selectedInlineCompletion.read(t)].filter(uw);return H1e(o,a=>{let l=a.toSingleTextEdit(t);return l=l.removeCommonPrefix(i,I.fromPositions(l.range.getStartPosition(),e.range.getEndPosition())),l.augments(e)?{edit:l,completion:a}:void 0})}_deltaSelectedInlineCompletionIndex(e){return eu(this,void 0,void 0,function*(){yield this.triggerExplicitly();const t=this._filteredInlineCompletionItems.get()||[];if(t.length>0){const i=(this.selectedInlineCompletionIndex.get()+e+t.length)%t.length;this._selectedInlineCompletionId.set(t[i].semanticId,void 0)}else this._selectedInlineCompletionId.set(void 0,void 0)})}next(){return eu(this,void 0,void 0,function*(){yield this._deltaSelectedInlineCompletionIndex(1)})}previous(){return eu(this,void 0,void 0,function*(){yield this._deltaSelectedInlineCompletionIndex(-1)})}accept(e){var t;return eu(this,void 0,void 0,function*(){if(e.getModel()!==this.textModel)throw new Rn;const i=this.state.get();if(!i||i.ghostText.isEmpty()||!i.inlineCompletion)return;const s=i.inlineCompletion.toInlineCompletion(void 0);e.pushUndoStop(),s.snippetInfo?(e.executeEdits("inlineSuggestion.accept",[Yi.replaceMove(s.range,""),...s.additionalTextEdits]),e.setPosition(s.snippetInfo.range.getStartPosition()),(t=xs.get(e))===null||t===void 0||t.insert(s.snippetInfo.snippet,{undoStopBefore:!1})):e.executeEdits("inlineSuggestion.accept",[Yi.replaceMove(s.range,s.insertText),...s.additionalTextEdits]),s.command&&s.source.addRef(),Gi(o=>{this._source.clear(o),this._isActive.set(!1,o)}),s.command&&(yield this._commandService.executeCommand(s.command.id,...s.command.arguments||[]).then(void 0,Bn),s.source.removeRef())})}acceptNextWord(e){return eu(this,void 0,void 0,function*(){yield this._acceptNext(e,(t,i)=>{const s=this.textModel.getLanguageIdAtPosition(t.lineNumber,t.column),o=this._languageConfigurationService.getLanguageConfiguration(s),r=new RegExp(o.wordDefinition.source,o.wordDefinition.flags.replace("g","")),a=i.match(r);let l=0;a&&a.index!==void 0?a.index===0?l=a[0].length:l=a.index:l=i.length;const d=/\s+/g.exec(i);return d&&d.index!==void 0&&d.index+d[0].length{const s=i.match(/\n/);return s&&s.index!==void 0?s.index+1:i.length})})}_acceptNext(e,t){return eu(this,void 0,void 0,function*(){if(e.getModel()!==this.textModel)throw new Rn;const i=this.state.get();if(!i||i.ghostText.isEmpty()||!i.inlineCompletion)return;const s=i.ghostText,o=i.inlineCompletion.toInlineCompletion(void 0);if(o.snippetInfo||o.filterText!==o.insertText){yield this.accept(e);return}const r=s.parts[0],a=new Y(s.lineNumber,r.column),l=r.lines.join("\n"),c=t(a,l);if(c===l.length&&s.parts.length===1){this.accept(e);return}const d=l.substring(0,c);this._isAcceptingPartially=!0;try{e.pushUndoStop(),e.executeEdits("inlineSuggestion.accept",[Yi.replace(I.fromPositions(a),d)]);const u=i5(d);e.setPosition(t5(a,u))}finally{this._isAcceptingPartially=!1}if(o.source.provider.handlePartialAccept){const u=I.fromPositions(o.range.getStartPosition(),t5(a,i5(d))),h=e.getModel().getValueInRange(u,1);o.source.provider.handlePartialAccept(o.source.inlineCompletions,o.sourceInlineCompletion,h.length)}})}handleSuggestAccepted(e){var t,i;const s=e.toSingleTextEdit().removeCommonPrefix(this.textModel),o=this._computeAugmentedCompletion(s,void 0);if(!o)return;const r=o.completion.inlineCompletion;(i=(t=r.source.provider).handlePartialAccept)===null||i===void 0||i.call(t,r.source.inlineCompletions,r.sourceInlineCompletion,s.text.length)}};a5=g8e([MR(9,_t),MR(10,gn),MR(11,Ni)],a5);var p8e=globalThis&&globalThis.__decorate||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},hK=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},iC;class u6{constructor(e){this.name=e}select(e,t,i){if(i.length===0)return 0;const s=i[0].score[0];for(let o=0;ol&&u.type===i[c].completion.kind&&u.insertText===i[c].completion.insertText&&(l=u.touch,a=c),i[c].completion.preselect&&r===-1)return r=c}return a!==-1?a:r!==-1?r:0}toJSON(){return this._cache.toJSON()}fromJSON(e){this._cache.clear();const t=0;for(const[i,s]of e)s.touch=t,s.type=typeof s.type=="number"?s.type:pw.fromString(s.type),this._cache.set(i,s);this._seq=this._cache.size}}class _8e extends u6{constructor(){super("recentlyUsedByPrefix"),this._trie=eb.forStrings(),this._seq=0}memorize(e,t,i){const{word:s}=e.getWordUntilPosition(t),o="".concat(e.getLanguageId(),"/").concat(s);this._trie.set(o,{type:i.completion.kind,insertText:i.completion.insertText,touch:this._seq++})}select(e,t,i){const{word:s}=e.getWordUntilPosition(t);if(!s)return super.select(e,t,i);const o="".concat(e.getLanguageId(),"/").concat(s);let r=this._trie.get(o);if(r||(r=this._trie.findSubstr(o)),r)for(let a=0;ae.push([i,t])),e.sort((t,i)=>-(t[1].touch-i[1].touch)).forEach((t,i)=>t[1].touch=i),e.slice(0,200)}fromJSON(e){if(this._trie.clear(),e.length>0){this._seq=e[0][1].touch+1;for(const[t,i]of e)i.type=typeof i.type=="number"?i.type:pw.fromString(i.type),this._trie.set(t,i)}}}let Ey=iC=class{constructor(e,t){this._storageService=e,this._configService=t,this._disposables=new be,this._persistSoon=new Si(()=>this._saveState(),500),this._disposables.add(e.onWillSaveState(i=>{i.reason===aI.SHUTDOWN&&this._saveState()}))}dispose(){this._disposables.dispose(),this._persistSoon.dispose()}memorize(e,t,i){this._withStrategy(e,t).memorize(e,t,i),this._persistSoon.schedule()}select(e,t,i){return this._withStrategy(e,t).select(e,t,i)}_withStrategy(e,t){var i;const s=this._configService.getValue("editor.suggestSelection",{overrideIdentifier:e.getLanguageIdAtPosition(t.lineNumber,t.column),resource:e.uri});if(((i=this._strategy)===null||i===void 0?void 0:i.name)!==s){this._saveState();const o=iC._strategyCtors.get(s)||Xne;this._strategy=new o;try{const a=this._configService.getValue("editor.suggest.shareSuggestSelections")?0:1,l=this._storageService.get("".concat(iC._storagePrefix,"/").concat(s),a);l&&this._strategy.fromJSON(JSON.parse(l))}catch{}}return this._strategy}_saveState(){if(this._strategy){const t=this._configService.getValue("editor.suggest.shareSuggestSelections")?0:1,i=JSON.stringify(this._strategy);this._storageService.store("".concat(iC._storagePrefix,"/").concat(this._strategy.name),i,t,1)}}};Ey._strategyCtors=new Map([["recentlyUsedByPrefix",_8e],["recentlyUsed",m8e],["first",Xne]]);Ey._storagePrefix="suggest/memories";Ey=iC=p8e([hK(0,yl),hK(1,zt)],Ey);const MN=Wt("ISuggestMemories");Gt(MN,Ey,1);var v8e=globalThis&&globalThis.__decorate||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},b8e=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},l5;let Iy=l5=class{constructor(e,t){this._editor=e,this._enabled=!1,this._ckAtEnd=l5.AtEnd.bindTo(t),this._configListener=this._editor.onDidChangeConfiguration(i=>i.hasChanged(122)&&this._update()),this._update()}dispose(){var e;this._configListener.dispose(),(e=this._selectionListener)===null||e===void 0||e.dispose(),this._ckAtEnd.reset()}_update(){const e=this._editor.getOption(122)==="on";if(this._enabled!==e)if(this._enabled=e,this._enabled){const t=()=>{if(!this._editor.hasModel()){this._ckAtEnd.set(!1);return}const i=this._editor.getModel(),s=this._editor.getSelection(),o=i.getWordAtPosition(s.getStartPosition());if(!o){this._ckAtEnd.set(!1);return}this._ckAtEnd.set(o.endColumn===s.getStartPosition().column)};this._selectionListener=this._editor.onDidChangeCursorSelection(t),t()}else this._selectionListener&&(this._ckAtEnd.reset(),this._selectionListener.dispose(),this._selectionListener=void 0)}};Iy.AtEnd=new Ve("atEndOfWord",!1);Iy=l5=v8e([b8e(1,bt)],Iy);var C8e=globalThis&&globalThis.__decorate||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},w8e=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},nC;let Tm=nC=class{constructor(e,t){this._editor=e,this._index=0,this._ckOtherSuggestions=nC.OtherSuggestions.bindTo(t)}dispose(){this.reset()}reset(){var e;this._ckOtherSuggestions.reset(),(e=this._listener)===null||e===void 0||e.dispose(),this._model=void 0,this._acceptNext=void 0,this._ignore=!1}set({model:e,index:t},i){if(e.items.length===0){this.reset();return}if(nC._moveIndex(!0,e,t)===t){this.reset();return}this._acceptNext=i,this._model=e,this._index=t,this._listener=this._editor.onDidChangeCursorPosition(()=>{this._ignore||this.reset()}),this._ckOtherSuggestions.set(!0)}static _moveIndex(e,t,i){let s=i;for(let o=t.items.length;o>0&&(s=(s+t.items.length+(e?1:-1))%t.items.length,!(s===i||!t.items[s].completion.additionalTextEdits));o--);return s}next(){this._move(!0)}prev(){this._move(!1)}_move(e){if(this._model)try{this._ignore=!0,this._index=nC._moveIndex(e,this._model,this._index),this._acceptNext({index:this._index,item:this._model.items[this._index],model:this._model})}finally{this._ignore=!1}}};Tm.OtherSuggestions=new Ve("hasOtherSuggestions",!1);Tm=nC=C8e([w8e(1,bt)],Tm);class y8e{constructor(e,t,i,s){this._disposables=new be,this._disposables.add(i.onDidSuggest(o=>{o.completionModel.items.length===0&&this.reset()})),this._disposables.add(i.onDidCancel(o=>{this.reset()})),this._disposables.add(t.onDidShow(()=>this._onItem(t.getFocusedItem()))),this._disposables.add(t.onDidFocus(this._onItem,this)),this._disposables.add(t.onDidHide(this.reset,this)),this._disposables.add(e.onWillType(o=>{if(this._active&&!t.isFrozen()&&i.state!==0){const r=o.charCodeAt(o.length-1);this._active.acceptCharacters.has(r)&&e.getOption(0)&&s(this._active.item)}}))}_onItem(e){if(!e||!io(e.item.completion.commitCharacters)){this.reset();return}if(this._active&&this._active.item.item===e.item)return;const t=new LE;for(const i of e.item.completion.commitCharacters)i.length>0&&t.add(i.charCodeAt(0));this._active={acceptCharacters:t,item:e}}reset(){this._active=void 0}dispose(){this._disposables.dispose()}}var S8e=globalThis&&globalThis.__awaiter||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 Pr{provideSelectionRanges(e,t){return S8e(this,void 0,void 0,function*(){const i=[];for(const s of t){const o=[];i.push(o);const r=new Map;yield new Promise(a=>Pr._bracketsRightYield(a,0,e,s,r)),yield new Promise(a=>Pr._bracketsLeftYield(a,0,e,s,r,o))}return i})}static _bracketsRightYield(e,t,i,s,o){const r=new Map,a=Date.now();for(;;){if(t>=Pr._maxRounds){e();break}if(!s){e();break}const l=i.bracketPairs.findNextBracket(s);if(!l){e();break}if(Date.now()-a>Pr._maxDuration){setTimeout(()=>Pr._bracketsRightYield(e,t+1,i,s,o));break}if(l.bracketInfo.isOpeningBracket){const d=l.bracketInfo.bracketText,u=r.has(d)?r.get(d):0;r.set(d,u+1)}else{const d=l.bracketInfo.getOpeningBrackets()[0].bracketText;let u=r.has(d)?r.get(d):0;if(u-=1,r.set(d,Math.max(0,u)),u<0){let h=o.get(d);h||(h=new To,o.set(d,h)),h.push(l.range)}}s=l.range.getEndPosition()}}static _bracketsLeftYield(e,t,i,s,o,r){const a=new Map,l=Date.now();for(;;){if(t>=Pr._maxRounds&&o.size===0){e();break}if(!s){e();break}const c=i.bracketPairs.findPrevBracket(s);if(!c){e();break}if(Date.now()-l>Pr._maxDuration){setTimeout(()=>Pr._bracketsLeftYield(e,t+1,i,s,o,r));break}if(c.bracketInfo.isOpeningBracket){const u=c.bracketInfo.bracketText;let h=a.has(u)?a.get(u):0;if(h-=1,a.set(u,Math.max(0,h)),h<0){const f=o.get(u);if(f){const g=f.shift();f.size===0&&o.delete(u);const p=I.fromPositions(c.range.getEndPosition(),g.getStartPosition()),_=I.fromPositions(c.range.getStartPosition(),g.getEndPosition());r.push({range:p}),r.push({range:_}),Pr._addBracketLeading(i,_,r)}}}else{const u=c.bracketInfo.getOpeningBrackets()[0].bracketText,h=a.has(u)?a.get(u):0;a.set(u,h+1)}s=c.range.getStartPosition()}}static _addBracketLeading(e,t,i){if(t.startLineNumber===t.endLineNumber)return;const s=t.startLineNumber,o=e.getLineFirstNonWhitespaceColumn(s);o!==0&&o!==t.startColumn&&(i.push({range:I.fromPositions(new Y(s,o),t.getEndPosition())}),i.push({range:I.fromPositions(new Y(s,1),t.getEndPosition())}));const r=s-1;if(r>0){const a=e.getLineFirstNonWhitespaceColumn(r);a===t.startColumn&&a!==e.getLineLastNonWhitespaceColumn(r)&&(i.push({range:I.fromPositions(new Y(r,a),t.getEndPosition())}),i.push({range:I.fromPositions(new Y(r,1),t.getEndPosition())}))}}}Pr._maxDuration=30;Pr._maxRounds=2;var L8e=globalThis&&globalThis.__awaiter||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 Kl{static create(e,t){return L8e(this,void 0,void 0,function*(){if(!t.getOption(117).localityBonus||!t.hasModel())return Kl.None;const i=t.getModel(),s=t.getPosition();if(!e.canComputeWordRanges(i.uri))return Kl.None;const[o]=yield new Pr().provideSelectionRanges(i,[s]);if(o.length===0)return Kl.None;const r=yield e.computeWordRanges(i.uri,o[0].range);if(!r)return Kl.None;const a=i.getWordUntilPosition(s);return delete r[a.word],new class extends Kl{distance(l,c){if(!s.equals(t.getPosition()))return 0;if(c.kind===17)return 2<<20;const d=typeof c.label=="string"?c.label:c.label.label,u=r[d];if(UZ(u))return 2<<20;const h=cw(u,I.fromPositions(l),I.compareRangesUsingStarts),f=h>=0?u[h]:u[Math.max(0,~h-1)];let g=o.length;for(const p of o){if(!I.containsRange(p.range,f))break;g-=1}return g}}})}}Kl.None=new class extends Kl{distance(){return 0}};let fK=class{constructor(e,t){this.leadingLineContent=e,this.characterCountDelta=t}};class Kh{constructor(e,t,i,s,o,r,a=Ox.default,l=void 0){this.clipboardText=l,this._snippetCompareFn=Kh._compareCompletionItems,this._items=e,this._column=t,this._wordDistance=s,this._options=o,this._refilterKind=1,this._lineContext=i,this._fuzzyScoreOptions=a,r==="top"?this._snippetCompareFn=Kh._compareCompletionItemsSnippetsUp:r==="bottom"&&(this._snippetCompareFn=Kh._compareCompletionItemsSnippetsDown)}get lineContext(){return this._lineContext}set lineContext(e){(this._lineContext.leadingLineContent!==e.leadingLineContent||this._lineContext.characterCountDelta!==e.characterCountDelta)&&(this._refilterKind=this._lineContext.characterCountDelta0&&i[0].container.incomplete&&e.add(t);return e}get stats(){return this._ensureCachedState(),this._stats}_ensureCachedState(){this._refilterKind!==0&&this._createCachedState()}_createCachedState(){this._itemsByProvider=new Map;const e=[],{leadingLineContent:t,characterCountDelta:i}=this._lineContext;let s="",o="";const r=this._refilterKind===1?this._items:this._filteredItems,a=[],l=!this._options.filterGraceful||r.length>2e3?fm:BTe;for(let c=0;c=f)d.score=lc.Default;else if(typeof d.completion.filterText=="string"){const p=l(s,o,g,d.completion.filterText,d.filterTextLow,0,this._fuzzyScoreOptions);if(!p)continue;RP(d.completion.filterText,d.textLabel)===0?d.score=p:(d.score=RTe(s,o,g,d.textLabel,d.labelLow,0),d.score[0]=p[0])}else{const p=l(s,o,g,d.textLabel,d.labelLow,0,this._fuzzyScoreOptions);if(!p)continue;d.score=p}}d.idx=c,d.distance=this._wordDistance.distance(d.position,d.completion),a.push(d),e.push(d.textLabel.length)}this._filteredItems=a.sort(this._snippetCompareFn),this._refilterKind=0,this._stats={pLabelLen:e.length?B2(e.length-.85,e,(c,d)=>c-d):0}}static _compareCompletionItems(e,t){return e.score[0]>t.score[0]?-1:e.score[0]t.distance?1:e.idxt.idx?1:0}static _compareCompletionItemsSnippetsDown(e,t){if(e.completion.kind!==t.completion.kind){if(e.completion.kind===27)return 1;if(t.completion.kind===27)return-1}return Kh._compareCompletionItems(e,t)}static _compareCompletionItemsSnippetsUp(e,t){if(e.completion.kind!==t.completion.kind){if(e.completion.kind===27)return-1;if(t.completion.kind===27)return 1}return Kh._compareCompletionItems(e,t)}}var k8e=globalThis&&globalThis.__decorate||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},Ch=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},D8e=globalThis&&globalThis.__awaiter||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())})},c5;class Qg{static shouldAutoTrigger(e){if(!e.hasModel())return!1;const t=e.getModel(),i=e.getPosition();t.tokenization.tokenizeIfCheap(i.lineNumber);const s=t.getWordAtPosition(i);return!(!s||s.endColumn!==i.column&&s.startColumn+1!==i.column||!isNaN(Number(s.word)))}constructor(e,t,i){this.leadingLineContent=e.getLineContent(t.lineNumber).substr(0,t.column-1),this.leadingWord=e.getWordUntilPosition(t),this.lineNumber=t.lineNumber,this.column=t.column,this.triggerOptions=i}}function E8e(n,e,t){if(!e.getContextKeyValue(us.inlineSuggestionVisible.key))return!0;const i=e.getContextKeyValue(us.suppressSuggestions.key);return i!==void 0?!i:!n.getOption(62).suppressSuggestions}function I8e(n,e,t){if(!e.getContextKeyValue("inlineSuggestionVisible"))return!0;const i=e.getContextKeyValue(us.suppressSuggestions.key);return i!==void 0?!i:!n.getOption(62).suppressSuggestions}let d5=c5=class{constructor(e,t,i,s,o,r,a,l,c){this._editor=e,this._editorWorkerService=t,this._clipboardService=i,this._telemetryService=s,this._logService=o,this._contextKeyService=r,this._configurationService=a,this._languageFeaturesService=l,this._envService=c,this._toDispose=new be,this._triggerCharacterListener=new be,this._triggerQuickSuggest=new _l,this._triggerState=void 0,this._completionDisposables=new be,this._onDidCancel=new j,this._onDidTrigger=new j,this._onDidSuggest=new j,this.onDidCancel=this._onDidCancel.event,this.onDidTrigger=this._onDidTrigger.event,this.onDidSuggest=this._onDidSuggest.event,this._telemetryGate=0,this._currentSelection=this._editor.getSelection()||new Je(1,1,1,1),this._toDispose.add(this._editor.onDidChangeModel(()=>{this._updateTriggerCharacters(),this.cancel()})),this._toDispose.add(this._editor.onDidChangeModelLanguage(()=>{this._updateTriggerCharacters(),this.cancel()})),this._toDispose.add(this._editor.onDidChangeConfiguration(()=>{this._updateTriggerCharacters()})),this._toDispose.add(this._languageFeaturesService.completionProvider.onDidChange(()=>{this._updateTriggerCharacters(),this._updateActiveSuggestSession()}));let d=!1;this._toDispose.add(this._editor.onDidCompositionStart(()=>{d=!0})),this._toDispose.add(this._editor.onDidCompositionEnd(()=>{d=!1,this._onCompositionEnd()})),this._toDispose.add(this._editor.onDidChangeCursorSelection(u=>{d||this._onCursorChange(u)})),this._toDispose.add(this._editor.onDidChangeModelContent(()=>{!d&&this._triggerState!==void 0&&this._refilterCompletionItems()})),this._updateTriggerCharacters()}dispose(){fi(this._triggerCharacterListener),fi([this._onDidCancel,this._onDidSuggest,this._onDidTrigger,this._triggerQuickSuggest]),this._toDispose.dispose(),this._completionDisposables.dispose(),this.cancel()}_updateTriggerCharacters(){if(this._triggerCharacterListener.clear(),this._editor.getOption(90)||!this._editor.hasModel()||!this._editor.getOption(120))return;const e=new Map;for(const i of this._languageFeaturesService.completionProvider.all(this._editor.getModel()))for(const s of i.triggerCharacters||[]){let o=e.get(s);o||(o=new Set,o.add(n8e()),e.set(s,o)),o.add(i)}const t=i=>{var s;if(!I8e(this._editor,this._contextKeyService,this._configurationService)||Qg.shouldAutoTrigger(this._editor))return;if(!i){const a=this._editor.getPosition();i=this._editor.getModel().getLineContent(a.lineNumber).substr(0,a.column-1)}let o="";rm(i.charCodeAt(i.length-1))?es(i.charCodeAt(i.length-2))&&(o=i.substr(i.length-2)):o=i.charAt(i.length-1);const r=e.get(o);if(r){const a=new Map;if(this._completionModel)for(const[l,c]of this._completionModel.getItemsByProvider())r.has(l)||a.set(l,c);this.trigger({auto:!0,triggerKind:1,triggerCharacter:o,retrigger:!!this._completionModel,clipboardText:(s=this._completionModel)===null||s===void 0?void 0:s.clipboardText,completionOptions:{providerFilter:r,providerItemsToReuse:a}})}};this._triggerCharacterListener.add(this._editor.onDidType(t)),this._triggerCharacterListener.add(this._editor.onDidCompositionEnd(()=>t()))}get state(){return this._triggerState?this._triggerState.auto?2:1:0}cancel(e=!1){var t;this._triggerState!==void 0&&(this._triggerQuickSuggest.cancel(),(t=this._requestToken)===null||t===void 0||t.cancel(),this._requestToken=void 0,this._triggerState=void 0,this._completionModel=void 0,this._context=void 0,this._onDidCancel.fire({retrigger:e}))}clear(){this._completionDisposables.clear()}_updateActiveSuggestSession(){this._triggerState!==void 0&&(!this._editor.hasModel()||!this._languageFeaturesService.completionProvider.has(this._editor.getModel())?this.cancel():this.trigger({auto:this._triggerState.auto,retrigger:!0}))}_onCursorChange(e){if(!this._editor.hasModel())return;const t=this._currentSelection;if(this._currentSelection=this._editor.getSelection(),!e.selection.isEmpty()||e.reason!==0&&e.reason!==3||e.source!=="keyboard"&&e.source!=="deleteLeft"){this.cancel();return}this._triggerState===void 0&&e.reason===0?(t.containsRange(this._currentSelection)||t.getEndPosition().isBeforeOrEqual(this._currentSelection.getPosition()))&&this._doTriggerQuickSuggest():this._triggerState!==void 0&&e.reason===3&&this._refilterCompletionItems()}_onCompositionEnd(){this._triggerState===void 0?this._doTriggerQuickSuggest():this._refilterCompletionItems()}_doTriggerQuickSuggest(){var e;Lv.isAllOff(this._editor.getOption(88))||this._editor.getOption(117).snippetsPreventQuickSuggestions&&(!((e=xs.get(this._editor))===null||e===void 0)&&e.isInSnippet())||(this.cancel(),this._triggerQuickSuggest.cancelAndSet(()=>{if(this._triggerState!==void 0||!Qg.shouldAutoTrigger(this._editor)||!this._editor.hasModel()||!this._editor.hasWidgetFocus())return;const t=this._editor.getModel(),i=this._editor.getPosition(),s=this._editor.getOption(88);if(!Lv.isAllOff(s)){if(!Lv.isAllOn(s)){t.tokenization.tokenizeIfCheap(i.lineNumber);const o=t.tokenization.getLineTokens(i.lineNumber),r=o.getStandardTokenType(o.findTokenIndexAtOffset(Math.max(i.column-1-1,0)));if(Lv.valueFor(s,r)!=="on")return}E8e(this._editor,this._contextKeyService,this._configurationService)&&this._languageFeaturesService.completionProvider.has(t)&&this.trigger({auto:!0})}},this._editor.getOption(89)))}_refilterCompletionItems(){bi(this._editor.hasModel()),bi(this._triggerState!==void 0);const e=this._editor.getModel(),t=this._editor.getPosition(),i=new Qg(e,t,Object.assign(Object.assign({},this._triggerState),{refilter:!0}));this._onNewContext(i)}trigger(e){var t,i,s,o,r,a;if(!this._editor.hasModel())return;const l=this._editor.getModel(),c=new Qg(l,this._editor.getPosition(),e);this.cancel(e.retrigger),this._triggerState=e,this._onDidTrigger.fire({auto:e.auto,shy:(t=e.shy)!==null&&t!==void 0?t:!1,position:this._editor.getPosition()}),this._context=c;let d={triggerKind:(i=e.triggerKind)!==null&&i!==void 0?i:0};e.triggerCharacter&&(d={triggerKind:1,triggerCharacter:e.triggerCharacter}),this._requestToken=new Tn;const u=this._editor.getOption(111);let h=1;switch(u){case"top":h=0;break;case"bottom":h=2;break}const{itemKind:f,showDeprecated:g}=c5._createSuggestFilter(this._editor),p=new Dy(h,(o=(s=e.completionOptions)===null||s===void 0?void 0:s.kindFilter)!==null&&o!==void 0?o:f,(r=e.completionOptions)===null||r===void 0?void 0:r.providerFilter,(a=e.completionOptions)===null||a===void 0?void 0:a.providerItemsToReuse,g),_=Kl.create(this._editorWorkerService,this._editor),v=c6(this._languageFeaturesService.completionProvider,l,this._editor.getPosition(),p,d,this._requestToken.token);Promise.all([v,_]).then(([b,C])=>D8e(this,void 0,void 0,function*(){var w;if((w=this._requestToken)===null||w===void 0||w.dispose(),!this._editor.hasModel())return;let y=e==null?void 0:e.clipboardText;if(!y&&b.needsClipboard&&(y=yield this._clipboardService.readText()),this._triggerState===void 0)return;const L=this._editor.getModel(),S=new Qg(L,this._editor.getPosition(),e),k=Object.assign(Object.assign({},Ox.default),{firstMatchCanBeWeak:!this._editor.getOption(117).matchOnWordStartOnly});if(this._completionModel=new Kh(b.items,this._context.column,{leadingLineContent:S.leadingLineContent,characterCountDelta:S.column-this._context.column},C,this._editor.getOption(117),this._editor.getOption(111),k,y),this._completionDisposables.add(b.disposable),this._onNewContext(S),this._reportDurationsTelemetry(b.durations),!this._envService.isBuilt||this._envService.isExtensionDevelopment)for(const D of b.items)D.isInvalid&&this._logService.warn("[suggest] did IGNORE invalid completion item from ".concat(D.provider._debugDisplayName),D.completion)})).catch(Dt)}_reportDurationsTelemetry(e){this._telemetryGate++%230===0&&setTimeout(()=>{this._telemetryService.publicLog2("suggest.durations.json",{data:JSON.stringify(e)}),this._logService.debug("suggest.durations.json",e)})}static _createSuggestFilter(e){const t=new Set;e.getOption(111)==="none"&&t.add(27);const s=e.getOption(117);return s.showMethods||t.add(0),s.showFunctions||t.add(1),s.showConstructors||t.add(2),s.showFields||t.add(3),s.showVariables||t.add(4),s.showClasses||t.add(5),s.showStructs||t.add(6),s.showInterfaces||t.add(7),s.showModules||t.add(8),s.showProperties||t.add(9),s.showEvents||t.add(10),s.showOperators||t.add(11),s.showUnits||t.add(12),s.showValues||t.add(13),s.showConstants||t.add(14),s.showEnums||t.add(15),s.showEnumMembers||t.add(16),s.showKeywords||t.add(17),s.showWords||t.add(18),s.showColors||t.add(19),s.showFiles||t.add(20),s.showReferences||t.add(21),s.showColors||t.add(22),s.showFolders||t.add(23),s.showTypeParameters||t.add(24),s.showSnippets||t.add(27),s.showUsers||t.add(25),s.showIssues||t.add(26),{itemKind:t,showDeprecated:s.showDeprecated}}_onNewContext(e){if(this._context){if(e.lineNumber!==this._context.lineNumber){this.cancel();return}if(ki(e.leadingLineContent)!==ki(this._context.leadingLineContent)){this.cancel();return}if(e.columnthis._context.leadingWord.startColumn){if(Qg.shouldAutoTrigger(this._editor)&&this._context){const i=this._completionModel.getItemsByProvider();this.trigger({auto:this._context.triggerOptions.auto,retrigger:!0,clipboardText:this._completionModel.clipboardText,completionOptions:{providerItemsToReuse:i}})}return}if(e.column>this._context.column&&this._completionModel.getIncompleteProvider().size>0&&e.leadingWord.word.length!==0){const t=new Map,i=new Set;for(const[s,o]of this._completionModel.getItemsByProvider())o.length>0&&o[0].container.incomplete?i.add(s):t.set(s,o);this.trigger({auto:this._context.triggerOptions.auto,triggerKind:2,retrigger:!0,clipboardText:this._completionModel.clipboardText,completionOptions:{providerFilter:i,providerItemsToReuse:t}})}else{const t=this._completionModel.lineContext;let i=!1;if(this._completionModel.lineContext={leadingLineContent:e.leadingLineContent,characterCountDelta:e.column-this._context.column},this._completionModel.items.length===0){const s=Qg.shouldAutoTrigger(this._editor);if(!this._context){this.cancel();return}if(s&&this._context.leadingWord.endColumn0,i&&e.leadingWord.word.length===0){this.cancel();return}}this._onDidSuggest.fire({completionModel:this._completionModel,triggerOptions:e.triggerOptions,isFrozen:i})}}}}};d5=c5=k8e([Ch(1,Sl),Ch(2,ch),Ch(3,ra),Ch(4,aa),Ch(5,bt),Ch(6,zt),Ch(7,Ze),Ch(8,A9)],d5);class RN{constructor(e,t){this._disposables=new be,this._lastOvertyped=[],this._locked=!1,this._disposables.add(e.onWillType(()=>{if(this._locked||!e.hasModel())return;const i=e.getSelections(),s=i.length;let o=!1;for(let a=0;aRN._maxSelectionLength)return;this._lastOvertyped[a]={value:r.getValueInRange(l),multiline:l.startLineNumber!==l.endLineNumber}}})),this._disposables.add(t.onDidTrigger(i=>{this._locked=!0})),this._disposables.add(t.onDidCancel(i=>{this._locked=!1}))}getLastOvertypedInfo(e){if(e>=0&&e=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},RR=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};class h6 extends gm{updateLabel(){const e=this._keybindingService.lookupKeybinding(this._action.id,this._contextKeyService);if(!e)return super.updateLabel();this.label&&(this.label.textContent=m({key:"content",comment:["A label","A keybinding"]},"{0} ({1})",this._action.label,h6.symbolPrintEnter(e)))}static symbolPrintEnter(e){var t;return(t=e.getLabel())===null||t===void 0?void 0:t.replace(/\benter\b/gi,"⏎")}}let u5=class{constructor(e,t,i,s,o){this._menuId=t,this._menuService=s,this._contextKeyService=o,this._menuDisposables=new be,this.element=ge(e,ye(".suggest-status-bar"));const r=a=>a instanceof fl?i.createInstance(h6,a,void 0):void 0;this._leftActions=new Pa(this.element,{actionViewItemProvider:r}),this._rightActions=new Pa(this.element,{actionViewItemProvider:r}),this._leftActions.domNode.classList.add("left"),this._rightActions.domNode.classList.add("right")}dispose(){this._menuDisposables.dispose(),this._leftActions.dispose(),this._rightActions.dispose(),this.element.remove()}show(){const e=this._menuService.createMenu(this._menuId,this._contextKeyService),t=()=>{const i=[],s=[];for(const[o,r]of e.getActions())o==="left"?i.push(...r):s.push(...r);this._leftActions.clear(),this._leftActions.push(i),this._rightActions.clear(),this._rightActions.push(s)};this._menuDisposables.add(e.onDidChange(()=>t())),this._menuDisposables.add(e)}hide(){this._menuDisposables.clear()}};u5=T8e([RR(2,_t),RR(3,Vd),RR(4,bt)],u5);var x8e=globalThis&&globalThis.__decorate||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},N8e=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};function f6(n){return!!n&&!!(n.completion.documentation||n.completion.detail&&n.completion.detail!==n.completion.label)}let h5=class{constructor(e,t){this._editor=e,this._onDidClose=new j,this.onDidClose=this._onDidClose.event,this._onDidChangeContents=new j,this.onDidChangeContents=this._onDidChangeContents.event,this._disposables=new be,this._renderDisposeable=new be,this._borderWidth=1,this._size=new ii(330,0),this.domNode=ye(".suggest-details"),this.domNode.classList.add("no-docs"),this._markdownRenderer=t.createInstance(Zu,{editor:e}),this._body=ye(".body"),this._scrollbar=new bS(this._body,{alwaysConsumeMouseWheel:!0}),ge(this.domNode,this._scrollbar.getDomNode()),this._disposables.add(this._scrollbar),this._header=ge(this._body,ye(".header")),this._close=ge(this._header,ye("span"+dt.asCSSSelector(Me.close))),this._close.title=m("details.close","Close"),this._type=ge(this._header,ye("p.type")),this._docs=ge(this._body,ye("p.docs")),this._configureFont(),this._disposables.add(this._editor.onDidChangeConfiguration(i=>{i.hasChanged(50)&&this._configureFont()}))}dispose(){this._disposables.dispose(),this._renderDisposeable.dispose()}_configureFont(){const e=this._editor.getOptions(),t=e.get(50),i=t.getMassagedFontFamily(),s=e.get(118)||t.fontSize,o=e.get(119)||t.lineHeight,r=t.fontWeight,a="".concat(s,"px"),l="".concat(o,"px");this.domNode.style.fontSize=a,this.domNode.style.lineHeight="".concat(o/s),this.domNode.style.fontWeight=r,this.domNode.style.fontFeatureSettings=t.fontFeatureSettings,this._type.style.fontFamily=i,this._close.style.height=l,this._close.style.width=l}getLayoutInfo(){const e=this._editor.getOption(119)||this._editor.getOption(50).lineHeight,t=this._borderWidth,i=t*2;return{lineHeight:e,borderWidth:t,borderHeight:i,verticalPadding:22,horizontalPadding:14}}renderLoading(){this._type.textContent=m("loading","Loading..."),this._docs.textContent="",this.domNode.classList.remove("no-docs","no-type"),this.layout(this.size.width,this.getLayoutInfo().lineHeight*2),this._onDidChangeContents.fire(this)}renderItem(e,t){var i,s;this._renderDisposeable.clear();let{detail:o,documentation:r}=e.completion;if(t){let a="";a+="score: ".concat(e.score[0],"\n"),a+="prefix: ".concat((i=e.word)!==null&&i!==void 0?i:"(no prefix)","\n"),a+="word: ".concat(e.completion.filterText?e.completion.filterText+" (filterText)":e.textLabel,"\n"),a+="distance: ".concat(e.distance," (localityBonus-setting)\n"),a+="index: ".concat(e.idx,", based on ").concat(e.completion.sortText&&'sortText: "'.concat(e.completion.sortText,'"')||"label","\n"),a+="commit_chars: ".concat((s=e.completion.commitCharacters)===null||s===void 0?void 0:s.join(""),"\n"),r=new Bs().appendCodeblock("empty",a),o="Provider: ".concat(e.provider._debugDisplayName)}if(!t&&!f6(e)){this.clearContents();return}if(this.domNode.classList.remove("no-docs","no-type"),o){const a=o.length>1e5?"".concat(o.substr(0,1e5),"…"):o;this._type.textContent=a,this._type.title=a,mr(this._type),this._type.classList.toggle("auto-wrap",!/\r?\n^\s+/gmi.test(a))}else Ds(this._type),this._type.title="",Lo(this._type),this.domNode.classList.add("no-type");if(Ds(this._docs),typeof r=="string")this._docs.classList.remove("markdown-docs"),this._docs.textContent=r;else if(r){this._docs.classList.add("markdown-docs"),Ds(this._docs);const a=this._markdownRenderer.render(r);this._docs.appendChild(a.element),this._renderDisposeable.add(a),this._renderDisposeable.add(this._markdownRenderer.onDidRenderAsync(()=>{this.layout(this._size.width,this._type.clientHeight+this._docs.clientHeight),this._onDidChangeContents.fire(this)}))}this.domNode.style.userSelect="text",this.domNode.tabIndex=-1,this._close.onmousedown=a=>{a.preventDefault(),a.stopPropagation()},this._close.onclick=a=>{a.preventDefault(),a.stopPropagation(),this._onDidClose.fire()},this._body.scrollTop=0,this.layout(this._size.width,this._type.clientHeight+this._docs.clientHeight),this._onDidChangeContents.fire(this)}clearContents(){this.domNode.classList.add("no-docs"),this._type.textContent="",this._docs.textContent=""}get size(){return this._size}layout(e,t){const i=new ii(e,t);ii.equals(i,this._size)||(this._size=i,Zbe(this.domNode,e,t)),this._scrollbar.scanDomNode()}scrollDown(e=8){this._body.scrollTop+=e}scrollUp(e=8){this._body.scrollTop-=e}scrollTop(){this._body.scrollTop=0}scrollBottom(){this._body.scrollTop=this._body.scrollHeight}pageDown(){this.scrollDown(80)}pageUp(){this.scrollUp(80)}set borderWidth(e){this._borderWidth=e}get borderWidth(){return this._borderWidth}};h5=x8e([N8e(1,_t)],h5);class A8e{constructor(e,t){this.widget=e,this._editor=t,this._disposables=new be,this._added=!1,this._preferAlignAtTop=!0,this._resizable=new U7,this._resizable.domNode.classList.add("suggest-details-container"),this._resizable.domNode.appendChild(e.domNode),this._resizable.enableSashes(!1,!0,!0,!1);let i,s,o=0,r=0;this._disposables.add(this._resizable.onDidWillResize(()=>{i=this._topLeft,s=this._resizable.size})),this._disposables.add(this._resizable.onDidResize(a=>{if(i&&s){this.widget.layout(a.dimension.width,a.dimension.height);let l=!1;a.west&&(r=s.width-a.dimension.width,l=!0),a.north&&(o=s.height-a.dimension.height,l=!0),l&&this._applyTopLeft({top:i.top+o,left:i.left+r})}a.done&&(i=void 0,s=void 0,o=0,r=0,this._userSize=a.dimension)})),this._disposables.add(this.widget.onDidChangeContents(()=>{var a;this._anchorBox&&this._placeAtAnchor(this._anchorBox,(a=this._userSize)!==null&&a!==void 0?a:this.widget.size,this._preferAlignAtTop)}))}dispose(){this._resizable.dispose(),this._disposables.dispose(),this.hide()}getId(){return"suggest.details"}getDomNode(){return this._resizable.domNode}getPosition(){return null}show(){this._added||(this._editor.addOverlayWidget(this),this.getDomNode().style.position="fixed",this._added=!0)}hide(e=!1){this._resizable.clearSashHoverState(),this._added&&(this._editor.removeOverlayWidget(this),this._added=!1,this._anchorBox=void 0,this._topLeft=void 0),e&&(this._userSize=void 0,this.widget.clearContents())}placeAtAnchor(e,t){var i;const s=e.getBoundingClientRect();this._anchorBox=s,this._preferAlignAtTop=t,this._placeAtAnchor(this._anchorBox,(i=this._userSize)!==null&&i!==void 0?i:this.widget.size,t)}_placeAtAnchor(e,t,i){var s;const o=L0(this.getDomNode().ownerDocument.body),r=this.widget.getLayoutInfo(),a=new ii(220,2*r.lineHeight),l=e.top,c=function(){const C=o.width-(e.left+e.width+r.borderWidth+r.horizontalPadding),w=-r.borderWidth+e.left+e.width,y=new ii(C,o.height-e.top-r.borderHeight-r.verticalPadding),L=y.with(void 0,e.top+e.height-r.borderHeight-r.verticalPadding);return{top:l,left:w,fit:C-t.width,maxSizeTop:y,maxSizeBottom:L,minSize:a.with(Math.min(C,a.width))}}(),d=function(){const C=e.left-r.borderWidth-r.horizontalPadding,w=Math.max(r.horizontalPadding,e.left-t.width-r.borderWidth),y=new ii(C,o.height-e.top-r.borderHeight-r.verticalPadding),L=y.with(void 0,e.top+e.height-r.borderHeight-r.verticalPadding);return{top:l,left:w,fit:C-t.width,maxSizeTop:y,maxSizeBottom:L,minSize:a.with(Math.min(C,a.width))}}(),u=function(){const C=e.left,w=-r.borderWidth+e.top+e.height,y=new ii(e.width-r.borderHeight,o.height-e.top-e.height-r.verticalPadding);return{top:w,left:C,fit:y.height-t.height,maxSizeBottom:y,maxSizeTop:y,minSize:a.with(y.width)}}(),h=[c,d,u],f=(s=h.find(C=>C.fit>=0))!==null&&s!==void 0?s:h.sort((C,w)=>w.fit-C.fit)[0],g=e.top+e.height-r.borderHeight;let p,_=t.height;const v=Math.max(f.maxSizeTop.height,f.maxSizeBottom.height);_>v&&(_=v);let b;i?_<=f.maxSizeTop.height?(p=!0,b=f.maxSizeTop):(p=!1,b=f.maxSizeBottom):_<=f.maxSizeBottom.height?(p=!1,b=f.maxSizeBottom):(p=!0,b=f.maxSizeTop),this._applyTopLeft({left:f.left,top:p?f.top:g-_}),this.getDomNode().style.position="fixed",this._resizable.enableSashes(!p,f===c,p,f!==c),this._resizable.minSize=f.minSize,this._resizable.maxSize=b,this._resizable.layout(_,Math.min(b.width,t.width)),this.widget.layout(this._resizable.size.width,this._resizable.size.height)}_applyTopLeft(e){this._topLeft=e,this.getDomNode().style.left="".concat(this._topLeft.left,"px"),this.getDomNode().style.top="".concat(this._topLeft.top,"px")}}var xu;(function(n){n[n.FILE=0]="FILE",n[n.FOLDER=1]="FOLDER",n[n.ROOT_FOLDER=2]="ROOT_FOLDER"})(xu||(xu={}));const M8e=/(?:\/|^)(?:([^\/]+)\/)?([^\/]+)$/;function Lk(n,e,t,i){const s=i===xu.ROOT_FOLDER?["rootfolder-icon"]:i===xu.FOLDER?["folder-icon"]:["file-icon"];if(t){let o;if(t.scheme===Nt.data)o=Qf.parseMetaData(t).get(Qf.META_DATA_LABEL);else{const r=t.path.match(M8e);r?(o=kk(r[2].toLowerCase()),r[1]&&s.push("".concat(kk(r[1].toLowerCase()),"-name-dir-icon"))):o=kk(t.authority.toLowerCase())}if(i===xu.FOLDER)s.push("".concat(o,"-name-folder-icon"));else{if(o){if(s.push("".concat(o,"-name-file-icon")),s.push("name-file-icon"),o.length<=255){const a=o.split(".");for(let l=1;l=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},PR=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},wh;function Qne(n){return"suggest-aria-id:".concat(n)}const O8e=Sn("suggest-more-info",Me.chevronRight,m("suggestMoreInfoIcon","Icon for more information in the suggest widget.")),F8e=new(wh=class{extract(e,t){if(e.textLabel.match(wh._regexStrict))return t[0]=e.textLabel,!0;if(e.completion.detail&&e.completion.detail.match(wh._regexStrict))return t[0]=e.completion.detail,!0;if(typeof e.completion.documentation=="string"){const i=wh._regexRelaxed.exec(e.completion.documentation);if(i&&(i.index===0||i.index+i[0].length===e.completion.documentation.length))return t[0]=i[0],!0}return!1}},wh._regexRelaxed=/(#([\da-fA-F]{3}){1,2}|(rgb|hsl)a\(\s*(\d{1,3}%?\s*,\s*){3}(1|0?\.\d+)\)|(rgb|hsl)\(\s*\d{1,3}%?(\s*,\s*\d{1,3}%?){2}\s*\))/,wh._regexStrict=new RegExp("^".concat(wh._regexRelaxed.source,"$"),"i"),wh);let f5=class{constructor(e,t,i,s){this._editor=e,this._modelService=t,this._languageService=i,this._themeService=s,this._onDidToggleDetails=new j,this.onDidToggleDetails=this._onDidToggleDetails.event,this.templateId="suggestion"}dispose(){this._onDidToggleDetails.dispose()}renderTemplate(e){const t=new be,i=e;i.classList.add("show-file-icons");const s=ge(e,ye(".icon")),o=ge(s,ye("span.colorspan")),r=ge(e,ye(".contents")),a=ge(r,ye(".main")),l=ge(a,ye(".icon-label.codicon")),c=ge(a,ye("span.left")),d=ge(a,ye("span.right")),u=new wI(c,{supportHighlights:!0,supportIcons:!0});t.add(u);const h=ge(c,ye("span.signature-label")),f=ge(c,ye("span.qualifier-label")),g=ge(d,ye("span.details-label")),p=ge(d,ye("span.readMore"+dt.asCSSSelector(O8e)));p.title=m("readMore","Read More");const _=()=>{const v=this._editor.getOptions(),b=v.get(50),C=b.getMassagedFontFamily(),w=b.fontFeatureSettings,y=v.get(118)||b.fontSize,L=v.get(119)||b.lineHeight,S=b.fontWeight,k=b.letterSpacing,D="".concat(y,"px"),x="".concat(L,"px"),A="".concat(k,"px");i.style.fontSize=D,i.style.fontWeight=S,i.style.letterSpacing=A,a.style.fontFamily=C,a.style.fontFeatureSettings=w,a.style.lineHeight=x,s.style.height=x,s.style.width=x,p.style.height=x,p.style.width=x};return _(),t.add(this._editor.onDidChangeConfiguration(v=>{(v.hasChanged(50)||v.hasChanged(118)||v.hasChanged(119))&&_()})),{root:i,left:c,right:d,icon:s,colorspan:o,iconLabel:u,iconContainer:l,parametersLabel:h,qualifierLabel:f,detailsLabel:g,readMore:p,disposables:t}}renderElement(e,t,i){const{completion:s}=e;i.root.id=Qne(t),i.colorspan.style.backgroundColor="";const o={labelEscapeNewLines:!0,matches:DS(e.score)},r=[];if(s.kind===19&&F8e.extract(e,r))i.icon.className="icon customcolor",i.iconContainer.className="icon hide",i.colorspan.style.backgroundColor=r[0];else if(s.kind===20&&this._themeService.getFileIconTheme().hasFileIcons){i.icon.className="icon hide",i.iconContainer.className="icon hide";const a=Lk(this._modelService,this._languageService,ct.from({scheme:"fake",path:e.textLabel}),xu.FILE),l=Lk(this._modelService,this._languageService,ct.from({scheme:"fake",path:s.detail}),xu.FILE);o.extraClasses=a.length>l.length?a:l}else s.kind===23&&this._themeService.getFileIconTheme().hasFolderIcons?(i.icon.className="icon hide",i.iconContainer.className="icon hide",o.extraClasses=[Lk(this._modelService,this._languageService,ct.from({scheme:"fake",path:e.textLabel}),xu.FOLDER),Lk(this._modelService,this._languageService,ct.from({scheme:"fake",path:s.detail}),xu.FOLDER)].flat()):(i.icon.className="icon hide",i.iconContainer.className="",i.iconContainer.classList.add("suggest-icon",...dt.asClassNameArray(pw.toIcon(s.kind))));s.tags&&s.tags.indexOf(1)>=0&&(o.extraClasses=(o.extraClasses||[]).concat(["deprecated"]),o.matches=[]),i.iconLabel.setLabel(e.textLabel,void 0,o),typeof s.label=="string"?(i.parametersLabel.textContent="",i.detailsLabel.textContent=OR(s.detail||""),i.root.classList.add("string-label")):(i.parametersLabel.textContent=OR(s.label.detail||""),i.detailsLabel.textContent=OR(s.label.description||""),i.root.classList.remove("string-label")),this._editor.getOption(117).showInlineDetails?mr(i.detailsLabel):Lo(i.detailsLabel),f6(e)?(i.right.classList.add("can-expand-details"),mr(i.readMore),i.readMore.onmousedown=a=>{a.stopPropagation(),a.preventDefault()},i.readMore.onclick=a=>{a.stopPropagation(),a.preventDefault(),this._onDidToggleDetails.fire()}):(i.right.classList.remove("can-expand-details"),Lo(i.readMore),i.readMore.onmousedown=null,i.readMore.onclick=null)}disposeTemplate(e){e.disposables.dispose()}};f5=P8e([PR(1,Zi),PR(2,qi),PR(3,os)],f5);function OR(n){return n.replace(/\r\n|\r|\n/g,"")}var B8e=globalThis&&globalThis.__decorate||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=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},W8e=globalThis&&globalThis.__awaiter||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())})},X_;F("editorSuggestWidget.background",{dark:un,light:un,hcDark:un,hcLight:un},m("editorSuggestWidgetBackground","Background color of the suggest widget."));F("editorSuggestWidget.border",{dark:ad,light:ad,hcDark:ad,hcLight:ad},m("editorSuggestWidgetBorder","Border color of the suggest widget."));const Ek=F("editorSuggestWidget.foreground",{dark:Ja,light:Ja,hcDark:Ja,hcLight:Ja},m("editorSuggestWidgetForeground","Foreground color of the suggest widget."));F("editorSuggestWidget.selectedForeground",{dark:Tp,light:Tp,hcDark:Tp,hcLight:Tp},m("editorSuggestWidgetSelectedForeground","Foreground color of the selected entry in the suggest widget."));F("editorSuggestWidget.selectedIconForeground",{dark:av,light:av,hcDark:av,hcLight:av},m("editorSuggestWidgetSelectedIconForeground","Icon foreground color of the selected entry in the suggest widget."));const V8e=F("editorSuggestWidget.selectedBackground",{dark:xp,light:xp,hcDark:xp,hcLight:xp},m("editorSuggestWidgetSelectedBackground","Background color of the selected entry in the suggest widget."));F("editorSuggestWidget.highlightForeground",{dark:el,light:el,hcDark:el,hcLight:el},m("editorSuggestWidgetHighlightForeground","Color of the match highlights in the suggest widget."));F("editorSuggestWidget.focusHighlightForeground",{dark:LL,light:LL,hcDark:LL,hcLight:LL},m("editorSuggestWidgetFocusHighlightForeground","Color of the match highlights in the suggest widget when an item is focused."));F("editorSuggestWidgetStatus.foreground",{dark:nt(Ek,.5),light:nt(Ek,.5),hcDark:nt(Ek,.5),hcLight:nt(Ek,.5)},m("editorSuggestWidgetStatusForeground","Foreground color of the suggest widget status."));class H8e{constructor(e,t){this._service=e,this._key="suggestWidget.size/".concat(t.getEditorType(),"/").concat(t instanceof sg)}restore(){var e;const t=(e=this._service.get(this._key,0))!==null&&e!==void 0?e:"";try{const i=JSON.parse(t);if(ii.is(i))return ii.lift(i)}catch{}}store(e){this._service.store(this._key,JSON.stringify(e),0,1)}reset(){this._service.remove(this._key,0)}}let Ty=X_=class{constructor(e,t,i,s,o){this.editor=e,this._storageService=t,this._state=0,this._isAuto=!1,this._pendingLayout=new Ts,this._pendingShowDetails=new Ts,this._ignoreFocusEvents=!1,this._forceRenderingAbove=!1,this._explainMode=!1,this._showTimeout=new _l,this._disposables=new be,this._onDidSelect=new nm,this._onDidFocus=new nm,this._onDidHide=new j,this._onDidShow=new j,this.onDidSelect=this._onDidSelect.event,this.onDidFocus=this._onDidFocus.event,this.onDidHide=this._onDidHide.event,this.onDidShow=this._onDidShow.event,this._onDetailsKeydown=new j,this.onDetailsKeyDown=this._onDetailsKeydown.event,this.element=new U7,this.element.domNode.classList.add("editor-widget","suggest-widget"),this._contentWidget=new $8e(this,e),this._persistedSize=new H8e(t,e);class r{constructor(f,g,p=!1,_=!1){this.persistedSize=f,this.currentSize=g,this.persistHeight=p,this.persistWidth=_}}let a;this._disposables.add(this.element.onDidWillResize(()=>{this._contentWidget.lockPreference(),a=new r(this._persistedSize.restore(),this.element.size)})),this._disposables.add(this.element.onDidResize(h=>{var f,g,p,_;if(this._resize(h.dimension.width,h.dimension.height),a&&(a.persistHeight=a.persistHeight||!!h.north||!!h.south,a.persistWidth=a.persistWidth||!!h.east||!!h.west),!!h.done){if(a){const{itemHeight:v,defaultSize:b}=this.getLayoutInfo(),C=Math.round(v/2);let{width:w,height:y}=this.element.size;(!a.persistHeight||Math.abs(a.currentSize.height-y)<=C)&&(y=(g=(f=a.persistedSize)===null||f===void 0?void 0:f.height)!==null&&g!==void 0?g:b.height),(!a.persistWidth||Math.abs(a.currentSize.width-w)<=C)&&(w=(_=(p=a.persistedSize)===null||p===void 0?void 0:p.width)!==null&&_!==void 0?_:b.width),this._persistedSize.store(new ii(w,y))}this._contentWidget.unlockPreference(),a=void 0}})),this._messageElement=ge(this.element.domNode,ye(".message")),this._listElement=ge(this.element.domNode,ye(".tree"));const l=this._disposables.add(o.createInstance(h5,this.editor));l.onDidClose(this.toggleDetails,this,this._disposables),this._details=new A8e(l,this.editor);const c=()=>this.element.domNode.classList.toggle("no-icons",!this.editor.getOption(117).showIcons);c();const d=o.createInstance(f5,this.editor);this._disposables.add(d),this._disposables.add(d.onDidToggleDetails(()=>this.toggleDetails())),this._list=new wl("SuggestWidget",this._listElement,{getHeight:h=>this.getLayoutInfo().itemHeight,getTemplateId:h=>"suggestion"},[d],{alwaysConsumeMouseWheel:!0,useShadows:!1,mouseSupport:!1,multipleSelectionSupport:!1,accessibilityProvider:{getRole:()=>"option",getWidgetAriaLabel:()=>m("suggest","Suggest"),getWidgetRole:()=>"listbox",getAriaLabel:h=>{let f=h.textLabel;if(typeof h.completion.label!="string"){const{detail:v,description:b}=h.completion.label;v&&b?f=m("label.full","{0} {1}, {2}",f,v,b):v?f=m("label.detail","{0} {1}",f,v):b&&(f=m("label.desc","{0}, {1}",f,b))}if(!h.isResolved||!this._isDetailsVisible())return f;const{documentation:g,detail:p}=h.completion,_=sm("{0}{1}",p||"",g?typeof g=="string"?g:g.value:"");return m("ariaCurrenttSuggestionReadDetails","{0}, docs: {1}",f,_)}}}),this._list.style(N0({listInactiveFocusBackground:V8e,listInactiveFocusOutline:$i})),this._status=o.createInstance(u5,this.element.domNode,Af);const u=()=>this.element.domNode.classList.toggle("with-status-bar",this.editor.getOption(117).showStatusBar);u(),this._disposables.add(s.onDidColorThemeChange(h=>this._onThemeChange(h))),this._onThemeChange(s.getColorTheme()),this._disposables.add(this._list.onMouseDown(h=>this._onListMouseDownOrTap(h))),this._disposables.add(this._list.onTap(h=>this._onListMouseDownOrTap(h))),this._disposables.add(this._list.onDidChangeSelection(h=>this._onListSelection(h))),this._disposables.add(this._list.onDidChangeFocus(h=>this._onListFocus(h))),this._disposables.add(this.editor.onDidChangeCursorSelection(()=>this._onCursorSelectionChanged())),this._disposables.add(this.editor.onDidChangeConfiguration(h=>{h.hasChanged(117)&&(u(),c())})),this._ctxSuggestWidgetVisible=Tt.Visible.bindTo(i),this._ctxSuggestWidgetDetailsVisible=Tt.DetailsVisible.bindTo(i),this._ctxSuggestWidgetMultipleSuggestions=Tt.MultipleSuggestions.bindTo(i),this._ctxSuggestWidgetHasFocusedSuggestion=Tt.HasFocusedSuggestion.bindTo(i),this._disposables.add(In(this._details.widget.domNode,"keydown",h=>{this._onDetailsKeydown.fire(h)})),this._disposables.add(this.editor.onMouseDown(h=>this._onEditorMouseDown(h)))}dispose(){var e;this._details.widget.dispose(),this._details.dispose(),this._list.dispose(),this._status.dispose(),this._disposables.dispose(),(e=this._loadingTimeout)===null||e===void 0||e.dispose(),this._pendingLayout.dispose(),this._pendingShowDetails.dispose(),this._showTimeout.dispose(),this._contentWidget.dispose(),this.element.dispose()}_onEditorMouseDown(e){this._details.widget.domNode.contains(e.target.element)?this._details.widget.domNode.focus():this.element.domNode.contains(e.target.element)&&this.editor.focus()}_onCursorSelectionChanged(){this._state!==0&&this._contentWidget.layout()}_onListMouseDownOrTap(e){typeof e.element>"u"||typeof e.index>"u"||(e.browserEvent.preventDefault(),e.browserEvent.stopPropagation(),this._select(e.element,e.index))}_onListSelection(e){e.elements.length&&this._select(e.elements[0],e.indexes[0])}_select(e,t){const i=this._completionModel;i&&(this._onDidSelect.fire({item:e,index:t,model:i}),this.editor.focus())}_onThemeChange(e){this._details.widget.borderWidth=ac(e.type)?2:1}_onListFocus(e){var t;if(this._ignoreFocusEvents)return;if(!e.elements.length){this._currentSuggestionDetails&&(this._currentSuggestionDetails.cancel(),this._currentSuggestionDetails=void 0,this._focusedItem=void 0),this.editor.setAriaOptions({activeDescendant:void 0}),this._ctxSuggestWidgetHasFocusedSuggestion.set(!1);return}if(!this._completionModel)return;this._ctxSuggestWidgetHasFocusedSuggestion.set(!0);const i=e.elements[0],s=e.indexes[0];i!==this._focusedItem&&((t=this._currentSuggestionDetails)===null||t===void 0||t.cancel(),this._currentSuggestionDetails=void 0,this._focusedItem=i,this._list.reveal(s),this._currentSuggestionDetails=Xn(o=>W8e(this,void 0,void 0,function*(){const r=Kf(()=>{this._isDetailsVisible()&&this.showDetails(!0)},250),a=o.onCancellationRequested(()=>r.dispose());try{return yield i.resolve(o)}finally{r.dispose(),a.dispose()}})),this._currentSuggestionDetails.then(()=>{s>=this._list.length||i!==this._list.element(s)||(this._ignoreFocusEvents=!0,this._list.splice(s,1,[i]),this._list.setFocus([s]),this._ignoreFocusEvents=!1,this._isDetailsVisible()?this.showDetails(!1):this.element.domNode.classList.remove("docs-side"),this.editor.setAriaOptions({activeDescendant:Qne(s)}))}).catch(Dt)),this._onDidFocus.fire({item:i,index:s,model:this._completionModel})}_setState(e){if(this._state!==e)switch(this._state=e,this.element.domNode.classList.toggle("frozen",e===4),this.element.domNode.classList.remove("message"),e){case 0:Lo(this._messageElement,this._listElement,this._status.element),this._details.hide(!0),this._status.hide(),this._contentWidget.hide(),this._ctxSuggestWidgetVisible.reset(),this._ctxSuggestWidgetMultipleSuggestions.reset(),this._ctxSuggestWidgetHasFocusedSuggestion.reset(),this._showTimeout.cancel(),this.element.domNode.classList.remove("visible"),this._list.splice(0,this._list.length),this._focusedItem=void 0,this._cappedHeight=void 0,this._explainMode=!1;break;case 1:this.element.domNode.classList.add("message"),this._messageElement.textContent=X_.LOADING_MESSAGE,Lo(this._listElement,this._status.element),mr(this._messageElement),this._details.hide(),this._show(),this._focusedItem=void 0,Yf(X_.LOADING_MESSAGE);break;case 2:this.element.domNode.classList.add("message"),this._messageElement.textContent=X_.NO_SUGGESTIONS_MESSAGE,Lo(this._listElement,this._status.element),mr(this._messageElement),this._details.hide(),this._show(),this._focusedItem=void 0,Yf(X_.NO_SUGGESTIONS_MESSAGE);break;case 3:Lo(this._messageElement),mr(this._listElement,this._status.element),this._show();break;case 4:Lo(this._messageElement),mr(this._listElement,this._status.element),this._show();break;case 5:Lo(this._messageElement),mr(this._listElement,this._status.element),this._details.show(),this._show();break}}_show(){this._status.show(),this._contentWidget.show(),this._layout(this._persistedSize.restore()),this._ctxSuggestWidgetVisible.set(!0),this._showTimeout.cancelAndSet(()=>{this.element.domNode.classList.add("visible"),this._onDidShow.fire(this)},100)}showTriggered(e,t){this._state===0&&(this._contentWidget.setPosition(this.editor.getPosition()),this._isAuto=!!e,this._isAuto||(this._loadingTimeout=Kf(()=>this._setState(1),t)))}showSuggestions(e,t,i,s,o){var r,a;if(this._contentWidget.setPosition(this.editor.getPosition()),(r=this._loadingTimeout)===null||r===void 0||r.dispose(),(a=this._currentSuggestionDetails)===null||a===void 0||a.cancel(),this._currentSuggestionDetails=void 0,this._completionModel!==e&&(this._completionModel=e),i&&this._state!==2&&this._state!==0){this._setState(4);return}const l=this._completionModel.items.length,c=l===0;if(this._ctxSuggestWidgetMultipleSuggestions.set(l>1),c){this._setState(s?0:2),this._completionModel=void 0;return}this._focusedItem=void 0,this._onDidFocus.pause(),this._onDidSelect.pause();try{this._list.splice(0,this._list.length,this._completionModel.items),this._setState(i?4:3),this._list.reveal(t,0),this._list.setFocus(o?[]:[t])}finally{this._onDidFocus.resume(),this._onDidSelect.resume()}this._pendingLayout.value=vE(()=>{this._pendingLayout.clear(),this._layout(this.element.size),this._details.widget.domNode.classList.remove("focused")})}focusSelected(){this._list.length>0&&this._list.setFocus([0])}selectNextPage(){switch(this._state){case 0:return!1;case 5:return this._details.widget.pageDown(),!0;case 1:return!this._isAuto;default:return this._list.focusNextPage(),!0}}selectNext(){switch(this._state){case 0:return!1;case 1:return!this._isAuto;default:return this._list.focusNext(1,!0),!0}}selectLast(){switch(this._state){case 0:return!1;case 5:return this._details.widget.scrollBottom(),!0;case 1:return!this._isAuto;default:return this._list.focusLast(),!0}}selectPreviousPage(){switch(this._state){case 0:return!1;case 5:return this._details.widget.pageUp(),!0;case 1:return!this._isAuto;default:return this._list.focusPreviousPage(),!0}}selectPrevious(){switch(this._state){case 0:return!1;case 1:return!this._isAuto;default:return this._list.focusPrevious(1,!0),!1}}selectFirst(){switch(this._state){case 0:return!1;case 5:return this._details.widget.scrollTop(),!0;case 1:return!this._isAuto;default:return this._list.focusFirst(),!0}}getFocusedItem(){if(this._state!==0&&this._state!==2&&this._state!==1&&this._completionModel&&this._list.getFocus().length>0)return{item:this._list.getFocusedElements()[0],index:this._list.getFocus()[0],model:this._completionModel}}toggleDetailsFocus(){this._state===5?(this._setState(3),this._details.widget.domNode.classList.remove("focused")):this._state===3&&this._isDetailsVisible()&&(this._setState(5),this._details.widget.domNode.classList.add("focused"))}toggleDetails(){this._isDetailsVisible()?(this._pendingShowDetails.clear(),this._ctxSuggestWidgetDetailsVisible.set(!1),this._setDetailsVisible(!1),this._details.hide(),this.element.domNode.classList.remove("shows-details")):(f6(this._list.getFocusedElements()[0])||this._explainMode)&&(this._state===3||this._state===5||this._state===4)&&(this._ctxSuggestWidgetDetailsVisible.set(!0),this._setDetailsVisible(!0),this.showDetails(!1))}showDetails(e){this._pendingShowDetails.value=vE(()=>{this._pendingShowDetails.clear(),this._details.show(),e?this._details.widget.renderLoading():this._details.widget.renderItem(this._list.getFocusedElements()[0],this._explainMode),this._positionDetails(),this.editor.focus(),this.element.domNode.classList.add("shows-details")})}toggleExplainMode(){this._list.getFocusedElements()[0]&&(this._explainMode=!this._explainMode,this._isDetailsVisible()?this.showDetails(!1):this.toggleDetails())}resetPersistedSize(){this._persistedSize.reset()}hideWidget(){var e;this._pendingLayout.clear(),this._pendingShowDetails.clear(),(e=this._loadingTimeout)===null||e===void 0||e.dispose(),this._setState(0),this._onDidHide.fire(this),this.element.clearSashHoverState();const t=this._persistedSize.restore(),i=Math.ceil(this.getLayoutInfo().itemHeight*4.3);t&&t.heightc&&(l=c);const d=this._completionModel?this._completionModel.stats.pLabelLen*r.typicalHalfwidthCharacterWidth:l,u=r.statusBarHeight+this._list.contentHeight+r.borderHeight,h=r.itemHeight+r.statusBarHeight,f=Un(this.editor.getDomNode()),g=this.editor.getScrolledVisiblePosition(this.editor.getPosition()),p=f.top+g.top+g.height,_=Math.min(o.height-p-r.verticalPadding,u),v=f.top+g.top-r.verticalPadding,b=Math.min(v,u);let C=Math.min(Math.max(b,_)+r.borderHeight,u);a===((t=this._cappedHeight)===null||t===void 0?void 0:t.capped)&&(a=this._cappedHeight.wanted),aC&&(a=C);const w=150;a>_||this._forceRenderingAbove&&v>w?(this._contentWidget.setPreference(1),this.element.enableSashes(!0,!0,!1,!1),C=b):(this._contentWidget.setPreference(2),this.element.enableSashes(!1,!0,!0,!1),C=_),this.element.preferredSize=new ii(d,r.defaultSize.height),this.element.maxSize=new ii(c,C),this.element.minSize=new ii(220,h),this._cappedHeight=a===u?{wanted:(s=(i=this._cappedHeight)===null||i===void 0?void 0:i.wanted)!==null&&s!==void 0?s:e.height,capped:a}:void 0}this._resize(l,a)}_resize(e,t){const{width:i,height:s}=this.element.maxSize;e=Math.min(i,e),t=Math.min(s,t);const{statusBarHeight:o}=this.getLayoutInfo();this._list.layout(t-o,e),this._listElement.style.height="".concat(t-o,"px"),this.element.layout(t,e),this._contentWidget.layout(),this._positionDetails()}_positionDetails(){var e;this._isDetailsVisible()&&this._details.placeAtAnchor(this.element.domNode,((e=this._contentWidget.getPosition())===null||e===void 0?void 0:e.preference[0])===2)}getLayoutInfo(){const e=this.editor.getOption(50),t=fr(this.editor.getOption(119)||e.lineHeight,8,1e3),i=!this.editor.getOption(117).showStatusBar||this._state===2||this._state===1?0:t,s=this._details.widget.borderWidth,o=2*s;return{itemHeight:t,statusBarHeight:i,borderWidth:s,borderHeight:o,typicalHalfwidthCharacterWidth:e.typicalHalfwidthCharacterWidth,verticalPadding:22,horizontalPadding:14,defaultSize:new ii(430,i+12*t+o)}}_isDetailsVisible(){return this._storageService.getBoolean("expandSuggestionDocs",0,!1)}_setDetailsVisible(e){this._storageService.store("expandSuggestionDocs",e,0,0)}forceRenderingAbove(){this._forceRenderingAbove||(this._forceRenderingAbove=!0,this._layout(this._persistedSize.restore()))}stopForceRenderingAbove(){this._forceRenderingAbove=!1}};Ty.LOADING_MESSAGE=m("suggestWidget.loading","Loading...");Ty.NO_SUGGESTIONS_MESSAGE=m("suggestWidget.noSuggestions","No suggestions.");Ty=X_=B8e([Dk(1,yl),Dk(2,bt),Dk(3,os),Dk(4,_t)],Ty);class $8e{constructor(e,t){this._widget=e,this._editor=t,this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this._preferenceLocked=!1,this._added=!1,this._hidden=!1}dispose(){this._added&&(this._added=!1,this._editor.removeContentWidget(this))}getId(){return"editor.widget.suggestWidget"}getDomNode(){return this._widget.element.domNode}show(){this._hidden=!1,this._added||(this._added=!0,this._editor.addContentWidget(this))}hide(){this._hidden||(this._hidden=!0,this.layout())}layout(){this._editor.layoutContentWidget(this)}getPosition(){return this._hidden||!this._position||!this._preference?null:{position:this._position,preference:[this._preference]}}beforeRender(){const{height:e,width:t}=this._widget.element.size,{borderWidth:i,horizontalPadding:s}=this._widget.getLayoutInfo();return new ii(t+2*i+s,e+2*i)}afterRender(e){this._widget._afterRender(e)}setPreference(e){this._preferenceLocked||(this._preference=e)}lockPreference(){this._preferenceLocked=!0}unlockPreference(){this._preferenceLocked=!1}setPosition(e){this._position=e}}var z8e=globalThis&&globalThis.__decorate||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},O_=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},g5;class U8e{constructor(e,t){if(this._model=e,this._position=t,e.getLineMaxColumn(t.lineNumber)!==t.column){const s=e.getOffsetAt(t),o=e.getPositionAt(s+1);this._marker=e.deltaDecorations([],[{range:I.fromPositions(t,o),options:{description:"suggest-line-suffix",stickiness:1}}])}}dispose(){this._marker&&!this._model.isDisposed()&&this._model.deltaDecorations(this._marker,[])}delta(e){if(this._model.isDisposed()||this._position.lineNumber!==e.lineNumber)return 0;if(this._marker){const t=this._model.getDecorationRange(this._marker[0]);return this._model.getOffsetAt(t.getStartPosition())-this._model.getOffsetAt(e)}else return this._model.getLineMaxColumn(e.lineNumber)-e.column}}let il=g5=class{static get(e){return e.getContribution(g5.ID)}constructor(e,t,i,s,o,r,a){this._memoryService=t,this._commandService=i,this._contextKeyService=s,this._instantiationService=o,this._logService=r,this._telemetryService=a,this._lineSuffix=new Ts,this._toDispose=new be,this._selectors=new j8e(u=>u.priority),this._onWillInsertSuggestItem=new j,this.onWillInsertSuggestItem=this._onWillInsertSuggestItem.event,this.editor=e,this.model=o.createInstance(d5,this.editor),this._selectors.register({priority:0,select:(u,h,f)=>this._memoryService.select(u,h,f)});const l=Tt.InsertMode.bindTo(s);l.set(e.getOption(117).insertMode),this._toDispose.add(this.model.onDidTrigger(()=>l.set(e.getOption(117).insertMode))),this.widget=this._toDispose.add(new aD(()=>{const u=this._instantiationService.createInstance(Ty,this.editor);this._toDispose.add(u),this._toDispose.add(u.onDidSelect(_=>this._insertSuggestion(_,0),this));const h=new y8e(this.editor,u,this.model,_=>this._insertSuggestion(_,2));this._toDispose.add(h);const f=Tt.MakesTextEdit.bindTo(this._contextKeyService),g=Tt.HasInsertAndReplaceRange.bindTo(this._contextKeyService),p=Tt.CanResolve.bindTo(this._contextKeyService);return this._toDispose.add(vt(()=>{f.reset(),g.reset(),p.reset()})),this._toDispose.add(u.onDidFocus(({item:_})=>{const v=this.editor.getPosition(),b=_.editStart.column,C=v.column;let w=!0;this.editor.getOption(1)==="smart"&&this.model.state===2&&!_.completion.additionalTextEdits&&!(_.completion.insertTextRules&4)&&C-b===_.completion.insertText.length&&(w=this.editor.getModel().getValueInRange({startLineNumber:v.lineNumber,startColumn:b,endLineNumber:v.lineNumber,endColumn:C})!==_.completion.insertText),f.set(w),g.set(!Y.equals(_.editInsertEnd,_.editReplaceEnd)),p.set(!!_.provider.resolveCompletionItem||!!_.completion.documentation||_.completion.detail!==_.completion.label)})),this._toDispose.add(u.onDetailsKeyDown(_=>{if(_.toKeyCodeChord().equals(new Gu(!0,!1,!1,!1,33))||Kt&&_.toKeyCodeChord().equals(new Gu(!1,!1,!1,!0,33))){_.stopPropagation();return}_.toKeyCodeChord().isModifierKey()||this.editor.focus()})),u})),this._overtypingCapturer=this._toDispose.add(new aD(()=>this._toDispose.add(new RN(this.editor,this.model)))),this._alternatives=this._toDispose.add(new aD(()=>this._toDispose.add(new Tm(this.editor,this._contextKeyService)))),this._toDispose.add(o.createInstance(Iy,e)),this._toDispose.add(this.model.onDidTrigger(u=>{this.widget.value.showTriggered(u.auto,u.shy?250:50),this._lineSuffix.value=new U8e(this.editor.getModel(),u.position)})),this._toDispose.add(this.model.onDidSuggest(u=>{if(u.triggerOptions.shy)return;let h=-1;for(const g of this._selectors.itemsOrderedByPriorityDesc)if(h=g.select(this.editor.getModel(),this.editor.getPosition(),u.completionModel.items),h!==-1)break;h===-1&&(h=0);let f=!1;if(u.triggerOptions.auto){const g=this.editor.getOption(117);g.selectionMode==="never"||g.selectionMode==="always"?f=g.selectionMode==="never":g.selectionMode==="whenTriggerCharacter"?f=u.triggerOptions.triggerKind!==1:g.selectionMode==="whenQuickSuggestion"&&(f=u.triggerOptions.triggerKind===1&&!u.triggerOptions.refilter)}this.widget.value.showSuggestions(u.completionModel,h,u.isFrozen,u.triggerOptions.auto,f)})),this._toDispose.add(this.model.onDidCancel(u=>{u.retrigger||this.widget.value.hideWidget()})),this._toDispose.add(this.editor.onDidBlurEditorWidget(()=>{this.model.cancel(),this.model.clear()}));const c=Tt.AcceptSuggestionsOnEnter.bindTo(s),d=()=>{const u=this.editor.getOption(1);c.set(u==="on"||u==="smart")};this._toDispose.add(this.editor.onDidChangeConfiguration(()=>d())),d()}dispose(){this._alternatives.dispose(),this._toDispose.dispose(),this.widget.dispose(),this.model.dispose(),this._lineSuffix.dispose(),this._onWillInsertSuggestItem.dispose()}_insertSuggestion(e,t){if(!e||!e.item){this._alternatives.value.reset(),this.model.cancel(),this.model.clear();return}if(!this.editor.hasModel())return;const i=xs.get(this.editor);if(!i)return;this._onWillInsertSuggestItem.fire({item:e.item});const s=this.editor.getModel(),o=s.getAlternativeVersionId(),{item:r}=e,a=[],l=new Tn;t&1||this.editor.pushUndoStop();const c=this.getOverwriteInfo(r,!!(t&8));this._memoryService.memorize(s,this.editor.getPosition(),r);const d=r.isResolved;let u=-1,h=-1;if(Array.isArray(r.completion.additionalTextEdits)){this.model.cancel();const g=mc.capture(this.editor);this.editor.executeEdits("suggestController.additionalTextEdits.sync",r.completion.additionalTextEdits.map(p=>Yi.replaceMove(I.lift(p.range),p.text))),g.restoreRelativeVerticalPositionOfCursor(this.editor)}else if(!d){const g=new so;let p;const _=s.onDidChangeContent(w=>{if(w.isFlush){l.cancel(),_.dispose();return}for(const y of w.changes){const L=I.getEndPosition(y.range);(!p||Y.isBefore(L,p))&&(p=L)}}),v=t;t|=2;let b=!1;const C=this.editor.onWillType(()=>{C.dispose(),b=!0,v&2||this.editor.pushUndoStop()});a.push(r.resolve(l.token).then(()=>{if(!r.completion.additionalTextEdits||l.token.isCancellationRequested)return;if(p&&r.completion.additionalTextEdits.some(y=>Y.isBefore(p,I.getStartPosition(y.range))))return!1;b&&this.editor.pushUndoStop();const w=mc.capture(this.editor);return this.editor.executeEdits("suggestController.additionalTextEdits.async",r.completion.additionalTextEdits.map(y=>Yi.replaceMove(I.lift(y.range),y.text))),w.restoreRelativeVerticalPositionOfCursor(this.editor),(b||!(v&2))&&this.editor.pushUndoStop(),!0}).then(w=>{this._logService.trace("[suggest] async resolving of edits DONE (ms, applied?)",g.elapsed(),w),h=w===!0?1:w===!1?0:-2}).finally(()=>{_.dispose(),C.dispose()}))}let{insertText:f}=r.completion;if(r.completion.insertTextRules&4||(f=t0.escape(f)),this.model.cancel(),i.insert(f,{overwriteBefore:c.overwriteBefore,overwriteAfter:c.overwriteAfter,undoStopBefore:!1,undoStopAfter:!1,adjustWhitespace:!(r.completion.insertTextRules&1),clipboardText:e.model.clipboardText,overtypingCapturer:this._overtypingCapturer.value}),t&2||this.editor.pushUndoStop(),r.completion.command)if(r.completion.command.id===KS.id)this.model.trigger({auto:!0,retrigger:!0});else{const g=new so;a.push(this._commandService.executeCommand(r.completion.command.id,...r.completion.command.arguments?[...r.completion.command.arguments]:[]).catch(p=>{r.completion.extensionId?Bn(p):Dt(p)}).finally(()=>{u=g.elapsed()}))}t&4&&this._alternatives.value.set(e,g=>{for(l.cancel();s.canUndo();){o!==s.getAlternativeVersionId()&&s.undo(),this._insertSuggestion(g,3|(t&8?8:0));break}}),this._alertCompletionItem(r),Promise.all(a).finally(()=>{this._reportSuggestionAcceptedTelemetry(r,s,d,u,h),this.model.clear(),l.dispose()})}_reportSuggestionAcceptedTelemetry(e,t,i,s,o){var r,a,l;Math.floor(Math.random()*100)!==0&&this._telemetryService.publicLog2("suggest.acceptedSuggestion",{extensionId:(a=(r=e.extensionId)===null||r===void 0?void 0:r.value)!==null&&a!==void 0?a:"unknown",providerId:(l=e.provider._debugDisplayName)!==null&&l!==void 0?l:"unknown",kind:e.completion.kind,basenameHash:SQ(Ra(t.uri)).toString(16),languageId:t.getLanguageId(),fileExtension:Qke(t.uri),resolveInfo:e.provider.resolveCompletionItem?i?1:0:-1,resolveDuration:e.resolveDuration,commandDuration:s,additionalEditsAsync:o})}getOverwriteInfo(e,t){bi(this.editor.hasModel());let i=this.editor.getOption(117).insertMode==="replace";t&&(i=!i);const s=e.position.column-e.editStart.column,o=(i?e.editReplaceEnd.column:e.editInsertEnd.column)-e.position.column,r=this.editor.getPosition().column-e.position.column,a=this._lineSuffix.value?this._lineSuffix.value.delta(this.editor.getPosition()):0;return{overwriteBefore:s+r,overwriteAfter:o+a}}_alertCompletionItem(e){if(io(e.completion.additionalTextEdits)){const t=m("aria.alert.snippet","Accepting '{0}' made {1} additional edits",e.textLabel,e.completion.additionalTextEdits.length);to(t)}}triggerSuggest(e,t,i){this.editor.hasModel()&&(this.model.trigger({auto:t!=null?t:!1,completionOptions:{providerFilter:e,kindFilter:i?new Set:void 0}}),this.editor.revealPosition(this.editor.getPosition(),0),this.editor.focus())}triggerSuggestAndAcceptBest(e){if(!this.editor.hasModel())return;const t=this.editor.getPosition(),i=()=>{t.equals(this.editor.getPosition())&&this._commandService.executeCommand(e.fallback)},s=o=>{if(o.completion.insertTextRules&4||o.completion.additionalTextEdits)return!0;const r=this.editor.getPosition(),a=o.editStart.column,l=r.column;return l-a!==o.completion.insertText.length?!0:this.editor.getModel().getValueInRange({startLineNumber:r.lineNumber,startColumn:a,endLineNumber:r.lineNumber,endColumn:l})!==o.completion.insertText};We.once(this.model.onDidTrigger)(o=>{const r=[];We.any(this.model.onDidTrigger,this.model.onDidCancel)(()=>{fi(r),i()},void 0,r),this.model.onDidSuggest(({completionModel:a})=>{if(fi(r),a.items.length===0){i();return}const l=this._memoryService.select(this.editor.getModel(),this.editor.getPosition(),a.items),c=a.items[l];if(!s(c)){i();return}this.editor.pushUndoStop(),this._insertSuggestion({index:l,item:c,model:a},7)},void 0,r)}),this.model.trigger({auto:!1,shy:!0}),this.editor.revealPosition(t,0),this.editor.focus()}acceptSelectedSuggestion(e,t){const i=this.widget.value.getFocusedItem();let s=0;e&&(s|=4),t&&(s|=8),this._insertSuggestion(i,s)}acceptNextSuggestion(){this._alternatives.value.next()}acceptPrevSuggestion(){this._alternatives.value.prev()}cancelSuggestWidget(){this.model.cancel(),this.model.clear(),this.widget.value.hideWidget()}focusSuggestion(){this.widget.value.focusSelected()}selectNextSuggestion(){this.widget.value.selectNext()}selectNextPageSuggestion(){this.widget.value.selectNextPage()}selectLastSuggestion(){this.widget.value.selectLast()}selectPrevSuggestion(){this.widget.value.selectPrevious()}selectPrevPageSuggestion(){this.widget.value.selectPreviousPage()}selectFirstSuggestion(){this.widget.value.selectFirst()}toggleSuggestionDetails(){this.widget.value.toggleDetails()}toggleExplainMode(){this.widget.value.toggleExplainMode()}toggleSuggestionFocus(){this.widget.value.toggleDetailsFocus()}resetWidgetSize(){this.widget.value.resetPersistedSize()}forceRenderingAbove(){this.widget.value.forceRenderingAbove()}stopForceRenderingAbove(){this.widget.isInitialized&&this.widget.value.stopForceRenderingAbove()}registerSelector(e){return this._selectors.register(e)}};il.ID="editor.contrib.suggestController";il=g5=z8e([O_(1,MN),O_(2,gn),O_(3,bt),O_(4,_t),O_(5,aa),O_(6,ra)],il);class j8e{constructor(e){this.prioritySelector=e,this._items=new Array}register(e){if(this._items.indexOf(e)!==-1)throw new Error("Value is already registered");return this._items.push(e),this._items.sort((t,i)=>this.prioritySelector(i)-this.prioritySelector(t)),{dispose:()=>{const t=this._items.indexOf(e);t>=0&&this._items.splice(t,1)}}}get itemsOrderedByPriorityDesc(){return this._items}}class KS extends Ue{constructor(){super({id:KS.id,label:m("suggest.trigger.label","Trigger Suggest"),alias:"Trigger Suggest",precondition:fe.and(O.writable,O.hasCompletionItemProvider,Tt.Visible.toNegated()),kbOpts:{kbExpr:O.textInputFocus,primary:2058,secondary:[2087],mac:{primary:266,secondary:[521,2087]},weight:100}})}run(e,t,i){const s=il.get(t);if(!s)return;let o;i&&typeof i=="object"&&i.auto===!0&&(o=!0),s.triggerSuggest(void 0,o,void 0)}}KS.id="editor.action.triggerSuggest";ti(il.ID,il,2);De(KS);const ea=100+90,Wo=fs.bindToContribution(il.get);Re(new Wo({id:"acceptSelectedSuggestion",precondition:fe.and(Tt.Visible,Tt.HasFocusedSuggestion),handler(n){n.acceptSelectedSuggestion(!0,!1)},kbOpts:[{primary:2,kbExpr:fe.and(Tt.Visible,O.textInputFocus),weight:ea},{primary:3,kbExpr:fe.and(Tt.Visible,O.textInputFocus,Tt.AcceptSuggestionsOnEnter,Tt.MakesTextEdit),weight:ea}],menuOpts:[{menuId:Af,title:m("accept.insert","Insert"),group:"left",order:1,when:Tt.HasInsertAndReplaceRange.toNegated()},{menuId:Af,title:m("accept.insert","Insert"),group:"left",order:1,when:fe.and(Tt.HasInsertAndReplaceRange,Tt.InsertMode.isEqualTo("insert"))},{menuId:Af,title:m("accept.replace","Replace"),group:"left",order:1,when:fe.and(Tt.HasInsertAndReplaceRange,Tt.InsertMode.isEqualTo("replace"))}]}));Re(new Wo({id:"acceptAlternativeSelectedSuggestion",precondition:fe.and(Tt.Visible,O.textInputFocus,Tt.HasFocusedSuggestion),kbOpts:{weight:ea,kbExpr:O.textInputFocus,primary:1027,secondary:[1026]},handler(n){n.acceptSelectedSuggestion(!1,!0)},menuOpts:[{menuId:Af,group:"left",order:2,when:fe.and(Tt.HasInsertAndReplaceRange,Tt.InsertMode.isEqualTo("insert")),title:m("accept.replace","Replace")},{menuId:Af,group:"left",order:2,when:fe.and(Tt.HasInsertAndReplaceRange,Tt.InsertMode.isEqualTo("replace")),title:m("accept.insert","Insert")}]}));qt.registerCommandAlias("acceptSelectedSuggestionOnEnter","acceptSelectedSuggestion");Re(new Wo({id:"hideSuggestWidget",precondition:Tt.Visible,handler:n=>n.cancelSuggestWidget(),kbOpts:{weight:ea,kbExpr:O.textInputFocus,primary:9,secondary:[1033]}}));Re(new Wo({id:"selectNextSuggestion",precondition:fe.and(Tt.Visible,fe.or(Tt.MultipleSuggestions,Tt.HasFocusedSuggestion.negate())),handler:n=>n.selectNextSuggestion(),kbOpts:{weight:ea,kbExpr:O.textInputFocus,primary:18,secondary:[2066],mac:{primary:18,secondary:[2066,300]}}}));Re(new Wo({id:"selectNextPageSuggestion",precondition:fe.and(Tt.Visible,fe.or(Tt.MultipleSuggestions,Tt.HasFocusedSuggestion.negate())),handler:n=>n.selectNextPageSuggestion(),kbOpts:{weight:ea,kbExpr:O.textInputFocus,primary:12,secondary:[2060]}}));Re(new Wo({id:"selectLastSuggestion",precondition:fe.and(Tt.Visible,fe.or(Tt.MultipleSuggestions,Tt.HasFocusedSuggestion.negate())),handler:n=>n.selectLastSuggestion()}));Re(new Wo({id:"selectPrevSuggestion",precondition:fe.and(Tt.Visible,fe.or(Tt.MultipleSuggestions,Tt.HasFocusedSuggestion.negate())),handler:n=>n.selectPrevSuggestion(),kbOpts:{weight:ea,kbExpr:O.textInputFocus,primary:16,secondary:[2064],mac:{primary:16,secondary:[2064,302]}}}));Re(new Wo({id:"selectPrevPageSuggestion",precondition:fe.and(Tt.Visible,fe.or(Tt.MultipleSuggestions,Tt.HasFocusedSuggestion.negate())),handler:n=>n.selectPrevPageSuggestion(),kbOpts:{weight:ea,kbExpr:O.textInputFocus,primary:11,secondary:[2059]}}));Re(new Wo({id:"selectFirstSuggestion",precondition:fe.and(Tt.Visible,fe.or(Tt.MultipleSuggestions,Tt.HasFocusedSuggestion.negate())),handler:n=>n.selectFirstSuggestion()}));Re(new Wo({id:"focusSuggestion",precondition:fe.and(Tt.Visible,Tt.HasFocusedSuggestion.negate()),handler:n=>n.focusSuggestion(),kbOpts:{weight:ea,kbExpr:O.textInputFocus,primary:2058,secondary:[2087],mac:{primary:266,secondary:[2087]}}}));Re(new Wo({id:"focusAndAcceptSuggestion",precondition:fe.and(Tt.Visible,Tt.HasFocusedSuggestion.negate()),handler:n=>{n.focusSuggestion(),n.acceptSelectedSuggestion(!0,!1)}}));Re(new Wo({id:"toggleSuggestionDetails",precondition:fe.and(Tt.Visible,Tt.HasFocusedSuggestion),handler:n=>n.toggleSuggestionDetails(),kbOpts:{weight:ea,kbExpr:O.textInputFocus,primary:2058,secondary:[2087],mac:{primary:266,secondary:[2087]}},menuOpts:[{menuId:Af,group:"right",order:1,when:fe.and(Tt.DetailsVisible,Tt.CanResolve),title:m("detail.more","show less")},{menuId:Af,group:"right",order:1,when:fe.and(Tt.DetailsVisible.toNegated(),Tt.CanResolve),title:m("detail.less","show more")}]}));Re(new Wo({id:"toggleExplainMode",precondition:Tt.Visible,handler:n=>n.toggleExplainMode(),kbOpts:{weight:100,primary:2138}}));Re(new Wo({id:"toggleSuggestionFocus",precondition:Tt.Visible,handler:n=>n.toggleSuggestionFocus(),kbOpts:{weight:ea,kbExpr:O.textInputFocus,primary:2570,mac:{primary:778}}}));Re(new Wo({id:"insertBestCompletion",precondition:fe.and(O.textInputFocus,fe.equals("config.editor.tabCompletion","on"),Iy.AtEnd,Tt.Visible.toNegated(),Tm.OtherSuggestions.toNegated(),xs.InSnippetMode.toNegated()),handler:(n,e)=>{n.triggerSuggestAndAcceptBest(Io(e)?Object.assign({fallback:"tab"},e):{fallback:"tab"})},kbOpts:{weight:ea,primary:2}}));Re(new Wo({id:"insertNextSuggestion",precondition:fe.and(O.textInputFocus,fe.equals("config.editor.tabCompletion","on"),Tm.OtherSuggestions,Tt.Visible.toNegated(),xs.InSnippetMode.toNegated()),handler:n=>n.acceptNextSuggestion(),kbOpts:{weight:ea,kbExpr:O.textInputFocus,primary:2}}));Re(new Wo({id:"insertPrevSuggestion",precondition:fe.and(O.textInputFocus,fe.equals("config.editor.tabCompletion","on"),Tm.OtherSuggestions,Tt.Visible.toNegated(),xs.InSnippetMode.toNegated()),handler:n=>n.acceptPrevSuggestion(),kbOpts:{weight:ea,kbExpr:O.textInputFocus,primary:1026}}));De(class extends Ue{constructor(){super({id:"editor.action.resetSuggestSize",label:m("suggest.reset.label","Reset Suggest Widget Size"),alias:"Reset Suggest Widget Size",precondition:void 0})}run(n,e){var t;(t=il.get(e))===null||t===void 0||t.resetWidgetSize()}});class K8e extends te{get selectedItem(){return this._selectedItem}constructor(e,t,i,s){super(),this.editor=e,this.suggestControllerPreselector=t,this.checkModelVersion=i,this.onWillAccept=s,this.isSuggestWidgetVisible=!1,this.isShiftKeyPressed=!1,this._isActive=!1,this._currentSuggestItemInfo=void 0,this._selectedItem=Pi(this,void 0),this._register(e.onKeyDown(r=>{r.shiftKey&&!this.isShiftKeyPressed&&(this.isShiftKeyPressed=!0,this.update(this._isActive))})),this._register(e.onKeyUp(r=>{r.shiftKey&&this.isShiftKeyPressed&&(this.isShiftKeyPressed=!1,this.update(this._isActive))}));const o=il.get(this.editor);if(o){this._register(o.registerSelector({priority:100,select:(l,c,d)=>{var u;Gi(v=>this.checkModelVersion(v));const h=this.editor.getModel();if(!h)return-1;const f=(u=this.suggestControllerPreselector())===null||u===void 0?void 0:u.removeCommonPrefix(h);if(!f)return-1;const g=Y.lift(c),p=d.map((v,b)=>{const w=$C.fromSuggestion(o,h,g,v,this.isShiftKeyPressed).toSingleTextEdit().removeCommonPrefix(h),y=f.augments(w);return{index:b,valid:y,prefixLength:w.text.length,suggestItem:v}}).filter(v=>v&&v.valid&&v.prefixLength>0),_=DQ(p,Sa(v=>v.prefixLength,Mu));return _?_.index:-1}}));let r=!1;const a=()=>{r||(r=!0,this._register(o.widget.value.onDidShow(()=>{this.isSuggestWidgetVisible=!0,this.update(!0)})),this._register(o.widget.value.onDidHide(()=>{this.isSuggestWidgetVisible=!1,this.update(!1)})),this._register(o.widget.value.onDidFocus(()=>{this.isSuggestWidgetVisible=!0,this.update(!0)})))};this._register(We.once(o.model.onDidTrigger)(l=>{a()})),this._register(o.onWillInsertSuggestItem(l=>{const c=this.editor.getPosition(),d=this.editor.getModel();if(!c||!d)return;const u=$C.fromSuggestion(o,d,c,l.item,this.isShiftKeyPressed);this.onWillAccept(u)}))}this.update(this._isActive)}update(e){const t=this.getSuggestItemInfo();(this._isActive!==e||!q8e(this._currentSuggestItemInfo,t))&&(this._isActive=e,this._currentSuggestItemInfo=t,Gi(i=>{this.checkModelVersion(i),this._selectedItem.set(this._isActive?this._currentSuggestItemInfo:void 0,i)}))}getSuggestItemInfo(){const e=il.get(this.editor);if(!e||!this.isSuggestWidgetVisible)return;const t=e.widget.value.getFocusedItem(),i=this.editor.getPosition(),s=this.editor.getModel();if(!(!t||!i||!s))return $C.fromSuggestion(e,s,i,t.item,this.isShiftKeyPressed)}stopForceRenderingAbove(){const e=il.get(this.editor);e==null||e.stopForceRenderingAbove()}forceRenderingAbove(){const e=il.get(this.editor);e==null||e.forceRenderingAbove()}}class $C{static fromSuggestion(e,t,i,s,o){let{insertText:r}=s.completion,a=!1;if(s.completion.insertTextRules&4){const c=new t0().parse(r);c.children.length<100&&JI.adjustWhitespace(t,i,!0,c),r=c.toString(),a=!0}const l=e.getOverwriteInfo(s,o);return new $C(I.fromPositions(i.delta(0,-l.overwriteBefore),i.delta(0,Math.max(l.overwriteAfter,0))),r,s.completion.kind,a)}constructor(e,t,i,s){this.range=e,this.insertText=t,this.completionItemKind=i,this.isSnippetText=s}equals(e){return this.range.equalsRange(e.range)&&this.insertText===e.insertText&&this.completionItemKind===e.completionItemKind&&this.isSnippetText===e.isSnippetText}toSelectedSuggestionInfo(){return new wX(this.range,this.insertText,this.completionItemKind,this.isSnippetText)}toSingleTextEdit(){return new i0(this.range,this.insertText)}}function q8e(n,e){return n===e?!0:!n||!e?!1:n.equals(e)}var G8e=globalThis&&globalThis.__decorate||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},yh=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},p5;let ta=p5=class extends te{static get(e){return e.getContribution(p5.ID)}constructor(e,t,i,s,o,r,a,l,c){super(),this.editor=e,this.instantiationService=t,this.contextKeyService=i,this.configurationService=s,this.commandService=o,this.debounceService=r,this.languageFeaturesService=a,this.audioCueService=l,this._keybindingService=c,this.model=kI("inlineCompletionModel",void 0),this.textModelVersionId=Pi(this,-1),this.cursorPosition=Pi(this,new Y(1,1)),this.suggestWidgetAdaptor=this._register(new K8e(this.editor,()=>{var h,f;return(f=(h=this.model.get())===null||h===void 0?void 0:h.selectedInlineCompletion.get())===null||f===void 0?void 0:f.toSingleTextEdit(void 0)},h=>this.updateObservables(h,Rr.Other),h=>{Gi(f=>{var g;this.updateObservables(f,Rr.Other),(g=this.model.get())===null||g===void 0||g.handleSuggestAccepted(h)})})),this._enabled=ks(this.editor.onDidChangeConfiguration,()=>this.editor.getOption(62).enabled),this.ghostTextWidget=this._register(this.instantiationService.createInstance(o5,this.editor,{ghostText:this.model.map((h,f)=>h==null?void 0:h.ghostText.read(f)),minReservedLineCount:DI(0),targetTextModel:this.model.map(h=>h==null?void 0:h.textModel)})),this._debounceValue=this.debounceService.for(this.languageFeaturesService.inlineCompletionsProvider,"InlineCompletionsDebounce",{min:50,max:50}),this._register(new us(this.contextKeyService,this.model)),this._register(We.runAndSubscribe(e.onDidChangeModel,()=>Gi(h=>{this.model.set(void 0,h),this.updateObservables(h,Rr.Other);const f=e.getModel();if(f){const g=t.createInstance(a5,f,this.suggestWidgetAdaptor.selectedItem,this.cursorPosition,this.textModelVersionId,this._debounceValue,ks(e.onDidChangeConfiguration,()=>e.getOption(117).preview),ks(e.onDidChangeConfiguration,()=>e.getOption(117).previewMode),ks(e.onDidChangeConfiguration,()=>e.getOption(62).mode),this._enabled);this.model.set(g,h)}})));const d=h=>{var f;return h.isUndoing?Rr.Undo:h.isRedoing?Rr.Redo:!((f=this.model.get())===null||f===void 0)&&f.isAcceptingPartially?Rr.AcceptWord:Rr.Other};this._register(e.onDidChangeModelContent(h=>Gi(f=>this.updateObservables(f,d(h))))),this._register(e.onDidChangeCursorPosition(h=>Gi(f=>{var g;this.updateObservables(f,Rr.Other),(h.reason===3||h.source==="api")&&((g=this.model.get())===null||g===void 0||g.stop(f))}))),this._register(e.onDidType(()=>Gi(h=>{var f;this.updateObservables(h,Rr.Other),this._enabled.get()&&((f=this.model.get())===null||f===void 0||f.trigger(h))}))),this._register(this.commandService.onDidExecuteCommand(h=>{new Set([Gv.Tab.id,Gv.DeleteLeft.id,Gv.DeleteRight.id,une,"acceptSelectedSuggestion"]).has(h.commandId)&&e.hasTextFocus()&&this._enabled.get()&&Gi(g=>{var p;(p=this.model.get())===null||p===void 0||p.trigger(g)})})),this._register(this.editor.onDidBlurEditorWidget(()=>{this.contextKeyService.getContextKeyValue("accessibleViewIsShown")||this.configurationService.getValue("editor.inlineSuggest.keepOnBlur")||e.getOption(62).keepOnBlur||lg.dropDownVisible||Gi(h=>{var f;(f=this.model.get())===null||f===void 0||f.stop(h)})})),this._register(xi(h=>{var f;const g=(f=this.model.read(h))===null||f===void 0?void 0:f.state.read(h);g!=null&&g.suggestItem?g.ghostText.lineCount>=2&&this.suggestWidgetAdaptor.forceRenderingAbove():this.suggestWidgetAdaptor.stopForceRenderingAbove()})),this._register(vt(()=>{this.suggestWidgetAdaptor.stopForceRenderingAbove()}));let u;this._register(xi(h=>{const f=this.model.read(h),g=f==null?void 0:f.state.read(h);if(!f||!g||!g.inlineCompletion){u=void 0;return}if(g.inlineCompletion.semanticId!==u){u=g.inlineCompletion.semanticId;const p=f.textModel.getLineContent(g.ghostText.lineNumber);this.audioCueService.playAudioCue(Jt.inlineSuggestion).then(()=>{this.editor.getOption(8)&&this.provideScreenReaderUpdate(g.ghostText.renderForScreenReader(p))})}})),this._register(new OF(this.editor,this.model,this.instantiationService)),this._register(this.configurationService.onDidChangeConfiguration(h=>{h.affectsConfiguration("accessibility.verbosity.inlineCompletions")&&this.editor.updateOptions({inlineCompletionsAccessibilityVerbose:this.configurationService.getValue("accessibility.verbosity.inlineCompletions")})})),this.editor.updateOptions({inlineCompletionsAccessibilityVerbose:this.configurationService.getValue("accessibility.verbosity.inlineCompletions")})}provideScreenReaderUpdate(e){const t=this.contextKeyService.getContextKeyValue("accessibleViewIsShown"),i=this._keybindingService.lookupKeybinding("editor.action.accessibleView");let s;!t&&i&&this.editor.getOption(147)&&(s=m("showAccessibleViewHint","Inspect this in the accessible view ({0})",i.getAriaLabel())),to(s?e+", "+s:e)}updateObservables(e,t){var i,s;const o=this.editor.getModel();this.textModelVersionId.set((i=o==null?void 0:o.getVersionId())!==null&&i!==void 0?i:-1,e,t),this.cursorPosition.set((s=this.editor.getPosition())!==null&&s!==void 0?s:new Y(1,1),e)}shouldShowHoverAt(e){var t;const i=(t=this.model.get())===null||t===void 0?void 0:t.ghostText.get();return i?i.parts.some(s=>e.containsPosition(new Y(i.lineNumber,s.column))):!1}shouldShowHoverAtViewZone(e){return this.ghostTextWidget.ownsViewZone(e)}};ta.ID="editor.contrib.inlineCompletionsController";ta=p5=G8e([yh(1,_t),yh(2,bt),yh(3,zt),yh(4,gn),yh(5,Va),yh(6,Ze),yh(7,MS),yh(8,Di)],ta);var Ng=globalThis&&globalThis.__awaiter||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 PN extends Ue{constructor(){super({id:PN.ID,label:m("action.inlineSuggest.showNext","Show Next Inline Suggestion"),alias:"Show Next Inline Suggestion",precondition:fe.and(O.writable,us.inlineSuggestionVisible),kbOpts:{weight:100,primary:606}})}run(e,t){var i;return Ng(this,void 0,void 0,function*(){const s=ta.get(t);(i=s==null?void 0:s.model.get())===null||i===void 0||i.next()})}}PN.ID=fne;class ON extends Ue{constructor(){super({id:ON.ID,label:m("action.inlineSuggest.showPrevious","Show Previous Inline Suggestion"),alias:"Show Previous Inline Suggestion",precondition:fe.and(O.writable,us.inlineSuggestionVisible),kbOpts:{weight:100,primary:604}})}run(e,t){var i;return Ng(this,void 0,void 0,function*(){const s=ta.get(t);(i=s==null?void 0:s.model.get())===null||i===void 0||i.previous()})}}ON.ID=hne;class Y8e extends Ue{constructor(){super({id:"editor.action.inlineSuggest.trigger",label:m("action.inlineSuggest.trigger","Trigger Inline Suggestion"),alias:"Trigger Inline Suggestion",precondition:O.writable})}run(e,t){var i;return Ng(this,void 0,void 0,function*(){const s=ta.get(t);(i=s==null?void 0:s.model.get())===null||i===void 0||i.triggerExplicitly()})}}class Z8e extends Ue{constructor(){super({id:"editor.action.inlineSuggest.acceptNextWord",label:m("action.inlineSuggest.acceptNextWord","Accept Next Word Of Inline Suggestion"),alias:"Accept Next Word Of Inline Suggestion",precondition:fe.and(O.writable,us.inlineSuggestionVisible),kbOpts:{weight:100+1,primary:2065,kbExpr:fe.and(O.writable,us.inlineSuggestionVisible)},menuOpts:[{menuId:M.InlineSuggestionToolbar,title:m("acceptWord","Accept Word"),group:"primary",order:2}]})}run(e,t){var i;return Ng(this,void 0,void 0,function*(){const s=ta.get(t);yield(i=s==null?void 0:s.model.get())===null||i===void 0?void 0:i.acceptNextWord(s.editor)})}}class X8e extends Ue{constructor(){super({id:"editor.action.inlineSuggest.acceptNextLine",label:m("action.inlineSuggest.acceptNextLine","Accept Next Line Of Inline Suggestion"),alias:"Accept Next Line Of Inline Suggestion",precondition:fe.and(O.writable,us.inlineSuggestionVisible),kbOpts:{weight:100+1},menuOpts:[{menuId:M.InlineSuggestionToolbar,title:m("acceptLine","Accept Line"),group:"secondary",order:2}]})}run(e,t){var i;return Ng(this,void 0,void 0,function*(){const s=ta.get(t);yield(i=s==null?void 0:s.model.get())===null||i===void 0?void 0:i.acceptNextLine(s.editor)})}}class Q8e extends Ue{constructor(){super({id:une,label:m("action.inlineSuggest.accept","Accept Inline Suggestion"),alias:"Accept Inline Suggestion",precondition:us.inlineSuggestionVisible,menuOpts:[{menuId:M.InlineSuggestionToolbar,title:m("accept","Accept"),group:"primary",order:1}],kbOpts:{primary:2,weight:200,kbExpr:fe.and(us.inlineSuggestionVisible,O.tabMovesFocus.toNegated(),us.inlineSuggestionHasIndentationLessThanTabSize,Tt.Visible.toNegated(),O.hoverFocused.toNegated())}})}run(e,t){var i;return Ng(this,void 0,void 0,function*(){const s=ta.get(t);s&&((i=s.model.get())===null||i===void 0||i.accept(s.editor),s.editor.focus())})}}class FN extends Ue{constructor(){super({id:FN.ID,label:m("action.inlineSuggest.hide","Hide Inline Suggestion"),alias:"Hide Inline Suggestion",precondition:us.inlineSuggestionVisible,kbOpts:{weight:100,primary:9}})}run(e,t){return Ng(this,void 0,void 0,function*(){const i=ta.get(t);Gi(s=>{var o;(o=i==null?void 0:i.model.get())===null||o===void 0||o.stop(s)})})}}FN.ID="editor.action.inlineSuggest.hide";class BN extends oa{constructor(){super({id:BN.ID,title:m("action.inlineSuggest.alwaysShowToolbar","Always Show Toolbar"),f1:!1,precondition:void 0,menu:[{id:M.InlineSuggestionToolbar,group:"secondary",order:10}],toggled:fe.equals("config.editor.inlineSuggest.showToolbar","always")})}run(e,t){return Ng(this,void 0,void 0,function*(){const i=e.get(zt),o=i.getValue("editor.inlineSuggest.showToolbar")==="always"?"onHover":"always";i.updateValue("editor.inlineSuggest.showToolbar",o)})}}BN.ID="editor.action.inlineSuggest.toggleAlwaysShowToolbar";var J8e=globalThis&&globalThis.__decorate||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},E1=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};class e9e{constructor(e,t,i){this.owner=e,this.range=t,this.controller=i}isValidForHoverAnchor(e){return e.type===1&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}}let m5=class{constructor(e,t,i,s,o,r){this._editor=e,this._languageService=t,this._openerService=i,this.accessibilityService=s,this._instantiationService=o,this._telemetryService=r,this.hoverOrdinal=4}suggestHoverAnchor(e){const t=ta.get(this._editor);if(!t)return null;const i=e.target;if(i.type===8){const s=i.detail;if(t.shouldShowHoverAtViewZone(s.viewZoneId))return new AD(1e3,this,I.fromPositions(this._editor.getModel().validatePosition(s.positionBefore||s.position)),e.event.posx,e.event.posy,!1)}return i.type===7&&t.shouldShowHoverAt(i.range)?new AD(1e3,this,i.range,e.event.posx,e.event.posy,!1):i.type===6&&i.detail.mightBeForeignElement&&t.shouldShowHoverAt(i.range)?new AD(1e3,this,i.range,e.event.posx,e.event.posy,!1):null}computeSync(e,t){if(this._editor.getOption(62).showToolbar==="always")return[];const i=ta.get(this._editor);return i&&i.shouldShowHoverAt(e.range)?[new e9e(this,e.range,i)]:[]}renderHoverParts(e,t){const i=new be,s=t[0];this._telemetryService.publicLog2("inlineCompletionHover.shown"),this.accessibilityService.isScreenReaderOptimized()&&!this._editor.getOption(8)&&this.renderScreenReaderText(e,s,i);const o=s.controller.model.get(),r=this._instantiationService.createInstance(lg,this._editor,!1,DI(null),o.selectedInlineCompletionIndex,o.inlineCompletionsCount,o.selectedInlineCompletion.map(a=>{var l;return(l=a==null?void 0:a.inlineCompletion.source.inlineCompletions.commands)!==null&&l!==void 0?l:[]}));return e.fragment.appendChild(r.getDomNode()),o.triggerExplicitly(),i.add(r),i}renderScreenReaderText(e,t,i){const s=ye,o=s("div.hover-row.markdown-hover"),r=ge(o,s("div.hover-contents",{"aria-live":"assertive"})),a=i.add(new Zu({editor:this._editor},this._languageService,this._openerService)),l=c=>{i.add(a.onDidRenderAsync(()=>{r.className="hover-contents code-hover-contents",e.onContentsChanged()}));const d=m("inlineSuggestionFollows","Suggestion:"),u=i.add(a.render(new Bs().appendText(d).appendCodeblock("text",c)));r.replaceChildren(u.element)};i.add(xi(c=>{var d;const u=(d=t.controller.model.read(c))===null||d===void 0?void 0:d.ghostText.read(c);if(u){const h=this._editor.getModel().getLineContent(u.lineNumber);l(u.renderForScreenReader(h))}else Es(r)})),e.fragment.appendChild(o)}};m5=J8e([E1(1,qi),E1(2,Ir),E1(3,oh),E1(4,_t),E1(5,ra)],m5);ti(ta.ID,ta,3);De(Y8e);De(PN);De(ON);De(Z8e);De(X8e);De(Q8e);De(FN);Ui(BN);c_.register(m5);function ur(n,e){let t=0;for(let i=0;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},i9e=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};function Jne(n,e,t,i,s){if(n.getLineCount()===1&&n.getLineMaxColumn(1)===1)return[];const o=e.getLanguageConfiguration(n.getLanguageId()).indentationRules;if(!o)return[];for(i=Math.min(i,n.getLineCount());t<=i&&o.unIndentedLinePattern;){const _=n.getLineContent(t);if(!o.unIndentedLinePattern.test(_))break;t++}if(t>i-1)return[];const{tabSize:r,indentSize:a,insertSpaces:l}=n.getOptions(),c=(_,v)=>(v=v||1,va.shiftIndent(_,_.length+v,r,a,l)),d=(_,v)=>(v=v||1,va.unshiftIndent(_,_.length+v,r,a,l)),u=[];let h;const f=n.getLineContent(t);let g=f;if(s!=null){h=s;const _=ki(f);g=h+f.substring(_.length),o.decreaseIndentPattern&&o.decreaseIndentPattern.test(g)&&(h=d(h),g=h+f.substring(_.length)),f!==g&&u.push(Yi.replaceMove(new Je(t,1,t,_.length+1),OE(h,a,l)))}else h=ki(f);let p=h;o.increaseIndentPattern&&o.increaseIndentPattern.test(g)?(p=c(p),h=c(h)):o.indentNextLinePattern&&o.indentNextLinePattern.test(g)&&(p=c(p)),t++;for(let _=t;_<=i;_++){const v=n.getLineContent(_),b=ki(v),C=p+v.substring(b.length);o.decreaseIndentPattern&&o.decreaseIndentPattern.test(C)&&(p=d(p),h=d(h)),b!==p&&u.push(Yi.replaceMove(new Je(_,1,_,b.length+1),OE(p,a,l))),!(o.unIndentedLinePattern&&o.unIndentedLinePattern.test(v))&&(o.increaseIndentPattern&&o.increaseIndentPattern.test(C)?(h=c(h),p=h):o.indentNextLinePattern&&o.indentNextLinePattern.test(C)?p=c(p):p=h)}return u}class WN extends Ue{constructor(){super({id:WN.ID,label:m("indentationToSpaces","Convert Indentation to Spaces"),alias:"Convert Indentation to Spaces",precondition:O.writable})}run(e,t){const i=t.getModel();if(!i)return;const s=i.getOptions(),o=t.getSelection();if(!o)return;const r=new r9e(o,s.tabSize);t.pushUndoStop(),t.executeCommands(this.id,[r]),t.pushUndoStop(),i.updateOptions({insertSpaces:!0})}}WN.ID="editor.action.indentationToSpaces";class VN extends Ue{constructor(){super({id:VN.ID,label:m("indentationToTabs","Convert Indentation to Tabs"),alias:"Convert Indentation to Tabs",precondition:O.writable})}run(e,t){const i=t.getModel();if(!i)return;const s=i.getOptions(),o=t.getSelection();if(!o)return;const r=new a9e(o,s.tabSize);t.pushUndoStop(),t.executeCommands(this.id,[r]),t.pushUndoStop(),i.updateOptions({insertSpaces:!1})}}VN.ID="editor.action.indentationToTabs";class g6 extends Ue{constructor(e,t,i){super(i),this.insertSpaces=e,this.displaySizeOnly=t}run(e,t){const i=e.get(yc),s=e.get(Zi),o=t.getModel();if(!o)return;const r=s.getCreationOptions(o.getLanguageId(),o.uri,o.isForSimpleWidget),a=o.getOptions(),l=[1,2,3,4,5,6,7,8].map(d=>({id:d.toString(),label:d.toString(),description:d===r.tabSize&&d===a.tabSize?m("configuredTabSize","Configured Tab Size"):d===r.tabSize?m("defaultTabSize","Default Tab Size"):d===a.tabSize?m("currentTabSize","Current Tab Size"):void 0})),c=Math.min(o.getOptions().tabSize-1,7);setTimeout(()=>{i.pick(l,{placeHolder:m({key:"selectTabWidth",comment:["Tab corresponds to the tab key"]},"Select Tab Size for Current File"),activeItem:l[c]}).then(d=>{if(d&&o&&!o.isDisposed()){const u=parseInt(d.label,10);this.displaySizeOnly?o.updateOptions({tabSize:u}):o.updateOptions({tabSize:u,indentSize:u,insertSpaces:this.insertSpaces})}})},50)}}class HN extends g6{constructor(){super(!1,!1,{id:HN.ID,label:m("indentUsingTabs","Indent Using Tabs"),alias:"Indent Using Tabs",precondition:void 0})}}HN.ID="editor.action.indentUsingTabs";class $N extends g6{constructor(){super(!0,!1,{id:$N.ID,label:m("indentUsingSpaces","Indent Using Spaces"),alias:"Indent Using Spaces",precondition:void 0})}}$N.ID="editor.action.indentUsingSpaces";class zN extends g6{constructor(){super(!0,!0,{id:zN.ID,label:m("changeTabDisplaySize","Change Tab Display Size"),alias:"Change Tab Display Size",precondition:void 0})}}zN.ID="editor.action.changeTabDisplaySize";class UN extends Ue{constructor(){super({id:UN.ID,label:m("detectIndentation","Detect Indentation from Content"),alias:"Detect Indentation from Content",precondition:void 0})}run(e,t){const i=e.get(Zi),s=t.getModel();if(!s)return;const o=i.getCreationOptions(s.getLanguageId(),s.uri,s.isForSimpleWidget);s.detectIndentation(o.insertSpaces,o.tabSize)}}UN.ID="editor.action.detectIndentation";class n9e extends Ue{constructor(){super({id:"editor.action.reindentlines",label:m("editor.reindentlines","Reindent Lines"),alias:"Reindent Lines",precondition:O.writable})}run(e,t){const i=e.get(Ni),s=t.getModel();if(!s)return;const o=Jne(s,i,1,s.getLineCount());o.length>0&&(t.pushUndoStop(),t.executeEdits(this.id,o),t.pushUndoStop())}}class s9e extends Ue{constructor(){super({id:"editor.action.reindentselectedlines",label:m("editor.reindentselectedlines","Reindent Selected Lines"),alias:"Reindent Selected Lines",precondition:O.writable})}run(e,t){const i=e.get(Ni),s=t.getModel();if(!s)return;const o=t.getSelections();if(o===null)return;const r=[];for(const a of o){let l=a.startLineNumber,c=a.endLineNumber;if(l!==c&&a.endColumn===1&&c--,l===1){if(l===c)continue}else l--;const d=Jne(s,i,l,c);r.push(...d)}r.length>0&&(t.pushUndoStop(),t.executeEdits(this.id,r),t.pushUndoStop())}}class o9e{constructor(e,t){this._initialSelection=t,this._edits=[],this._selectionId=null;for(const i of e)i.range&&typeof i.text=="string"&&this._edits.push(i)}getEditOperations(e,t){for(const s of this._edits)t.addEditOperation(I.lift(s.range),s.text);let i=!1;Array.isArray(this._edits)&&this._edits.length===1&&this._initialSelection.isEmpty()&&(this._edits[0].range.startColumn===this._initialSelection.endColumn&&this._edits[0].range.startLineNumber===this._initialSelection.endLineNumber?(i=!0,this._selectionId=t.trackSelection(this._initialSelection,!0)):this._edits[0].range.endColumn===this._initialSelection.startColumn&&this._edits[0].range.endLineNumber===this._initialSelection.startLineNumber&&(i=!0,this._selectionId=t.trackSelection(this._initialSelection,!1))),i||(this._selectionId=t.trackSelection(this._initialSelection))}computeCursorState(e,t){return t.getTrackedSelection(this._selectionId)}}let xy=class{constructor(e,t){this.editor=e,this._languageConfigurationService=t,this.callOnDispose=new be,this.callOnModel=new be,this.callOnDispose.add(e.onDidChangeConfiguration(()=>this.update())),this.callOnDispose.add(e.onDidChangeModel(()=>this.update())),this.callOnDispose.add(e.onDidChangeModelLanguage(()=>this.update()))}update(){this.callOnModel.clear(),!(this.editor.getOption(12)<4||this.editor.getOption(55))&&this.editor.hasModel()&&this.callOnModel.add(this.editor.onDidPaste(({range:e})=>{this.trigger(e)}))}trigger(e){const t=this.editor.getSelections();if(t===null||t.length>1)return;const i=this.editor.getModel();if(!i||!i.tokenization.isCheapToTokenize(e.getStartPosition().lineNumber))return;const s=this.editor.getOption(12),{tabSize:o,indentSize:r,insertSpaces:a}=i.getOptions(),l=[],c={shiftIndent:f=>va.shiftIndent(f,f.length+1,o,r,a),unshiftIndent:f=>va.unshiftIndent(f,f.length+1,o,r,a)};let d=e.startLineNumber;for(;d<=e.endLineNumber;){if(this.shouldIgnoreLine(i,d)){d++;continue}break}if(d>e.endLineNumber)return;let u=i.getLineContent(d);if(!/\S/.test(u.substring(0,e.startColumn-1))){const f=wC(s,i,i.getLanguageId(),d,c,this._languageConfigurationService);if(f!==null){const g=ki(u),p=ur(f,o),_=ur(g,o);if(p!==_){const v=zC(p,o,a);l.push({range:new I(d,1,d,g.length+1),text:v}),u=v+u.substr(g.length)}else{const v=gJ(i,d,this._languageConfigurationService);if(v===0||v===8)return}}}const h=d;for(;di.tokenization.getLineTokens(p),getLanguageId:()=>i.getLanguageId(),getLanguageIdAtPosition:(p,_)=>i.getLanguageIdAtPosition(p,_)},getLineContent:p=>p===h?u:i.getLineContent(p)},i.getLanguageId(),d+1,c,this._languageConfigurationService);if(g!==null){const p=ur(g,o),_=ur(ki(i.getLineContent(d+1)),o);if(p!==_){const v=p-_;for(let b=d+1;b<=e.endLineNumber;b++){const C=i.getLineContent(b),w=ki(C),L=ur(w,o)+v,S=zC(L,o,a);S!==w&&l.push({range:new I(b,1,b,w.length+1),text:S})}}}}if(l.length>0){this.editor.pushUndoStop();const f=new o9e(l,this.editor.getSelection());this.editor.executeCommand("autoIndentOnPaste",f),this.editor.pushUndoStop()}}shouldIgnoreLine(e,t){e.tokenization.forceTokenization(t);const i=e.getLineFirstNonWhitespaceColumn(t);if(i===0)return!0;const s=e.tokenization.getLineTokens(t);if(s.getCount()>0){const o=s.findTokenIndexAtOffset(i);if(o>=0&&s.getStandardTokenType(o)===1)return!0}return!1}dispose(){this.callOnDispose.dispose(),this.callOnModel.dispose()}};xy.ID="editor.contrib.autoIndentOnPaste";xy=t9e([i9e(1,Ni)],xy);function ese(n,e,t,i){if(n.getLineCount()===1&&n.getLineMaxColumn(1)===1)return;let s="";for(let r=0;rthis._currentResolve=void 0)),yield this._currentResolve}})}_doResolve(e){var t,i;return eT(this,void 0,void 0,function*(){try{const s=yield Promise.resolve(this.provider.resolveInlayHint(this.hint,e));this.hint.tooltip=(t=s==null?void 0:s.tooltip)!==null&&t!==void 0?t:this.hint.tooltip,this.hint.label=(i=s==null?void 0:s.label)!==null&&i!==void 0?i:this.hint.label,this._isResolved=!0}catch(s){Bn(s),this._isResolved=!1}})}}class Ny{static create(e,t,i,s){return eT(this,void 0,void 0,function*(){const o=[],r=e.ordered(t).reverse().map(a=>i.map(l=>eT(this,void 0,void 0,function*(){try{const c=yield a.provideInlayHints(t,l,s);c!=null&&c.hints.length&&o.push([c,a])}catch(c){Bn(c)}})));if(yield Promise.all(r.flat()),s.isCancellationRequested||t.isDisposed())throw new Sg;return new Ny(i,o,t)})}constructor(e,t,i){this._disposables=new be,this.ranges=e,this.provider=new Set;const s=[];for(const[o,r]of t){this._disposables.add(o),this.provider.add(r);for(const a of o.hints){const l=i.validatePosition(a.position);let c="before";const d=Ny._getRangeAtPosition(i,l);let u;d.getStartPosition().isBefore(l)?(u=I.fromPositions(d.getStartPosition(),l),c="after"):(u=I.fromPositions(l,d.getEndPosition()),c="before"),s.push(new p6(a,new tse(u,c),r))}}this.items=s.sort((o,r)=>Y.compare(o.hint.position,r.hint.position))}dispose(){this._disposables.dispose()}static _getRangeAtPosition(e,t){const i=t.lineNumber,s=e.getWordAtPosition(t);if(s)return new I(i,s.startColumn,i,s.endColumn);e.tokenization.tokenizeIfCheap(i);const o=e.tokenization.getLineTokens(i),r=t.column-1,a=o.findTokenIndexAtOffset(r);let l=o.getStartOffset(a),c=o.getEndOffset(a);return c-l===1&&(l===r&&a>1?(l=o.getStartOffset(a-1),c=o.getEndOffset(a-1)):c===r&&aiv(g)?g.command.id:yN()));for(const g of mo.all())h.has(g.desc.id)&&u.push(new Ro(g.desc.id,fl.label(g.desc,{renderShortTitle:!0}),void 0,!0,()=>UC(this,void 0,void 0,function*(){const p=yield o.createModelReference(d.uri);try{const _=new Yb(p.object.textEditorModel,I.getStartPosition(d.range)),v=i.item.anchor.range;yield l.invokeFunction(g.runEditorCommand.bind(g),e,_,v)}finally{p.dispose()}})));if(i.part.command){const{command:g}=i.part;u.push(new hs),u.push(new Ro(g.id,g.title,void 0,!0,()=>UC(this,void 0,void 0,function*(){var p;try{yield a.executeCommand(g.id,...(p=g.arguments)!==null&&p!==void 0?p:[])}catch(_){c.notify({severity:xx.Error,source:i.item.provider.displayName,message:_})}})))}const f=e.getOption(126);r.showContextMenu({domForShadowRoot:f&&(s=e.getDomNode())!==null&&s!==void 0?s:void 0,getAnchor:()=>{const g=Un(t);return{x:g.left,y:g.top+g.height+8}},getActions:()=>u,onHide:()=>{e.focus()},autoSelectFirstItem:!0})})}function ise(n,e,t,i){return UC(this,void 0,void 0,function*(){const o=yield n.get(sr).createModelReference(i.uri);yield t.invokeWithinContext(r=>UC(this,void 0,void 0,function*(){const a=e.hasSideBySideModifier,l=r.get(bt),c=tr.inPeekEditor.getValue(l),d=!a&&t.getOption(87)&&!c;return new US({openToSide:a,openInPeek:d,muteMessage:!0},{title:{value:"",original:""},id:"",precondition:void 0}).run(r,new Yb(o.object.textEditorModel,I.getStartPosition(i.range)),I.lift(i.range))})),o.dispose()})}var d9e=globalThis&&globalThis.__decorate||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},F_=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},Q_=globalThis&&globalThis.__awaiter||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())})},OD;class tT{constructor(){this._entries=new Dg(50)}get(e){const t=tT._key(e);return this._entries.get(t)}set(e,t){const i=tT._key(e);this._entries.set(i,t)}static _key(e){return"".concat(e.uri.toString(),"/").concat(e.getVersionId())}}const nse=Wt("IInlayHintsCache");Gt(nse,tT,1);class _5{constructor(e,t){this.item=e,this.index=t}get part(){const e=this.item.hint.label;return typeof e=="string"?{label:e}:e[this.index]}}class u9e{constructor(e,t){this.part=e,this.hasTriggerModifier=t}}let xm=OD=class{static get(e){var t;return(t=e.getContribution(OD.ID))!==null&&t!==void 0?t:void 0}constructor(e,t,i,s,o,r,a){this._editor=e,this._languageFeaturesService=t,this._inlayHintsCache=s,this._commandService=o,this._notificationService=r,this._instaService=a,this._disposables=new be,this._sessionDisposables=new be,this._decorationsMetadata=new Map,this._ruleFactory=new mS(this._editor),this._activeRenderMode=0,this._debounceInfo=i.for(t.inlayHintsProvider,"InlayHint",{min:25}),this._disposables.add(t.inlayHintsProvider.onDidChange(()=>this._update())),this._disposables.add(e.onDidChangeModel(()=>this._update())),this._disposables.add(e.onDidChangeModelLanguage(()=>this._update())),this._disposables.add(e.onDidChangeConfiguration(l=>{l.hasChanged(139)&&this._update()})),this._update()}dispose(){this._sessionDisposables.dispose(),this._removeAllDecorations(),this._disposables.dispose()}_update(){this._sessionDisposables.clear(),this._removeAllDecorations();const e=this._editor.getOption(139);if(e.enabled==="off")return;const t=this._editor.getModel();if(!t||!this._languageFeaturesService.inlayHintsProvider.has(t))return;const i=this._inlayHintsCache.get(t);i&&this._updateHintsDecorators([t.getFullModelRange()],i),this._sessionDisposables.add(vt(()=>{t.isDisposed()||this._cacheHintsForFastRestore(t)}));let s;const o=new Set,r=new Si(()=>Q_(this,void 0,void 0,function*(){const a=Date.now();s==null||s.dispose(!0),s=new Tn;const l=t.onWillDispose(()=>s==null?void 0:s.cancel());try{const c=s.token,d=yield Ny.create(this._languageFeaturesService.inlayHintsProvider,t,this._getHintsRanges(),c);if(r.delay=this._debounceInfo.update(t,Date.now()-a),c.isCancellationRequested){d.dispose();return}for(const u of d.provider)typeof u.onDidChangeInlayHints=="function"&&!o.has(u)&&(o.add(u),this._sessionDisposables.add(u.onDidChangeInlayHints(()=>{r.isScheduled()||r.schedule()})));this._sessionDisposables.add(d),this._updateHintsDecorators(d.ranges,d.items),this._cacheHintsForFastRestore(t)}catch(c){Dt(c)}finally{s.dispose(),l.dispose()}}),this._debounceInfo.get(t));if(this._sessionDisposables.add(r),this._sessionDisposables.add(vt(()=>s==null?void 0:s.dispose(!0))),r.schedule(0),this._sessionDisposables.add(this._editor.onDidScrollChange(a=>{(a.scrollTopChanged||!r.isScheduled())&&r.schedule()})),this._sessionDisposables.add(this._editor.onDidChangeModelContent(a=>{const l=Math.max(r.delay,1250);r.schedule(l)})),e.enabled==="on")this._activeRenderMode=0;else{let a,l;e.enabled==="onUnlessPressed"?(a=0,l=1):(a=1,l=0),this._activeRenderMode=a,this._sessionDisposables.add(wu.getInstance().event(c=>{if(!this._editor.hasModel())return;const d=c.altKey&&c.ctrlKey&&!(c.shiftKey||c.metaKey)?l:a;if(d!==this._activeRenderMode){this._activeRenderMode=d;const u=this._editor.getModel(),h=this._copyInlayHintsWithCurrentAnchor(u);this._updateHintsDecorators([u.getFullModelRange()],h),r.schedule(0)}}))}this._sessionDisposables.add(this._installDblClickGesture(()=>r.schedule(0))),this._sessionDisposables.add(this._installLinkGesture()),this._sessionDisposables.add(this._installContextMenu())}_installLinkGesture(){const e=new be,t=e.add(new fN(this._editor)),i=new be;return e.add(i),e.add(t.onMouseMoveOrRelevantKeyDown(s=>{const[o]=s,r=this._getInlayHintLabelPart(o),a=this._editor.getModel();if(!r||!a){i.clear();return}const l=new Tn;i.add(vt(()=>l.dispose(!0))),r.item.resolve(l.token),this._activeInlayHintPart=r.part.command||r.part.location?new u9e(r,o.hasTriggerModifier):void 0;const c=a.validatePosition(r.item.hint.position).lineNumber,d=new I(c,1,c,a.getLineMaxColumn(c)),u=this._getInlineHintsForRange(d);this._updateHintsDecorators([d],u),i.add(vt(()=>{this._activeInlayHintPart=void 0,this._updateHintsDecorators([d],u)}))})),e.add(t.onCancel(()=>i.clear())),e.add(t.onExecute(s=>Q_(this,void 0,void 0,function*(){const o=this._getInlayHintLabelPart(s);if(o){const r=o.part;r.location?this._instaService.invokeFunction(ise,s,this._editor,r.location):G2.is(r.command)&&(yield this._invokeCommand(r.command,o.item))}}))),e}_getInlineHintsForRange(e){const t=new Set;for(const i of this._decorationsMetadata.values())e.containsRange(i.item.anchor.range)&&t.add(i.item);return Array.from(t)}_installDblClickGesture(e){return this._editor.onMouseUp(t=>Q_(this,void 0,void 0,function*(){if(t.event.detail!==2)return;const i=this._getInlayHintLabelPart(t);if(i&&(t.event.preventDefault(),yield i.item.resolve(Ft.None),io(i.item.hint.textEdits))){const s=i.item.hint.textEdits.map(o=>Yi.replace(I.lift(o.range),o.text));this._editor.executeEdits("inlayHint.default",s),e()}}))}_installContextMenu(){return this._editor.onContextMenu(e=>Q_(this,void 0,void 0,function*(){if(!(e.event.target instanceof HTMLElement))return;const t=this._getInlayHintLabelPart(e);t&&(yield this._instaService.invokeFunction(c9e,this._editor,e.event.target,t))}))}_getInlayHintLabelPart(e){var t;if(e.target.type!==6)return;const i=(t=e.target.detail.injectedText)===null||t===void 0?void 0:t.options;if(i instanceof eg&&(i==null?void 0:i.attachedData)instanceof _5)return i.attachedData}_invokeCommand(e,t){var i;return Q_(this,void 0,void 0,function*(){try{yield this._commandService.executeCommand(e.id,...(i=e.arguments)!==null&&i!==void 0?i:[])}catch(s){this._notificationService.notify({severity:xx.Error,source:t.provider.displayName,message:s})}})}_cacheHintsForFastRestore(e){const t=this._copyInlayHintsWithCurrentAnchor(e);this._inlayHintsCache.set(e,t)}_copyInlayHintsWithCurrentAnchor(e){const t=new Map;for(const[i,s]of this._decorationsMetadata){if(t.has(s.item))continue;const o=e.getDecorationRange(i);if(o){const r=new tse(o,s.item.anchor.direction),a=s.item.with({anchor:r});t.set(s.item,a)}}return Array.from(t.values())}_getHintsRanges(){const t=this._editor.getModel(),i=this._editor.getVisibleRangesPlusViewportAboveBelow(),s=[];for(const o of i.sort(I.compareRangesUsingStarts)){const r=t.validateRange(new I(o.startLineNumber-30,o.startColumn,o.endLineNumber+30,o.endColumn));s.length===0||!I.areIntersectingOrTouching(s[s.length-1],r)?s.push(r):s[s.length-1]=I.plusRange(s[s.length-1],r)}return s}_updateHintsDecorators(e,t){var i,s;const o=[],r=(p,_,v,b,C)=>{const w={content:v,inlineClassNameAffectsLetterSpacing:!0,inlineClassName:_.className,cursorStops:b,attachedData:C};o.push({item:p,classNameRef:_,decoration:{range:p.anchor.range,options:{description:"InlayHint",showIfCollapsed:p.anchor.range.isEmpty(),collapseOnReplaceEdit:!p.anchor.range.isEmpty(),stickiness:0,[p.anchor.direction]:this._activeRenderMode===0?w:void 0}}})},a=(p,_)=>{const v=this._ruleFactory.createClassNameRef({width:"".concat(l/3|0,"px"),display:"inline-block"});r(p,v," ",_?Jl.Right:Jl.None)},{fontSize:l,fontFamily:c,padding:d,isUniform:u}=this._getLayoutInfo(),h="--code-editorInlayHintsFontFamily";this._editor.getContainerDomNode().style.setProperty(h,c);for(const p of t){p.hint.paddingLeft&&a(p,!1);const _=typeof p.hint.label=="string"?[{label:p.hint.label}]:p.hint.label;for(let v=0;v<_.length;v++){const b=_[v],C=v===0,w=v===_.length-1,y={fontSize:"".concat(l,"px"),fontFamily:"var(".concat(h,"), ").concat(wr.fontFamily),verticalAlign:u?"baseline":"middle",unicodeBidi:"isolate"};io(p.hint.textEdits)&&(y.cursor="default"),this._fillInColors(y,p.hint),(b.command||b.location)&&((i=this._activeInlayHintPart)===null||i===void 0?void 0:i.part.item)===p&&this._activeInlayHintPart.part.index===v&&(y.textDecoration="underline",this._activeInlayHintPart.hasTriggerModifier&&(y.color=sn(qwe),y.cursor="pointer")),d&&(C&&w?(y.padding="1px ".concat(Math.max(1,l/4)|0,"px"),y.borderRadius="".concat(l/4|0,"px")):C?(y.padding="1px 0 1px ".concat(Math.max(1,l/4)|0,"px"),y.borderRadius="".concat(l/4|0,"px 0 0 ").concat(l/4|0,"px")):w?(y.padding="1px ".concat(Math.max(1,l/4)|0,"px 1px 0"),y.borderRadius="0 ".concat(l/4|0,"px ").concat(l/4|0,"px 0")):y.padding="1px 0 1px 0"),r(p,this._ruleFactory.createClassNameRef(y),h9e(b.label),w&&!p.hint.paddingRight?Jl.Right:Jl.None,new _5(p,v))}if(p.hint.paddingRight&&a(p,!0),o.length>OD._MAX_DECORATORS)break}const f=[];for(const p of e)for(const{id:_}of(s=this._editor.getDecorationsInRange(p))!==null&&s!==void 0?s:[]){const v=this._decorationsMetadata.get(_);v&&(f.push(_),v.classNameRef.dispose(),this._decorationsMetadata.delete(_))}const g=mc.capture(this._editor);this._editor.changeDecorations(p=>{const _=p.deltaDecorations(f,o.map(v=>v.decoration));for(let v=0;v<_.length;v++){const b=o[v];this._decorationsMetadata.set(_[v],b)}}),g.restore(this._editor)}_fillInColors(e,t){t.kind===fE.Parameter?(e.backgroundColor=sn(Xwe),e.color=sn(Zwe)):t.kind===fE.Type?(e.backgroundColor=sn(Ywe),e.color=sn(Gwe)):(e.backgroundColor=sn(Du),e.color=sn(ku))}_getLayoutInfo(){const e=this._editor.getOption(139),t=e.padding,i=this._editor.getOption(52),s=this._editor.getOption(49);let o=e.fontSize;(!o||o<5||o>i)&&(o=i);const r=e.fontFamily||s;return{fontSize:o,fontFamily:r,padding:t,isUniform:!t&&r===s&&o===i}}_removeAllDecorations(){this._editor.removeDecorations(Array.from(this._decorationsMetadata.keys()));for(const e of this._decorationsMetadata.values())e.classNameRef.dispose();this._decorationsMetadata.clear()}};xm.ID="editor.contrib.InlayHints";xm._MAX_DECORATORS=1500;xm=OD=d9e([F_(1,Ze),F_(2,Va),F_(3,nse),F_(4,gn),F_(5,Nn),F_(6,_t)],xm);function h9e(n){const e=" ";return n.replace(/[ \t]/g,e)}qt.registerCommand("_executeInlayHintProvider",(n,...e)=>Q_(void 0,void 0,void 0,function*(){const[t,i]=e;bi(ct.isUri(t)),bi(I.isIRange(i));const{inlayHintsProvider:s}=n.get(Ze),o=yield n.get(sr).createModelReference(t);try{const r=yield Ny.create(s,o.object.textEditorModel,[I.lift(i)],Ft.None),a=r.items.map(l=>l.hint);return setTimeout(()=>r.dispose(),0),a}finally{o.dispose()}}));var f9e=globalThis&&globalThis.__decorate||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},I1=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},gK=globalThis&&globalThis.__awaiter||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())})},g9e=globalThis&&globalThis.__asyncValues||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)}};class pK extends AD{constructor(e,t,i,s){super(10,t,e.item.anchor.range,i,s,!0),this.part=e}}let v5=class extends HI{constructor(e,t,i,s,o,r){super(e,t,i,s,r),this._resolverService=o,this.hoverOrdinal=6}suggestHoverAnchor(e){var t;if(!xm.get(this._editor)||e.target.type!==6)return null;const s=(t=e.target.detail.injectedText)===null||t===void 0?void 0:t.options;return s instanceof eg&&s.attachedData instanceof _5?new pK(s.attachedData,this,e.event.posx,e.event.posy):null}computeSync(){return[]}computeAsync(e,t,i){return e instanceof pK?new Mn(s=>gK(this,void 0,void 0,function*(){var o,r,a,l;const{part:c}=e;if(yield c.item.resolve(i),i.isCancellationRequested)return;let d;typeof c.item.hint.tooltip=="string"?d=new Bs().appendText(c.item.hint.tooltip):c.item.hint.tooltip&&(d=c.item.hint.tooltip),d&&s.emitOne(new Yl(this,e.range,[d],!1,0)),io(c.item.hint.textEdits)&&s.emitOne(new Yl(this,e.range,[new Bs().appendText(m("hint.dbl","Double-click to insert"))],!1,10001));let u;if(typeof c.part.tooltip=="string"?u=new Bs().appendText(c.part.tooltip):c.part.tooltip&&(u=c.part.tooltip),u&&s.emitOne(new Yl(this,e.range,[u],!1,1)),c.part.location||c.part.command){let _;const b=this._editor.getOption(77)==="altKey"?Kt?m("links.navigate.kb.meta.mac","cmd + click"):m("links.navigate.kb.meta","ctrl + click"):Kt?m("links.navigate.kb.alt.mac","option + click"):m("links.navigate.kb.alt","alt + click");c.part.location&&c.part.command?_=new Bs().appendText(m("hint.defAndCommand","Go to Definition ({0}), right click for more",b)):c.part.location?_=new Bs().appendText(m("hint.def","Go to Definition ({0})",b)):c.part.command&&(_=new Bs("[".concat(m("hint.cmd","Execute Command"),"](").concat(l9e(c.part.command),' "').concat(c.part.command.title,'") (').concat(b,")"),{isTrusted:!0})),_&&s.emitOne(new Yl(this,e.range,[_],!1,1e4))}const h=yield this._resolveInlayHintLabelPartHover(c,i);try{for(var f=!0,g=g9e(h),p;p=yield g.next(),o=p.done,!o;f=!0){l=p.value,f=!1;const _=l;s.emitOne(_)}}catch(_){r={error:_}}finally{try{!f&&!o&&(a=g.return)&&(yield a.call(g))}finally{if(r)throw r.error}}})):Mn.EMPTY}_resolveInlayHintLabelPartHover(e,t){return gK(this,void 0,void 0,function*(){if(!e.part.location)return Mn.EMPTY;const{uri:i,range:s}=e.part.location,o=yield this._resolverService.createModelReference(i);try{const r=o.object.textEditorModel;return this._languageFeaturesService.hoverProvider.has(r)?K7(this._languageFeaturesService.hoverProvider,r,new Y(s.startLineNumber,s.startColumn),t).filter(a=>!Vb(a.hover.contents)).map(a=>new Yl(this,e.item.anchor.range,a.hover.contents,!1,2+a.ordinal)):Mn.EMPTY}finally{o.dispose()}})}};v5=f9e([I1(1,qi),I1(2,Ir),I1(3,zt),I1(4,sr),I1(5,Ze)],v5);ti(xm.ID,xm,1);c_.register(v5);class p9e{constructor(e,t,i){this._editRange=e,this._originalSelection=t,this._text=i}getEditOperations(e,t){t.addTrackedEditOperation(this._editRange,this._text)}computeCursorState(e,t){const s=t.getInverseEditOperations()[0].range;return this._originalSelection.isEmpty()?new Je(s.endLineNumber,Math.min(this._originalSelection.positionColumn,s.endColumn),s.endLineNumber,Math.min(this._originalSelection.positionColumn,s.endColumn)):new Je(s.endLineNumber,s.endColumn-this._text.length,s.endLineNumber,s.endColumn)}}var m9e=globalThis&&globalThis.__decorate||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},_9e=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},FD;let dg=FD=class{static get(e){return e.getContribution(FD.ID)}constructor(e,t){this.editor=e,this.editorWorkerService=t,this.decorations=this.editor.createDecorationsCollection()}dispose(){}run(e,t){var i;(i=this.currentRequest)===null||i===void 0||i.cancel();const s=this.editor.getSelection(),o=this.editor.getModel();if(!o||!s)return;let r=s;if(r.startLineNumber!==r.endLineNumber)return;const a=new Wte(this.editor,5),l=o.uri;return this.editorWorkerService.canNavigateValueSet(l)?(this.currentRequest=Xn(c=>this.editorWorkerService.navigateValueSet(l,r,t)),this.currentRequest.then(c=>{var d;if(!c||!c.range||!c.value||!a.validate(this.editor))return;const u=I.lift(c.range);let h=c.range;const f=c.value.length-(r.endColumn-r.startColumn);h={startLineNumber:h.startLineNumber,startColumn:h.startColumn,endLineNumber:h.endLineNumber,endColumn:h.startColumn+c.value.length},f>1&&(r=new Je(r.startLineNumber,r.startColumn,r.endLineNumber,r.endColumn+f-1));const g=new p9e(u,r,c.value);this.editor.pushUndoStop(),this.editor.executeCommand(e,g),this.editor.pushUndoStop(),this.decorations.set([{range:h,options:FD.DECORATION}]),(d=this.decorationRemover)===null||d===void 0||d.cancel(),this.decorationRemover=jf(350),this.decorationRemover.then(()=>this.decorations.clear()).catch(Dt)}).catch(Dt)):Promise.resolve(void 0)}};dg.ID="editor.contrib.inPlaceReplaceController";dg.DECORATION=kt.register({description:"in-place-replace",className:"valueSetReplacement"});dg=FD=m9e([_9e(1,Sl)],dg);class v9e extends Ue{constructor(){super({id:"editor.action.inPlaceReplace.up",label:m("InPlaceReplaceAction.previous.label","Replace with Previous Value"),alias:"Replace with Previous Value",precondition:O.writable,kbOpts:{kbExpr:O.editorTextFocus,primary:3159,weight:100}})}run(e,t){const i=dg.get(t);return i?i.run(this.id,!1):Promise.resolve(void 0)}}class b9e extends Ue{constructor(){super({id:"editor.action.inPlaceReplace.down",label:m("InPlaceReplaceAction.next.label","Replace with Next Value"),alias:"Replace with Next Value",precondition:O.writable,kbOpts:{kbExpr:O.editorTextFocus,primary:3161,weight:100}})}run(e,t){const i=dg.get(t);return i?i.run(this.id,!0):Promise.resolve(void 0)}}ti(dg.ID,dg,4);De(v9e);De(b9e);class C9e extends Ue{constructor(){super({id:"expandLineSelection",label:m("expandLineSelection","Expand Line Selection"),alias:"Expand Line Selection",precondition:void 0,kbOpts:{weight:0,kbExpr:O.textInputFocus,primary:2090}})}run(e,t,i){if(i=i||{},!t.hasModel())return;const s=t._getViewModel();s.model.pushStackElement(),s.setCursorStates(i.source,3,ms.expandLineSelection(s,s.getCursorStates())),s.revealPrimaryCursor(i.source,!0)}}De(C9e);class w9e{constructor(e,t){this._selection=e,this._cursors=t,this._selectionId=null}getEditOperations(e,t){const i=y9e(e,this._cursors);for(let s=0,o=i.length;sr.lineNumber===a.lineNumber?r.column-a.column:r.lineNumber-a.lineNumber);for(let r=e.length-2;r>=0;r--)e[r].lineNumber===e[r+1].lineNumber&&e.splice(r,1);const t=[];let i=0,s=0;const o=e.length;for(let r=1,a=n.getLineCount();r<=a;r++){const l=n.getLineContent(r),c=l.length+1;let d=0;if(s=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},L9e=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let b5=class{constructor(e,t,i,s){this._languageConfigurationService=s,this._selection=e,this._isMovingDown=t,this._autoIndent=i,this._selectionId=null,this._moveEndLineSelectionShrink=!1}getEditOperations(e,t){const i=e.getLineCount();if(this._isMovingDown&&this._selection.endLineNumber===i){this._selectionId=t.trackSelection(this._selection);return}if(!this._isMovingDown&&this._selection.startLineNumber===1){this._selectionId=t.trackSelection(this._selection);return}this._moveEndPositionDown=!1;let s=this._selection;s.startLineNumbere.tokenization.getLineTokens(d),getLanguageId:()=>e.getLanguageId(),getLanguageIdAtPosition:(d,u)=>e.getLanguageIdAtPosition(d,u)},getLineContent:null};if(s.startLineNumber===s.endLineNumber&&e.getLineMaxColumn(s.startLineNumber)===1){const d=s.startLineNumber,u=this._isMovingDown?d+1:d-1;e.getLineMaxColumn(u)===1?t.addEditOperation(new I(1,1,1,1),null):(t.addEditOperation(new I(d,1,d,1),e.getLineContent(u)),t.addEditOperation(new I(u,1,u,e.getLineMaxColumn(u)),null)),s=new Je(u,1,u,1)}else{let d,u;if(this._isMovingDown){d=s.endLineNumber+1,u=e.getLineContent(d),t.addEditOperation(new I(d-1,e.getLineMaxColumn(d-1),d,e.getLineMaxColumn(d)),null);let h=u;if(this.shouldAutoIndent(e,s)){const f=this.matchEnterRule(e,l,o,d,s.startLineNumber-1);if(f!==null){const p=ki(e.getLineContent(d)),_=f+ur(p,o);h=zC(_,o,a)+this.trimStart(u)}else{c.getLineContent=_=>_===s.startLineNumber?e.getLineContent(d):e.getLineContent(_);const p=wC(this._autoIndent,c,e.getLanguageIdAtPosition(d,1),s.startLineNumber,l,this._languageConfigurationService);if(p!==null){const _=ki(e.getLineContent(d)),v=ur(p,o),b=ur(_,o);v!==b&&(h=zC(v,o,a)+this.trimStart(u))}}t.addEditOperation(new I(s.startLineNumber,1,s.startLineNumber,1),h+"\n");const g=this.matchEnterRuleMovingDown(e,l,o,s.startLineNumber,d,h);if(g!==null)g!==0&&this.getIndentEditsOfMovingBlock(e,t,s,o,a,g);else{c.getLineContent=_=>_===s.startLineNumber?h:_>=s.startLineNumber+1&&_<=s.endLineNumber+1?e.getLineContent(_-1):e.getLineContent(_);const p=wC(this._autoIndent,c,e.getLanguageIdAtPosition(d,1),s.startLineNumber+1,l,this._languageConfigurationService);if(p!==null){const _=ki(e.getLineContent(s.startLineNumber)),v=ur(p,o),b=ur(_,o);if(v!==b){const C=v-b;this.getIndentEditsOfMovingBlock(e,t,s,o,a,C)}}}}else t.addEditOperation(new I(s.startLineNumber,1,s.startLineNumber,1),h+"\n")}else if(d=s.startLineNumber-1,u=e.getLineContent(d),t.addEditOperation(new I(d,1,d+1,1),null),t.addEditOperation(new I(s.endLineNumber,e.getLineMaxColumn(s.endLineNumber),s.endLineNumber,e.getLineMaxColumn(s.endLineNumber)),"\n"+u),this.shouldAutoIndent(e,s)){c.getLineContent=f=>f===d?e.getLineContent(s.startLineNumber):e.getLineContent(f);const h=this.matchEnterRule(e,l,o,s.startLineNumber,s.startLineNumber-2);if(h!==null)h!==0&&this.getIndentEditsOfMovingBlock(e,t,s,o,a,h);else{const f=wC(this._autoIndent,c,e.getLanguageIdAtPosition(s.startLineNumber,1),d,l,this._languageConfigurationService);if(f!==null){const g=ki(e.getLineContent(s.startLineNumber)),p=ur(f,o),_=ur(g,o);if(p!==_){const v=p-_;this.getIndentEditsOfMovingBlock(e,t,s,o,a,v)}}}}}this._selectionId=t.trackSelection(s)}buildIndentConverter(e,t,i){return{shiftIndent:s=>va.shiftIndent(s,s.length+1,e,t,i),unshiftIndent:s=>va.unshiftIndent(s,s.length+1,e,t,i)}}parseEnterResult(e,t,i,s,o){if(o){let r=o.indentation;o.indentAction===Pn.None||o.indentAction===Pn.Indent?r=o.indentation+o.appendText:o.indentAction===Pn.IndentOutdent?r=o.indentation:o.indentAction===Pn.Outdent&&(r=t.unshiftIndent(o.indentation)+o.appendText);const a=e.getLineContent(s);if(this.trimStart(a).indexOf(this.trimStart(r))>=0){const l=ki(e.getLineContent(s));let c=ki(r);const d=gJ(e,s,this._languageConfigurationService);d!==null&&d&2&&(c=t.unshiftIndent(c));const u=ur(c,i),h=ur(l,i);return u-h}}return null}matchEnterRuleMovingDown(e,t,i,s,o,r){if(oc(r)>=0){const a=e.getLineMaxColumn(o),l=qv(this._autoIndent,e,new I(o,a,o,a),this._languageConfigurationService);return this.parseEnterResult(e,t,i,s,l)}else{let a=s-1;for(;a>=1;){const d=e.getLineContent(a);if(oc(d)>=0)break;a--}if(a<1||s>e.getLineCount())return null;const l=e.getLineMaxColumn(a),c=qv(this._autoIndent,e,new I(a,l,a,l),this._languageConfigurationService);return this.parseEnterResult(e,t,i,s,c)}}matchEnterRule(e,t,i,s,o,r){let a=o;for(;a>=1;){let d;if(a===o&&r!==void 0?d=r:d=e.getLineContent(a),oc(d)>=0)break;a--}if(a<1||s>e.getLineCount())return null;const l=e.getLineMaxColumn(a),c=qv(this._autoIndent,e,new I(a,l,a,l),this._languageConfigurationService);return this.parseEnterResult(e,t,i,s,c)}trimStart(e){return e.replace(/^\s+/,"")}shouldAutoIndent(e,t){if(this._autoIndent<4||!e.tokenization.isCheapToTokenize(t.startLineNumber))return!1;const i=e.getLanguageIdAtPosition(t.startLineNumber,1),s=e.getLanguageIdAtPosition(t.endLineNumber,1);return!(i!==s||this._languageConfigurationService.getLanguageConfiguration(i).indentRulesSupport===null)}getIndentEditsOfMovingBlock(e,t,i,s,o,r){for(let a=i.startLineNumber;a<=i.endLineNumber;a++){const l=e.getLineContent(a),c=ki(l),u=ur(c,s)+r,h=zC(u,s,o);h!==c&&(t.addEditOperation(new I(a,1,a,c.length+1),h),a===i.endLineNumber&&i.endColumn<=c.length+1&&h===""&&(this._moveEndLineSelectionShrink=!0))}}computeCursorState(e,t){let i=t.getTrackedSelection(this._selectionId);return this._moveEndPositionDown&&(i=i.setEndPosition(i.endLineNumber+1,1)),this._moveEndLineSelectionShrink&&i.startLineNumber=s)return null;const o=[];for(let a=i;a<=s;a++)o.push(n.getLineContent(a));let r=o.slice(0);return r.sort(Mf.getCollator().compare),t===!0&&(r=r.reverse()),{startLineNumber:i,endLineNumber:s,before:o,after:r}}function k9e(n,e,t){const i=ose(n,e,t);return i?Yi.replace(new I(i.startLineNumber,1,i.endLineNumber,n.getLineMaxColumn(i.endLineNumber)),i.after.join("\n")):null}class rse extends Ue{constructor(e,t){super(t),this.down=e}run(e,t){if(!t.hasModel())return;const i=t.getSelections().map((r,a)=>({selection:r,index:a,ignore:!1}));i.sort((r,a)=>I.compareRangesUsingStarts(r.selection,a.selection));let s=i[0];for(let r=1;rnew Y(a.positionLineNumber,a.positionColumn)));const o=t.getSelection();if(o===null)return;const r=new w9e(o,s);t.pushUndoStop(),t.executeCommands(this.id,[r]),t.pushUndoStop()}}jN.ID="editor.action.trimTrailingWhitespace";class R9e extends Ue{constructor(){super({id:"editor.action.deleteLines",label:m("lines.delete","Delete Line"),alias:"Delete Line",precondition:O.writable,kbOpts:{kbExpr:O.textInputFocus,primary:3113,weight:100}})}run(e,t){if(!t.hasModel())return;const i=this._getLinesToRemove(t),s=t.getModel();if(s.getLineCount()===1&&s.getLineMaxColumn(1)===1)return;let o=0;const r=[],a=[];for(let l=0,c=i.length;l1&&(u-=1,f=s.getLineMaxColumn(u)),r.push(Yi.replace(new Je(u,f,h,g),"")),a.push(new Je(u-o,d.positionColumn,u-o,d.positionColumn)),o+=d.endLineNumber-d.startLineNumber+1}t.pushUndoStop(),t.executeEdits(this.id,r,a),t.pushUndoStop()}_getLinesToRemove(e){const t=e.getSelections().map(o=>{let r=o.endLineNumber;return o.startLineNumbero.startLineNumber===r.startLineNumber?o.endLineNumber-r.endLineNumber:o.startLineNumber-r.startLineNumber);const i=[];let s=t[0];for(let o=1;o=t[o].startLineNumber?s.endLineNumber=t[o].endLineNumber:(i.push(s),s=t[o]);return i.push(s),i}}class P9e extends Ue{constructor(){super({id:"editor.action.indentLines",label:m("lines.indent","Indent Line"),alias:"Indent Line",precondition:O.writable,kbOpts:{kbExpr:O.editorTextFocus,primary:2142,weight:100}})}run(e,t){const i=t._getViewModel();i&&(t.pushUndoStop(),t.executeCommands(this.id,Qi.indent(i.cursorConfig,t.getModel(),t.getSelections())),t.pushUndoStop())}}class O9e extends Ue{constructor(){super({id:"editor.action.outdentLines",label:m("lines.outdent","Outdent Line"),alias:"Outdent Line",precondition:O.writable,kbOpts:{kbExpr:O.editorTextFocus,primary:2140,weight:100}})}run(e,t){Gv.Outdent.runEditorCommand(e,t,null)}}class F9e extends Ue{constructor(){super({id:"editor.action.insertLineBefore",label:m("lines.insertBefore","Insert Line Above"),alias:"Insert Line Above",precondition:O.writable,kbOpts:{kbExpr:O.editorTextFocus,primary:3075,weight:100}})}run(e,t){const i=t._getViewModel();i&&(t.pushUndoStop(),t.executeCommands(this.id,Qi.lineInsertBefore(i.cursorConfig,t.getModel(),t.getSelections())))}}class B9e extends Ue{constructor(){super({id:"editor.action.insertLineAfter",label:m("lines.insertAfter","Insert Line Below"),alias:"Insert Line Below",precondition:O.writable,kbOpts:{kbExpr:O.editorTextFocus,primary:2051,weight:100}})}run(e,t){const i=t._getViewModel();i&&(t.pushUndoStop(),t.executeCommands(this.id,Qi.lineInsertAfter(i.cursorConfig,t.getModel(),t.getSelections())))}}class cse extends Ue{run(e,t){if(!t.hasModel())return;const i=t.getSelection(),s=this._getRangesToDelete(t),o=[];for(let l=0,c=s.length-1;lYi.replace(l,""));t.pushUndoStop(),t.executeEdits(this.id,a,r),t.pushUndoStop()}}class W9e extends cse{constructor(){super({id:"deleteAllLeft",label:m("lines.deleteAllLeft","Delete All Left"),alias:"Delete All Left",precondition:O.writable,kbOpts:{kbExpr:O.textInputFocus,primary:0,mac:{primary:2049},weight:100}})}_getEndCursorState(e,t){let i=null;const s=[];let o=0;return t.forEach(r=>{let a;if(r.endColumn===1&&o>0){const l=r.startLineNumber-o;a=new Je(l,r.startColumn,l,r.startColumn)}else a=new Je(r.startLineNumber,r.startColumn,r.startLineNumber,r.startColumn);o+=r.endLineNumber-r.startLineNumber,r.intersectRanges(e)?i=a:s.push(a)}),i&&s.unshift(i),s}_getRangesToDelete(e){const t=e.getSelections();if(t===null)return[];let i=t;const s=e.getModel();return s===null?[]:(i.sort(I.compareRangesUsingStarts),i=i.map(o=>{if(o.isEmpty())if(o.startColumn===1){const r=Math.max(1,o.startLineNumber-1),a=o.startLineNumber===1?1:s.getLineLength(r)+1;return new I(r,a,o.startLineNumber,1)}else return new I(o.startLineNumber,1,o.startLineNumber,o.startColumn);else return new I(o.startLineNumber,1,o.endLineNumber,o.endColumn)}),i)}}class V9e extends cse{constructor(){super({id:"deleteAllRight",label:m("lines.deleteAllRight","Delete All Right"),alias:"Delete All Right",precondition:O.writable,kbOpts:{kbExpr:O.textInputFocus,primary:0,mac:{primary:297,secondary:[2068]},weight:100}})}_getEndCursorState(e,t){let i=null;const s=[];for(let o=0,r=t.length,a=0;o{if(o.isEmpty()){const r=t.getLineMaxColumn(o.startLineNumber);return o.startColumn===r?new I(o.startLineNumber,o.startColumn,o.startLineNumber+1,1):new I(o.startLineNumber,o.startColumn,o.startLineNumber,r)}return o});return s.sort(I.compareRangesUsingStarts),s}}class H9e extends Ue{constructor(){super({id:"editor.action.joinLines",label:m("lines.joinLines","Join Lines"),alias:"Join Lines",precondition:O.writable,kbOpts:{kbExpr:O.editorTextFocus,primary:0,mac:{primary:296},weight:100}})}run(e,t){const i=t.getSelections();if(i===null)return;let s=t.getSelection();if(s===null)return;i.sort(I.compareRangesUsingStarts);const o=[],r=i.reduce((h,f)=>h.isEmpty()?h.endLineNumber===f.startLineNumber?(s.equalsSelection(h)&&(s=f),f):f.startLineNumber>h.endLineNumber+1?(o.push(h),f):new Je(h.startLineNumber,h.startColumn,f.endLineNumber,f.endColumn):f.startLineNumber>h.endLineNumber?(o.push(h),f):new Je(h.startLineNumber,h.startColumn,f.endLineNumber,f.endColumn));o.push(r);const a=t.getModel();if(a===null)return;const l=[],c=[];let d=s,u=0;for(let h=0,f=o.length;h=1){let x=!0;y===""&&(x=!1),x&&(y.charAt(y.length-1)===" "||y.charAt(y.length-1)===" ")&&(x=!1,y=y.replace(/[\s\uFEFF\xA0]+$/g," "));const A=k.substr(D-1);y+=(x?" ":"")+A,x?v=A.length+1:v=A.length}else v=0}const L=new I(p,_,b,C);if(!L.isEmpty()){let S;g.isEmpty()?(l.push(Yi.replace(L,y)),S=new Je(L.startLineNumber-u,y.length-v+1,p-u,y.length-v+1)):g.startLineNumber===g.endLineNumber?(l.push(Yi.replace(L,y)),S=new Je(g.startLineNumber-u,g.startColumn,g.endLineNumber-u,g.endColumn)):(l.push(Yi.replace(L,y)),S=new Je(g.startLineNumber-u,g.startColumn,g.startLineNumber-u,y.length-w)),I.intersectRanges(L,s)!==null?d=S:c.push(S)}u+=L.endLineNumber-L.startLineNumber}c.unshift(d),t.pushUndoStop(),t.executeEdits(this.id,l,c),t.pushUndoStop()}}class $9e extends Ue{constructor(){super({id:"editor.action.transpose",label:m("editor.transpose","Transpose Characters around the Cursor"),alias:"Transpose Characters around the Cursor",precondition:O.writable})}run(e,t){const i=t.getSelections();if(i===null)return;const s=t.getModel();if(s===null)return;const o=[];for(let r=0,a=i.length;r=d){if(c.lineNumber===s.getLineCount())continue;const u=new I(c.lineNumber,Math.max(1,c.column-1),c.lineNumber+1,1),h=s.getValueInRange(u).split("").reverse().join("");o.push(new Rs(new Je(c.lineNumber,Math.max(1,c.column-1),c.lineNumber+1,1),h))}else{const u=new I(c.lineNumber,Math.max(1,c.column-1),c.lineNumber,c.column+1),h=s.getValueInRange(u).split("").reverse().join("");o.push(new u9(u,h,new Je(c.lineNumber,c.column+1,c.lineNumber,c.column+1)))}}t.pushUndoStop(),t.executeCommands(this.id,o),t.pushUndoStop()}}class V0 extends Ue{run(e,t){const i=t.getSelections();if(i===null)return;const s=t.getModel();if(s===null)return;const o=t.getOption(129),r=[];for(const a of i)if(a.isEmpty()){const l=a.getStartPosition(),c=t.getConfiguredWordAtPosition(l);if(!c)continue;const d=new I(l.lineNumber,c.startColumn,l.lineNumber,c.endColumn),u=s.getValueInRange(d);r.push(Yi.replace(d,this._modifyText(u,o)))}else{const l=s.getValueInRange(a);r.push(Yi.replace(a,this._modifyText(l,o)))}t.pushUndoStop(),t.executeEdits(this.id,r),t.pushUndoStop()}}class z9e extends V0{constructor(){super({id:"editor.action.transformToUppercase",label:m("editor.transformToUppercase","Transform to Uppercase"),alias:"Transform to Uppercase",precondition:O.writable})}_modifyText(e,t){return e.toLocaleUpperCase()}}class U9e extends V0{constructor(){super({id:"editor.action.transformToLowercase",label:m("editor.transformToLowercase","Transform to Lowercase"),alias:"Transform to Lowercase",precondition:O.writable})}_modifyText(e,t){return e.toLocaleLowerCase()}}class d_{constructor(e,t){this._pattern=e,this._flags=t,this._actual=null,this._evaluated=!1}get(){if(!this._evaluated){this._evaluated=!0;try{this._actual=new RegExp(this._pattern,this._flags)}catch{}}return this._actual}isSupported(){return this.get()!==null}}class Ay extends V0{constructor(){super({id:"editor.action.transformToTitlecase",label:m("editor.transformToTitlecase","Transform to Title Case"),alias:"Transform to Title Case",precondition:O.writable})}_modifyText(e,t){const i=Ay.titleBoundary.get();return i?e.toLocaleLowerCase().replace(i,s=>s.toLocaleUpperCase()):e}}Ay.titleBoundary=new d_("(^|[^\\p{L}\\p{N}']|((^|\\P{L})'))\\p{L}","gmu");class Rf extends V0{constructor(){super({id:"editor.action.transformToSnakecase",label:m("editor.transformToSnakecase","Transform to Snake Case"),alias:"Transform to Snake Case",precondition:O.writable})}_modifyText(e,t){const i=Rf.caseBoundary.get(),s=Rf.singleLetters.get();return!i||!s?e:e.replace(i,"$1_$2").replace(s,"$1_$2$3").toLocaleLowerCase()}}Rf.caseBoundary=new d_("(\\p{Ll})(\\p{Lu})","gmu");Rf.singleLetters=new d_("(\\p{Lu}|\\p{N})(\\p{Lu})(\\p{Ll})","gmu");class My extends V0{constructor(){super({id:"editor.action.transformToCamelcase",label:m("editor.transformToCamelcase","Transform to Camel Case"),alias:"Transform to Camel Case",precondition:O.writable})}_modifyText(e,t){const i=My.wordBoundary.get();if(!i)return e;const s=e.split(i);return s.shift()+s.map(r=>r.substring(0,1).toLocaleUpperCase()+r.substring(1)).join("")}}My.wordBoundary=new d_("[_\\s-]","gm");class $u extends V0{static isSupported(){return[this.caseBoundary,this.singleLetters,this.underscoreBoundary].every(t=>t.isSupported())}constructor(){super({id:"editor.action.transformToKebabcase",label:m("editor.transformToKebabcase","Transform to Kebab Case"),alias:"Transform to Kebab Case",precondition:O.writable})}_modifyText(e,t){const i=$u.caseBoundary.get(),s=$u.singleLetters.get(),o=$u.underscoreBoundary.get();return!i||!s||!o?e:e.replace(o,"$1-$3").replace(i,"$1-$2").replace(s,"$1-$2").toLocaleLowerCase()}}$u.caseBoundary=new d_("(\\p{Ll})(\\p{Lu})","gmu");$u.singleLetters=new d_("(\\p{Lu}|\\p{N})(\\p{Lu}\\p{Ll})","gmu");$u.underscoreBoundary=new d_("(\\S)(_)(\\S)","gm");De(D9e);De(E9e);De(I9e);De(T9e);De(x9e);De(N9e);De(A9e);De(M9e);De(jN);De(R9e);De(P9e);De(O9e);De(F9e);De(B9e);De(W9e);De(V9e);De(H9e);De($9e);De(z9e);De(U9e);Rf.caseBoundary.isSupported()&&Rf.singleLetters.isSupported()&&De(Rf);My.wordBoundary.isSupported()&&De(My);Ay.titleBoundary.isSupported()&&De(Ay);$u.isSupported()&&De($u);var j9e=globalThis&&globalThis.__decorate||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},Ik=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},C5=globalThis&&globalThis.__awaiter||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())})},BD;const dse=new Ve("LinkedEditingInputVisible",!1),K9e="linked-editing-decoration";let ug=BD=class extends te{static get(e){return e.getContribution(BD.ID)}constructor(e,t,i,s,o){super(),this.languageConfigurationService=s,this._syncRangesToken=0,this._localToDispose=this._register(new be),this._editor=e,this._providers=i.linkedEditingRangeProvider,this._enabled=!1,this._visibleContextKey=dse.bindTo(t),this._debounceInformation=o.for(this._providers,"Linked Editing",{max:200}),this._currentDecorations=this._editor.createDecorationsCollection(),this._languageWordPattern=null,this._currentWordPattern=null,this._ignoreChangeEvent=!1,this._localToDispose=this._register(new be),this._rangeUpdateTriggerPromise=null,this._rangeSyncTriggerPromise=null,this._currentRequest=null,this._currentRequestPosition=null,this._currentRequestModelVersion=null,this._register(this._editor.onDidChangeModel(()=>this.reinitialize(!0))),this._register(this._editor.onDidChangeConfiguration(r=>{(r.hasChanged(69)||r.hasChanged(92))&&this.reinitialize(!1)})),this._register(this._providers.onDidChange(()=>this.reinitialize(!1))),this._register(this._editor.onDidChangeModelLanguage(()=>this.reinitialize(!0))),this.reinitialize(!0)}reinitialize(e){const t=this._editor.getModel(),i=t!==null&&(this._editor.getOption(69)||this._editor.getOption(92))&&this._providers.has(t);if(i===this._enabled&&!e||(this._enabled=i,this.clearRanges(),this._localToDispose.clear(),!i||t===null))return;this._localToDispose.add(We.runAndSubscribe(t.onDidChangeLanguageConfiguration,()=>{this._languageWordPattern=this.languageConfigurationService.getLanguageConfiguration(t.getLanguageId()).getWordDefinition()}));const s=new pl(this._debounceInformation.get(t)),o=()=>{var l;this._rangeUpdateTriggerPromise=s.trigger(()=>this.updateRanges(),(l=this._debounceDuration)!==null&&l!==void 0?l:this._debounceInformation.get(t))},r=new pl(0),a=l=>{this._rangeSyncTriggerPromise=r.trigger(()=>this._syncRanges(l))};this._localToDispose.add(this._editor.onDidChangeCursorPosition(()=>{o()})),this._localToDispose.add(this._editor.onDidChangeModelContent(l=>{if(!this._ignoreChangeEvent&&this._currentDecorations.length>0){const c=this._currentDecorations.getRange(0);if(c&&l.changes.every(d=>c.intersectRanges(d.range))){a(this._syncRangesToken);return}}o()})),this._localToDispose.add({dispose:()=>{s.dispose(),r.dispose()}}),this.updateRanges()}_syncRanges(e){if(!this._editor.hasModel()||e!==this._syncRangesToken||this._currentDecorations.length===0)return;const t=this._editor.getModel(),i=this._currentDecorations.getRange(0);if(!i||i.startLineNumber!==i.endLineNumber)return this.clearRanges();const s=t.getValueInRange(i);if(this._currentWordPattern){const r=s.match(this._currentWordPattern);if((r?r[0].length:0)!==s.length)return this.clearRanges()}const o=[];for(let r=1,a=this._currentDecorations.length;r1){this.clearRanges();return}const i=this._editor.getModel(),s=i.getVersionId();if(this._currentRequestPosition&&this._currentRequestModelVersion===s){if(t.equals(this._currentRequestPosition))return;if(this._currentDecorations.length>0){const r=this._currentDecorations.getRange(0);if(r&&r.containsPosition(t))return}}this.clearRanges(),this._currentRequestPosition=t,this._currentRequestModelVersion=s;const o=Xn(r=>C5(this,void 0,void 0,function*(){try{const a=new so(!1),l=yield use(this._providers,i,t,r);if(this._debounceInformation.update(i,a.elapsed()),o!==this._currentRequest||(this._currentRequest=null,s!==i.getVersionId()))return;let c=[];l!=null&&l.ranges&&(c=l.ranges),this._currentWordPattern=(l==null?void 0:l.wordPattern)||this._languageWordPattern;let d=!1;for(let h=0,f=c.length;h({range:h,options:BD.DECORATION}));this._visibleContextKey.set(!0),this._currentDecorations.set(u),this._syncRangesToken++}catch(a){bc(a)||Dt(a),(this._currentRequest===o||!this._currentRequest)&&this.clearRanges()}}));return this._currentRequest=o,o})}};ug.ID="editor.contrib.linkedEditing";ug.DECORATION=kt.register({description:"linked-editing",stickiness:0,className:K9e});ug=BD=j9e([Ik(1,bt),Ik(2,Ze),Ik(3,Ni),Ik(4,Va)],ug);class q9e extends Ue{constructor(){super({id:"editor.action.linkedEditing",label:m("linkedEditing.label","Start Linked Editing"),alias:"Start Linked Editing",precondition:fe.and(O.writable,O.hasRenameProvider),kbOpts:{kbExpr:O.editorTextFocus,primary:3132,weight:100}})}runCommand(e,t){const i=e.get(ai),[s,o]=Array.isArray(t)&&t||[void 0,void 0];return ct.isUri(s)&&Y.isIPosition(o)?i.openCodeEditor({resource:s},i.getActiveCodeEditor()).then(r=>{r&&(r.setPosition(o),r.invokeWithinContext(a=>(this.reportTelemetry(a,r),this.run(a,r))))},Dt):super.runCommand(e,t)}run(e,t){const i=ug.get(t);return i?Promise.resolve(i.updateRanges(!0)):Promise.resolve()}}const G9e=fs.bindToContribution(ug.get);Re(new G9e({id:"cancelLinkedEditingInput",precondition:dse,handler:n=>n.clearRanges(),kbOpts:{kbExpr:O.editorTextFocus,weight:100+99,primary:9,secondary:[1033]}}));function use(n,e,t,i){const s=n.ordered(e);return cQ(s.map(o=>()=>C5(this,void 0,void 0,function*(){try{return yield o.provideLinkedEditingRanges(e,t,i)}catch(r){Bn(r);return}})),o=>!!o&&io(o==null?void 0:o.ranges))}F("editor.linkedEditingBackground",{dark:ee.fromHex("#f00").transparent(.3),light:ee.fromHex("#f00").transparent(.3),hcDark:ee.fromHex("#f00").transparent(.3),hcLight:ee.white},m("editorLinkedEditingBackground","Background color when the editor auto renames on type."));$d("_executeLinkedEditingProvider",(n,e,t)=>{const{linkedEditingRangeProvider:i}=n.get(Ze);return use(i,e,t,Ft.None)});ti(ug.ID,ug,1);De(q9e);var hse=globalThis&&globalThis.__awaiter||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 Y9e=class{constructor(e,t){this._link=e,this._provider=t}toJSON(){return{range:this.range,url:this.url,tooltip:this.tooltip}}get range(){return this._link.range}get url(){return this._link.url}get tooltip(){return this._link.tooltip}resolve(e){return hse(this,void 0,void 0,function*(){return this._link.url?this._link.url:typeof this._provider.resolveLink=="function"?Promise.resolve(this._provider.resolveLink(this._link,e)).then(t=>(this._link=t||this._link,this._link.url?this.resolve(e):Promise.reject(new Error("missing")))):Promise.reject(new Error("missing"))})}};class iT{constructor(e){this._disposables=new be;let t=[];for(const[i,s]of e){const o=i.links.map(r=>new Y9e(r,s));t=iT._union(t,o),_8(i)&&this._disposables.add(i)}this.links=t}dispose(){this._disposables.dispose(),this.links.length=0}static _union(e,t){const i=[];let s,o,r,a;for(s=0,r=0,o=e.length,a=t.length;sPromise.resolve(o.provideLinks(e,t)).then(a=>{a&&(i[r]=[a,o])},Bn));return Promise.all(s).then(()=>{const o=new iT(wd(i));return t.isCancellationRequested?(o.dispose(),new iT([])):o})}qt.registerCommand("_executeLinkProvider",(n,...e)=>hse(void 0,void 0,void 0,function*(){let[t,i]=e;bi(t instanceof ct),typeof i!="number"&&(i=0);const{linkProvider:s}=n.get(Ze),o=n.get(Zi).getModel(t);if(!o)return[];const r=yield fse(s,o,Ft.None);if(!r)return[];for(let l=0;l=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},Tk=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},X9e=globalThis&&globalThis.__awaiter||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())})},w5;let n0=w5=class extends te{static get(e){return e.getContribution(w5.ID)}constructor(e,t,i,s,o){super(),this.editor=e,this.openerService=t,this.notificationService=i,this.languageFeaturesService=s,this.providers=this.languageFeaturesService.linkProvider,this.debounceInformation=o.for(this.providers,"Links",{min:1e3,max:4e3}),this.computeLinks=this._register(new Si(()=>this.computeLinksNow(),1e3)),this.computePromise=null,this.activeLinksList=null,this.currentOccurrences={},this.activeLinkDecorationId=null;const r=this._register(new fN(e));this._register(r.onMouseMoveOrRelevantKeyDown(([a,l])=>{this._onEditorMouseMove(a,l)})),this._register(r.onExecute(a=>{this.onEditorMouseUp(a)})),this._register(r.onCancel(a=>{this.cleanUpActiveLinkDecoration()})),this._register(e.onDidChangeConfiguration(a=>{a.hasChanged(70)&&(this.updateDecorations([]),this.stop(),this.computeLinks.schedule(0))})),this._register(e.onDidChangeModelContent(a=>{this.editor.hasModel()&&this.computeLinks.schedule(this.debounceInformation.get(this.editor.getModel()))})),this._register(e.onDidChangeModel(a=>{this.currentOccurrences={},this.activeLinkDecorationId=null,this.stop(),this.computeLinks.schedule(0)})),this._register(e.onDidChangeModelLanguage(a=>{this.stop(),this.computeLinks.schedule(0)})),this._register(this.providers.onDidChange(a=>{this.stop(),this.computeLinks.schedule(0)})),this.computeLinks.schedule(0)}computeLinksNow(){return X9e(this,void 0,void 0,function*(){if(!this.editor.hasModel()||!this.editor.getOption(70))return;const e=this.editor.getModel();if(!e.isTooLargeForSyncing()&&this.providers.has(e)){this.activeLinksList&&(this.activeLinksList.dispose(),this.activeLinksList=null),this.computePromise=Xn(t=>fse(this.providers,e,t));try{const t=new so(!1);if(this.activeLinksList=yield this.computePromise,this.debounceInformation.update(e,t.elapsed()),e.isDisposed())return;this.updateDecorations(this.activeLinksList.links)}catch(t){Dt(t)}finally{this.computePromise=null}}})}updateDecorations(e){const t=this.editor.getOption(77)==="altKey",i=[],s=Object.keys(this.currentOccurrences);for(const r of s){const a=this.currentOccurrences[r];i.push(a.decorationId)}const o=[];if(e)for(const r of e)o.push(ab.decoration(r,t));this.editor.changeDecorations(r=>{const a=r.deltaDecorations(i,o);this.currentOccurrences={},this.activeLinkDecorationId=null;for(let l=0,c=a.length;l{s.activate(o,i),this.activeLinkDecorationId=s.decorationId})}else this.cleanUpActiveLinkDecoration()}cleanUpActiveLinkDecoration(){const e=this.editor.getOption(77)==="altKey";if(this.activeLinkDecorationId){const t=this.currentOccurrences[this.activeLinkDecorationId];t&&this.editor.changeDecorations(i=>{t.deactivate(i,e)}),this.activeLinkDecorationId=null}}onEditorMouseUp(e){if(!this.isEnabled(e))return;const t=this.getLinkOccurrence(e.target.position);t&&this.openLinkOccurrence(t,e.hasSideBySideModifier,!0)}openLinkOccurrence(e,t,i=!1){if(!this.openerService)return;const{link:s}=e;s.resolve(Ft.None).then(o=>{if(typeof o=="string"&&this.editor.hasModel()){const r=this.editor.getModel().uri;if(r.scheme===Nt.file&&o.startsWith("".concat(Nt.file,":"))){const a=ct.parse(o);if(a.scheme===Nt.file){const l=Ac(a);let c=null;l.startsWith("/./")?c=".".concat(l.substr(1)):l.startsWith("//./")&&(c=".".concat(l.substr(2))),c&&(o=Jke(r,c))}}}return this.openerService.open(o,{openToSide:t,fromUserGesture:i,allowContributedOpeners:!0,allowCommands:!0,fromWorkspace:!0})},o=>{const r=o instanceof Error?o.message:o;r==="invalid"?this.notificationService.warn(m("invalid.url","Failed to open this link because it is not well-formed: {0}",s.url.toString())):r==="missing"?this.notificationService.warn(m("missing.url","Failed to open this link because its target is missing.")):Dt(o)})}getLinkOccurrence(e){if(!this.editor.hasModel()||!e)return null;const t=this.editor.getModel().getDecorationsInRange({startLineNumber:e.lineNumber,startColumn:e.column,endLineNumber:e.lineNumber,endColumn:e.column},0,!0);for(const i of t){const s=this.currentOccurrences[i.id];if(s)return s}return null}isEnabled(e,t){return!!(e.target.type===6&&(e.hasTriggerModifier||t&&t.keyCodeIsTriggerKey))}stop(){var e;this.computeLinks.cancel(),this.activeLinksList&&((e=this.activeLinksList)===null||e===void 0||e.dispose(),this.activeLinksList=null),this.computePromise&&(this.computePromise.cancel(),this.computePromise=null)}dispose(){super.dispose(),this.stop()}};n0.ID="editor.linkDetector";n0=w5=Z9e([Tk(1,Ir),Tk(2,Nn),Tk(3,Ze),Tk(4,Va)],n0);const mK={general:kt.register({description:"detected-link",stickiness:1,collapseOnReplaceEdit:!0,inlineClassName:"detected-link"}),active:kt.register({description:"detected-link-active",stickiness:1,collapseOnReplaceEdit:!0,inlineClassName:"detected-link-active"})};class ab{static decoration(e,t){return{range:e.range,options:ab._getOptions(e,t,!1)}}static _getOptions(e,t,i){const s=Object.assign({},i?mK.active:mK.general);return s.hoverMessage=Q9e(e,t),s}constructor(e,t){this.link=e,this.decorationId=t}activate(e,t){e.changeDecorationOptions(this.decorationId,ab._getOptions(this.link,t,!0))}deactivate(e,t){e.changeDecorationOptions(this.decorationId,ab._getOptions(this.link,t,!1))}}function Q9e(n,e){const t=n.url&&/^command:/i.test(n.url.toString()),i=n.tooltip?n.tooltip:t?m("links.navigate.executeCmd","Execute command"):m("links.navigate.follow","Follow link"),s=e?Kt?m("links.navigate.kb.meta.mac","cmd + click"):m("links.navigate.kb.meta","ctrl + click"):Kt?m("links.navigate.kb.alt.mac","option + click"):m("links.navigate.kb.alt","alt + click");if(n.url){let o="";if(/^command:/i.test(n.url.toString())){const a=n.url.toString().match(/^command:([^?#]+)/);if(a){const l=a[1];o=m("tooltip.explanation","Execute command {0}",l)}}return new Bs("",!0).appendLink(n.url.toString(!0).replace(/ /g,"%20"),i,o).appendMarkdown(" (".concat(s,")"))}else return new Bs().appendText("".concat(i," (").concat(s,")"))}class J9e extends Ue{constructor(){super({id:"editor.action.openLink",label:m("label","Open Link"),alias:"Open Link",precondition:void 0})}run(e,t){const i=n0.get(t);if(!i||!t.hasModel())return;const s=t.getSelections();for(const o of s){const r=i.getLinkOccurrence(o.getEndPosition());r&&i.openLinkOccurrence(r,!1)}}}ti(n0.ID,n0,1);De(J9e);class y5 extends te{constructor(e){super(),this._editor=e,this._register(this._editor.onMouseDown(t=>{const i=this._editor.getOption(116);i>=0&&t.target.type===6&&t.target.position.column>=i&&this._editor.updateOptions({stopRenderingLineAfter:-1})}))}}y5.ID="editor.contrib.longLinesHelper";ti(y5.ID,y5,2);const xk=F("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);F("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);F("editor.wordHighlightTextBackground",{light:xk,dark:xk,hcDark:xk,hcLight:xk},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 Nk=F("editor.wordHighlightBorder",{light:null,dark:null,hcDark:$i,hcLight:$i},m("wordHighlightBorder","Border color of a symbol during read-access, like reading a variable."));F("editor.wordHighlightStrongBorder",{light:null,dark:null,hcDark:$i,hcLight:$i},m("wordHighlightStrongBorder","Border color of a symbol during write-access, like writing to a variable."));F("editor.wordHighlightTextBorder",{light:Nk,dark:Nk,hcDark:Nk,hcLight:Nk},m("wordHighlightTextBorder","Border color of a textual occurrence for a symbol."));const e7e=F("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),t7e=F("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),i7e=F("editorOverviewRuler.wordHighlightTextForeground",{dark:j1,light:j1,hcDark:j1,hcLight:j1},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),n7e=kt.register({description:"word-highlight-strong",stickiness:1,className:"wordHighlightStrong",overviewRuler:{color:sn(t7e),position:Qr.Center},minimap:{color:sn(vx),position:yr.Inline}}),s7e=kt.register({description:"word-highlight-text",stickiness:1,className:"wordHighlightText",overviewRuler:{color:sn(i7e),position:Qr.Center},minimap:{color:sn(vx),position:yr.Inline}}),o7e=kt.register({description:"selection-highlight-overview",stickiness:1,className:"selectionHighlight",overviewRuler:{color:sn(j1),position:Qr.Center},minimap:{color:sn(vx),position:yr.Inline}}),r7e=kt.register({description:"selection-highlight",stickiness:1,className:"selectionHighlight"}),a7e=kt.register({description:"word-highlight",stickiness:1,className:"wordHighlight",overviewRuler:{color:sn(e7e),position:Qr.Center},minimap:{color:sn(vx),position:yr.Inline}});function l7e(n){return n===mw.Write?n7e:n===mw.Text?s7e:a7e}function c7e(n){return n?r7e:o7e}bl((n,e)=>{const t=n.getColor(i9);t&&e.addRule(".monaco-editor .selectionHighlight { background-color: ".concat(t.transparent(.5),"; }"))});var d7e=globalThis&&globalThis.__decorate||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},u7e=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},S5;function Ag(n,e){const t=e.filter(i=>!n.find(s=>s.equals(i)));if(t.length>=1){const i=t.map(o=>"line ".concat(o.viewState.position.lineNumber," column ").concat(o.viewState.position.column)).join(", "),s=t.length===1?m("cursorAdded","Cursor added: {0}",i):m("cursorsAdded","Cursors added: {0}",i);Yf(s)}}class h7e extends Ue{constructor(){super({id:"editor.action.insertCursorAbove",label:m("mutlicursor.insertAbove","Add Cursor Above"),alias:"Add Cursor Above",precondition:void 0,kbOpts:{kbExpr:O.editorTextFocus,primary:2576,linux:{primary:1552,secondary:[3088]},weight:100},menuOpts:{menuId:M.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,ms.addCursorUp(o,r,s)),o.revealTopMostCursor(i.source),Ag(r,o.getCursorStates())}}class f7e extends Ue{constructor(){super({id:"editor.action.insertCursorBelow",label:m("mutlicursor.insertBelow","Add Cursor Below"),alias:"Add Cursor Below",precondition:void 0,kbOpts:{kbExpr:O.editorTextFocus,primary:2578,linux:{primary:1554,secondary:[3090]},weight:100},menuOpts:{menuId:M.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,ms.addCursorDown(o,r,s)),o.revealBottomMostCursor(i.source),Ag(r,o.getCursorStates())}}class g7e extends Ue{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:O.editorTextFocus,primary:1575,weight:100},menuOpts:{menuId:M.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 Je(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),Ag(r,o.getCursorStates())}}class p7e extends Ue{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 Je(l,i[0].startColumn,l,i[0].endColumn));const r=t._getViewModel(),a=r.getCursorStates();o.length>0&&t.setSelections(o),Ag(a,r.getCursorStates())}}class m7e extends Ue{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 Je(a,i[0].startColumn,a,i[0].endColumn));const o=t._getViewModel(),r=o.getCursorStates();s.length>0&&t.setSelections(s),Ag(r,o.getCursorStates())}}class Ak{constructor(e,t,i){this.selections=e,this.revealRange=t,this.revealScrollType=i}}class Ry{static create(e,t){if(!e.hasModel())return null;const i=t.getState();if(!e.hasTextFocus()&&i.isRevealed&&i.searchString.length>0)return new Ry(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 Je(l.startLineNumber,u.startColumn,l.startLineNumber,u.endColumn)}else c=e.getModel().getValueInRange(l).replace(/\r\n/g,"\n");return new Ry(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 Ak(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 Ak(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 Je(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 Ak(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 Ak(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 Je(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 Nm extends te{static get(e){return e.getContribution(Nm.ID)}constructor(e){super(),this._sessionDispose=this._register(new be),this._editor=e,this._ignoreSelectionChange=!1,this._session=null}dispose(){this._endSession(),super.dispose()}_beginSessionIfNeeded(e){if(!this._session){const t=Ry.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 Je(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(!gse(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 Je(o.range.startLineNumber,o.range.startColumn,o.range.endLineNumber,o.range.endColumn)))}}}Nm.ID="editor.contrib.multiCursorController";class H0 extends Ue{run(e,t){const i=Nm.get(t);if(!i)return;const s=t._getViewModel();if(s){const o=s.getCursorStates(),r=Oo.get(t);if(r)this._run(i,r);else{const a=e.get(_t).createInstance(Oo,t);this._run(i,a),a.dispose()}Ag(o,s.getCursorStates())}}}class _7e extends H0{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:O.focus,primary:2082,weight:100},menuOpts:{menuId:M.MenubarSelectionMenu,group:"3_multi",title:m({key:"miAddSelectionToNextFindMatch",comment:["&& denotes a mnemonic"]},"Add &&Next Occurrence"),order:5}})}_run(e,t){e.addSelectionToNextFindMatch(t)}}class v7e extends H0{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:M.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 b7e extends H0{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:O.focus,primary:qn(2089,2082),weight:100}})}_run(e,t){e.moveSelectionToNextFindMatch(t)}}class C7e extends H0{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 w7e extends H0{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:O.focus,primary:3114,weight:100},menuOpts:{menuId:M.MenubarSelectionMenu,group:"3_multi",title:m({key:"miSelectHighlights",comment:["&& denotes a mnemonic"]},"Select All &&Occurrences"),order:7}})}_run(e,t){e.selectAll(t)}}class y7e extends H0{constructor(){super({id:"editor.action.changeAll",label:m("changeAll.label","Change All Occurrences"),alias:"Change All Occurrences",precondition:fe.and(O.writable,O.editorTextFocus),kbOpts:{kbExpr:O.editorTextFocus,primary:2108,weight:100},contextMenuOpts:{group:"1_modification",order:1.2}})}_run(e,t){e.selectAll(t)}}class S7e{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(I.compareRangesUsingStarts)),this._cachedFindMatches}}let Py=S5=class extends te{constructor(e,t){super(),this._languageFeaturesService=t,this.editor=e,this._isEnabled=e.getOption(107),this._decorations=e.createDecorationsCollection(),this.updateSoon=this._register(new Si(()=>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=Oo.get(e);i&&this._register(i.getState().onFindReplaceStateChange(s=>{this._update()})),this.updateSoon.schedule()}_update(){this._setState(S5._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=Nm.get(i);if(!o)return null;const r=Oo.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(!gse(i.getModel(),d,h))return null}a=Ry.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 S7e(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(I.compareRangesUsingStarts);const o=[];for(let l=0,c=0,d=i.length,u=s.length;l=u)o.push(h),l++;else{const f=I.compareRangesUsingStarts(h,s[c]);f<0?((s[c].isEmpty()||!I.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:c7e(r)}));this._decorations.set(a)}dispose(){this._setState(null),super.dispose()}};Py.ID="editor.contrib.selectionHighlighter";Py=S5=d7e([u7e(1,Ze)],Py);function gse(n,e,t){const i=_K(n,e[0],!t);for(let s=1,o=e.length;spse(void 0,void 0,void 0,function*(){const[t,i,s]=e;bi(ct.isUri(t)),bi(Y.isIPosition(i)),bi(typeof s=="string"||!s);const o=n.get(Ze),r=yield n.get(sr).createModelReference(t);try{const a=yield mse(o.signatureHelpProvider,r.object.textEditorModel,Y.lift(i),{triggerKind:gd.Invoke,isRetrigger:!1,triggerCharacter:s},Ft.None);return a?(setTimeout(()=>a.dispose(),0),a.value):void 0}finally{r.dispose()}}));var D7e=globalThis&&globalThis.__awaiter||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())})},Bh;(function(n){n.Default={type:0};class e{constructor(s,o){this.request=s,this.previouslyActiveHints=o,this.type=2}}n.Pending=e;class t{constructor(s){this.hints=s,this.type=1}}n.Active=t})(Bh||(Bh={}));class KN extends te{constructor(e,t,i=KN.DEFAULT_DELAY){super(),this._onChangedHints=this._register(new j),this.onChangedHints=this._onChangedHints.event,this.triggerOnType=!1,this._state=Bh.Default,this._pendingTriggers=[],this._lastSignatureHelpResult=this._register(new Ts),this.triggerChars=new LE,this.retriggerChars=new LE,this.triggerId=0,this.editor=e,this.providers=t,this.throttledDelayer=new pl(i),this._register(this.editor.onDidBlurEditorWidget(()=>this.cancel())),this._register(this.editor.onDidChangeConfiguration(()=>this.onEditorConfigurationChange())),this._register(this.editor.onDidChangeModel(s=>this.onModelChanged())),this._register(this.editor.onDidChangeModelLanguage(s=>this.onModelChanged())),this._register(this.editor.onDidChangeCursorSelection(s=>this.onCursorChange(s))),this._register(this.editor.onDidChangeModelContent(s=>this.onModelContentChange())),this._register(this.providers.onDidChange(this.onModelChanged,this)),this._register(this.editor.onDidType(s=>this.onDidType(s))),this.onEditorConfigurationChange(),this.onModelChanged()}get state(){return this._state}set state(e){this._state.type===2&&this._state.request.cancel(),this._state=e}cancel(e=!1){this.state=Bh.Default,this.throttledDelayer.cancel(),e||this._onChangedHints.fire(void 0)}trigger(e,t){const i=this.editor.getModel();if(!i||!this.providers.has(i))return;const s=++this.triggerId;this._pendingTriggers.push(e),this.throttledDelayer.trigger(()=>this.doTrigger(s),t).catch(Dt)}next(){if(this.state.type!==1)return;const e=this.state.hints.signatures.length,t=this.state.hints.activeSignature,i=t%e===e-1,s=this.editor.getOption(85).cycle;if((e<2||i)&&!s){this.cancel();return}this.updateActiveSignature(i&&s?0:t+1)}previous(){if(this.state.type!==1)return;const e=this.state.hints.signatures.length,t=this.state.hints.activeSignature,i=t===0,s=this.editor.getOption(85).cycle;if((e<2||i)&&!s){this.cancel();return}this.updateActiveSignature(i&&s?e-1:t-1)}updateActiveSignature(e){this.state.type===1&&(this.state=new Bh.Active(Object.assign(Object.assign({},this.state.hints),{activeSignature:e})),this._onChangedHints.fire(this.state.hints))}doTrigger(e){return D7e(this,void 0,void 0,function*(){const t=this.state.type===1||this.state.type===2,i=this.getLastActiveHints();if(this.cancel(!0),this._pendingTriggers.length===0)return!1;const s=this._pendingTriggers.reduce(E7e);this._pendingTriggers=[];const o={triggerKind:s.triggerKind,triggerCharacter:s.triggerCharacter,isRetrigger:t,activeSignatureHelp:i};if(!this.editor.hasModel())return!1;const r=this.editor.getModel(),a=this.editor.getPosition();this.state=new Bh.Pending(Xn(l=>mse(this.providers,r,a,o,l)),i);try{const l=yield this.state.request;return e!==this.triggerId?(l==null||l.dispose(),!1):!l||!l.value.signatures||l.value.signatures.length===0?(l==null||l.dispose(),this._lastSignatureHelpResult.clear(),this.cancel(),!1):(this.state=new Bh.Active(l.value),this._lastSignatureHelpResult.value=l,this._onChangedHints.fire(this.state.hints),!0)}catch(l){return e===this.triggerId&&(this.state=Bh.Default),Dt(l),!1}})}getLastActiveHints(){switch(this.state.type){case 1:return this.state.hints;case 2:return this.state.previouslyActiveHints;default:return}}get isTriggered(){return this.state.type===1||this.state.type===2||this.throttledDelayer.isTriggered()}onModelChanged(){this.cancel(),this.triggerChars.clear(),this.retriggerChars.clear();const e=this.editor.getModel();if(e)for(const t of this.providers.ordered(e)){for(const i of t.signatureHelpTriggerCharacters||[])if(i.length){const s=i.charCodeAt(0);this.triggerChars.add(s),this.retriggerChars.add(s)}for(const i of t.signatureHelpRetriggerCharacters||[])i.length&&this.retriggerChars.add(i.charCodeAt(0))}}onDidType(e){if(!this.triggerOnType)return;const t=e.length-1,i=e.charCodeAt(t);(this.triggerChars.has(i)||this.isTriggered&&this.retriggerChars.has(i))&&this.trigger({triggerKind:gd.TriggerCharacter,triggerCharacter:e.charAt(t)})}onCursorChange(e){e.source==="mouse"?this.cancel():this.isTriggered&&this.trigger({triggerKind:gd.ContentChange})}onModelContentChange(){this.isTriggered&&this.trigger({triggerKind:gd.ContentChange})}onEditorConfigurationChange(){this.triggerOnType=this.editor.getOption(85).enabled,this.triggerOnType||this.cancel()}dispose(){this.cancel(!0),super.dispose()}}KN.DEFAULT_DELAY=120;function E7e(n,e){switch(e.triggerKind){case gd.Invoke:return e;case gd.ContentChange:return n;case gd.TriggerCharacter:default:return e}}var I7e=globalThis&&globalThis.__decorate||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},FR=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},L5;const xr=ye,T7e=Sn("parameter-hints-next",Me.chevronDown,m("parameterHintsNextIcon","Icon for show next parameter hint.")),x7e=Sn("parameter-hints-previous",Me.chevronUp,m("parameterHintsPreviousIcon","Icon for show previous parameter hint."));let nT=L5=class extends te{constructor(e,t,i,s,o){super(),this.editor=e,this.model=t,this.renderDisposeables=this._register(new be),this.visible=!1,this.announcedLabel=null,this.allowEditorOverflow=!0,this.markdownRenderer=this._register(new Zu({editor:e},o,s)),this.keyVisible=Am.Visible.bindTo(i),this.keyMultipleSignatures=Am.MultipleSignatures.bindTo(i)}createParameterHintDOMNodes(){const e=xr(".editor-widget.parameter-hints-widget"),t=ge(e,xr(".phwrapper"));t.tabIndex=-1;const i=ge(t,xr(".controls")),s=ge(i,xr(".button"+dt.asCSSSelector(x7e))),o=ge(i,xr(".overloads")),r=ge(i,xr(".button"+dt.asCSSSelector(T7e)));this._register(ce(s,"click",h=>{xt.stop(h),this.previous()})),this._register(ce(r,"click",h=>{xt.stop(h),this.next()}));const a=xr(".body"),l=new bS(a,{alwaysConsumeMouseWheel:!0});this._register(l),t.appendChild(l.getDomNode());const c=ge(a,xr(".signature")),d=ge(a,xr(".docs"));e.style.userSelect="text",this.domNodes={element:e,signature:c,overloads:o,docs:d,scrollbar:l},this.editor.addContentWidget(this),this.hide(),this._register(this.editor.onDidChangeCursorSelection(h=>{this.visible&&this.editor.layoutContentWidget(this)}));const u=()=>{if(!this.domNodes)return;const h=this.editor.getOption(50);this.domNodes.element.style.fontSize="".concat(h.fontSize,"px"),this.domNodes.element.style.lineHeight="".concat(h.lineHeight/h.fontSize)};u(),this._register(We.chain(this.editor.onDidChangeConfiguration.bind(this.editor),h=>h.filter(f=>f.hasChanged(50)))(u)),this._register(this.editor.onDidLayoutChange(h=>this.updateMaxHeight())),this.updateMaxHeight()}show(){this.visible||(this.domNodes||this.createParameterHintDOMNodes(),this.keyVisible.set(!0),this.visible=!0,setTimeout(()=>{var e;(e=this.domNodes)===null||e===void 0||e.element.classList.add("visible")},100),this.editor.layoutContentWidget(this))}hide(){var e;this.renderDisposeables.clear(),this.visible&&(this.keyVisible.reset(),this.visible=!1,this.announcedLabel=null,(e=this.domNodes)===null||e===void 0||e.element.classList.remove("visible"),this.editor.layoutContentWidget(this))}getPosition(){return this.visible?{position:this.editor.getPosition(),preference:[1,2]}:null}render(e){var t;if(this.renderDisposeables.clear(),!this.domNodes)return;const i=e.signatures.length>1;this.domNodes.element.classList.toggle("multiple",i),this.keyMultipleSignatures.set(i),this.domNodes.signature.innerText="",this.domNodes.docs.innerText="";const s=e.signatures[e.activeSignature];if(!s)return;const o=ge(this.domNodes.signature,xr(".code")),r=this.editor.getOption(50);o.style.fontSize="".concat(r.fontSize,"px"),o.style.fontFamily=r.fontFamily;const a=s.parameters.length>0,l=(t=s.activeParameter)!==null&&t!==void 0?t:e.activeParameter;if(a)this.renderParameters(o,s,l);else{const u=ge(o,xr("span"));u.textContent=s.label}const c=s.parameters[l];if(c!=null&&c.documentation){const u=xr("span.documentation");if(typeof c.documentation=="string")u.textContent=c.documentation;else{const h=this.renderMarkdownDocs(c.documentation);u.appendChild(h.element)}ge(this.domNodes.docs,xr("p",{},u))}if(s.documentation!==void 0)if(typeof s.documentation=="string")ge(this.domNodes.docs,xr("p",{},s.documentation));else{const u=this.renderMarkdownDocs(s.documentation);ge(this.domNodes.docs,u.element)}const d=this.hasDocs(s,c);if(this.domNodes.signature.classList.toggle("has-docs",d),this.domNodes.docs.classList.toggle("empty",!d),this.domNodes.overloads.textContent=String(e.activeSignature+1).padStart(e.signatures.length.toString().length,"0")+"/"+e.signatures.length,c){let u="";const h=s.parameters[l];Array.isArray(h.label)?u=s.label.substring(h.label[0],h.label[1]):u=h.label,h.documentation&&(u+=typeof h.documentation=="string"?", ".concat(h.documentation):", ".concat(h.documentation.value)),s.documentation&&(u+=typeof s.documentation=="string"?", ".concat(s.documentation):", ".concat(s.documentation.value)),this.announcedLabel!==u&&(to(m("hint","{0}, hint",u)),this.announcedLabel=u)}this.editor.layoutContentWidget(this),this.domNodes.scrollbar.scanDomNode()}renderMarkdownDocs(e){const t=this.renderDisposeables.add(this.markdownRenderer.render(e,{asyncRenderCallback:()=>{var i;(i=this.domNodes)===null||i===void 0||i.scrollbar.scanDomNode()}}));return t.element.classList.add("markdown-docs"),t}hasDocs(e,t){return!!(t&&typeof t.documentation=="string"&&kp(t.documentation).length>0||t&&typeof t.documentation=="object"&&kp(t.documentation).value.length>0||e.documentation&&typeof e.documentation=="string"&&kp(e.documentation).length>0||e.documentation&&typeof e.documentation=="object"&&kp(e.documentation.value).length>0)}renderParameters(e,t,i){const[s,o]=this.getParameterLabelOffsets(t,i),r=document.createElement("span");r.textContent=t.label.substring(0,s);const a=document.createElement("span");a.textContent=t.label.substring(s,o),a.className="parameter active";const l=document.createElement("span");l.textContent=t.label.substring(o),ge(e,r,a,l)}getParameterLabelOffsets(e,t){const i=e.parameters[t];if(i){if(Array.isArray(i.label))return i.label;if(i.label.length){const s=new RegExp("(\\W|^)".concat(Xr(i.label),"(?=\\W|$)"),"g");s.test(e.label);const o=s.lastIndex-i.label.length;return o>=0?[o,s.lastIndex]:[0,0]}else return[0,0]}else return[0,0]}next(){this.editor.focus(),this.model.next()}previous(){this.editor.focus(),this.model.previous()}getDomNode(){return this.domNodes||this.createParameterHintDOMNodes(),this.domNodes.element}getId(){return L5.ID}updateMaxHeight(){if(!this.domNodes)return;const e=Math.max(this.editor.getLayoutInfo().height/4,250),t="".concat(e,"px");this.domNodes.element.style.maxHeight=t;const i=this.domNodes.element.getElementsByClassName("phwrapper");i.length&&(i[0].style.maxHeight=t)}};nT.ID="editor.widget.parameterHintsWidget";nT=L5=I7e([FR(2,bt),FR(3,Ir),FR(4,qi)],nT);F("editorHoverWidget.highlightForeground",{dark:el,light:el,hcDark:el,hcLight:el},m("editorHoverWidgetHighlightForeground","Foreground color of the active item in the parameter hint."));var N7e=globalThis&&globalThis.__decorate||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},vK=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},k5;let Mm=k5=class extends te{static get(e){return e.getContribution(k5.ID)}constructor(e,t,i){super(),this.editor=e,this.model=this._register(new KN(e,i.signatureHelpProvider)),this._register(this.model.onChangedHints(s=>{var o;s?(this.widget.value.show(),this.widget.value.render(s)):(o=this.widget.rawValue)===null||o===void 0||o.hide()})),this.widget=new kg(()=>this._register(t.createInstance(nT,this.editor,this.model)))}cancel(){this.model.cancel()}previous(){var e;(e=this.widget.rawValue)===null||e===void 0||e.previous()}next(){var e;(e=this.widget.rawValue)===null||e===void 0||e.next()}trigger(e){this.model.trigger(e,0)}};Mm.ID="editor.controller.parameterHints";Mm=k5=N7e([vK(1,_t),vK(2,Ze)],Mm);class A7e extends Ue{constructor(){super({id:"editor.action.triggerParameterHints",label:m("parameterHints.trigger.label","Trigger Parameter Hints"),alias:"Trigger Parameter Hints",precondition:O.hasSignatureHelpProvider,kbOpts:{kbExpr:O.editorTextFocus,primary:3082,weight:100}})}run(e,t){const i=Mm.get(t);i==null||i.trigger({triggerKind:gd.Invoke})}}ti(Mm.ID,Mm,2);De(A7e);const m6=100+75,_6=fs.bindToContribution(Mm.get);Re(new _6({id:"closeParameterHints",precondition:Am.Visible,handler:n=>n.cancel(),kbOpts:{weight:m6,kbExpr:O.focus,primary:9,secondary:[1033]}}));Re(new _6({id:"showPrevParameterHint",precondition:fe.and(Am.Visible,Am.MultipleSignatures),handler:n=>n.previous(),kbOpts:{weight:m6,kbExpr:O.focus,primary:16,secondary:[528],mac:{primary:16,secondary:[528,302]}}}));Re(new _6({id:"showNextParameterHint",precondition:fe.and(Am.Visible,Am.MultipleSignatures),handler:n=>n.next(),kbOpts:{weight:m6,kbExpr:O.focus,primary:18,secondary:[530],mac:{primary:18,secondary:[530,300]}}}));var M7e=globalThis&&globalThis.__decorate||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=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};const qN=new Ve("renameInputVisible",!1,m("renameInputVisible","Whether the rename input widget is visible"));let D5=class{constructor(e,t,i,s,o){this._editor=e,this._acceptKeybindings=t,this._themeService=i,this._keybindingService=s,this._disposables=new be,this.allowEditorOverflow=!0,this._visibleContextKey=qN.bindTo(o),this._editor.addContentWidget(this),this._disposables.add(this._editor.onDidChangeConfiguration(r=>{r.hasChanged(50)&&this._updateFont()})),this._disposables.add(i.onDidColorThemeChange(this._updateStyles,this))}dispose(){this._disposables.dispose(),this._editor.removeContentWidget(this)}getId(){return"__renameInputWidget"}getDomNode(){return this._domNode||(this._domNode=document.createElement("div"),this._domNode.className="monaco-editor rename-box",this._input=document.createElement("input"),this._input.className="rename-input",this._input.type="text",this._input.setAttribute("aria-label",m("renameAriaLabel","Rename input. Type new name and press Enter to commit.")),this._domNode.appendChild(this._input),this._label=document.createElement("div"),this._label.className="rename-label",this._domNode.appendChild(this._label),this._updateFont(),this._updateStyles(this._themeService.getColorTheme())),this._domNode}_updateStyles(e){var t,i,s,o;if(!this._input||!this._domNode)return;const r=e.getColor(nd),a=e.getColor(J8);this._domNode.style.backgroundColor=String((t=e.getColor(un))!==null&&t!==void 0?t:""),this._domNode.style.boxShadow=r?" 0 0 8px 2px ".concat(r):"",this._domNode.style.border=a?"1px solid ".concat(a):"",this._domNode.style.color=String((i=e.getColor(HQ))!==null&&i!==void 0?i:""),this._input.style.backgroundColor=String((s=e.getColor(VQ))!==null&&s!==void 0?s:"");const l=e.getColor($Q);this._input.style.borderWidth=l?"1px":"0px",this._input.style.borderStyle=l?"solid":"none",this._input.style.borderColor=(o=l==null?void 0:l.toString())!==null&&o!==void 0?o:"none"}_updateFont(){if(!this._input||!this._label)return;const e=this._editor.getOption(50);this._input.style.fontFamily=e.fontFamily,this._input.style.fontWeight=e.fontWeight,this._input.style.fontSize="".concat(e.fontSize,"px"),this._label.style.fontSize="".concat(e.fontSize*.8,"px")}getPosition(){return this._visible?{position:this._position,preference:[2,1]}:null}beforeRender(){var e,t;const[i,s]=this._acceptKeybindings;return this._label.innerText=m({key:"label",comment:['placeholders are keybindings, e.g "F2 to Rename, Shift+F2 to Preview"']},"{0} to Rename, {1} to Preview",(e=this._keybindingService.lookupKeybinding(i))===null||e===void 0?void 0:e.getLabel(),(t=this._keybindingService.lookupKeybinding(s))===null||t===void 0?void 0:t.getLabel()),null}afterRender(e){e||this.cancelInput(!0)}acceptInput(e){var t;(t=this._currentAcceptInput)===null||t===void 0||t.call(this,e)}cancelInput(e){var t;(t=this._currentCancelInput)===null||t===void 0||t.call(this,e)}getInput(e,t,i,s,o,r){this._domNode.classList.toggle("preview",o),this._position=new Y(e.startLineNumber,e.startColumn),this._input.value=t,this._input.setAttribute("selectionStart",i.toString()),this._input.setAttribute("selectionEnd",s.toString()),this._input.size=Math.max((e.endColumn-e.startColumn)*1.1,20);const a=new be;return new Promise(l=>{this._currentCancelInput=c=>(this._currentAcceptInput=void 0,this._currentCancelInput=void 0,l(c),!0),this._currentAcceptInput=c=>{if(this._input.value.trim().length===0||this._input.value===t){this.cancelInput(!0);return}this._currentAcceptInput=void 0,this._currentCancelInput=void 0,l({newName:this._input.value,wantsPreview:o&&c})},a.add(r.onCancellationRequested(()=>this.cancelInput(!0))),a.add(this._editor.onDidBlurEditorWidget(()=>{var c;return this.cancelInput(!(!((c=this._domNode)===null||c===void 0)&&c.ownerDocument.hasFocus()))})),this._show()}).finally(()=>{a.dispose(),this._hide()})}_show(){this._editor.revealLineInCenterIfOutsideViewport(this._position.lineNumber,0),this._visible=!0,this._visibleContextKey.set(!0),this._editor.layoutContentWidget(this),setTimeout(()=>{this._input.focus(),this._input.setSelectionRange(parseInt(this._input.getAttribute("selectionStart")),parseInt(this._input.getAttribute("selectionEnd")))},100)}_hide(){this._visible=!1,this._visibleContextKey.reset(),this._editor.layoutContentWidget(this)}};D5=M7e([BR(2,os),BR(3,Di),BR(4,bt)],D5);var R7e=globalThis&&globalThis.__decorate||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},Jg=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},Qp=globalThis&&globalThis.__awaiter||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())})},E5;class v6{constructor(e,t,i){this.model=e,this.position=t,this._providerRenameIdx=0,this._providers=i.ordered(e)}hasProvider(){return this._providers.length>0}resolveRenameLocation(e){return Qp(this,void 0,void 0,function*(){const t=[];for(this._providerRenameIdx=0;this._providerRenameIdx0?t.join("\n"):void 0}:{range:I.fromPositions(this.position),text:"",rejectReason:t.length>0?t.join("\n"):void 0}})}provideRenameEdits(e,t){return Qp(this,void 0,void 0,function*(){return this._provideRenameEdits(e,this._providerRenameIdx,[],t)})}_provideRenameEdits(e,t,i,s){return Qp(this,void 0,void 0,function*(){const o=this._providers[t];if(!o)return{edits:[],rejectReason:i.join("\n")};const r=yield o.provideRenameEdits(this.model,this.position,e,s);if(r){if(r.rejectReason)return this._provideRenameEdits(e,t+1,i.concat(r.rejectReason),s)}else return this._provideRenameEdits(e,t+1,i.concat(m("no result","No result.")),s);return r})}}function P7e(n,e,t,i){return Qp(this,void 0,void 0,function*(){const s=new v6(e,t,n),o=yield s.resolveRenameLocation(Ft.None);return o!=null&&o.rejectReason?{edits:[],rejectReason:o.rejectReason}:s.provideRenameEdits(i,Ft.None)})}let Rm=E5=class{static get(e){return e.getContribution(E5.ID)}constructor(e,t,i,s,o,r,a,l){this.editor=e,this._instaService=t,this._notificationService=i,this._bulkEditService=s,this._progressService=o,this._logService=r,this._configService=a,this._languageFeaturesService=l,this._disposableStore=new be,this._cts=new Tn,this._renameInputField=this._disposableStore.add(this._instaService.createInstance(D5,this.editor,["acceptRenameInput","acceptRenameInputWithPreview"]))}dispose(){this._disposableStore.dispose(),this._cts.dispose(!0)}run(){var e,t;return Qp(this,void 0,void 0,function*(){if(this._cts.dispose(!0),this._cts=new Tn,!this.editor.hasModel())return;const i=this.editor.getPosition(),s=new v6(this.editor.getModel(),i,this._languageFeaturesService.renameProvider);if(!s.hasProvider())return;const o=new tg(this.editor,5,void 0,this._cts.token);let r;try{const g=s.resolveRenameLocation(o.token);this._progressService.showWhile(g,250),r=yield g}catch(g){(e=Sr.get(this.editor))===null||e===void 0||e.showMessage(g||m("resolveRenameLocationFailed","An unknown error occurred while resolving rename location"),i);return}finally{o.dispose()}if(!r)return;if(r.rejectReason){(t=Sr.get(this.editor))===null||t===void 0||t.showMessage(r.rejectReason,i);return}if(o.token.isCancellationRequested)return;const a=new tg(this.editor,5,r.range,this._cts.token),l=this.editor.getSelection();let c=0,d=r.text.length;!I.isEmpty(l)&&!I.spansMultipleLines(l)&&I.containsRange(r.range,l)&&(c=Math.max(0,l.startColumn-r.range.startColumn),d=Math.min(r.range.endColumn,l.endColumn)-r.range.startColumn);const u=this._bulkEditService.hasPreviewHandler()&&this._configService.getValue(this.editor.getModel().uri,"editor.rename.enablePreview"),h=yield this._renameInputField.getInput(r.range,r.text,c,d,u,a.token);if(typeof h=="boolean"){h&&this.editor.focus(),a.dispose();return}this.editor.focus();const f=ox(s.provideRenameEdits(h.newName,a.token),a.token).then(g=>Qp(this,void 0,void 0,function*(){if(!(!g||!this.editor.hasModel())){if(g.rejectReason){this._notificationService.info(g.rejectReason);return}this.editor.setSelection(I.fromPositions(this.editor.getSelection().getPosition())),this._bulkEditService.apply(g,{editor:this.editor,showPreview:h.wantsPreview,label:m("label","Renaming '{0}' to '{1}'",r==null?void 0:r.text,h.newName),code:"undoredo.rename",quotableLabel:m("quotableLabel","Renaming {0} to {1}",r==null?void 0:r.text,h.newName),respectAutoSaveConfig:!0}).then(p=>{p.ariaSummary&&to(m("aria","Successfully renamed '{0}' to '{1}'. Summary: {2}",r.text,h.newName,p.ariaSummary))}).catch(p=>{this._notificationService.error(m("rename.failedApply","Rename failed to apply edits")),this._logService.error(p)})}}),g=>{this._notificationService.error(m("rename.failed","Rename failed to compute edits")),this._logService.error(g)}).finally(()=>{a.dispose()});return this._progressService.showWhile(f,250),f})}acceptRenameInput(e){this._renameInputField.acceptInput(e)}cancelRenameInput(){this._renameInputField.cancelInput(!0)}};Rm.ID="editor.contrib.renameController";Rm=E5=R7e([Jg(1,_t),Jg(2,Nn),Jg(3,kS),Jg(4,Tg),Jg(5,aa),Jg(6,j8),Jg(7,Ze)],Rm);class O7e extends Ue{constructor(){super({id:"editor.action.rename",label:m("rename.label","Rename Symbol"),alias:"Rename Symbol",precondition:fe.and(O.writable,O.hasRenameProvider),kbOpts:{kbExpr:O.editorTextFocus,primary:60,weight:100},contextMenuOpts:{group:"1_modification",order:1.1}})}runCommand(e,t){const i=e.get(ai),[s,o]=Array.isArray(t)&&t||[void 0,void 0];return ct.isUri(s)&&Y.isIPosition(o)?i.openCodeEditor({resource:s},i.getActiveCodeEditor()).then(r=>{r&&(r.setPosition(o),r.invokeWithinContext(a=>(this.reportTelemetry(a,r),this.run(a,r))))},Dt):super.runCommand(e,t)}run(e,t){const i=Rm.get(t);return i?i.run():Promise.resolve()}}ti(Rm.ID,Rm,4);De(O7e);const b6=fs.bindToContribution(Rm.get);Re(new b6({id:"acceptRenameInput",precondition:qN,handler:n=>n.acceptRenameInput(!1),kbOpts:{weight:100+99,kbExpr:fe.and(O.focus,fe.not("isComposing")),primary:3}}));Re(new b6({id:"acceptRenameInputWithPreview",precondition:fe.and(qN,fe.has("config.editor.rename.enablePreview")),handler:n=>n.acceptRenameInput(!0),kbOpts:{weight:100+99,kbExpr:fe.and(O.focus,fe.not("isComposing")),primary:1024+3}}));Re(new b6({id:"cancelRenameInput",precondition:qN,handler:n=>n.cancelRenameInput(),kbOpts:{weight:100+99,kbExpr:O.focus,primary:9,secondary:[1033]}}));$d("_executeDocumentRenameProvider",function(n,e,t,...i){const[s]=i;bi(typeof s=="string");const{renameProvider:o}=n.get(Ze);return P7e(o,e,t,s)});$d("_executePrepareRename",function(n,e,t){return Qp(this,void 0,void 0,function*(){const{renameProvider:i}=n.get(Ze),o=yield new v6(e,t,i).resolveRenameLocation(Ft.None);if(o!=null&&o.rejectReason)throw new Error(o.rejectReason);return o})});en.as(wc.Configuration).registerConfiguration({id:"editor",properties:{"editor.rename.enablePreview":{scope:5,description:m("enablePreview","Enable/disable the ability to preview changes before renaming"),default:!0,type:"boolean"}}});function F7e(n){for(let e=0,t=n.length;e0?t[0]:[]}function Cse(n,e,t,i,s){return hg(this,void 0,void 0,function*(){const o=H7e(n,e),r=yield Promise.all(o.map(a=>hg(this,void 0,void 0,function*(){let l,c=null;try{l=yield a.provideDocumentSemanticTokens(e,a===t?i:null,s)}catch(d){c=d,l=null}return(!l||!GN(l)&&!vse(l))&&(l=null),new V7e(a,l,c)})));for(const a of r){if(a.error)throw a.error;if(a.tokens)return a}return r.length>0?r[0]:null})}function $7e(n,e){const t=n.orderedGroups(e);return t.length>0?t[0]:null}class z7e{constructor(e,t){this.provider=e,this.tokens=t}}function U7e(n,e){return n.has(e)}function wse(n,e){const t=n.orderedGroups(e);return t.length>0?t[0]:[]}function C6(n,e,t,i){return hg(this,void 0,void 0,function*(){const s=wse(n,e),o=yield Promise.all(s.map(r=>hg(this,void 0,void 0,function*(){let a;try{a=yield r.provideDocumentRangeSemanticTokens(e,t,i)}catch(l){Bn(l),a=null}return(!a||!GN(a))&&(a=null),new z7e(r,a)})));for(const r of o)if(r.tokens)return r;return o.length>0?o[0]:null})}qt.registerCommand("_provideDocumentSemanticTokensLegend",(n,...e)=>hg(void 0,void 0,void 0,function*(){const[t]=e;bi(t instanceof ct);const i=n.get(Zi).getModel(t);if(!i)return;const{documentSemanticTokensProvider:s}=n.get(Ze),o=$7e(s,i);return o?o[0].getLegend():n.get(gn).executeCommand("_provideDocumentRangeSemanticTokensLegend",t)}));qt.registerCommand("_provideDocumentSemanticTokens",(n,...e)=>hg(void 0,void 0,void 0,function*(){const[t]=e;bi(t instanceof ct);const i=n.get(Zi).getModel(t);if(!i)return;const{documentSemanticTokensProvider:s}=n.get(Ze);if(!bse(s,i))return n.get(gn).executeCommand("_provideDocumentRangeSemanticTokens",t,i.getFullModelRange());const o=yield Cse(s,i,null,null,Ft.None);if(!o)return;const{provider:r,tokens:a}=o;if(!a||!GN(a))return;const l=_se({id:0,type:"full",data:a.data});return a.resultId&&r.releaseDocumentSemanticTokens(a.resultId),l}));qt.registerCommand("_provideDocumentRangeSemanticTokensLegend",(n,...e)=>hg(void 0,void 0,void 0,function*(){const[t,i]=e;bi(t instanceof ct);const s=n.get(Zi).getModel(t);if(!s)return;const{documentRangeSemanticTokensProvider:o}=n.get(Ze),r=wse(o,s);if(r.length===0)return;if(r.length===1)return r[0].getLegend();if(!i||!I.isIRange(i))return console.warn("provideDocumentRangeSemanticTokensLegend might be out-of-sync with provideDocumentRangeSemanticTokens unless a range argument is passed in"),r[0].getLegend();const a=yield C6(o,s,I.lift(i),Ft.None);if(a)return a.provider.getLegend()}));qt.registerCommand("_provideDocumentRangeSemanticTokens",(n,...e)=>hg(void 0,void 0,void 0,function*(){const[t,i]=e;bi(t instanceof ct),bi(I.isIRange(i));const s=n.get(Zi).getModel(t);if(!s)return;const{documentRangeSemanticTokensProvider:o}=n.get(Ze),r=yield C6(o,s,I.lift(i),Ft.None);if(!(!r||!r.tokens))return _se({id:0,type:"full",data:r.tokens.data})}));const w6="editor.semanticHighlighting";function I5(n,e,t){var i;const s=(i=t.getValue(w6,{overrideIdentifier:n.getLanguageId(),resource:n.uri}))===null||i===void 0?void 0:i.enabled;return typeof s=="boolean"?s:e.getColorTheme().semanticHighlighting}var yse=globalThis&&globalThis.__decorate||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},zc=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},Mh;let T5=class extends te{constructor(e,t,i,s,o,r){super(),this._watchers=Object.create(null);const a=d=>{this._watchers[d.uri.toString()]=new Oy(d,e,i,o,r)},l=(d,u)=>{u.dispose(),delete this._watchers[d.uri.toString()]},c=()=>{for(const d of t.getModels()){const u=this._watchers[d.uri.toString()];I5(d,i,s)?u||a(d):u&&l(d,u)}};this._register(t.onModelAdded(d=>{I5(d,i,s)&&a(d)})),this._register(t.onModelRemoved(d=>{const u=this._watchers[d.uri.toString()];u&&l(d,u)})),this._register(s.onDidChangeConfiguration(d=>{d.affectsConfiguration(w6)&&c()})),this._register(i.onDidColorThemeChange(c))}dispose(){for(const e of Object.values(this._watchers))e.dispose();super.dispose()}};T5=yse([zc(0,Nx),zc(1,Zi),zc(2,os),zc(3,zt),zc(4,Va),zc(5,Ze)],T5);let Oy=Mh=class extends te{constructor(e,t,i,s,o){super(),this._semanticTokensStylingService=t,this._isDisposed=!1,this._model=e,this._provider=o.documentSemanticTokensProvider,this._debounceInformation=s.for(this._provider,"DocumentSemanticTokens",{min:Mh.REQUEST_MIN_DELAY,max:Mh.REQUEST_MAX_DELAY}),this._fetchDocumentSemanticTokens=this._register(new Si(()=>this._fetchDocumentSemanticTokensNow(),Mh.REQUEST_MIN_DELAY)),this._currentDocumentResponse=null,this._currentDocumentRequestCancellationTokenSource=null,this._documentProvidersChangeListeners=[],this._providersChangedDuringRequest=!1,this._register(this._model.onDidChangeContent(()=>{this._fetchDocumentSemanticTokens.isScheduled()||this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model))})),this._register(this._model.onDidChangeAttached(()=>{this._fetchDocumentSemanticTokens.isScheduled()||this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model))})),this._register(this._model.onDidChangeLanguage(()=>{this._currentDocumentResponse&&(this._currentDocumentResponse.dispose(),this._currentDocumentResponse=null),this._currentDocumentRequestCancellationTokenSource&&(this._currentDocumentRequestCancellationTokenSource.cancel(),this._currentDocumentRequestCancellationTokenSource=null),this._setDocumentSemanticTokens(null,null,null,[]),this._fetchDocumentSemanticTokens.schedule(0)}));const r=()=>{fi(this._documentProvidersChangeListeners),this._documentProvidersChangeListeners=[];for(const a of this._provider.all(e))typeof a.onDidChange=="function"&&this._documentProvidersChangeListeners.push(a.onDidChange(()=>{if(this._currentDocumentRequestCancellationTokenSource){this._providersChangedDuringRequest=!0;return}this._fetchDocumentSemanticTokens.schedule(0)}))};r(),this._register(this._provider.onDidChange(()=>{r(),this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model))})),this._register(i.onDidColorThemeChange(a=>{this._setDocumentSemanticTokens(null,null,null,[]),this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model))})),this._fetchDocumentSemanticTokens.schedule(0)}dispose(){this._currentDocumentResponse&&(this._currentDocumentResponse.dispose(),this._currentDocumentResponse=null),this._currentDocumentRequestCancellationTokenSource&&(this._currentDocumentRequestCancellationTokenSource.cancel(),this._currentDocumentRequestCancellationTokenSource=null),fi(this._documentProvidersChangeListeners),this._documentProvidersChangeListeners=[],this._setDocumentSemanticTokens(null,null,null,[]),this._isDisposed=!0,super.dispose()}_fetchDocumentSemanticTokensNow(){if(this._currentDocumentRequestCancellationTokenSource)return;if(!bse(this._provider,this._model)){this._currentDocumentResponse&&this._model.tokenization.setSemanticTokens(null,!1);return}if(!this._model.isAttachedToEditor())return;const e=new Tn,t=this._currentDocumentResponse?this._currentDocumentResponse.provider:null,i=this._currentDocumentResponse&&this._currentDocumentResponse.resultId||null,s=Cse(this._provider,this._model,t,i,e.token);this._currentDocumentRequestCancellationTokenSource=e,this._providersChangedDuringRequest=!1;const o=[],r=this._model.onDidChangeContent(l=>{o.push(l)}),a=new so(!1);s.then(l=>{if(this._debounceInformation.update(this._model,a.elapsed()),this._currentDocumentRequestCancellationTokenSource=null,r.dispose(),!l)this._setDocumentSemanticTokens(null,null,null,o);else{const{provider:c,tokens:d}=l,u=this._semanticTokensStylingService.getStyling(c);this._setDocumentSemanticTokens(c,d||null,u,o)}},l=>{l&&(bc(l)||typeof l.message=="string"&&l.message.indexOf("busy")!==-1)||Dt(l),this._currentDocumentRequestCancellationTokenSource=null,r.dispose(),(o.length>0||this._providersChangedDuringRequest)&&(this._fetchDocumentSemanticTokens.isScheduled()||this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model)))})}static _copy(e,t,i,s,o){o=Math.min(o,i.length-s,e.length-t);for(let r=0;r{(s.length>0||this._providersChangedDuringRequest)&&!this._fetchDocumentSemanticTokens.isScheduled()&&this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model))};if(this._currentDocumentResponse&&(this._currentDocumentResponse.dispose(),this._currentDocumentResponse=null),this._isDisposed){e&&t&&e.releaseDocumentSemanticTokens(t.resultId);return}if(!e||!i){this._model.tokenization.setSemanticTokens(null,!1);return}if(!t){this._model.tokenization.setSemanticTokens(null,!0),r();return}if(vse(t)){if(!o){this._model.tokenization.setSemanticTokens(null,!0);return}if(t.edits.length===0)t={resultId:t.resultId,data:o.data};else{let a=0;for(const h of t.edits)a+=(h.data?h.data.length:0)-h.deleteCount;const l=o.data,c=new Uint32Array(l.length+a);let d=l.length,u=c.length;for(let h=t.edits.length-1;h>=0;h--){const f=t.edits[h];if(f.start>l.length){i.warnInvalidEditStart(o.resultId,t.resultId,h,f.start,l.length),this._model.tokenization.setSemanticTokens(null,!0);return}const g=d-(f.start+f.deleteCount);g>0&&(Mh._copy(l,d-g,c,u-g,g),u-=g),f.data&&(Mh._copy(f.data,0,c,u-f.data.length,f.data.length),u-=f.data.length),d=f.start}d>0&&Mh._copy(l,0,c,0,d),t={resultId:t.resultId,data:c}}}if(GN(t)){this._currentDocumentResponse=new j7e(e,t.resultId,t.data);const a=iee(t,i,this._model.getLanguageId());if(s.length>0)for(const l of s)for(const c of a)for(const d of l.changes)c.applyEdit(d.range,d.text);this._model.tokenization.setSemanticTokens(a,!0)}else this._model.tokenization.setSemanticTokens(null,!0);r()}};Oy.REQUEST_MIN_DELAY=300;Oy.REQUEST_MAX_DELAY=2e3;Oy=Mh=yse([zc(1,Nx),zc(2,os),zc(3,Va),zc(4,Ze)],Oy);class j7e{constructor(e,t,i){this.provider=e,this.resultId=t,this.data=i}dispose(){this.provider.releaseDocumentSemanticTokens(this.resultId)}}Qx(T5);var K7e=globalThis&&globalThis.__decorate||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},T1=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let Fy=class extends te{constructor(e,t,i,s,o,r){super(),this._semanticTokensStylingService=t,this._themeService=i,this._configurationService=s,this._editor=e,this._provider=r.documentRangeSemanticTokensProvider,this._debounceInformation=o.for(this._provider,"DocumentRangeSemanticTokens",{min:100,max:500}),this._tokenizeViewport=this._register(new Si(()=>this._tokenizeViewportNow(),100)),this._outstandingRequests=[];const a=()=>{this._editor.hasModel()&&this._tokenizeViewport.schedule(this._debounceInformation.get(this._editor.getModel()))};this._register(this._editor.onDidScrollChange(()=>{a()})),this._register(this._editor.onDidChangeModel(()=>{this._cancelAll(),a()})),this._register(this._editor.onDidChangeModelContent(l=>{this._cancelAll(),a()})),this._register(this._provider.onDidChange(()=>{this._cancelAll(),a()})),this._register(this._configurationService.onDidChangeConfiguration(l=>{l.affectsConfiguration(w6)&&(this._cancelAll(),a())})),this._register(this._themeService.onDidColorThemeChange(()=>{this._cancelAll(),a()})),a()}_cancelAll(){for(const e of this._outstandingRequests)e.cancel();this._outstandingRequests=[]}_removeOutstandingRequest(e){for(let t=0,i=this._outstandingRequests.length;tthis._requestRange(e,i)))}_requestRange(e,t){const i=e.getVersionId(),s=Xn(r=>Promise.resolve(C6(this._provider,e,t,r))),o=new so(!1);return s.then(r=>{if(this._debounceInformation.update(e,o.elapsed()),!r||!r.tokens||e.isDisposed()||e.getVersionId()!==i)return;const{provider:a,tokens:l}=r,c=this._semanticTokensStylingService.getStyling(a);e.tokenization.setPartialSemanticTokens(t,iee(l,c,e.getLanguageId()))}).then(()=>this._removeOutstandingRequest(s),()=>this._removeOutstandingRequest(s)),s}};Fy.ID="editor.contrib.viewportSemanticTokens";Fy=K7e([T1(1,Nx),T1(2,os),T1(3,zt),T1(4,Va),T1(5,Ze)],Fy);ti(Fy.ID,Fy,1);class q7e{constructor(e=!0){this.selectSubwords=e}provideSelectionRanges(e,t){const i=[];for(const s of t){const o=[];i.push(o),this.selectSubwords&&this._addInWordRanges(o,e,s),this._addWordRanges(o,e,s),this._addWhitespaceLine(o,e,s),o.push({range:e.getFullModelRange()})}return i}_addInWordRanges(e,t,i){const s=t.getWordAtPosition(i);if(!s)return;const{word:o,startColumn:r}=s,a=i.column-r;let l=a,c=a,d=0;for(;l>=0;l--){const u=o.charCodeAt(l);if(l!==a&&(u===95||u===45))break;if(Xh(u)&&Vc(d))break;d=u}for(l+=1;c0&&t.getLineFirstNonWhitespaceColumn(i.lineNumber)===0&&t.getLineLastNonWhitespaceColumn(i.lineNumber)===0&&e.push({range:new I(i.lineNumber,1,i.lineNumber,t.getLineMaxColumn(i.lineNumber))})}}var G7e=globalThis&&globalThis.__decorate||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},Y7e=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},YN=globalThis&&globalThis.__awaiter||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())})},x5;class y6{constructor(e,t){this.index=e,this.ranges=t}mov(e){const t=this.index+(e?1:-1);if(t<0||t>=this.ranges.length)return this;const i=new y6(t,this.ranges);return i.ranges[t].equalsRange(this.ranges[this.index])?i.mov(e):i}}let s0=x5=class{static get(e){return e.getContribution(x5.ID)}constructor(e,t){this._editor=e,this._languageFeaturesService=t,this._ignoreSelection=!1}dispose(){var e;(e=this._selectionListener)===null||e===void 0||e.dispose()}run(e){return YN(this,void 0,void 0,function*(){if(!this._editor.hasModel())return;const t=this._editor.getSelections(),i=this._editor.getModel();if(this._state||(yield Lse(this._languageFeaturesService.selectionRangeProvider,i,t.map(o=>o.getPosition()),this._editor.getOption(112),Ft.None).then(o=>{var r;if(!(!io(o)||o.length!==t.length)&&!(!this._editor.hasModel()||!yn(this._editor.getSelections(),t,(a,l)=>a.equalsSelection(l)))){for(let a=0;al.containsPosition(t[a].getStartPosition())&&l.containsPosition(t[a].getEndPosition())),o[a].unshift(t[a]);this._state=o.map(a=>new y6(0,a)),(r=this._selectionListener)===null||r===void 0||r.dispose(),this._selectionListener=this._editor.onDidChangeCursorPosition(()=>{var a;this._ignoreSelection||((a=this._selectionListener)===null||a===void 0||a.dispose(),this._state=void 0)})}})),!this._state)return;this._state=this._state.map(o=>o.mov(e));const s=this._state.map(o=>Je.fromPositions(o.ranges[o.index].getStartPosition(),o.ranges[o.index].getEndPosition()));this._ignoreSelection=!0;try{this._editor.setSelections(s)}finally{this._ignoreSelection=!1}})}};s0.ID="editor.contrib.smartSelectController";s0=x5=G7e([Y7e(1,Ze)],s0);class Sse extends Ue{constructor(e,t){super(t),this._forward=e}run(e,t){return YN(this,void 0,void 0,function*(){const i=s0.get(t);i&&(yield i.run(this._forward))})}}class Z7e extends Sse{constructor(){super(!0,{id:"editor.action.smartSelect.expand",label:m("smartSelect.expand","Expand Selection"),alias:"Expand Selection",precondition:void 0,kbOpts:{kbExpr:O.editorTextFocus,primary:1553,mac:{primary:3345,secondary:[1297]},weight:100},menuOpts:{menuId:M.MenubarSelectionMenu,group:"1_basic",title:m({key:"miSmartSelectGrow",comment:["&& denotes a mnemonic"]},"&&Expand Selection"),order:2}})}}qt.registerCommandAlias("editor.action.smartSelect.grow","editor.action.smartSelect.expand");class X7e extends Sse{constructor(){super(!1,{id:"editor.action.smartSelect.shrink",label:m("smartSelect.shrink","Shrink Selection"),alias:"Shrink Selection",precondition:void 0,kbOpts:{kbExpr:O.editorTextFocus,primary:1551,mac:{primary:3343,secondary:[1295]},weight:100},menuOpts:{menuId:M.MenubarSelectionMenu,group:"1_basic",title:m({key:"miSmartSelectShrink",comment:["&& denotes a mnemonic"]},"&&Shrink Selection"),order:3}})}}ti(s0.ID,s0,4);De(Z7e);De(X7e);function Lse(n,e,t,i,s){return YN(this,void 0,void 0,function*(){const o=n.all(e).concat(new q7e(i.selectSubwords));o.length===1&&o.unshift(new Pr);const r=[],a=[];for(const l of o)r.push(Promise.resolve(l.provideSelectionRanges(e,t,s)).then(c=>{if(io(c)&&c.length===t.length)for(let d=0;d{if(l.length===0)return[];l.sort((h,f)=>Y.isBefore(h.getStartPosition(),f.getStartPosition())?1:Y.isBefore(f.getStartPosition(),h.getStartPosition())||Y.isBefore(h.getEndPosition(),f.getEndPosition())?-1:Y.isBefore(f.getEndPosition(),h.getEndPosition())?1:0);const c=[];let d;for(const h of l)(!d||I.containsRange(h,d)&&!I.equalsRange(h,d))&&(c.push(h),d=h);if(!i.selectLeadingAndTrailingWhitespace)return c;const u=[c[0]];for(let h=1;hn}),WR="data-sticky-line-index",wK="data-sticky-is-line",e6e="data-sticky-is-line-number",yK="data-sticky-is-folding-icon";class t6e extends te{constructor(e){super(),this._editor=e,this._foldingIconStore=new be,this._rootDomNode=document.createElement("div"),this._lineNumbersDomNode=document.createElement("div"),this._linesDomNodeScrollable=document.createElement("div"),this._linesDomNode=document.createElement("div"),this._lineHeight=this._editor.getOption(66),this._stickyLines=[],this._lineNumbers=[],this._lastLineRelativePosition=0,this._minContentWidthInPx=0,this._isOnGlyphMargin=!1,this._lineNumbersDomNode.className="sticky-widget-line-numbers",this._lineNumbersDomNode.setAttribute("role","none"),this._linesDomNode.className="sticky-widget-lines",this._linesDomNode.setAttribute("role","list"),this._linesDomNodeScrollable.className="sticky-widget-lines-scrollable",this._linesDomNodeScrollable.appendChild(this._linesDomNode),this._rootDomNode.className="sticky-widget",this._rootDomNode.classList.toggle("peek",e instanceof sg),this._rootDomNode.appendChild(this._lineNumbersDomNode),this._rootDomNode.appendChild(this._linesDomNodeScrollable);const t=()=>{this._linesDomNode.style.left=this._editor.getOption(114).scrollWithEditor?"-".concat(this._editor.getScrollLeft(),"px"):"0px"};this._register(this._editor.onDidChangeConfiguration(i=>{i.hasChanged(114)&&t(),i.hasChanged(66)&&(this._lineHeight=this._editor.getOption(66))})),this._register(this._editor.onDidScrollChange(i=>{i.scrollLeftChanged&&t(),i.scrollWidthChanged&&this._updateWidgetWidth()})),this._register(this._editor.onDidChangeModel(()=>{t(),this._updateWidgetWidth()})),this._register(this._foldingIconStore),t(),this._register(this._editor.onDidLayoutChange(i=>{this._updateWidgetWidth()})),this._updateWidgetWidth()}get lineNumbers(){return this._lineNumbers}get lineNumberCount(){return this._lineNumbers.length}getStickyLineForLine(e){return this._stickyLines.find(t=>t.lineNumber===e)}getCurrentLines(){return this._lineNumbers}setState(e,t,i=1/0){if((!this._previousState&&!e||this._previousState&&this._previousState.equals(e))&&i===1/0)return;this._previousState=e;const s=this._stickyLines;if(this._clearStickyWidget(),!e||!this._editor._getViewModel())return;if(e.startLineNumbers.length*this._lineHeight+e.lastLineRelativePosition>0){this._lastLineRelativePosition=e.lastLineRelativePosition;const r=[...e.startLineNumbers];e.showEndForLine!==null&&(r[e.showEndForLine]=e.endLineNumbers[e.showEndForLine]),this._lineNumbers=r}else this._lastLineRelativePosition=0,this._lineNumbers=[];this._renderRootNode(s,t,i)}_updateWidgetWidth(){const e=this._editor.getLayoutInfo(),t=e.contentLeft;this._lineNumbersDomNode.style.width="".concat(t,"px"),this._linesDomNodeScrollable.style.setProperty("--vscode-editorStickyScroll-scrollableWidth","".concat(this._editor.getScrollWidth()-e.verticalScrollbarWidth,"px")),this._rootDomNode.style.width="".concat(e.width-e.verticalScrollbarWidth,"px")}_clearStickyWidget(){this._stickyLines=[],this._foldingIconStore.clear(),Ds(this._lineNumbersDomNode),Ds(this._linesDomNode),this._rootDomNode.style.display="none"}_useFoldingOpacityTransition(e){this._lineNumbersDomNode.style.setProperty("--vscode-editorStickyScroll-foldingOpacityTransition","opacity ".concat(e?.5:0,"s"))}_setFoldingIconsVisibility(e){for(const t of this._stickyLines){const i=t.foldingIcon;i&&i.setVisible(e?!0:i.isCollapsed)}}_renderRootNode(e,t,i=1/0){return J7e(this,void 0,void 0,function*(){const s=this._editor.getLayoutInfo();for(const[r,a]of this._lineNumbers.entries()){const l=e[r],c=a>=i||(l==null?void 0:l.lineNumber)!==a?this._renderChildNode(r,a,t,s):this._updateTopAndZIndexOfStickyLine(l);c&&(this._linesDomNode.appendChild(c.lineDomNode),this._lineNumbersDomNode.appendChild(c.lineNumberDomNode),this._stickyLines.push(c))}t&&(this._setFoldingHoverListeners(),this._useFoldingOpacityTransition(!this._isOnGlyphMargin));const o=this._lineNumbers.length*this._lineHeight+this._lastLineRelativePosition;if(o===0){this._clearStickyWidget();return}this._rootDomNode.style.display="block",this._lineNumbersDomNode.style.height="".concat(o,"px"),this._linesDomNodeScrollable.style.height="".concat(o,"px"),this._rootDomNode.style.height="".concat(o,"px"),this._rootDomNode.style.marginLeft="0px",this._updateMinContentWidth(),this._editor.layoutOverlayWidget(this)})}_setFoldingHoverListeners(){this._editor.getOption(109)==="mouseover"&&(this._foldingIconStore.add(ce(this._lineNumbersDomNode,Pe.MOUSE_ENTER,t=>{this._isOnGlyphMargin=!0,this._setFoldingIconsVisibility(!0)})),this._foldingIconStore.add(ce(this._lineNumbersDomNode,Pe.MOUSE_LEAVE,()=>{this._isOnGlyphMargin=!1,this._useFoldingOpacityTransition(!0),this._setFoldingIconsVisibility(!1)})))}_renderChildNode(e,t,i,s){const o=this._editor._getViewModel();if(!o)return;const r=o.coordinatesConverter.convertModelPositionToViewPosition(new Y(t,1)).lineNumber,a=o.getViewLineRenderingData(r),l=this._editor.getOption(67);let c;try{c=br.filter(a.inlineDecorations,r,a.minColumn,a.maxColumn)}catch{c=[]}const d=new Eg(!0,!0,a.content,a.continuesWithWrappedLine,a.isBasicASCII,a.containsRTL,0,a.tokens,c,a.tabSize,a.startVisibleColumn,1,1,1,500,"none",!0,!0,null),u=new D0(2e3),h=gS(d,u);let f;CK?f=CK.createHTML(u.build()):f=u.build();const g=document.createElement("span");g.setAttribute(WR,String(e)),g.setAttribute(wK,""),g.setAttribute("role","listitem"),g.tabIndex=0,g.className="sticky-line-content",g.classList.add("stickyLine".concat(t)),g.style.lineHeight="".concat(this._lineHeight,"px"),g.innerHTML=f;const p=document.createElement("span");p.setAttribute(WR,String(e)),p.setAttribute(e6e,""),p.className="sticky-line-number",p.style.lineHeight="".concat(this._lineHeight,"px");const _=s.contentLeft;p.style.width="".concat(_,"px");const v=document.createElement("span");l.renderType===1||l.renderType===3&&t%10===0?v.innerText=t.toString():l.renderType===2&&(v.innerText=Math.abs(t-this._editor.getPosition().lineNumber).toString()),v.className="sticky-line-number-inner",v.style.lineHeight="".concat(this._lineHeight,"px"),v.style.width="".concat(s.lineNumbersWidth,"px"),v.style.paddingLeft="".concat(s.lineNumbersLeft,"px"),p.appendChild(v);const b=this._renderFoldingIconForLine(i,t);b&&p.appendChild(b.domNode),this._editor.applyFontInfo(g),this._editor.applyFontInfo(v),p.style.lineHeight="".concat(this._lineHeight,"px"),g.style.lineHeight="".concat(this._lineHeight,"px"),p.style.height="".concat(this._lineHeight,"px"),g.style.height="".concat(this._lineHeight,"px");const C=new i6e(e,t,g,p,b,h.characterMapping);return this._updateTopAndZIndexOfStickyLine(C)}_updateTopAndZIndexOfStickyLine(e){var t;const i=e.index,s=e.lineDomNode,o=e.lineNumberDomNode,r=i===this._lineNumbers.length-1,a="0",l="1";s.style.zIndex=r?a:l,o.style.zIndex=r?a:l;const c="".concat(i*this._lineHeight+this._lastLineRelativePosition+(!((t=e.foldingIcon)===null||t===void 0)&&t.isCollapsed?1:0),"px"),d="".concat(i*this._lineHeight,"px");return s.style.top=r?c:d,o.style.top=r?c:d,e}_renderFoldingIconForLine(e,t){const i=this._editor.getOption(109);if(!e||i==="never")return;const s=e.regions,o=s.findRange(t),r=s.getStartLineNumber(o);if(!(t===r))return;const l=s.isCollapsed(o),c=new n6e(l,r,s.getEndLineNumber(o),this._lineHeight);return c.setVisible(this._isOnGlyphMargin?!0:l||i==="always"),c.domNode.setAttribute(yK,""),c}_updateMinContentWidth(){this._minContentWidthInPx=0;for(const e of this._stickyLines)e.lineDomNode.scrollWidth>this._minContentWidthInPx&&(this._minContentWidthInPx=e.lineDomNode.scrollWidth);this._minContentWidthInPx+=this._editor.getLayoutInfo().verticalScrollbarWidth}getId(){return"editor.contrib.stickyScrollWidget"}getDomNode(){return this._rootDomNode}getPosition(){return{preference:null}}getMinContentWidthInPx(){return this._minContentWidthInPx}focusLineWithIndex(e){0<=e&&e0)return null;const t=this._getRenderedStickyLineFromChildDomNode(e);if(!t)return null;const i=r9(t.characterMapping,e,0);return new Y(t.lineNumber,i)}getLineNumberFromChildDomNode(e){var t,i;return(i=(t=this._getRenderedStickyLineFromChildDomNode(e))===null||t===void 0?void 0:t.lineNumber)!==null&&i!==void 0?i:null}_getRenderedStickyLineFromChildDomNode(e){const t=this.getLineIndexFromChildDomNode(e);return t===null||t<0||t>=this._stickyLines.length?null:this._stickyLines[t]}getLineIndexFromChildDomNode(e){const t=this._getAttributeValue(e,WR);return t?parseInt(t,10):null}isInStickyLine(e){return this._getAttributeValue(e,wK)!==void 0}isInFoldingIconDomNode(e){return this._getAttributeValue(e,yK)!==void 0}_getAttributeValue(e,t){for(;e&&e!==this._rootDomNode;){const i=e.getAttribute(t);if(i!==null)return i;e=e.parentElement}}}class i6e{constructor(e,t,i,s,o,r){this.index=e,this.lineNumber=t,this.lineDomNode=i,this.lineNumberDomNode=s,this.foldingIcon=o,this.characterMapping=r}}class n6e{constructor(e,t,i,s){this.isCollapsed=e,this.foldingStartLine=t,this.foldingEndLine=i,this.dimension=s,this.domNode=document.createElement("div"),this.domNode.style.width="".concat(s,"px"),this.domNode.style.height="".concat(s,"px"),this.domNode.className=dt.asClassName(e?TN:IN)}setVisible(e){this.domNode.style.cursor=e?"pointer":"default",this.domNode.style.opacity=e?"1":"0"}}class jC{constructor(e,t){this.startLineNumber=e,this.endLineNumber=t}}class sT{constructor(e,t,i){this.range=e,this.children=t,this.parent=i}}class kse{constructor(e,t,i,s){this.uri=e,this.version=t,this.element=i,this.outlineProviderId=s}}var ZN=globalThis&&globalThis.__decorate||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=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},SK=globalThis&&globalThis.__awaiter||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())})},KC;(function(n){n.OUTLINE_MODEL="outlineModel",n.FOLDING_PROVIDER_MODEL="foldingProviderModel",n.INDENTATION_MODEL="indentationModel"})(KC||(KC={}));var uf;(function(n){n[n.VALID=0]="VALID",n[n.INVALID=1]="INVALID",n[n.CANCELED=2]="CANCELED"})(uf||(uf={}));let N5=class extends te{constructor(e,t,i,s){super(),this._editor=e,this._languageConfigurationService=t,this._languageFeaturesService=i,this._modelProviders=[],this._modelPromise=null,this._updateScheduler=this._register(new pl(300)),this._updateOperation=this._register(new be);const o=new A5(i),r=new R5(this._editor,i),a=new M5(this._editor,t);switch(s){case KC.OUTLINE_MODEL:this._modelProviders.push(o),this._modelProviders.push(r),this._modelProviders.push(a);break;case KC.FOLDING_PROVIDER_MODEL:this._modelProviders.push(r),this._modelProviders.push(a);break;case KC.INDENTATION_MODEL:this._modelProviders.push(a);break}}_cancelModelPromise(){this._modelPromise&&(this._modelPromise.cancel(),this._modelPromise=null)}update(e,t,i){return SK(this,void 0,void 0,function*(){return this._updateOperation.clear(),this._updateOperation.add({dispose:()=>{this._cancelModelPromise(),this._updateScheduler.cancel()}}),this._cancelModelPromise(),yield this._updateScheduler.trigger(()=>SK(this,void 0,void 0,function*(){for(const s of this._modelProviders){const{statusPromise:o,modelPromise:r}=s.computeStickyModel(e,t,i);this._modelPromise=r;const a=yield o;if(this._modelPromise!==r)return null;switch(a){case uf.CANCELED:return this._updateOperation.clear(),null;case uf.VALID:return s.stickyModel}}return null})).catch(s=>(Dt(s),null))})}};N5=ZN([By(1,Ni),By(2,Ze)],N5);class Dse{constructor(){this._stickyModel=null}get stickyModel(){return this._stickyModel}_invalid(){return this._stickyModel=null,uf.INVALID}computeStickyModel(e,t,i){if(i.isCancellationRequested||!this.isProviderValid(e))return{statusPromise:this._invalid(),modelPromise:null};const s=Xn(o=>this.createModelFromProvider(e,t,o));return{statusPromise:s.then(o=>this.isModelValid(o)?i.isCancellationRequested?uf.CANCELED:(this._stickyModel=this.createStickyModel(e,t,i,o),uf.VALID):this._invalid()).then(void 0,o=>(Dt(o),uf.CANCELED)),modelPromise:s}}isModelValid(e){return!0}isProviderValid(e){return!0}}let A5=class extends Dse{constructor(e){super(),this._languageFeaturesService=e}createModelFromProvider(e,t,i){return gu.create(this._languageFeaturesService.documentSymbolProvider,e,i)}createStickyModel(e,t,i,s){var o;const{stickyOutlineElement:r,providerID:a}=this._stickyModelFromOutlineModel(s,(o=this._stickyModel)===null||o===void 0?void 0:o.outlineProviderId);return new kse(e.uri,t,r,a)}isModelValid(e){return e&&e.children.size>0}_stickyModelFromOutlineModel(e,t){let i;if(Pt.first(e.children.values())instanceof Yne){const a=Pt.find(e.children.values(),l=>l.id===t);if(a)i=a.children;else{let l="",c=-1,d;for(const[u,h]of e.children.entries()){const f=this._findSumOfRangesOfGroup(h);f>c&&(d=h,c=f,l=h.id)}t=l,i=d.children}}else i=e.children;const s=[],o=Array.from(i.values()).sort((a,l)=>{const c=new jC(a.symbol.range.startLineNumber,a.symbol.range.endLineNumber),d=new jC(l.symbol.range.startLineNumber,l.symbol.range.endLineNumber);return this._comparator(c,d)});for(const a of o)s.push(this._stickyModelFromOutlineElement(a,a.symbol.selectionRange.startLineNumber));return{stickyOutlineElement:new sT(void 0,s,void 0),providerID:t}}_stickyModelFromOutlineElement(e,t){const i=[];for(const o of e.children.values())if(o.symbol.selectionRange.startLineNumber!==o.symbol.range.endLineNumber)if(o.symbol.selectionRange.startLineNumber!==t)i.push(this._stickyModelFromOutlineElement(o,o.symbol.selectionRange.startLineNumber));else for(const r of o.children.values())i.push(this._stickyModelFromOutlineElement(r,o.symbol.selectionRange.startLineNumber));i.sort((o,r)=>this._comparator(o.range,r.range));const s=new jC(e.symbol.selectionRange.startLineNumber,e.symbol.range.endLineNumber);return new sT(s,i,void 0)}_comparator(e,t){return e.startLineNumber!==t.startLineNumber?e.startLineNumber-t.startLineNumber:t.endLineNumber-e.endLineNumber}_findSumOfRangesOfGroup(e){let t=0;for(const i of e.children.values())t+=this._findSumOfRangesOfGroup(i);return e instanceof JF?t+e.symbol.range.endLineNumber-e.symbol.selectionRange.startLineNumber:t}};A5=ZN([By(0,Ze)],A5);class Ese extends Dse{constructor(e){super(),this._foldingLimitReporter=new Kne(e)}createStickyModel(e,t,i,s){const o=this._fromFoldingRegions(s);return new kse(e.uri,t,o,void 0)}isModelValid(e){return e!==null}_fromFoldingRegions(e){const t=e.length,i=[],s=new sT(void 0,[],void 0);for(let o=0;o0}createModelFromProvider(e,t,i){const s=Md.getFoldingRangeProviders(this._languageFeaturesService,e);return new r6(e,s,()=>this.createModelFromProvider(e,t,i),this._foldingLimitReporter,void 0).compute(i)}};R5=ZN([By(1,Ze)],R5);var s6e=globalThis&&globalThis.__decorate||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},LK=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},kK=globalThis&&globalThis.__awaiter||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 o6e{constructor(e,t,i){this.startLineNumber=e,this.endLineNumber=t,this.nestingDepth=i}}let P5=class extends te{constructor(e,t,i){super(),this._languageFeaturesService=t,this._languageConfigurationService=i,this._onDidChangeStickyScroll=this._register(new j),this.onDidChangeStickyScroll=this._onDidChangeStickyScroll.event,this._options=null,this._model=null,this._cts=null,this._stickyModelProvider=null,this._editor=e,this._sessionStore=this._register(new be),this._updateSoon=this._register(new Si(()=>this.update(),50)),this._register(this._editor.onDidChangeConfiguration(s=>{s.hasChanged(114)&&this.readConfiguration()})),this.readConfiguration()}readConfiguration(){this._stickyModelProvider=null,this._sessionStore.clear(),this._options=this._editor.getOption(114),this._options.enabled&&(this._stickyModelProvider=this._sessionStore.add(new N5(this._editor,this._languageConfigurationService,this._languageFeaturesService,this._options.defaultModel)),this._sessionStore.add(this._editor.onDidChangeModel(()=>{this._model=null,this._onDidChangeStickyScroll.fire(),this.update()})),this._sessionStore.add(this._editor.onDidChangeHiddenAreas(()=>this.update())),this._sessionStore.add(this._editor.onDidChangeModelContent(()=>this._updateSoon.schedule())),this._sessionStore.add(this._languageFeaturesService.documentSymbolProvider.onDidChange(()=>this.update())),this.update())}getVersionId(){var e;return(e=this._model)===null||e===void 0?void 0:e.version}update(){var e;return kK(this,void 0,void 0,function*(){(e=this._cts)===null||e===void 0||e.dispose(!0),this._cts=new Tn,yield this.updateStickyModel(this._cts.token),this._onDidChangeStickyScroll.fire()})}updateStickyModel(e){return kK(this,void 0,void 0,function*(){if(!this._editor.hasModel()||!this._stickyModelProvider||this._editor.getModel().isTooLargeForTokenization()){this._model=null;return}const t=this._editor.getModel(),i=t.getVersionId(),s=yield this._stickyModelProvider.update(t,i,e);e.isCancellationRequested||(this._model=s)})}updateIndex(e){return e===-1?e=0:e<0&&(e=-e-2),e}getCandidateStickyLinesIntersectingFromStickyModel(e,t,i,s,o){if(t.children.length===0)return;let r=o;const a=[];for(let d=0;dd-u)),c=this.updateIndex(cw(a,e.startLineNumber+s,(d,u)=>d-u));for(let d=l;d<=c;d++){const u=t.children[d];if(!u)return;if(u.range){const h=u.range.startLineNumber,f=u.range.endLineNumber;e.startLineNumber<=f+1&&h-1<=e.endLineNumber&&h!==r&&(r=h,i.push(new o6e(h,f-1,s+1)),this.getCandidateStickyLinesIntersectingFromStickyModel(e,u,i,s+1,h))}else this.getCandidateStickyLinesIntersectingFromStickyModel(e,u,i,s,o)}}getCandidateStickyLinesIntersecting(e){var t,i;if(!(!((t=this._model)===null||t===void 0)&&t.element))return[];let s=[];this.getCandidateStickyLinesIntersectingFromStickyModel(e,this._model.element,s,0,-1);const o=(i=this._editor._getViewModel())===null||i===void 0?void 0:i.getHiddenAreas();if(o)for(const r of o)s=s.filter(a=>!(a.startLineNumber>=r.startLineNumber&&a.endLineNumber<=r.endLineNumber+1));return s}};P5=s6e([LK(1,Ze),LK(2,Ni)],P5);var r6e=globalThis&&globalThis.__decorate||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},B_=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},VR=globalThis&&globalThis.__awaiter||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())})},O5;let Rd=O5=class extends te{constructor(e,t,i,s,o,r,a){super(),this._editor=e,this._contextMenuService=t,this._languageFeaturesService=i,this._instaService=s,this._contextKeyService=a,this._sessionStore=new be,this._foldingModel=null,this._maxStickyLines=Number.MAX_SAFE_INTEGER,this._candidateDefinitionsLength=-1,this._focusedStickyElementIndex=-1,this._enabled=!1,this._focused=!1,this._positionRevealed=!1,this._onMouseDown=!1,this._endLineNumbers=[],this._showEndForLine=null,this._stickyScrollWidget=new t6e(this._editor),this._stickyLineCandidateProvider=new P5(this._editor,i,o),this._register(this._stickyScrollWidget),this._register(this._stickyLineCandidateProvider),this._widgetState=new bK([],[],0),this._readConfiguration();const l=this._stickyScrollWidget.getDomNode();this._register(this._editor.onDidChangeConfiguration(d=>{(d.hasChanged(114)||d.hasChanged(72)||d.hasChanged(66)||d.hasChanged(109))&&this._readConfiguration()})),this._register(ce(l,Pe.CONTEXT_MENU,d=>VR(this,void 0,void 0,function*(){this._onContextMenu(d)}))),this._stickyScrollFocusedContextKey=O.stickyScrollFocused.bindTo(this._contextKeyService),this._stickyScrollVisibleContextKey=O.stickyScrollVisible.bindTo(this._contextKeyService);const c=this._register(Ld(l));this._register(c.onDidBlur(d=>{this._positionRevealed===!1&&l.clientHeight===0?(this._focusedStickyElementIndex=-1,this.focus()):this._disposeFocusStickyScrollStore()})),this._register(c.onDidFocus(d=>{this.focus()})),this._registerMouseListeners(),this._register(ce(l,Pe.MOUSE_DOWN,d=>{this._onMouseDown=!0}))}static get(e){return e.getContribution(O5.ID)}_disposeFocusStickyScrollStore(){var e;this._stickyScrollFocusedContextKey.set(!1),(e=this._focusDisposableStore)===null||e===void 0||e.dispose(),this._focused=!1,this._positionRevealed=!1,this._onMouseDown=!1}focus(){if(this._onMouseDown){this._onMouseDown=!1,this._editor.focus();return}this._stickyScrollFocusedContextKey.get()!==!0&&(this._focused=!0,this._focusDisposableStore=new be,this._stickyScrollFocusedContextKey.set(!0),this._focusedStickyElementIndex=this._stickyScrollWidget.lineNumbers.length-1,this._stickyScrollWidget.focusLineWithIndex(this._focusedStickyElementIndex))}focusNext(){this._focusedStickyElementIndex0&&this._focusNav(!1)}selectEditor(){this._editor.focus()}_focusNav(e){this._focusedStickyElementIndex=e?this._focusedStickyElementIndex+1:this._focusedStickyElementIndex-1,this._stickyScrollWidget.focusLineWithIndex(this._focusedStickyElementIndex)}goToFocused(){const e=this._stickyScrollWidget.lineNumbers;this._disposeFocusStickyScrollStore(),this._revealPosition({lineNumber:e[this._focusedStickyElementIndex],column:1})}_revealPosition(e){this._reveaInEditor(e,()=>this._editor.revealPosition(e))}_revealLineInCenterIfOutsideViewport(e){this._reveaInEditor(e,()=>this._editor.revealLineInCenterIfOutsideViewport(e.lineNumber,0))}_reveaInEditor(e,t){this._focused&&this._disposeFocusStickyScrollStore(),this._positionRevealed=!0,t(),this._editor.setSelection(I.fromPositions(e)),this._editor.focus()}_registerMouseListeners(){const e=this._register(new be),t=this._register(new fN(this._editor,{extractLineNumberFromMouseEvent:o=>{const r=this._stickyScrollWidget.getEditorPositionFromNode(o.target.element);return r?r.lineNumber:0}})),i=o=>{if(!this._editor.hasModel()||o.target.type!==12||o.target.detail!==this._stickyScrollWidget.getId())return null;const r=o.target.element;if(!r||r.innerText!==r.innerHTML)return null;const a=this._stickyScrollWidget.getEditorPositionFromNode(r);return a?{range:new I(a.lineNumber,a.column,a.lineNumber,a.column+r.innerText.length),textElement:r}:null},s=this._stickyScrollWidget.getDomNode();this._register(In(s,Pe.CLICK,o=>{if(o.ctrlKey||o.altKey||o.metaKey||!o.leftButton)return;if(o.shiftKey){const c=this._stickyScrollWidget.getLineIndexFromChildDomNode(o.target);if(c===null)return;const d=new Y(this._endLineNumbers[c],1);this._revealLineInCenterIfOutsideViewport(d);return}if(this._stickyScrollWidget.isInFoldingIconDomNode(o.target)){const c=this._stickyScrollWidget.getLineNumberFromChildDomNode(o.target);this._toggleFoldingRegionForLine(c);return}if(!this._stickyScrollWidget.isInStickyLine(o.target))return;let l=this._stickyScrollWidget.getEditorPositionFromNode(o.target);if(!l){const c=this._stickyScrollWidget.getLineNumberFromChildDomNode(o.target);if(c===null)return;l=new Y(c,1)}this._revealPosition(l)})),this._register(In(s,Pe.MOUSE_MOVE,o=>{if(o.shiftKey){const r=this._stickyScrollWidget.getLineIndexFromChildDomNode(o.target);if(r===null||this._showEndForLine!==null&&this._showEndForLine===r)return;this._showEndForLine=r,this._renderStickyScroll();return}this._showEndForLine!==null&&(this._showEndForLine=null,this._renderStickyScroll())})),this._register(ce(s,Pe.MOUSE_LEAVE,o=>{this._showEndForLine!==null&&(this._showEndForLine=null,this._renderStickyScroll())})),this._register(t.onMouseMoveOrRelevantKeyDown(([o,r])=>{const a=i(o);if(!a||!o.hasTriggerModifier||!this._editor.hasModel()){e.clear();return}const{range:l,textElement:c}=a;if(!l.equalsRange(this._stickyRangeProjectedOnEditor))this._stickyRangeProjectedOnEditor=l,e.clear();else if(c.style.textDecoration==="underline")return;const d=new Tn;e.add(vt(()=>d.dispose(!0)));let u;bN(this._languageFeaturesService.definitionProvider,this._editor.getModel(),new Y(l.startLineNumber,l.startColumn+1),d.token).then(h=>{if(!d.token.isCancellationRequested)if(h.length!==0){this._candidateDefinitionsLength=h.length;const f=c;u!==f?(e.clear(),u=f,u.style.textDecoration="underline",e.add(vt(()=>{u.style.textDecoration="none"}))):u||(u=f,u.style.textDecoration="underline",e.add(vt(()=>{u.style.textDecoration="none"})))}else e.clear()})})),this._register(t.onCancel(()=>{e.clear()})),this._register(t.onExecute(o=>VR(this,void 0,void 0,function*(){if(o.target.type!==12||o.target.detail!==this._stickyScrollWidget.getId())return;const r=this._stickyScrollWidget.getEditorPositionFromNode(o.target.element);r&&(this._candidateDefinitionsLength>1&&(this._focused&&this._disposeFocusStickyScrollStore(),this._revealPosition({lineNumber:r.lineNumber,column:1})),this._instaService.invokeFunction(ise,o,this._editor,{uri:this._editor.getModel().uri,range:this._stickyRangeProjectedOnEditor}))})))}_onContextMenu(e){const t=new ba(e);this._contextMenuService.showContextMenu({menuId:M.StickyScrollContext,getAnchor:()=>t})}_toggleFoldingRegionForLine(e){if(!this._foldingModel||e===null)return;const t=this._stickyScrollWidget.getStickyLineForLine(e),i=t==null?void 0:t.foldingIcon;if(!i)return;Hne(this._foldingModel,Number.MAX_VALUE,[e]),i.isCollapsed=!i.isCollapsed;const s=(i.isCollapsed?this._editor.getTopForLineNumber(i.foldingEndLine):this._editor.getTopForLineNumber(i.foldingStartLine))-this._editor.getOption(66)*t.index+1;this._editor.setScrollTop(s),this._renderStickyScroll(e)}_readConfiguration(){const e=this._editor.getOption(114);if(e.enabled===!1){this._editor.removeOverlayWidget(this._stickyScrollWidget),this._sessionStore.clear(),this._enabled=!1;return}else e.enabled&&!this._enabled&&(this._editor.addOverlayWidget(this._stickyScrollWidget),this._sessionStore.add(this._editor.onDidScrollChange(i=>{i.scrollTopChanged&&(this._showEndForLine=null,this._renderStickyScroll())})),this._sessionStore.add(this._editor.onDidLayoutChange(()=>this._onDidResize())),this._sessionStore.add(this._editor.onDidChangeModelTokens(i=>this._onTokensChange(i))),this._sessionStore.add(this._stickyLineCandidateProvider.onDidChangeStickyScroll(()=>{this._showEndForLine=null,this._renderStickyScroll()})),this._enabled=!0);this._editor.getOption(67).renderType===2&&this._sessionStore.add(this._editor.onDidChangeCursorPosition(()=>{this._showEndForLine=null,this._renderStickyScroll()}))}_needsUpdate(e){const t=this._stickyScrollWidget.getCurrentLines();for(const i of t)for(const s of e.ranges)if(i>=s.fromLineNumber&&i<=s.toLineNumber)return!0;return!1}_onTokensChange(e){this._needsUpdate(e)&&this._renderStickyScroll(-1)}_onDidResize(){const t=this._editor.getLayoutInfo().height/this._editor.getOption(66);this._maxStickyLines=Math.round(t*.25)}_renderStickyScroll(e=1/0){var t,i;return VR(this,void 0,void 0,function*(){const s=this._editor.getModel();if(!s||s.isTooLargeForTokenization()){this._foldingModel=null,this._stickyScrollWidget.setState(void 0,null,e);return}const o=this._stickyLineCandidateProvider.getVersionId();if(o===void 0||o===s.getVersionId())if(this._foldingModel=(i=yield(t=Md.get(this._editor))===null||t===void 0?void 0:t.getFoldingModel())!==null&&i!==void 0?i:null,this._widgetState=this.findScrollWidgetState(),this._stickyScrollVisibleContextKey.set(this._widgetState.startLineNumbers.length!==0),!this._focused)this._stickyScrollWidget.setState(this._widgetState,this._foldingModel,e);else if(this._focusedStickyElementIndex===-1)this._stickyScrollWidget.setState(this._widgetState,this._foldingModel,e),this._focusedStickyElementIndex=this._stickyScrollWidget.lineNumberCount-1,this._focusedStickyElementIndex!==-1&&this._stickyScrollWidget.focusLineWithIndex(this._focusedStickyElementIndex);else{const r=this._stickyScrollWidget.lineNumbers[this._focusedStickyElementIndex];this._stickyScrollWidget.setState(this._widgetState,this._foldingModel,e),this._stickyScrollWidget.lineNumberCount===0?this._focusedStickyElementIndex=-1:(this._stickyScrollWidget.lineNumbers.includes(r)||(this._focusedStickyElementIndex=this._stickyScrollWidget.lineNumberCount-1),this._stickyScrollWidget.focusLineWithIndex(this._focusedStickyElementIndex))}})}findScrollWidgetState(){const e=this._editor.getOption(66),t=Math.min(this._maxStickyLines,this._editor.getOption(114).maxLineCount),i=this._editor.getScrollTop();let s=0;const o=[],r=[],a=this._editor.getVisibleRanges();if(a.length!==0){const l=new jC(a[0].startLineNumber,a[a.length-1].endLineNumber),c=this._stickyLineCandidateProvider.getCandidateStickyLinesIntersecting(l);for(const d of c){const u=d.startLineNumber,h=d.endLineNumber,f=d.nestingDepth;if(h-u>0){const g=(f-1)*e,p=f*e,_=this._editor.getBottomForLineNumber(u)-i,v=this._editor.getTopForLineNumber(h)-i,b=this._editor.getBottomForLineNumber(h)-i;if(g>v&&g<=b){o.push(u),r.push(h+1),s=b-p;break}else p>_&&p<=b&&(o.push(u),r.push(h+1));if(o.length===t)break}}}return this._endLineNumbers=r,new bK(o,r,s,this._showEndForLine)}dispose(){super.dispose(),this._sessionStore.dispose()}};Rd.ID="store.contrib.stickyScrollController";Rd=O5=r6e([B_(1,Cl),B_(2,Ze),B_(3,_t),B_(4,Ni),B_(5,Va),B_(6,bt)],Rd);var a6e=globalThis&&globalThis.__awaiter||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 l6e extends oa{constructor(){super({id:"editor.action.toggleStickyScroll",title:{value:m("toggleStickyScroll","Toggle Sticky Scroll"),mnemonicTitle:m({key:"mitoggleStickyScroll",comment:["&& denotes a mnemonic"]},"&&Toggle Sticky Scroll"),original:"Toggle Sticky Scroll"},category:Q7e.View,toggled:{condition:fe.equals("config.editor.stickyScroll.enabled",!0),title:m("stickyScroll","Sticky Scroll"),mnemonicTitle:m({key:"miStickyScroll",comment:["&& denotes a mnemonic"]},"&&Sticky Scroll")},menu:[{id:M.CommandPalette},{id:M.MenubarAppearanceMenu,group:"4_editor",order:3},{id:M.StickyScrollContext}]})}run(e){return a6e(this,void 0,void 0,function*(){const t=e.get(zt),i=!t.getValue("editor.stickyScroll.enabled");return t.updateValue("editor.stickyScroll.enabled",i)})}}const XN=100;class c6e extends Cc{constructor(){super({id:"editor.action.focusStickyScroll",title:{value:m("focusStickyScroll","Focus Sticky Scroll"),mnemonicTitle:m({key:"mifocusStickyScroll",comment:["&& denotes a mnemonic"]},"&&Focus Sticky Scroll"),original:"Focus Sticky Scroll"},precondition:fe.and(fe.has("config.editor.stickyScroll.enabled"),O.stickyScrollVisible),menu:[{id:M.CommandPalette}]})}runEditorCommand(e,t){var i;(i=Rd.get(t))===null||i===void 0||i.focus()}}class d6e extends Cc{constructor(){super({id:"editor.action.selectNextStickyScrollLine",title:{value:m("selectNextStickyScrollLine.title","Select next sticky scroll line"),original:"Select next sticky scroll line"},precondition:O.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:XN,primary:18}})}runEditorCommand(e,t){var i;(i=Rd.get(t))===null||i===void 0||i.focusNext()}}class u6e extends Cc{constructor(){super({id:"editor.action.selectPreviousStickyScrollLine",title:{value:m("selectPreviousStickyScrollLine.title","Select previous sticky scroll line"),original:"Select previous sticky scroll line"},precondition:O.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:XN,primary:16}})}runEditorCommand(e,t){var i;(i=Rd.get(t))===null||i===void 0||i.focusPrevious()}}class h6e extends Cc{constructor(){super({id:"editor.action.goToFocusedStickyScrollLine",title:{value:m("goToFocusedStickyScrollLine.title","Go to focused sticky scroll line"),original:"Go to focused sticky scroll line"},precondition:O.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:XN,primary:3}})}runEditorCommand(e,t){var i;(i=Rd.get(t))===null||i===void 0||i.goToFocused()}}class f6e extends Cc{constructor(){super({id:"editor.action.selectEditor",title:{value:m("selectEditor.title","Select Editor"),original:"Select Editor"},precondition:O.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:XN,primary:9}})}runEditorCommand(e,t){var i;(i=Rd.get(t))===null||i===void 0||i.selectEditor()}}ti(Rd.ID,Rd,1);Ui(l6e);Ui(c6e);Ui(u6e);Ui(d6e);Ui(h6e);Ui(f6e);var S6=globalThis&&globalThis.__decorate||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=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},g6e=globalThis&&globalThis.__awaiter||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())})},ap;class p6e{constructor(e,t,i,s,o,r){this.range=e,this.insertText=t,this.filterText=i,this.additionalTextEdits=s,this.command=o,this.completion=r}}let F5=class extends B_e{constructor(e,t,i,s,o,r){super(o.disposable),this.model=e,this.line=t,this.word=i,this.completionModel=s,this._suggestMemoryService=r}canBeReused(e,t,i){return this.model===e&&this.line===t&&this.word.word.length>0&&this.word.startColumn===i.startColumn&&this.word.endColumn=0&&l.resolve(Ft.None)}return t}};F5=S6([Jp(5,MN)],F5);let B5=class{constructor(e,t,i,s){this._getEditorOption=e,this._languageFeatureService=t,this._clipboardService=i,this._suggestMemoryService=s}provideInlineCompletions(e,t,i,s){var o;return g6e(this,void 0,void 0,function*(){if(i.selectedSuggestionInfo)return;const r=this._getEditorOption(88,e);if(Lv.isAllOff(r))return;e.tokenization.tokenizeIfCheap(t.lineNumber);const a=e.tokenization.getLineTokens(t.lineNumber),l=a.getStandardTokenType(a.findTokenIndexAtOffset(Math.max(t.column-1-1,0)));if(Lv.valueFor(r,l)!=="inline")return;let c=e.getWordAtPosition(t),d;if(c!=null&&c.word||(d=this._getTriggerCharacterInfo(e,t)),!(c!=null&&c.word)&&!d||(c||(c=e.getWordUntilPosition(t)),c.endColumn!==t.column))return;let u;const h=e.getValueInRange(new I(t.lineNumber,1,t.lineNumber,t.column));if(!d&&(!((o=this._lastResult)===null||o===void 0)&&o.canBeReused(e,t.lineNumber,c))){const f=new fK(h,t.column-this._lastResult.word.endColumn);this._lastResult.completionModel.lineContext=f,this._lastResult.acquire(),u=this._lastResult}else{const f=yield c6(this._languageFeatureService.completionProvider,e,t,new Dy(void 0,void 0,d==null?void 0:d.providers),d&&{triggerKind:1,triggerCharacter:d.ch},s);let g;f.needsClipboard&&(g=yield this._clipboardService.readText());const p=new Kh(f.items,t.column,new fK(h,0),Kl.None,this._getEditorOption(117,e),this._getEditorOption(111,e),{boostFullMatch:!1,firstMatchCanBeWeak:!1},g);u=new F5(e,t.lineNumber,c,p,f,this._suggestMemoryService)}return this._lastResult=u,u})}handleItemDidShow(e,t){t.completion.resolve(Ft.None)}freeInlineCompletions(e){e.release()}_getTriggerCharacterInfo(e,t){var i;const s=e.getValueInRange(I.fromPositions({lineNumber:t.lineNumber,column:t.column-1},t)),o=new Set;for(const r of this._languageFeatureService.completionProvider.all(e))!((i=r.triggerCharacters)===null||i===void 0)&&i.includes(s)&&o.add(r);if(o.size!==0)return{providers:o,ch:s}}};B5=S6([Jp(1,Ze),Jp(2,ch),Jp(3,MN)],B5);let oT=ap=class{constructor(e,t,i,s){if(++ap._counter===1){const o=s.createInstance(B5,(r,a)=>{var l;return((l=i.listCodeEditors().find(d=>d.getModel()===a))!==null&&l!==void 0?l:e).getOption(r)});ap._disposable=t.inlineCompletionsProvider.register("*",o)}}dispose(){var e;--ap._counter===0&&((e=ap._disposable)===null||e===void 0||e.dispose(),ap._disposable=void 0)}};oT._counter=0;oT=ap=S6([Jp(1,Ze),Jp(2,ai),Jp(3,_t)],oT);ti("suggest.inlineCompletionsProvider",oT,0);class m6e extends Ue{constructor(){super({id:"editor.action.forceRetokenize",label:m("forceRetokenize","Developer: Force Retokenize"),alias:"Developer: Force Retokenize",precondition:void 0})}run(e,t){if(!t.hasModel())return;const i=t.getModel();i.tokenization.resetTokenization();const s=new so;i.tokenization.forceTokenization(i.getLineCount()),s.stop(),console.log("tokenization took ".concat(s.elapsed()))}}De(m6e);class QN extends oa{constructor(){super({id:QN.ID,title:{value:m({key:"toggle.tabMovesFocus",comment:["Turn on/off use of tab key for moving focus around VS Code"]},"Toggle Tab Key Moves Focus"),original:"Toggle Tab Key Moves Focus"},precondition:void 0,keybinding:{primary:2091,mac:{primary:1323},weight:100},f1:!0})}run(){const t=!Ib.getTabFocusMode();Ib.setTabFocusMode(t),to(t?m("toggle.tabMovesFocus.on","Pressing Tab will now move focus to the next focusable element"):m("toggle.tabMovesFocus.off","Pressing Tab will now insert the tab character"))}}QN.ID="editor.action.toggleTabFocusMode";Ui(QN);var _6e=globalThis&&globalThis.__decorate||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},v6e=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let W5=class extends te{get enabled(){return this._enabled}set enabled(e){e?(this.el.setAttribute("aria-disabled","false"),this.el.tabIndex=0,this.el.style.pointerEvents="auto",this.el.style.opacity="1",this.el.style.cursor="pointer",this._enabled=!1):(this.el.setAttribute("aria-disabled","true"),this.el.tabIndex=-1,this.el.style.pointerEvents="none",this.el.style.opacity="0.4",this.el.style.cursor="default",this._enabled=!0),this._enabled=e}constructor(e,t,i={},s){var o;super(),this._link=t,this._enabled=!0,this.el=ge(e,ye("a.monaco-link",{tabIndex:(o=t.tabIndex)!==null&&o!==void 0?o:0,href:t.href,title:t.title},t.label)),this.el.setAttribute("role","button");const r=this._register(new Vt(this.el,"click")),a=this._register(new Vt(this.el,"keypress")),l=We.chain(a.event,u=>u.map(h=>new Oi(h)).filter(h=>h.keyCode===3)),c=this._register(new Vt(this.el,Ti.Tap)).event;this._register(Ii.addTarget(this.el));const d=We.any(r.event,l,c);this._register(d(u=>{this.enabled&&(xt.stop(u,!0),i!=null&&i.opener?i.opener(this._link.href):s.open(this._link.href,{allowCommands:!0}))})),this.enabled=!0}};W5=_6e([v6e(3,Ir)],W5);var Ise=globalThis&&globalThis.__decorate||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},Tse=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};const b6e=26;let V5=class extends te{constructor(e,t){super(),this._editor=e,this.instantiationService=t,this.banner=this._register(this.instantiationService.createInstance(H5))}hide(){this._editor.setBanner(null,0),this.banner.clear()}show(e){this.banner.show(Object.assign(Object.assign({},e),{onClose:()=>{var t;this.hide(),(t=e.onClose)===null||t===void 0||t.call(e)}})),this._editor.setBanner(this.banner.element,b6e)}};V5=Ise([Tse(1,_t)],V5);let H5=class extends te{constructor(e){super(),this.instantiationService=e,this.markdownRenderer=this.instantiationService.createInstance(Zu,{}),this.element=ye("div.editor-banner"),this.element.tabIndex=0}getAriaLabel(e){if(e.ariaLabel)return e.ariaLabel;if(typeof e.message=="string")return e.message}getBannerMessage(e){if(typeof e=="string"){const t=ye("span");return t.innerText=e,t}return this.markdownRenderer.render(e).element}clear(){Ds(this.element)}show(e){Ds(this.element);const t=this.getAriaLabel(e);t&&this.element.setAttribute("aria-label",t);const i=ge(this.element,ye("div.icon-container"));i.setAttribute("aria-hidden","true"),e.icon&&i.appendChild(ye("div".concat(dt.asCSSSelector(e.icon))));const s=ge(this.element,ye("div.message-container"));if(s.setAttribute("aria-hidden","true"),s.appendChild(this.getBannerMessage(e.message)),this.messageActionsContainer=ge(this.element,ye("div.message-actions-container")),e.actions)for(const r of e.actions)this._register(this.instantiationService.createInstance(W5,this.messageActionsContainer,Object.assign(Object.assign({},r),{tabIndex:-1}),{}));const o=ge(this.element,ye("div.action-container"));this.actionBar=this._register(new Pa(o)),this.actionBar.push(this._register(new Ro("banner.close","Close Banner",dt.asClassName(fte),!0,()=>{typeof e.onClose=="function"&&e.onClose()})),{icon:!0,label:!1}),this.actionBar.setFocusable(!1)}};H5=Ise([Tse(0,_t)],H5);var L6=globalThis&&globalThis.__decorate||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},lb=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},Zs=globalThis&&globalThis.__awaiter||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 C6e=Sn("extensions-warning-message",Me.warning,m("warningIcon","Icon shown with a warning message in the extensions editor."));let o0=class extends te{constructor(e,t,i,s){super(),this._editor=e,this._editorWorkerService=t,this._workspaceTrustService=i,this._highlighter=null,this._bannerClosed=!1,this._updateState=o=>{if(o&&o.hasMore){if(this._bannerClosed)return;const r=Math.max(o.ambiguousCharacterCount,o.nonBasicAsciiCharacterCount,o.invisibleCharacterCount);let a;if(o.nonBasicAsciiCharacterCount>=r)a={message:m("unicodeHighlighting.thisDocumentHasManyNonBasicAsciiUnicodeCharacters","This document contains many non-basic ASCII unicode characters"),command:new z0};else if(o.ambiguousCharacterCount>=r)a={message:m("unicodeHighlighting.thisDocumentHasManyAmbiguousUnicodeCharacters","This document contains many ambiguous unicode characters"),command:new Mg};else if(o.invisibleCharacterCount>=r)a={message:m("unicodeHighlighting.thisDocumentHasManyInvisibleUnicodeCharacters","This document contains many invisible unicode characters"),command:new $0};else throw new Error("Unreachable");this._bannerController.show({id:"unicodeHighlightBanner",message:a.message,icon:C6e,actions:[{label:a.command.shortLabel,href:"command:".concat(a.command.id)}],onClose:()=>{this._bannerClosed=!0}})}else this._bannerController.hide()},this._bannerController=this._register(s.createInstance(V5,e)),this._register(this._editor.onDidChangeModel(()=>{this._bannerClosed=!1,this._updateHighlighter()})),this._options=e.getOption(124),this._register(i.onDidChangeTrust(o=>{this._updateHighlighter()})),this._register(e.onDidChangeConfiguration(o=>{o.hasChanged(124)&&(this._options=e.getOption(124),this._updateHighlighter())})),this._updateHighlighter()}dispose(){this._highlighter&&(this._highlighter.dispose(),this._highlighter=null),super.dispose()}_updateHighlighter(){if(this._updateState(null),this._highlighter&&(this._highlighter.dispose(),this._highlighter=null),!this._editor.hasModel())return;const e=w6e(this._workspaceTrustService.isWorkspaceTrusted(),this._options);if([e.nonBasicASCII,e.ambiguousCharacters,e.invisibleCharacters].every(i=>i===!1))return;const t={nonBasicASCII:e.nonBasicASCII,ambiguousCharacters:e.ambiguousCharacters,invisibleCharacters:e.invisibleCharacters,includeComments:e.includeComments,includeStrings:e.includeStrings,allowedCodePoints:Object.keys(e.allowedCharacters).map(i=>i.codePointAt(0)),allowedLocales:Object.keys(e.allowedLocales).map(i=>i==="_os"?new Intl.NumberFormat().resolvedOptions().locale:i==="_vscode"?Vme:i)};this._editorWorkerService.canComputeUnicodeHighlights(this._editor.getModel().uri)?this._highlighter=new $5(this._editor,t,this._updateState,this._editorWorkerService):this._highlighter=new y6e(this._editor,t,this._updateState)}getDecorationInfo(e){return this._highlighter?this._highlighter.getDecorationInfo(e):null}};o0.ID="editor.contrib.unicodeHighlighter";o0=L6([lb(1,Sl),lb(2,uee),lb(3,_t)],o0);function w6e(n,e){return{nonBasicASCII:e.nonBasicASCII===Mr?!n:e.nonBasicASCII,ambiguousCharacters:e.ambiguousCharacters,invisibleCharacters:e.invisibleCharacters,includeComments:e.includeComments===Mr?!n:e.includeComments,includeStrings:e.includeStrings===Mr?!n:e.includeStrings,allowedCharacters:e.allowedCharacters,allowedLocales:e.allowedLocales}}let $5=class extends te{constructor(e,t,i,s){super(),this._editor=e,this._options=t,this._updateState=i,this._editorWorkerService=s,this._model=this._editor.getModel(),this._decorations=this._editor.createDecorationsCollection(),this._updateSoon=this._register(new Si(()=>this._update(),250)),this._register(this._editor.onDidChangeModelContent(()=>{this._updateSoon.schedule()})),this._updateSoon.schedule()}dispose(){this._decorations.clear(),super.dispose()}_update(){if(this._model.isDisposed())return;if(!this._model.mightContainNonBasicASCII()){this._decorations.clear();return}const e=this._model.getVersionId();this._editorWorkerService.computedUnicodeHighlights(this._model.uri,this._options).then(t=>{if(this._model.isDisposed()||this._model.getVersionId()!==e)return;this._updateState(t);const i=[];if(!t.hasMore)for(const s of t.ranges)i.push({range:s,options:rT.instance.getDecorationFromOptions(this._options)});this._decorations.set(i)})}getDecorationInfo(e){if(!this._decorations.has(e))return null;const t=this._editor.getModel();if(!D9(t,e))return null;const i=t.getValueInRange(e.range);return{reason:xse(i,this._options),inComment:E9(t,e),inString:I9(t,e)}}};$5=L6([lb(3,Sl)],$5);class y6e extends te{constructor(e,t,i){super(),this._editor=e,this._options=t,this._updateState=i,this._model=this._editor.getModel(),this._decorations=this._editor.createDecorationsCollection(),this._updateSoon=this._register(new Si(()=>this._update(),250)),this._register(this._editor.onDidLayoutChange(()=>{this._updateSoon.schedule()})),this._register(this._editor.onDidScrollChange(()=>{this._updateSoon.schedule()})),this._register(this._editor.onDidChangeHiddenAreas(()=>{this._updateSoon.schedule()})),this._register(this._editor.onDidChangeModelContent(()=>{this._updateSoon.schedule()})),this._updateSoon.schedule()}dispose(){this._decorations.clear(),super.dispose()}_update(){if(this._model.isDisposed())return;if(!this._model.mightContainNonBasicASCII()){this._decorations.clear();return}const e=this._editor.getVisibleRanges(),t=[],i={ranges:[],ambiguousCharacterCount:0,invisibleCharacterCount:0,nonBasicAsciiCharacterCount:0,hasMore:!1};for(const s of e){const o=H8.computeUnicodeHighlights(this._model,this._options,s);for(const r of o.ranges)i.ranges.push(r);i.ambiguousCharacterCount+=i.ambiguousCharacterCount,i.invisibleCharacterCount+=i.invisibleCharacterCount,i.nonBasicAsciiCharacterCount+=i.nonBasicAsciiCharacterCount,i.hasMore=i.hasMore||o.hasMore}if(!i.hasMore)for(const s of i.ranges)t.push({range:s,options:rT.instance.getDecorationFromOptions(this._options)});this._updateState(i),this._decorations.set(t)}getDecorationInfo(e){if(!this._decorations.has(e))return null;const t=this._editor.getModel(),i=t.getValueInRange(e.range);return D9(t,e)?{reason:xse(i,this._options),inComment:E9(t,e),inString:I9(t,e)}:null}}let z5=class{constructor(e,t,i){this._editor=e,this._languageService=t,this._openerService=i,this.hoverOrdinal=5}computeSync(e,t){if(!this._editor.hasModel()||e.type!==1)return[];const i=this._editor.getModel(),s=this._editor.getContribution(o0.ID);if(!s)return[];const o=[],r=new Set;let a=300;for(const l of t){const c=s.getDecorationInfo(l);if(!c)continue;const u=i.getValueInRange(l.range).codePointAt(0),h=HR(u);let f;switch(c.reason.kind){case 0:{cS(c.reason.confusableWith)?f=m("unicodeHighlight.characterIsAmbiguousASCII","The character {0} could be confused with the ASCII character {1}, which is more common in source code.",h,HR(c.reason.confusableWith.codePointAt(0))):f=m("unicodeHighlight.characterIsAmbiguous","The character {0} could be confused with the character {1}, which is more common in source code.",h,HR(c.reason.confusableWith.codePointAt(0)));break}case 1:f=m("unicodeHighlight.characterIsInvisible","The character {0} is invisible.",h);break;case 2:f=m("unicodeHighlight.characterIsNonBasicAscii","The character {0} is not a basic ASCII character.",h);break}if(r.has(f))continue;r.add(f);const g={codePoint:u,reason:c.reason,inComment:c.inComment,inString:c.inString},p=m("unicodeHighlight.adjustSettings","Adjust settings"),_="command:".concat(qS.ID,"?").concat(encodeURIComponent(JSON.stringify(g))),v=new Bs("",!0).appendMarkdown(f).appendText(" ").appendLink(_,p);o.push(new Yl(this,l.range,[v],!1,a++))}return o}renderHoverParts(e,t){return rne(e,t,this._editor,this._languageService,this._openerService)}};z5=L6([lb(1,qi),lb(2,Ir)],z5);function U5(n){return"U+".concat(n.toString(16).padStart(4,"0"))}function HR(n){let e="`".concat(U5(n),"`");return pd.isInvisibleCharacter(n)||(e+=' "'.concat("".concat(S6e(n)),'"')),e}function S6e(n){return n===96?"`` ` ``":"`"+String.fromCodePoint(n)+"`"}function xse(n,e){return H8.computeUnicodeHighlightReason(n,e)}class rT{constructor(){this.map=new Map}getDecorationFromOptions(e){return this.getDecoration(!e.includeComments,!e.includeStrings)}getDecoration(e,t){const i="".concat(e).concat(t);let s=this.map.get(i);return s||(s=kt.createDynamic({description:"unicode-highlight",stickiness:1,className:"unicode-highlight",showIfCollapsed:!0,overviewRuler:null,minimap:null,hideInCommentTokens:e,hideInStringTokens:t}),this.map.set(i,s)),s}}rT.instance=new rT;class L6e extends Ue{constructor(){super({id:Mg.ID,label:m("action.unicodeHighlight.disableHighlightingInComments","Disable highlighting of characters in comments"),alias:"Disable highlighting of characters in comments",precondition:void 0}),this.shortLabel=m("unicodeHighlight.disableHighlightingInComments.shortLabel","Disable Highlight In Comments")}run(e,t,i){return Zs(this,void 0,void 0,function*(){const s=e==null?void 0:e.get(zt);s&&this.runAction(s)})}runAction(e){return Zs(this,void 0,void 0,function*(){yield e.updateValue(Go.includeComments,!1,2)})}}class k6e extends Ue{constructor(){super({id:Mg.ID,label:m("action.unicodeHighlight.disableHighlightingInStrings","Disable highlighting of characters in strings"),alias:"Disable highlighting of characters in strings",precondition:void 0}),this.shortLabel=m("unicodeHighlight.disableHighlightingInStrings.shortLabel","Disable Highlight In Strings")}run(e,t,i){return Zs(this,void 0,void 0,function*(){const s=e==null?void 0:e.get(zt);s&&this.runAction(s)})}runAction(e){return Zs(this,void 0,void 0,function*(){yield e.updateValue(Go.includeStrings,!1,2)})}}class Mg extends Ue{constructor(){super({id:Mg.ID,label:m("action.unicodeHighlight.disableHighlightingOfAmbiguousCharacters","Disable highlighting of ambiguous characters"),alias:"Disable highlighting of ambiguous characters",precondition:void 0}),this.shortLabel=m("unicodeHighlight.disableHighlightingOfAmbiguousCharacters.shortLabel","Disable Ambiguous Highlight")}run(e,t,i){return Zs(this,void 0,void 0,function*(){const s=e==null?void 0:e.get(zt);s&&this.runAction(s)})}runAction(e){return Zs(this,void 0,void 0,function*(){yield e.updateValue(Go.ambiguousCharacters,!1,2)})}}Mg.ID="editor.action.unicodeHighlight.disableHighlightingOfAmbiguousCharacters";class $0 extends Ue{constructor(){super({id:$0.ID,label:m("action.unicodeHighlight.disableHighlightingOfInvisibleCharacters","Disable highlighting of invisible characters"),alias:"Disable highlighting of invisible characters",precondition:void 0}),this.shortLabel=m("unicodeHighlight.disableHighlightingOfInvisibleCharacters.shortLabel","Disable Invisible Highlight")}run(e,t,i){return Zs(this,void 0,void 0,function*(){const s=e==null?void 0:e.get(zt);s&&this.runAction(s)})}runAction(e){return Zs(this,void 0,void 0,function*(){yield e.updateValue(Go.invisibleCharacters,!1,2)})}}$0.ID="editor.action.unicodeHighlight.disableHighlightingOfInvisibleCharacters";class z0 extends Ue{constructor(){super({id:z0.ID,label:m("action.unicodeHighlight.disableHighlightingOfNonBasicAsciiCharacters","Disable highlighting of non basic ASCII characters"),alias:"Disable highlighting of non basic ASCII characters",precondition:void 0}),this.shortLabel=m("unicodeHighlight.disableHighlightingOfNonBasicAsciiCharacters.shortLabel","Disable Non ASCII Highlight")}run(e,t,i){return Zs(this,void 0,void 0,function*(){const s=e==null?void 0:e.get(zt);s&&this.runAction(s)})}runAction(e){return Zs(this,void 0,void 0,function*(){yield e.updateValue(Go.nonBasicASCII,!1,2)})}}z0.ID="editor.action.unicodeHighlight.disableHighlightingOfNonBasicAsciiCharacters";class qS extends Ue{constructor(){super({id:qS.ID,label:m("action.unicodeHighlight.showExcludeOptions","Show Exclude Options"),alias:"Show Exclude Options",precondition:void 0})}run(e,t,i){return Zs(this,void 0,void 0,function*(){const{codePoint:s,reason:o,inString:r,inComment:a}=i,l=String.fromCodePoint(s),c=e.get(yc),d=e.get(zt);function u(g){return pd.isInvisibleCharacter(g)?m("unicodeHighlight.excludeInvisibleCharFromBeingHighlighted","Exclude {0} (invisible character) from being highlighted",U5(g)):m("unicodeHighlight.excludeCharFromBeingHighlighted","Exclude {0} from being highlighted","".concat(U5(g),' "').concat(l,'"'))}const h=[];if(o.kind===0)for(const g of o.notAmbiguousInLocales)h.push({label:m("unicodeHighlight.allowCommonCharactersInLanguage",'Allow unicode characters that are more common in the language "{0}".',g),run:()=>Zs(this,void 0,void 0,function*(){E6e(d,[g])})});if(h.push({label:u(s),run:()=>D6e(d,[s])}),a){const g=new L6e;h.push({label:g.label,run:()=>Zs(this,void 0,void 0,function*(){return g.runAction(d)})})}else if(r){const g=new k6e;h.push({label:g.label,run:()=>Zs(this,void 0,void 0,function*(){return g.runAction(d)})})}if(o.kind===0){const g=new Mg;h.push({label:g.label,run:()=>Zs(this,void 0,void 0,function*(){return g.runAction(d)})})}else if(o.kind===1){const g=new $0;h.push({label:g.label,run:()=>Zs(this,void 0,void 0,function*(){return g.runAction(d)})})}else if(o.kind===2){const g=new z0;h.push({label:g.label,run:()=>Zs(this,void 0,void 0,function*(){return g.runAction(d)})})}else I6e(o);const f=yield c.pick(h,{title:m("unicodeHighlight.configureUnicodeHighlightOptions","Configure Unicode Highlight Options")});f&&(yield f.run())})}}qS.ID="editor.action.unicodeHighlight.showExcludeOptions";function D6e(n,e){return Zs(this,void 0,void 0,function*(){const t=n.getValue(Go.allowedCharacters);let i;typeof t=="object"&&t?i=t:i={};for(const s of e)i[String.fromCodePoint(s)]=!0;yield n.updateValue(Go.allowedCharacters,i,2)})}function E6e(n,e){var t;return Zs(this,void 0,void 0,function*(){const i=(t=n.inspect(Go.allowedLocales).user)===null||t===void 0?void 0:t.value;let s;typeof i=="object"&&i?s=Object.assign({},i):s={};for(const o of e)s[o]=!0;yield n.updateValue(Go.allowedLocales,s,2)})}function I6e(n){throw new Error("Unexpected value: ".concat(n))}De(Mg);De($0);De(z0);De(qS);ti(o0.ID,o0,1);c_.register(z5);var T6e=globalThis&&globalThis.__decorate||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=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},x6e=globalThis&&globalThis.__awaiter||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 Nse="ignoreUnusualLineTerminators";function N6e(n,e,t){n.setModelProperty(e.uri,Nse,t)}function A6e(n,e){return n.getModelProperty(e.uri,Nse)}let Wy=class extends te{constructor(e,t,i){super(),this._editor=e,this._dialogService=t,this._codeEditorService=i,this._isPresentingDialog=!1,this._config=this._editor.getOption(125),this._register(this._editor.onDidChangeConfiguration(s=>{s.hasChanged(125)&&(this._config=this._editor.getOption(125),this._checkForUnusualLineTerminators())})),this._register(this._editor.onDidChangeModel(()=>{this._checkForUnusualLineTerminators()})),this._register(this._editor.onDidChangeModelContent(s=>{s.isUndoing||this._checkForUnusualLineTerminators()})),this._checkForUnusualLineTerminators()}_checkForUnusualLineTerminators(){return x6e(this,void 0,void 0,function*(){if(this._config==="off"||!this._editor.hasModel())return;const e=this._editor.getModel();if(!e.mightContainUnusualLineTerminators()||A6e(this._codeEditorService,e)===!0||this._editor.getOption(90))return;if(this._config==="auto"){e.removeUnusualLineTerminators(this._editor.getSelections());return}if(this._isPresentingDialog)return;let i;try{this._isPresentingDialog=!0,i=yield this._dialogService.confirm({title:m("unusualLineTerminators.title","Unusual Line Terminators"),message:m("unusualLineTerminators.message","Detected unusual line terminators"),detail:m("unusualLineTerminators.detail","The file '{0}' contains one or more unusual line terminator characters, like Line Separator (LS) or Paragraph Separator (PS).\n\nIt is recommended to remove them from the file. This can be configured via `editor.unusualLineTerminators`.",Ra(e.uri)),primaryButton:m({key:"unusualLineTerminators.fix",comment:["&& denotes a mnemonic"]},"&&Remove Unusual Line Terminators"),cancelButton:m("unusualLineTerminators.ignore","Ignore")})}finally{this._isPresentingDialog=!1}if(!i.confirmed){N6e(this._codeEditorService,e,!0);return}e.removeUnusualLineTerminators(this._editor.getSelections())})}};Wy.ID="editor.contrib.unusualLineTerminatorsDetector";Wy=T6e([DK(1,LS),DK(2,ai)],Wy);ti(Wy.ID,Wy,1);var M6e=globalThis&&globalThis.__decorate||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=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},j5;const JN=new Ve("hasWordHighlights",!1);function Ase(n,e,t,i){const s=n.ordered(e);return cQ(s.map(o=>()=>Promise.resolve(o.provideDocumentHighlights(e,t,i)).then(void 0,Bn)),io)}class Mse{constructor(e,t,i){this._model=e,this._selection=t,this._wordSeparators=i,this._wordRange=this._getCurrentWordRange(e,t),this._result=null}get result(){return this._result||(this._result=Xn(e=>this._compute(this._model,this._selection,this._wordSeparators,e))),this._result}_getCurrentWordRange(e,t){const i=e.getWordAtPosition(t.getPosition());return i?new I(t.startLineNumber,i.startColumn,t.startLineNumber,i.endColumn):null}isValid(e,t,i){const s=t.startLineNumber,o=t.startColumn,r=t.endColumn,a=this._getCurrentWordRange(e,t);let l=!!(this._wordRange&&this._wordRange.equalsRange(a));for(let c=0,d=i.length;!l&&c=r&&(l=!0)}return l}cancel(){this.result.cancel()}}class R6e extends Mse{constructor(e,t,i,s){super(e,t,i),this._providers=s}_compute(e,t,i,s){return Ase(this._providers,e,t.getPosition(),s).then(o=>o||[])}}class P6e extends Mse{constructor(e,t,i){super(e,t,i),this._selectionIsEmpty=t.isEmpty()}_compute(e,t,i,s){return jf(250,s).then(()=>{if(!t.isEmpty())return[];const o=e.getWordAtPosition(t.getPosition());return!o||o.word.length>1e3?[]:e.findMatches(o.word,!0,!1,!0,i,!1).map(a=>({range:a.range,kind:mw.Text}))})}isValid(e,t,i){const s=t.isEmpty();return this._selectionIsEmpty!==s?!1:super.isValid(e,t,i)}}function O6e(n,e,t,i){return n.has(e)?new R6e(e,t,i,n):new P6e(e,t,i)}$d("_executeDocumentHighlights",(n,e,t)=>{const i=n.get(Ze);return Ase(i.documentHighlightProvider,e,t,Ft.None)});class F6e{constructor(e,t,i,s){this.toUnhook=new be,this.workerRequestTokenId=0,this.workerRequestCompleted=!1,this.workerRequestValue=[],this.lastCursorPositionChangeTime=0,this.renderDecorationsTimer=-1,this.editor=e,this.providers=t,this.linkedHighlighters=i,this._hasWordHighlights=JN.bindTo(s),this._ignorePositionChangeEvent=!1,this.occurrencesHighlight=this.editor.getOption(80),this.model=this.editor.getModel(),this.toUnhook.add(e.onDidChangeCursorPosition(o=>{this._ignorePositionChangeEvent||this.occurrencesHighlight&&this._onPositionChanged(o)})),this.toUnhook.add(e.onDidChangeModelContent(o=>{this._stopAll()})),this.toUnhook.add(e.onDidChangeConfiguration(o=>{const r=this.editor.getOption(80);this.occurrencesHighlight!==r&&(this.occurrencesHighlight=r,this._stopAll())})),this.decorations=this.editor.createDecorationsCollection(),this.workerRequestTokenId=0,this.workerRequest=null,this.workerRequestCompleted=!1,this.lastCursorPositionChangeTime=0,this.renderDecorationsTimer=-1}hasDecorations(){return this.decorations.length>0}restore(){this.occurrencesHighlight&&this._run()}_getSortedHighlights(){return this.decorations.getRanges().sort(I.compareRangesUsingStarts)}moveNext(){const e=this._getSortedHighlights(),i=(e.findIndex(o=>o.containsPosition(this.editor.getPosition()))+1)%e.length,s=e[i];try{this._ignorePositionChangeEvent=!0,this.editor.setPosition(s.getStartPosition()),this.editor.revealRangeInCenterIfOutsideViewport(s);const o=this._getWord();if(o){const r=this.editor.getModel().getLineContent(s.startLineNumber);to("".concat(r,", ").concat(i+1," of ").concat(e.length," for '").concat(o.word,"'"))}}finally{this._ignorePositionChangeEvent=!1}}moveBack(){const e=this._getSortedHighlights(),i=(e.findIndex(o=>o.containsPosition(this.editor.getPosition()))-1+e.length)%e.length,s=e[i];try{this._ignorePositionChangeEvent=!0,this.editor.setPosition(s.getStartPosition()),this.editor.revealRangeInCenterIfOutsideViewport(s);const o=this._getWord();if(o){const r=this.editor.getModel().getLineContent(s.startLineNumber);to("".concat(r,", ").concat(i+1," of ").concat(e.length," for '").concat(o.word,"'"))}}finally{this._ignorePositionChangeEvent=!1}}_removeDecorations(){this.decorations.length>0&&(this.decorations.clear(),this._hasWordHighlights.set(!1))}_stopAll(){this._removeDecorations(),this.renderDecorationsTimer!==-1&&(clearTimeout(this.renderDecorationsTimer),this.renderDecorationsTimer=-1),this.workerRequest!==null&&(this.workerRequest.cancel(),this.workerRequest=null),this.workerRequestCompleted||(this.workerRequestTokenId++,this.workerRequestCompleted=!0)}_onPositionChanged(e){if(!this.occurrencesHighlight){this._stopAll();return}if(e.reason!==3){this._stopAll();return}this._run()}_getWord(){const e=this.editor.getSelection(),t=e.startLineNumber,i=e.startColumn;return this.model.getWordAtPosition({lineNumber:t,column:i})}_run(){const e=this.editor.getSelection();if(e.startLineNumber!==e.endLineNumber){this._stopAll();return}const t=e.startColumn,i=e.endColumn,s=this._getWord();if(!s||s.startColumn>t||s.endColumn{r===this.workerRequestTokenId&&(this.workerRequestCompleted=!0,this.workerRequestValue=a||[],this._beginRenderDecorations())},Dt)}}_beginRenderDecorations(){const e=new Date().getTime(),t=this.lastCursorPositionChangeTime+250;e>=t?(this.renderDecorationsTimer=-1,this.renderDecorations()):this.renderDecorationsTimer=setTimeout(()=>{this.renderDecorations()},t-e)}renderDecorations(){this.renderDecorationsTimer=-1;const e=[];for(const t of this.workerRequestValue)t.range&&e.push({range:t.range,options:l7e(t.kind)});this.decorations.set(e),this._hasWordHighlights.set(this.hasDecorations());for(const t of this.linkedHighlighters())(t==null?void 0:t.editor.getModel())===this.editor.getModel()&&(t._stopAll(),t.decorations.set(e),t._hasWordHighlights.set(t.hasDecorations()))}dispose(){this._stopAll(),this.toUnhook.dispose()}}let Pm=j5=class extends te{static get(e){return e.getContribution(j5.ID)}constructor(e,t,i){super(),this.wordHighlighter=null,this.linkedContributions=new Set;const s=()=>{e.hasModel()&&!e.getModel().isTooLargeForTokenization()&&(this.wordHighlighter=new F6e(e,i.documentHighlightProvider,()=>Pt.map(this.linkedContributions,o=>o.wordHighlighter),t))};this._register(e.onDidChangeModel(o=>{this.wordHighlighter&&(this.wordHighlighter.dispose(),this.wordHighlighter=null),s()})),s()}saveViewState(){return!!(this.wordHighlighter&&this.wordHighlighter.hasDecorations())}moveNext(){var e;(e=this.wordHighlighter)===null||e===void 0||e.moveNext()}moveBack(){var e;(e=this.wordHighlighter)===null||e===void 0||e.moveBack()}restoreViewState(e){this.wordHighlighter&&e&&this.wordHighlighter.restore()}dispose(){this.wordHighlighter&&(this.wordHighlighter.dispose(),this.wordHighlighter=null),super.dispose()}};Pm.ID="editor.contrib.wordHighlighter";Pm=j5=M6e([EK(1,bt),EK(2,Ze)],Pm);class Rse extends Ue{constructor(e,t){super(t),this._isNext=e}run(e,t){const i=Pm.get(t);i&&(this._isNext?i.moveNext():i.moveBack())}}class B6e extends Rse{constructor(){super(!0,{id:"editor.action.wordHighlight.next",label:m("wordHighlight.next.label","Go to Next Symbol Highlight"),alias:"Go to Next Symbol Highlight",precondition:JN,kbOpts:{kbExpr:O.editorTextFocus,primary:65,weight:100}})}}class W6e extends Rse{constructor(){super(!1,{id:"editor.action.wordHighlight.prev",label:m("wordHighlight.previous.label","Go to Previous Symbol Highlight"),alias:"Go to Previous Symbol Highlight",precondition:JN,kbOpts:{kbExpr:O.editorTextFocus,primary:1089,weight:100}})}}class V6e extends Ue{constructor(){super({id:"editor.action.wordHighlight.trigger",label:m("wordHighlight.trigger.label","Trigger Symbol Highlight"),alias:"Trigger Symbol Highlight",precondition:JN.toNegated(),kbOpts:{kbExpr:O.editorTextFocus,primary:0,weight:100}})}run(e,t,i){const s=Pm.get(t);s&&s.restoreViewState(!0)}}ti(Pm.ID,Pm,0);De(B6e);De(W6e);De(V6e);class eA extends fs{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode,this._wordNavigationType=e.wordNavigationType}runEditorCommand(e,t,i){if(!t.hasModel())return;const s=Aa(t.getOption(129)),o=t.getModel(),a=t.getSelections().map(l=>{const c=new Y(l.positionLineNumber,l.positionColumn),d=this._move(s,o,c,this._wordNavigationType);return this._moveTo(l,d,this._inSelectionMode)});if(o.pushStackElement(),t._getViewModel().setCursorStates("moveWordCommand",3,a.map(l=>Qt.fromModelSelection(l))),a.length===1){const l=new Y(a[0].positionLineNumber,a[0].positionColumn);t.revealPosition(l,0)}}_moveTo(e,t,i){return i?new Je(e.selectionStartLineNumber,e.selectionStartColumn,t.lineNumber,t.column):new Je(t.lineNumber,t.column,t.lineNumber,t.column)}}class Rg extends eA{_move(e,t,i,s){return oi.moveWordLeft(e,t,i,s)}}class Pg extends eA{_move(e,t,i,s){return oi.moveWordRight(e,t,i,s)}}class H6e extends Rg{constructor(){super({inSelectionMode:!1,wordNavigationType:0,id:"cursorWordStartLeft",precondition:void 0})}}class $6e extends Rg{constructor(){super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordEndLeft",precondition:void 0})}}class z6e extends Rg{constructor(){var e;super({inSelectionMode:!1,wordNavigationType:1,id:"cursorWordLeft",precondition:void 0,kbOpts:{kbExpr:fe.and(O.textInputFocus,(e=fe.and(pS,$x))===null||e===void 0?void 0:e.negate()),primary:2063,mac:{primary:527},weight:100}})}}class U6e extends Rg{constructor(){super({inSelectionMode:!0,wordNavigationType:0,id:"cursorWordStartLeftSelect",precondition:void 0})}}class j6e extends Rg{constructor(){super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordEndLeftSelect",precondition:void 0})}}class K6e extends Rg{constructor(){var e;super({inSelectionMode:!0,wordNavigationType:1,id:"cursorWordLeftSelect",precondition:void 0,kbOpts:{kbExpr:fe.and(O.textInputFocus,(e=fe.and(pS,$x))===null||e===void 0?void 0:e.negate()),primary:3087,mac:{primary:1551},weight:100}})}}class q6e extends Rg{constructor(){super({inSelectionMode:!1,wordNavigationType:3,id:"cursorWordAccessibilityLeft",precondition:void 0})}_move(e,t,i,s){return super._move(Aa(vc.wordSeparators.defaultValue),t,i,s)}}class G6e extends Rg{constructor(){super({inSelectionMode:!0,wordNavigationType:3,id:"cursorWordAccessibilityLeftSelect",precondition:void 0})}_move(e,t,i,s){return super._move(Aa(vc.wordSeparators.defaultValue),t,i,s)}}class Y6e extends Pg{constructor(){super({inSelectionMode:!1,wordNavigationType:0,id:"cursorWordStartRight",precondition:void 0})}}class Z6e extends Pg{constructor(){var e;super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordEndRight",precondition:void 0,kbOpts:{kbExpr:fe.and(O.textInputFocus,(e=fe.and(pS,$x))===null||e===void 0?void 0:e.negate()),primary:2065,mac:{primary:529},weight:100}})}}class X6e extends Pg{constructor(){super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordRight",precondition:void 0})}}class Q6e extends Pg{constructor(){super({inSelectionMode:!0,wordNavigationType:0,id:"cursorWordStartRightSelect",precondition:void 0})}}class J6e extends Pg{constructor(){var e;super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordEndRightSelect",precondition:void 0,kbOpts:{kbExpr:fe.and(O.textInputFocus,(e=fe.and(pS,$x))===null||e===void 0?void 0:e.negate()),primary:3089,mac:{primary:1553},weight:100}})}}class eWe extends Pg{constructor(){super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordRightSelect",precondition:void 0})}}class tWe extends Pg{constructor(){super({inSelectionMode:!1,wordNavigationType:3,id:"cursorWordAccessibilityRight",precondition:void 0})}_move(e,t,i,s){return super._move(Aa(vc.wordSeparators.defaultValue),t,i,s)}}class iWe extends Pg{constructor(){super({inSelectionMode:!0,wordNavigationType:3,id:"cursorWordAccessibilityRightSelect",precondition:void 0})}_move(e,t,i,s){return super._move(Aa(vc.wordSeparators.defaultValue),t,i,s)}}class tA extends fs{constructor(e){super(e),this._whitespaceHeuristics=e.whitespaceHeuristics,this._wordNavigationType=e.wordNavigationType}runEditorCommand(e,t,i){const s=e.get(Ni);if(!t.hasModel())return;const o=Aa(t.getOption(129)),r=t.getModel(),a=t.getSelections(),l=t.getOption(6),c=t.getOption(11),d=s.getLanguageConfiguration(r.getLanguageId()).getAutoClosingPairs(),u=t._getViewModel(),h=a.map(f=>{const g=this._delete({wordSeparators:o,model:r,selection:f,whitespaceHeuristics:this._whitespaceHeuristics,autoClosingDelete:t.getOption(9),autoClosingBrackets:l,autoClosingQuotes:c,autoClosingPairs:d,autoClosedCharacters:u.getCursorAutoClosedCharacters()},this._wordNavigationType);return new Rs(g,"")});t.pushUndoStop(),t.executeCommands(this.id,h),t.pushUndoStop()}}class k6 extends tA{_delete(e,t){const i=oi.deleteWordLeft(e,t);return i||new I(1,1,1,1)}}class D6 extends tA{_delete(e,t){const i=oi.deleteWordRight(e,t);if(i)return i;const s=e.model.getLineCount(),o=e.model.getLineMaxColumn(s);return new I(s,o,s,o)}}class nWe extends k6{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:0,id:"deleteWordStartLeft",precondition:O.writable})}}class sWe extends k6{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:2,id:"deleteWordEndLeft",precondition:O.writable})}}class oWe extends k6{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:0,id:"deleteWordLeft",precondition:O.writable,kbOpts:{kbExpr:O.textInputFocus,primary:2049,mac:{primary:513},weight:100}})}}class rWe extends D6{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:0,id:"deleteWordStartRight",precondition:O.writable})}}class aWe extends D6{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:2,id:"deleteWordEndRight",precondition:O.writable})}}class lWe extends D6{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:2,id:"deleteWordRight",precondition:O.writable,kbOpts:{kbExpr:O.textInputFocus,primary:2068,mac:{primary:532},weight:100}})}}class cWe extends Ue{constructor(){super({id:"deleteInsideWord",precondition:O.writable,label:m("deleteInsideWord","Delete Word"),alias:"Delete Word"})}run(e,t,i){if(!t.hasModel())return;const s=Aa(t.getOption(129)),o=t.getModel(),a=t.getSelections().map(l=>{const c=oi.deleteInsideWord(s,o,l);return new Rs(c,"")});t.pushUndoStop(),t.executeCommands(this.id,a),t.pushUndoStop()}}Re(new H6e);Re(new $6e);Re(new z6e);Re(new U6e);Re(new j6e);Re(new K6e);Re(new Y6e);Re(new Z6e);Re(new X6e);Re(new Q6e);Re(new J6e);Re(new eWe);Re(new q6e);Re(new G6e);Re(new tWe);Re(new iWe);Re(new nWe);Re(new sWe);Re(new oWe);Re(new rWe);Re(new aWe);Re(new lWe);De(cWe);class dWe extends tA{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:0,id:"deleteWordPartLeft",precondition:O.writable,kbOpts:{kbExpr:O.textInputFocus,primary:0,mac:{primary:769},weight:100}})}_delete(e,t){const i=yx.deleteWordPartLeft(e);return i||new I(1,1,1,1)}}class uWe extends tA{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:2,id:"deleteWordPartRight",precondition:O.writable,kbOpts:{kbExpr:O.textInputFocus,primary:0,mac:{primary:788},weight:100}})}_delete(e,t){const i=yx.deleteWordPartRight(e);if(i)return i;const s=e.model.getLineCount(),o=e.model.getLineMaxColumn(s);return new I(s,o,s,o)}}class Pse extends eA{_move(e,t,i,s){return yx.moveWordPartLeft(e,t,i)}}class hWe extends Pse{constructor(){super({inSelectionMode:!1,wordNavigationType:0,id:"cursorWordPartLeft",precondition:void 0,kbOpts:{kbExpr:O.textInputFocus,primary:0,mac:{primary:783},weight:100}})}}qt.registerCommandAlias("cursorWordPartStartLeft","cursorWordPartLeft");class fWe extends Pse{constructor(){super({inSelectionMode:!0,wordNavigationType:0,id:"cursorWordPartLeftSelect",precondition:void 0,kbOpts:{kbExpr:O.textInputFocus,primary:0,mac:{primary:1807},weight:100}})}}qt.registerCommandAlias("cursorWordPartStartLeftSelect","cursorWordPartLeftSelect");class Ose extends eA{_move(e,t,i,s){return yx.moveWordPartRight(e,t,i)}}class gWe extends Ose{constructor(){super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordPartRight",precondition:void 0,kbOpts:{kbExpr:O.textInputFocus,primary:0,mac:{primary:785},weight:100}})}}class pWe extends Ose{constructor(){super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordPartRightSelect",precondition:void 0,kbOpts:{kbExpr:O.textInputFocus,primary:0,mac:{primary:1809},weight:100}})}}Re(new dWe);Re(new uWe);Re(new hWe);Re(new fWe);Re(new gWe);Re(new pWe);class K5 extends te{constructor(e){super(),this.editor=e,this._register(this.editor.onDidAttemptReadOnlyEdit(()=>this._onDidAttemptReadOnlyEdit()))}_onDidAttemptReadOnlyEdit(){const e=Sr.get(this.editor);if(e&&this.editor.hasModel()){let t=this.editor.getOptions().get(91);t||(this.editor.isSimpleWidget?t=new Bs(m("editor.simple.readonly","Cannot edit in read-only input")):t=new Bs(m("editor.readonly","Cannot edit in read-only editor"))),e.showMessage(t,this.editor.getPosition())}}}K5.ID="editor.contrib.readOnlyMessageController";ti(K5.ID,K5,2);class q5 extends te{constructor(e){super(),this.editor=e,this.widget=null,uc&&(this._register(e.onDidChangeConfiguration(()=>this.update())),this.update())}update(){const e=!this.editor.getOption(90);!this.widget&&e?this.widget=new iA(this.editor):this.widget&&!e&&(this.widget.dispose(),this.widget=null)}dispose(){super.dispose(),this.widget&&(this.widget.dispose(),this.widget=null)}}q5.ID="editor.contrib.iPadShowKeyboard";class iA extends te{constructor(e){super(),this.editor=e,this._domNode=document.createElement("textarea"),this._domNode.className="iPadShowKeyboard",this._register(ce(this._domNode,"touchstart",t=>{this.editor.focus()})),this._register(ce(this._domNode,"focus",t=>{this.editor.focus()})),this.editor.addOverlayWidget(this)}dispose(){this.editor.removeOverlayWidget(this),super.dispose()}getId(){return iA.ID}getDomNode(){return this._domNode}getPosition(){return{preference:1}}}iA.ID="editor.contrib.ShowKeyboardWidget";ti(q5.ID,q5,3);var mWe=globalThis&&globalThis.__decorate||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},IK=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},G5;let r0=G5=class extends te{static get(e){return e.getContribution(G5.ID)}constructor(e,t,i){super(),this._editor=e,this._languageService=i,this._widget=null,this._register(this._editor.onDidChangeModel(s=>this.stop())),this._register(this._editor.onDidChangeModelLanguage(s=>this.stop())),this._register(nn.onDidChange(s=>this.stop())),this._register(this._editor.onKeyUp(s=>s.keyCode===9&&this.stop()))}dispose(){this.stop(),super.dispose()}launch(){this._widget||this._editor.hasModel()&&(this._widget=new nA(this._editor,this._languageService))}stop(){this._widget&&(this._widget.dispose(),this._widget=null)}};r0.ID="editor.contrib.inspectTokens";r0=G5=mWe([IK(1,la),IK(2,qi)],r0);class _We extends Ue{constructor(){super({id:"editor.action.inspectTokens",label:zO.inspectTokensAction,alias:"Developer: Inspect Tokens",precondition:void 0})}run(e,t){const i=r0.get(t);i==null||i.launch()}}function vWe(n){let e="";for(let t=0,i=n.length;tEb,tokenize:(s,o,r)=>q8(e,r),tokenizeEncoded:(s,o,r)=>px(i,r)}}class nA extends te{constructor(e,t){super(),this.allowEditorOverflow=!0,this._editor=e,this._languageService=t,this._model=this._editor.getModel(),this._domNode=document.createElement("div"),this._domNode.className="tokens-inspect-widget",this._tokenizationSupport=bWe(this._languageService.languageIdCodec,this._model.getLanguageId()),this._compute(this._editor.getPosition()),this._register(this._editor.onDidChangeCursorPosition(i=>this._compute(this._editor.getPosition()))),this._editor.addContentWidget(this)}dispose(){this._editor.removeContentWidget(this),super.dispose()}getId(){return nA._ID}_compute(e){const t=this._getTokensAtLine(e.lineNumber);let i=0;for(let l=t.tokens1.length-1;l>=0;l--){const c=t.tokens1[l];if(e.column-1>=c.offset){i=l;break}}let s=0;for(let l=t.tokens2.length>>>1;l>=0;l--)if(e.column-1>=t.tokens2[l<<1]){s=l;break}const o=this._model.getLineContent(e.lineNumber);let r="";if(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},TK=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},sC;let aT=sC=class{constructor(e,t){this.quickInputService=e,this.keybindingService=t,this.registry=en.as(i_.Quickaccess)}provide(e){const t=new be;return t.add(e.onDidAccept(()=>{const[i]=e.selectedItems;i&&this.quickInputService.quickAccess.show(i.prefix,{preserveValue:!0})})),t.add(e.onDidChangeValue(i=>{const s=this.registry.getQuickAccessProvider(i.substr(sC.PREFIX.length));s&&s.prefix&&s.prefix!==sC.PREFIX&&this.quickInputService.quickAccess.show(s.prefix,{preserveValue:!0})})),e.items=this.getQuickAccessProviders().filter(i=>i.prefix!==sC.PREFIX),t}getQuickAccessProviders(){return this.registry.getQuickAccessProviders().sort((t,i)=>t.prefix.localeCompare(i.prefix)).flatMap(t=>this.createPicks(t))}createPicks(e){return e.helpEntries.map(t=>{const i=t.prefix||e.prefix,s=i||"…";return{prefix:i,label:s,keybinding:t.commandId?this.keybindingService.lookupKeybinding(t.commandId):void 0,ariaLabel:m("helpPickAriaLabel","{0}, {1}",s,t.description),description:t.description}})}};aT.PREFIX="?";aT=sC=CWe([TK(0,yc),TK(1,Di)],aT);en.as(i_.Quickaccess).registerQuickAccessProvider({ctor:aT,prefix:"",helpEntries:[{description:UO.helpQuickAccessActionLabel}]});class Fse{constructor(e){this.options=e,this.rangeHighlightDecorationId=void 0}provide(e,t){var i;const s=new be;e.canAcceptInBackground=!!(!((i=this.options)===null||i===void 0)&&i.canAcceptInBackground),e.matchOnLabel=e.matchOnDescription=e.matchOnDetail=e.sortByLabel=!1;const o=s.add(new Ts);return o.value=this.doProvide(e,t),s.add(this.onDidActiveTextEditorControlChange(()=>{o.value=void 0,o.value=this.doProvide(e,t)})),s}doProvide(e,t){var i;const s=new be,o=this.activeTextEditorControl;if(o&&this.canProvideWithTextEditor(o)){const r={editor:o},a=Hte(o);if(a){let l=(i=o.saveViewState())!==null&&i!==void 0?i:void 0;s.add(a.onDidChangeCursorPosition(()=>{var c;l=(c=o.saveViewState())!==null&&c!==void 0?c:void 0})),r.restoreViewState=()=>{l&&o===this.activeTextEditorControl&&o.restoreViewState(l)},s.add($f(t.onCancellationRequested)(()=>{var c;return(c=r.restoreViewState)===null||c===void 0?void 0:c.call(r)}))}s.add(vt(()=>this.clearDecorations(o))),s.add(this.provideWithTextEditor(r,e,t))}else s.add(this.provideWithoutTextEditor(e,t));return s}canProvideWithTextEditor(e){return!0}gotoLocation({editor:e},t){e.setSelection(t.range),e.revealRangeInCenter(t.range,0),t.preserveFocus||e.focus();const i=e.getModel();i&&"getLineContent"in i&&Yf("".concat(i.getLineContent(t.range.startLineNumber)))}getModel(e){var t;return Vte(e)?(t=e.getModel())===null||t===void 0?void 0:t.modified:e.getModel()}addDecorations(e,t){e.changeDecorations(i=>{const s=[];this.rangeHighlightDecorationId&&(s.push(this.rangeHighlightDecorationId.overviewRulerDecorationId),s.push(this.rangeHighlightDecorationId.rangeHighlightId),this.rangeHighlightDecorationId=void 0);const o=[{range:t,options:{description:"quick-access-range-highlight",className:"rangeHighlight",isWholeLine:!0}},{range:t,options:{description:"quick-access-range-highlight-overview",overviewRuler:{color:sn(rJ),position:Qr.Full}}}],[r,a]=i.deltaDecorations(s,o);this.rangeHighlightDecorationId={rangeHighlightId:r,overviewRulerDecorationId:a}})}clearDecorations(e){const t=this.rangeHighlightDecorationId;t&&(e.changeDecorations(i=>{i.deltaDecorations([t.overviewRulerDecorationId,t.rangeHighlightId],[])}),this.rangeHighlightDecorationId=void 0)}}class sA extends Fse{constructor(){super({canAcceptInBackground:!0})}provideWithoutTextEditor(e){const t=m("cannotRunGotoLine","Open a text editor first to go to a line.");return e.items=[{label:t}],e.ariaLabel=t,te.None}provideWithTextEditor(e,t,i){const s=e.editor,o=new be;o.add(t.onDidAccept(l=>{const[c]=t.selectedItems;if(c){if(!this.isValidLineNumber(s,c.lineNumber))return;this.gotoLocation(e,{range:this.toRange(c.lineNumber,c.column),keyMods:t.keyMods,preserveFocus:l.inBackground}),l.inBackground||t.hide()}}));const r=()=>{const l=this.parsePosition(s,t.value.trim().substr(sA.PREFIX.length)),c=this.getPickLabel(s,l.lineNumber,l.column);if(t.items=[{lineNumber:l.lineNumber,column:l.column,label:c}],t.ariaLabel=c,!this.isValidLineNumber(s,l.lineNumber)){this.clearDecorations(s);return}const d=this.toRange(l.lineNumber,l.column);s.revealRangeInCenter(d,0),this.addDecorations(s,d)};r(),o.add(t.onDidChangeValue(()=>r()));const a=Hte(s);return a&&a.getOptions().get(67).renderType===2&&(a.updateOptions({lineNumbers:"on"}),o.add(vt(()=>a.updateOptions({lineNumbers:"relative"})))),o}toRange(e=1,t=1){return{startLineNumber:e,startColumn:t,endLineNumber:e,endColumn:t}}parsePosition(e,t){const i=t.split(/,|:|#/).map(o=>parseInt(o,10)).filter(o=>!isNaN(o)),s=this.lineCount(e)+1;return{lineNumber:i[0]>0?i[0]:s+i[0],column:i[1]}}getPickLabel(e,t,i){if(this.isValidLineNumber(e,t))return this.isValidColumn(e,t,i)?m("gotoLineColumnLabel","Go to line {0} and character {1}.",t,i):m("gotoLineLabel","Go to line {0}.",t);const s=e.getPosition()||{lineNumber:1,column:1},o=this.lineCount(e);return o>1?m("gotoLineLabelEmptyWithLimit","Current Line: {0}, Character: {1}. Type a line number between 1 and {2} to navigate to.",s.lineNumber,s.column,o):m("gotoLineLabelEmpty","Current Line: {0}, Character: {1}. Type a line number to navigate to.",s.lineNumber,s.column)}isValidLineNumber(e,t){return!t||typeof t!="number"?!1:t>0&&t<=this.lineCount(e)}isValidColumn(e,t,i){if(!i||typeof i!="number")return!1;const s=this.getModel(e);if(!s)return!1;const o={lineNumber:t,column:i};return s.validatePosition(o).equals(o)}lineCount(e){var t,i;return(i=(t=this.getModel(e))===null||t===void 0?void 0:t.getLineCount())!==null&&i!==void 0?i:0}}sA.PREFIX=":";var wWe=globalThis&&globalThis.__decorate||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},yWe=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let Vy=class extends sA{constructor(e){super(),this.editorService=e,this.onDidActiveTextEditorControlChange=We.None}get activeTextEditorControl(){var e;return(e=this.editorService.getFocusedCodeEditor())!==null&&e!==void 0?e:void 0}};Vy=wWe([yWe(0,ai)],Vy);let E6=class Bse extends Ue{constructor(){super({id:Bse.ID,label:tI.gotoLineActionLabel,alias:"Go to Line/Column...",precondition:void 0,kbOpts:{kbExpr:O.focus,primary:2085,mac:{primary:293},weight:100}})}run(e){e.get(yc).quickAccess.show(Vy.PREFIX)}};E6.ID="editor.action.gotoLine";De(E6);en.as(i_.Quickaccess).registerQuickAccessProvider({ctor:Vy,prefix:Vy.PREFIX,helpEntries:[{description:tI.gotoLineActionLabel,commandId:E6.ID}]});const Wse=[void 0,[]];function $R(n,e,t=0,i=0){const s=e;return s.values&&s.values.length>1?SWe(n,s.values,t,i):Vse(n,e,t,i)}function SWe(n,e,t,i){let s=0;const o=[];for(const r of e){const[a,l]=Vse(n,r,t,i);if(typeof a!="number")return Wse;s+=a,o.push(...l)}return[s,LWe(o)]}function Vse(n,e,t,i){const s=fm(e.original,e.originalLowercase,t,n,n.toLowerCase(),i,{firstMatchCanBeWeak:!0,boostFullMatch:!0});return s?[s[0],DS(s)]:Wse}function LWe(n){const e=n.sort((s,o)=>s.start-o.start),t=[];let i;for(const s of e)!i||!kWe(i,s)?(i=s,t.push(s)):(i.start=Math.min(i.start,s.start),i.end=Math.max(i.end,s.end));return t}function kWe(n,e){return!(n.end=0,r=xK(n);let a;const l=n.split(Hse);if(l.length>1)for(const c of l){const d=xK(c),{pathNormalized:u,normalized:h,normalizedLowercase:f}=NK(c);h&&(a||(a=[]),a.push({original:c,originalLowercase:c.toLowerCase(),pathNormalized:u,normalized:h,normalizedLowercase:f,expectContiguousMatch:d}))}return{original:n,originalLowercase:e,pathNormalized:t,normalized:i,normalizedLowercase:s,values:a,containsPathSeparator:o,expectContiguousMatch:r}}function NK(n){let e;zs?e=n.replace(/\//g,sc):e=n.replace(/\\/g,sc);const t=Lve(e).replace(/\s|"/g,"");return{pathNormalized:e,normalized:t,normalizedLowercase:t.toLowerCase()}}function AK(n){return Array.isArray(n)?Y5(n.map(e=>e.original).join(Hse)):Y5(n.original)}var DWe=globalThis&&globalThis.__decorate||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},MK=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},x1=globalThis&&globalThis.__awaiter||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())})},cb;let _d=cb=class extends Fse{constructor(e,t,i=Object.create(null)){super(i),this._languageFeaturesService=e,this._outlineModelService=t,this.options=i,this.options.canAcceptInBackground=!0}provideWithoutTextEditor(e){return this.provideLabelPick(e,m("cannotRunGotoSymbolWithoutEditor","To go to a symbol, first open a text editor with symbol information.")),te.None}provideWithTextEditor(e,t,i){const s=e.editor,o=this.getModel(s);return o?this._languageFeaturesService.documentSymbolProvider.has(o)?this.doProvideWithEditorSymbols(e,o,t,i):this.doProvideWithoutEditorSymbols(e,o,t,i):te.None}doProvideWithoutEditorSymbols(e,t,i,s){const o=new be;return this.provideLabelPick(i,m("cannotRunGotoSymbolWithoutSymbolProvider","The active text editor does not provide symbol information.")),x1(this,void 0,void 0,function*(){!(yield this.waitForLanguageSymbolRegistry(t,o))||s.isCancellationRequested||o.add(this.doProvideWithEditorSymbols(e,t,i,s))}),o}provideLabelPick(e,t){e.items=[{label:t,index:0,kind:14}],e.ariaLabel=t}waitForLanguageSymbolRegistry(e,t){return x1(this,void 0,void 0,function*(){if(this._languageFeaturesService.documentSymbolProvider.has(e))return!0;const i=new rx,s=t.add(this._languageFeaturesService.documentSymbolProvider.onDidChange(()=>{this._languageFeaturesService.documentSymbolProvider.has(e)&&(s.dispose(),i.complete(!0))}));return t.add(vt(()=>i.complete(!1))),i.p})}doProvideWithEditorSymbols(e,t,i,s){var o;const r=e.editor,a=new be;a.add(i.onDidAccept(u=>{const[h]=i.selectedItems;h&&h.range&&(this.gotoLocation(e,{range:h.range.selection,keyMods:i.keyMods,preserveFocus:u.inBackground}),u.inBackground||i.hide())})),a.add(i.onDidTriggerItemButton(({item:u})=>{u&&u.range&&(this.gotoLocation(e,{range:u.range.selection,keyMods:i.keyMods,forceSideBySide:!0}),i.hide())}));const l=this.getDocumentSymbols(t,s);let c;const d=u=>x1(this,void 0,void 0,function*(){c==null||c.dispose(!0),i.busy=!1,c=new Tn(s),i.busy=!0;try{const h=Y5(i.value.substr(cb.PREFIX.length).trim()),f=yield this.doGetSymbolPicks(l,h,void 0,c.token);if(s.isCancellationRequested)return;if(f.length>0){if(i.items=f,u&&h.original.length===0){const g=DE(f,p=>!!(p.type!=="separator"&&p.range&&I.containsPosition(p.range.decoration,u)));g&&(i.activeItems=[g])}}else h.original.length>0?this.provideLabelPick(i,m("noMatchingSymbolResults","No matching editor symbols")):this.provideLabelPick(i,m("noSymbolResults","No editor symbols"))}finally{s.isCancellationRequested||(i.busy=!1)}});return a.add(i.onDidChangeValue(()=>d(void 0))),d((o=r.getSelection())===null||o===void 0?void 0:o.getPosition()),a.add(i.onDidChangeActive(()=>{const[u]=i.activeItems;u&&u.range&&(r.revealRangeInCenter(u.range.selection,0),this.addDecorations(r,u.range.decoration))})),a}doGetSymbolPicks(e,t,i,s){var o,r;return x1(this,void 0,void 0,function*(){const a=yield e;if(s.isCancellationRequested)return[];const l=t.original.indexOf(cb.SCOPE_PREFIX)===0,c=l?1:0;let d,u;t.values&&t.values.length>1?(d=AK(t.values[0]),u=AK(t.values.slice(1))):d=t;let h;const f=(r=(o=this.options)===null||o===void 0?void 0:o.openSideBySideDirection)===null||r===void 0?void 0:r.call(o);f&&(h=[{iconClass:f==="right"?dt.asClassName(Me.splitHorizontal):dt.asClassName(Me.splitVertical),tooltip:f==="right"?m("openToSide","Open to the Side"):m("openToBottom","Open to the Bottom")}]);const g=[];for(let v=0;vc){let T=!1;if(d!==t&&([S,k]=$R(w,Object.assign(Object.assign({},t),{values:void 0}),c,y),typeof S=="number"&&(T=!0)),typeof S!="number"&&([S,k]=$R(w,d,c,y),typeof S!="number"))continue;if(!T&&u){if(L&&u.original.length>0&&([D,x]=$R(L,u)),typeof D!="number")continue;typeof S=="number"&&(S+=D)}}const A=b.tags&&b.tags.indexOf(1)>=0;g.push({index:v,kind:b.kind,score:S,label:w,ariaLabel:vve(b.name,b.kind),description:L,highlights:A?void 0:{label:k,description:x},range:{selection:I.collapseToStart(b.selectionRange),decoration:b.range},strikethrough:A,buttons:h})}const p=g.sort((v,b)=>l?this.compareByKindAndScore(v,b):this.compareByScore(v,b));let _=[];if(l){let w=function(){b&&typeof v=="number"&&C>0&&(b.label=sm(UR[v]||zR,C))},v,b,C=0;for(const y of p)v!==y.kind?(w(),v=y.kind,C=1,b={type:"separator"},_.push(b)):C++,_.push(y);w()}else p.length>0&&(_=[{label:m("symbols","symbols ({0})",g.length),type:"separator"},...p]);return _})}compareByScore(e,t){if(typeof e.score!="number"&&typeof t.score=="number")return 1;if(typeof e.score=="number"&&typeof t.score!="number")return-1;if(typeof e.score=="number"&&typeof t.score=="number"){if(e.score>t.score)return-1;if(e.scoret.index?1:0}compareByKindAndScore(e,t){const i=UR[e.kind]||zR,s=UR[t.kind]||zR,o=i.localeCompare(s);return o===0?this.compareByScore(e,t):o}getDocumentSymbols(e,t){return x1(this,void 0,void 0,function*(){const i=yield this._outlineModelService.getOrCreate(e,t);return t.isCancellationRequested?[]:i.asListOfDocumentSymbols()})}};_d.PREFIX="@";_d.SCOPE_PREFIX=":";_d.PREFIX_BY_CATEGORY="".concat(cb.PREFIX).concat(cb.SCOPE_PREFIX);_d=cb=DWe([MK(0,Ze),MK(1,xN)],_d);const zR=m("property","properties ({0})"),UR={5:m("method","methods ({0})"),11:m("function","functions ({0})"),8:m("_constructor","constructors ({0})"),12:m("variable","variables ({0})"),4:m("class","classes ({0})"),22:m("struct","structs ({0})"),23:m("event","events ({0})"),24:m("operator","operators ({0})"),10:m("interface","interfaces ({0})"),2:m("namespace","namespaces ({0})"),3:m("package","packages ({0})"),25:m("typeParameter","type parameters ({0})"),1:m("modules","modules ({0})"),6:m("property","properties ({0})"),9:m("enum","enumerations ({0})"),21:m("enumMember","enumeration members ({0})"),14:m("string","strings ({0})"),0:m("file","files ({0})"),17:m("array","arrays ({0})"),15:m("number","numbers ({0})"),16:m("boolean","booleans ({0})"),18:m("object","objects ({0})"),19:m("key","keys ({0})"),7:m("field","fields ({0})"),13:m("constant","constants ({0})")};var EWe=globalThis&&globalThis.__decorate||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},jR=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let Z5=class extends _d{constructor(e,t,i){super(t,i),this.editorService=e,this.onDidActiveTextEditorControlChange=We.None}get activeTextEditorControl(){var e;return(e=this.editorService.getFocusedCodeEditor())!==null&&e!==void 0?e:void 0}};Z5=EWe([jR(0,ai),jR(1,Ze),jR(2,xN)],Z5);class GS extends Ue{constructor(){super({id:GS.ID,label:Zw.quickOutlineActionLabel,alias:"Go to Symbol...",precondition:O.hasDocumentSymbolProvider,kbOpts:{kbExpr:O.focus,primary:3117,weight:100},contextMenuOpts:{group:"navigation",order:3}})}run(e){e.get(yc).quickAccess.show(_d.PREFIX,{itemActivation:Bl.NONE})}}GS.ID="editor.action.quickOutline";De(GS);en.as(i_.Quickaccess).registerQuickAccessProvider({ctor:Z5,prefix:_d.PREFIX,helpEntries:[{description:Zw.quickOutlineActionLabel,prefix:_d.PREFIX,commandId:GS.ID},{description:Zw.quickOutlineByCategoryActionLabel,prefix:_d.PREFIX_BY_CATEGORY}]});function KR(n,e){return e&&(n.stack||n.stacktrace)?m("stackTrace.format","{0}: {1}",PK(n),RK(n.stack)||RK(n.stacktrace)):PK(n)}function RK(n){return Array.isArray(n)?n.join("\n"):n}function PK(n){return n.code==="ERR_UNC_HOST_NOT_ALLOWED"?"".concat(n.message,". Please update the 'security.allowedUNCHosts' setting if you want to allow this host."):typeof n.code=="string"&&typeof n.errno=="number"&&typeof n.syscall=="string"?m("nodeExceptionMessage","A system error occurred ({0})",n.message):n.message||m("error.defaultMessage","An unknown error occurred. Please consult the log for more details.")}function $se(n=null,e=!1){if(!n)return m("error.defaultMessage","An unknown error occurred. Please consult the log for more details.");if(Array.isArray(n)){const t=wd(n),i=$se(t[0],e);return t.length>1?m("error.moreErrors","{0} ({1} errors in total)",i,t.length):i}if(Mo(n))return n;if(n.detail){const t=n.detail;if(t.error)return KR(t.error,e);if(t.exception)return KR(t.exception,e)}return n.stack?KR(n,e):n.message?n.message:m("error.defaultMessage","An unknown error occurred. Please consult the log for more details.")}function IWe(n){var e;const t=new Map;for(const i of n)t.set(i,((e=t.get(i))!==null&&e!==void 0?e:0)+1);return t}class qC{constructor(){this.chunkCount=0,this.chunkOccurrences=new Map,this.documents=new Map}calculateScores(e,t){const i=this.computeEmbedding(e),s=new Map,o=[];for(const[r,a]of this.documents){if(t.isCancellationRequested)return[];for(const l of a.chunks){const c=this.computeSimilarityScore(l,i,s);c>0&&o.push({key:r,score:c})}}return o}static termFrequencies(e){return IWe(qC.splitTerms(e))}static*splitTerms(e){const t=i=>i.toLowerCase();for(const[i]of e.matchAll(/\b\p{Letter}[\p{Letter}\d]{2,}\b/gu)){yield t(i);const s=i.split(new RegExp("(?<=[a-z])(?=[A-Z])","g"));if(s.length>1)for(const o of s)o.length>2&&/\p{Letter}{3,}/gu.test(o)&&(yield t(o))}}updateDocuments(e){var t;for(const{key:i}of e)this.deleteDocument(i);for(const i of e){const s=[];for(const o of i.textChunks){const r=qC.termFrequencies(o);for(const a of r.keys())this.chunkOccurrences.set(a,((t=this.chunkOccurrences.get(a))!==null&&t!==void 0?t:0)+1);s.push({text:o,tf:r})}this.chunkCount+=s.length,this.documents.set(i.key,{chunks:s})}return this}deleteDocument(e){const t=this.documents.get(e);if(t){this.documents.delete(e),this.chunkCount-=t.chunks.length;for(const i of t.chunks)for(const s of i.tf.keys()){const o=this.chunkOccurrences.get(s);if(typeof o=="number"){const r=o-1;r<=0?this.chunkOccurrences.delete(s):this.chunkOccurrences.set(s,r)}}}}computeSimilarityScore(e,t,i){let s=0;for(const[o,r]of Object.entries(t)){const a=e.tf.get(o);if(!a)continue;let l=i.get(o);typeof l!="number"&&(l=this.computeIdf(o),i.set(o,l));const c=a*l;s+=c*r}return s}computeEmbedding(e){const t=qC.termFrequencies(e);return this.computeTfidf(t)}computeIdf(e){var t;const i=(t=this.chunkOccurrences.get(e))!==null&&t!==void 0?t:0;return i>0?Math.log((this.chunkCount+1)/i):0}computeTfidf(e){const t=Object.create(null);for(const[i,s]of e){const o=this.computeIdf(i);o>0&&(t[i]=s*o)}return t}}function TWe(n){var e,t;const i=n.slice(0);i.sort((o,r)=>r.score-o.score);const s=(t=(e=i[0])===null||e===void 0?void 0:e.score)!==null&&t!==void 0?t:0;if(s>0)for(const o of i)o.score/=s;return i}var N1=globalThis&&globalThis.__awaiter||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())})},kv;(function(n){n[n.NO_ACTION=0]="NO_ACTION",n[n.CLOSE_PICKER=1]="CLOSE_PICKER",n[n.REFRESH_PICKER=2]="REFRESH_PICKER",n[n.REMOVE_ITEM=3]="REMOVE_ITEM"})(kv||(kv={}));function qR(n){const e=n;return Array.isArray(e.items)}function OK(n){const e=n;return!!e.picks&&e.additionalPicks instanceof Promise}class xWe extends te{constructor(e,t){super(),this.prefix=e,this.options=t}provide(e,t,i){var s;const o=new be;e.canAcceptInBackground=!!(!((s=this.options)===null||s===void 0)&&s.canAcceptInBackground),e.matchOnLabel=e.matchOnDescription=e.matchOnDetail=e.sortByLabel=!1;let r;const a=o.add(new Ts),l=()=>N1(this,void 0,void 0,function*(){const c=a.value=new be;r==null||r.dispose(!0),e.busy=!1,r=new Tn(t);const d=r.token,u=e.value.substr(this.prefix.length).trim(),h=this._getPicks(u,c,d,i),f=(p,_)=>{var v;let b,C;if(qR(p)?(b=p.items,C=p.active):b=p,b.length===0){if(_)return!1;(u.length>0||e.hideInput)&&(!((v=this.options)===null||v===void 0)&&v.noResultsPick)&&(hw(this.options.noResultsPick)?b=[this.options.noResultsPick(u)]:b=[this.options.noResultsPick])}return e.items=b,C&&(e.activeItems=[C]),!0},g=p=>N1(this,void 0,void 0,function*(){let _=!1,v=!1;yield Promise.all([(()=>N1(this,void 0,void 0,function*(){typeof p.mergeDelay=="number"&&(yield jf(p.mergeDelay),d.isCancellationRequested)||v||(_=f(p.picks,!0))}))(),(()=>N1(this,void 0,void 0,function*(){e.busy=!0;try{const b=yield p.additionalPicks;if(d.isCancellationRequested)return;let C,w;qR(p.picks)?(C=p.picks.items,w=p.picks.active):C=p.picks;let y,L;if(qR(b)?(y=b.items,L=b.active):y=b,y.length>0||!_){let S;if(!w&&!L){const k=e.activeItems[0];k&&C.indexOf(k)!==-1&&(S=k)}f({items:[...C,...y],active:w||L||S})}}finally{d.isCancellationRequested||(e.busy=!1),v=!0}}))()])});if(h!==null)if(OK(h))yield g(h);else if(!(h instanceof Promise))f(h);else{e.busy=!0;try{const p=yield h;if(d.isCancellationRequested)return;OK(p)?yield g(p):f(p)}finally{d.isCancellationRequested||(e.busy=!1)}}});return o.add(e.onDidChangeValue(()=>l())),l(),o.add(e.onDidAccept(c=>{const[d]=e.selectedItems;typeof(d==null?void 0:d.accept)=="function"&&(c.inBackground||e.hide(),d.accept(e.keyMods,c))})),o.add(e.onDidTriggerItemButton(({button:c,item:d})=>N1(this,void 0,void 0,function*(){var u,h;if(typeof d.trigger=="function"){const f=(h=(u=d.buttons)===null||u===void 0?void 0:u.indexOf(c))!==null&&h!==void 0?h:-1;if(f>=0){const g=d.trigger(f,e.keyMods),p=typeof g=="number"?g:yield g;if(t.isCancellationRequested)return;switch(p){case kv.NO_ACTION:break;case kv.CLOSE_PICKER:e.hide();break;case kv.REFRESH_PICKER:l();break;case kv.REMOVE_ITEM:{const _=e.items.indexOf(d);if(_!==-1){const v=e.items.slice(),b=v.splice(_,1),C=e.activeItems.filter(y=>y!==b[0]),w=e.keepScrollPosition;e.keepScrollPosition=!0,e.items=v,C&&(e.activeItems=C),e.keepScrollPosition=w}break}}}}}))),o}}var zse=globalThis&&globalThis.__decorate||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},Sp=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},GR=globalThis&&globalThis.__awaiter||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())})},lp,Jn;let Om=lp=class extends xWe{constructor(e,t,i,s,o,r){super(lp.PREFIX,e),this.instantiationService=t,this.keybindingService=i,this.commandService=s,this.telemetryService=o,this.dialogService=r,this.commandsHistory=this._register(this.instantiationService.createInstance(Fm)),this.options=e}_getPicks(e,t,i,s){var o,r,a,l;return GR(this,void 0,void 0,function*(){const c=yield this.getCommandPicks(i);if(i.isCancellationRequested)return[];const d=$f(()=>{const v=new qC;v.updateDocuments(c.map(C=>({key:C.commandId,textChunks:[C.label+(C.commandAlias?" ".concat(C.commandAlias):"")]})));const b=v.calculateScores(e,i);return TWe(b).filter(C=>C.score>lp.TFIDF_THRESHOLD).slice(0,lp.TFIDF_MAX_RESULTS)}),u=[];for(const v of c){const b=(o=lp.WORD_FILTER(e,v.label))!==null&&o!==void 0?o:void 0,C=v.commandAlias&&(r=lp.WORD_FILTER(e,v.commandAlias))!==null&&r!==void 0?r:void 0;if(b||C)v.highlights={label:b,detail:this.options.showAlias?C:void 0},u.push(v);else if(e===v.commandId)u.push(v);else if(e.length>=3){const w=d();if(i.isCancellationRequested)return[];const y=w.find(L=>L.key===v.commandId);y&&(v.tfIdfScore=y.score,u.push(v))}}const h=new Map;for(const v of u){const b=h.get(v.label);b?(v.description=v.commandId,b.description=b.commandId):h.set(v.label,v)}u.sort((v,b)=>{if(v.tfIdfScore&&b.tfIdfScore)return v.tfIdfScore===b.tfIdfScore?v.label.localeCompare(b.label):b.tfIdfScore-v.tfIdfScore;if(v.tfIdfScore)return 1;if(b.tfIdfScore)return-1;const C=this.commandsHistory.peek(v.commandId),w=this.commandsHistory.peek(b.commandId);if(C&&w)return C>w?-1:1;if(C)return-1;if(w)return 1;if(this.options.suggestedCommandIds){const y=this.options.suggestedCommandIds.has(v.commandId),L=this.options.suggestedCommandIds.has(b.commandId);if(y&&L)return 0;if(y)return-1;if(L)return 1}return v.label.localeCompare(b.label)});const f=[];let g=!1,p=!0,_=!!this.options.suggestedCommandIds;for(let v=0;vGR(this,void 0,void 0,function*(){var v;const b=yield this.getAdditionalCommandPicks(c,u,e,i);if(i.isCancellationRequested)return[];const C=b.map(w=>this.toCommandPick(w,s));return p&&((v=C[0])===null||v===void 0?void 0:v.type)!=="separator"&&C.unshift({type:"separator",label:m("suggested","similar commands")}),C}))()}:f})}toCommandPick(e,t){if(e.type==="separator")return e;const i=this.keybindingService.lookupKeybinding(e.commandId),s=i?m("commandPickAriaLabelWithKeybinding","{0}, {1}",e.label,i.getAriaLabel()):e.label;return Object.assign(Object.assign({},e),{ariaLabel:s,detail:this.options.showAlias&&e.commandAlias!==e.label?e.commandAlias:void 0,keybinding:i,accept:()=>GR(this,void 0,void 0,function*(){var o,r;this.commandsHistory.push(e.commandId),this.telemetryService.publicLog2("workbenchActionExecuted",{id:e.commandId,from:(o=t==null?void 0:t.from)!==null&&o!==void 0?o:"quick open"});try{!((r=e.args)===null||r===void 0)&&r.length?yield this.commandService.executeCommand(e.commandId,...e.args):yield this.commandService.executeCommand(e.commandId)}catch(a){bc(a)||this.dialogService.error(m("canNotRun","Command '{0}' resulted in an error",e.label),$se(a))}})})}};Om.PREFIX=">";Om.TFIDF_THRESHOLD=.5;Om.TFIDF_MAX_RESULTS=5;Om.WORD_FILTER=B9(ey,xTe,gee);Om=lp=zse([Sp(1,_t),Sp(2,Di),Sp(3,gn),Sp(4,ra),Sp(5,LS)],Om);let Fm=Jn=class extends te{constructor(e,t){super(),this.storageService=e,this.configurationService=t,this.configuredCommandsHistoryLength=0,this.updateConfiguration(),this.load(),this.registerListeners()}registerListeners(){this._register(this.configurationService.onDidChangeConfiguration(e=>this.updateConfiguration(e)))}updateConfiguration(e){e&&!e.affectsConfiguration("workbench.commandPalette.history")||(this.configuredCommandsHistoryLength=Jn.getConfiguredCommandHistoryLength(this.configurationService),Jn.cache&&Jn.cache.limit!==this.configuredCommandsHistoryLength&&(Jn.cache.limit=this.configuredCommandsHistoryLength,Jn.saveState(this.storageService)))}load(){const e=this.storageService.get(Jn.PREF_KEY_CACHE,0);let t;if(e)try{t=JSON.parse(e)}catch{}const i=Jn.cache=new Dg(this.configuredCommandsHistoryLength,1);if(t){let s;t.usesLRU?s=t.entries:s=t.entries.sort((o,r)=>o.value-r.value),s.forEach(o=>i.set(o.key,o.value))}Jn.counter=this.storageService.getNumber(Jn.PREF_KEY_COUNTER,0,Jn.counter)}push(e){Jn.cache&&(Jn.cache.set(e,Jn.counter++),Jn.saveState(this.storageService))}peek(e){var t;return(t=Jn.cache)===null||t===void 0?void 0:t.peek(e)}static saveState(e){if(!Jn.cache)return;const t={usesLRU:!0,entries:[]};Jn.cache.forEach((i,s)=>t.entries.push({key:s,value:i})),e.store(Jn.PREF_KEY_CACHE,JSON.stringify(t),0,0),e.store(Jn.PREF_KEY_COUNTER,Jn.counter,0,0)}static getConfiguredCommandHistoryLength(e){var t,i;const o=(i=(t=e.getValue().workbench)===null||t===void 0?void 0:t.commandPalette)===null||i===void 0?void 0:i.history;return typeof o=="number"?o:Jn.DEFAULT_COMMANDS_HISTORY_LENGTH}};Fm.DEFAULT_COMMANDS_HISTORY_LENGTH=50;Fm.PREF_KEY_CACHE="commandPalette.mru.cache";Fm.PREF_KEY_COUNTER="commandPalette.mru.counter";Fm.counter=1;Fm=Jn=zse([Sp(0,yl),Sp(1,zt)],Fm);class NWe extends Om{constructor(e,t,i,s,o,r){super(e,t,i,s,o,r)}getCodeEditorCommandPicks(){const e=this.activeTextEditorControl;if(!e)return[];const t=[];for(const i of e.getSupportedActions())t.push({commandId:i.id,commandAlias:i.alias,label:U9(i.label)||i.id});return t}}var AWe=globalThis&&globalThis.__decorate||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},W_=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},FK=globalThis&&globalThis.__awaiter||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 Hy=class extends NWe{get activeTextEditorControl(){var e;return(e=this.codeEditorService.getFocusedCodeEditor())!==null&&e!==void 0?e:void 0}constructor(e,t,i,s,o,r){super({showAlias:!1},e,i,s,o,r),this.codeEditorService=t}getCommandPicks(){return FK(this,void 0,void 0,function*(){return this.getCodeEditorCommandPicks()})}hasAdditionalCommandPicks(){return!1}getAdditionalCommandPicks(){return FK(this,void 0,void 0,function*(){return[]})}};Hy=AWe([W_(0,_t),W_(1,ai),W_(2,Di),W_(3,gn),W_(4,ra),W_(5,LS)],Hy);class YS extends Ue{constructor(){super({id:YS.ID,label:iI.quickCommandActionLabel,alias:"Command Palette",precondition:void 0,kbOpts:{kbExpr:O.focus,primary:59,weight:100},contextMenuOpts:{group:"z_commands",order:1}})}run(e){e.get(yc).quickAccess.show(Hy.PREFIX)}}YS.ID="editor.action.quickCommand";De(YS);en.as(i_.Quickaccess).registerQuickAccessProvider({ctor:Hy,prefix:Hy.PREFIX,helpEntries:[{description:iI.quickCommandHelp,commandId:YS.ID}]});var MWe=globalThis&&globalThis.__decorate||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},V_=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let X5=class extends rg{constructor(e,t,i,s,o,r,a){super(!0,e,t,i,s,o,r,a)}};X5=MWe([V_(1,bt),V_(2,ai),V_(3,Nn),V_(4,_t),V_(5,yl),V_(6,zt)],X5);ti(rg.ID,X5,4);class RWe extends Ue{constructor(){super({id:"editor.action.toggleHighContrast",label:jO.toggleHighContrast,alias:"Toggle High Contrast Theme",precondition:void 0}),this._originalThemeName=null}run(e,t){const i=e.get(la),s=i.getColorTheme();ac(s.type)?(i.setTheme(this._originalThemeName||(Nb(s.type)?sb:Cu)),this._originalThemeName=null):(i.setTheme(Nb(s.type)?Gp:Yp),this._originalThemeName=s.themeName)}}De(RWe);var PWe=Object.defineProperty,lT=Object.getOwnPropertySymbols,Use=Object.prototype.hasOwnProperty,jse=Object.prototype.propertyIsEnumerable,BK=(n,e,t)=>e in n?PWe(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,OWe=(n,e)=>{for(var t in e||(e={}))Use.call(e,t)&&BK(n,t,e[t]);if(lT)for(var t of lT(e))jse.call(e,t)&&BK(n,t,e[t]);return n},FWe=(n,e)=>{var t={};for(var i in n)Use.call(n,i)&&e.indexOf(i)<0&&(t[i]=n[i]);if(n!=null&&lT)for(var i of lT(n))e.indexOf(i)<0&&jse.call(n,i)&&(t[i]=n[i]);return t};function Vo(n){let e=!1;bd(()=>{n(),Fn(()=>{e=!0})}),eh(()=>{e&&n()})}function fg(n,e,t,i={}){if(!nh())return;const{passive:s=!1,capture:o=!1}=i;let r=!1,a=!1;const l=f=>v0(f)?f():ud(f),c=f=>{if(r||a)return;const g=l(f);g&&(g.addEventListener(e,t,{passive:s,capture:o}),r=!0)},d=f=>{if(!r||a)return;const g=l(f);g&&(g.removeEventListener(e,t,{capture:o}),r=!1)};let u;eo(n)&&(u=ht(()=>n.value,(f,g)=>{d(g),c(f)}));const h=()=>{u==null||u(),d(n),a=!0};return Vo(()=>{c(n)}),zm(()=>{d(n)}),$m(()=>{d(n)}),h}function Kse(n,e,t){if(!nh())return;fg(document,e,s=>{const o=v0(n)?n():ud(n);o&&!o.contains(s.target)&&t(s)})}function oA(n){Cd(()=>{n()}),$m(()=>{n()})}function BWe(n){const e=ih();return n in e.provides}function Ho(n){if(!BWe(n))return{index:null,parentProvider:null,bindParent:null};const t=lC(n),{childInstances:i,collect:s,clear:o}=t,r=FWe(t,["childInstances","collect","clear"]),a=ih();return{index:ve(()=>i.indexOf(a)),parentProvider:r,bindParent:d=>{bd(()=>{Fn().then(()=>{s(a,d)})}),zm(()=>{Fn().then(()=>{o(a,d)})})}}}function WWe(n){const e=[],t=i=>{if(i!=null&&i.component){t(i==null?void 0:i.component.subTree);return}Array.isArray(i==null?void 0:i.children)&&i.children.forEach(s=>{ow(s)&&(e.push(s),t(s))})};return t(n),e}function $o(n){const e=ih(),t=Cn([]),i=[],s=ve(()=>t.length),o=()=>{const c=WWe(e.subTree);t.sort((d,u)=>c.indexOf(d.vnode)-c.indexOf(u.vnode))},r=(c,d)=>{t.push(c),i.push(d),o()},a=(c,d)=>{QD(t,c),QD(i,d)};return{length:s,childProviders:i,bindChildren:c=>{MY(n,OWe({childInstances:t,collect:r,clear:a},c))}}}function U0(n){fg(()=>window,"resize",n,{passive:!0}),fg(()=>window,"orientationchange",n,{passive:!0})}function VWe(n,e){const t=se(!1);return ht(n,i=>{e===i&&(t.value=!0)},{immediate:!0}),t}function HWe(n,e){if(n>e)return"horizontal";if(e>n)return"vertical"}function j0(){const n=se(0),e=se(0),t=se(0),i=se(0),s=se(0),o=se(0),r=se(0),a=se(0),l=se(0),c=se(0),d=se(),u=se(!1),h=se(!1),f=se(0),g=se(0);let p=null;const _=()=>{n.value=0,e.value=0,t.value=0,i.value=0,s.value=0,o.value=0,r.value=0,a.value=0,l.value=0,c.value=0,d.value=void 0,u.value=!1,h.value=!1,f.value=0,g.value=0};return{startX:n,startY:e,deltaX:t,deltaY:i,offsetX:s,offsetY:o,prevX:r,prevY:a,moveX:l,moveY:c,direction:d,touching:u,dragging:h,startTime:f,distance:g,resetTouch:_,startTouch:L=>{_();const{clientX:S,clientY:k}=L.touches[0];n.value=S,e.value=k,r.value=S,a.value=k,u.value=!0,f.value=performance.now(),h.value=!1,p&&window.cancelAnimationFrame(p)},moveTouch:L=>{const{clientX:S,clientY:k}=L.touches[0];h.value=!0,t.value=S-n.value,i.value=k-e.value,s.value=Math.abs(t.value),o.value=Math.abs(i.value),g.value=Math.sqrt(s.value**2+o.value**2),l.value=S-r.value,c.value=k-a.value,d.value||(d.value=HWe(s.value,o.value)),r.value=S,a.value=k},endTouch:()=>{u.value=!1,p=window.requestAnimationFrame(()=>{h.value=!1})},isReachTop:L=>hb(L)===0&&i.value>0,isReachBottom:(L,S=1)=>{const{scrollHeight:k,clientHeight:D,scrollTop:x}=L,A=Math.abs(k-x-D);return i.value<0&&A<=S}}}function qse(){const n=se(),e=ih(),t=JY(e.type.name);return n.value="".concat(t,"-").concat(e.uid),n}function Gse(n={}){const{initialWidth:e=0,initialHeight:t=0}=n,i=se(e),s=se(t),o=()=>{nh()&&(i.value=window.innerWidth,s.value=window.innerHeight)};return Vo(o),U0(o),{width:i,height:s}}function Yse(n,e,t={}){const{passive:i=!0,eventName:s,defaultValue:o,emit:r}=t,a=s!=null?s:"onUpdate:".concat(e.toString()),l=()=>n[e]!=null?n[e]:o;if(!i)return ve({get(){return l()},set(d){r?r(a,d):JD(n[a],d)}});const c=se(l());return ht(()=>n[e],()=>{c.value=l()}),ht(()=>c.value,d=>{r?r(a,d):JD(n[a],d)}),c}function $We(){return new Worker(""+new URL("editor.worker-0d50d69b.js",import.meta.url).href)}function zWe(){return new Worker(""+new URL("json.worker-1c455b7b.js",import.meta.url).href)}function UWe(){return new Worker(""+new URL("css.worker-915947ab.js",import.meta.url).href)}function jWe(){return new Worker(""+new URL("html.worker-dc0570f2.js",import.meta.url).href)}function KWe(){return new Worker(""+new URL("ts.worker-4c71b1fc.js",import.meta.url).href)}var qWe=Object.defineProperty,GWe=Object.defineProperties,YWe=Object.getOwnPropertyDescriptors,WK=Object.getOwnPropertySymbols,ZWe=Object.prototype.hasOwnProperty,XWe=Object.prototype.propertyIsEnumerable,VK=(n,e,t)=>e in n?qWe(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,YR=(n,e)=>{for(var t in e||(e={}))ZWe.call(e,t)&&VK(n,t,e[t]);if(WK)for(var t of WK(e))XWe.call(e,t)&&VK(n,t,e[t]);return n},ZR=(n,e)=>GWe(n,YWe(e));self.MonacoEnvironment={getWorker(n,e){return e==="json"?new zWe:e==="css"||e==="scss"||e==="less"?new UWe:e==="html"||e==="handlebars"||e==="razor"?new jWe:e==="typescript"||e==="javascript"?new KWe:new $We}};var QWe=720,JWe=["h","ref","reactive","computed","readonly","watch","watchEffect","watchSyncEffect","watchPostEffect","isRef","unref","toRefs","isProxy","isReactive","isReadonly","onBeforeMount","onMounted","onBeforeUpdate","onUpdated","onBeforeUnmount","onUnmounted","axle"],eVe=et({props:{schema:{type:Object,default:()=>({})},components:{type:Object,default:()=>({})},injects:{type:Object,default:()=>({})},theme:{type:String,default:"vs"},activeTab:{type:String,default:"JSON"},editorFontSize:{type:Number,default:13},onChange:{type:[Function,Array]},"onUpdate:activeTab":{type:[Function,Array]}},setup(n){const e=qD(n.schema),t=se(null),i=Yse(n,"activeTab"),s=se(!0),o=se(["JSON","SCRIPT","CSS"]),{width:r}=Gse(),a=ve(()=>r.value>QWe);let l,c;bd(d),Cd(()=>{l.dispose(),c.dispose()}),ht(()=>[n.theme,n.schema],u);function d(){l=aF.create(t.value,h()),l.addCommand(Kte.CtrlCmd|jte.KeyS,g),lF.registerCompletionItemProvider("javascript",{provideCompletionItems(b,C){const w=b.getWordUntilPosition(C),y={startLineNumber:C.lineNumber,endLineNumber:C.lineNumber,startColumn:w.startColumn,endColumn:w.endColumn};return{suggestions:[...JWe,...Object.keys(n.injects)].map(L=>({label:L,kind:lF.CompletionItemKind.Variable,insertText:L,range:y}))}}})}function u(){const b=h();l.updateOptions(b),l.setValue(b.value),aF.setModelLanguage(l.getModel(),b.language),e.value=n.schema}function h(){var b,C;const w={scrollBeyondLastLine:!1,fontSize:n.editorFontSize,theme:n.theme,automaticLayout:!0,minimap:{enabled:!1}};return i.value==="JSON"?ZR(YR({},w),{value:JSON.stringify(n.schema,null,2),language:"json"}):i.value==="SCRIPT"?ZR(YR({},w),{value:(b=n.schema.code)!=null?b:"function setup() {}",language:"javascript"}):ZR(YR({},w),{value:(C=n.schema.css)!=null?C:"",language:"css"})}function f(b){return JSON.parse(JSON.stringify(b))}function g(){const b=l.getValue();let C="";if(i.value==="JSON"&&(C=b),i.value==="SCRIPT"){const w=f(e.value);w.code=b,C=JSON.stringify(w)}if(i.value==="CSS"){const w=f(e.value);w.css=b,C=JSON.stringify(w)}try{const w=JSON.parse(C);C!==JSON.stringify(e.value)&&JD(n.onChange,w),e.value=w}catch{alert("JSON parse error")}}function p(b){i.value=b,u()}function _(){s.value=!s.value}function v(){return o.value.map(b=>Oe("div",{class:L2("var-schema-repl-tab",[b===i.value,"var-schema-repl-tab-active"]),onClick:()=>p(b)},[b]))}return()=>Oe("div",{class:L2("var-schema-repl",[n.theme==="vs-dark","var-schema-repl-vs-dark"])},[Oe("div",{class:"var-schema-repl-tab-container"},[v()]),Oe("div",{class:"var-schema-repl-editor-container"},[wi(Oe("div",{class:"var-schema-repl-editor",style:{width:a.value?"50%":"100%"},ref:t},null),[[hl,a.value||s.value]]),wi(Oe(bme,{style:{width:a.value?"50%":"100%"},schema:e.value,components:n.components,injects:n.injects},null),[[hl,a.value||!s.value]]),!a.value&&Oe("button",{class:"var-schema-repl-transfer",onClick:_},[s.value?"SHOW PREVIEW":"SHOW EDITOR"])])])}});const Zse={locks:{},zIndex:2e3,enableRipple:!0};Cn(Zse);var Ea=Cn(Zse),tVe=Object.defineProperty,HK=Object.getOwnPropertySymbols,iVe=Object.prototype.hasOwnProperty,nVe=Object.prototype.propertyIsEnumerable,$K=(n,e,t)=>e in n?tVe(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,zK=(n,e)=>{for(var t in e||(e={}))iVe.call(e,t)&&$K(n,t,e[t]);if(HK)for(var t of HK(e))nVe.call(e,t)&&$K(n,t,e[t]);return n},UK=(n,e,t)=>new Promise((i,s)=>{var o=l=>{try{a(t.next(l))}catch(c){s(c)}},r=l=>{try{a(t.throw(l))}catch(c){s(c)}},a=l=>l.done?i(l.value):Promise.resolve(l.value).then(o,r);a((t=t.apply(n,e)).next())});function yi(n,e){return Array.isArray(e)?e.reduce((t,i)=>(t[i]=n[i],t),{}):n[e]}function lt(n,e){const t=e!=null?e:n;return t.install=function(i){const{name:s}=n;s&&i.component(s,n)},t}function sVe(n){const e=XY(n),t=document.createElement("div");return document.body.appendChild(t),{instance:e.mount(t),unmount(){e.unmount(),document.body.removeChild(t)}}}function K0(n,e={},t={}){const i={setup(){return()=>Bc(n,zK(zK({},e),t))}},{unmount:s}=sVe(i);return{unmountInstance:s}}function Xse(n){const e=[];return n.forEach(t=>{if(t.type!==ya){if(t.type===li&&tn(t.children)){t.children.forEach(i=>{e.push(i)});return}e.push(t)}}),e}function Ll(){const n=se(""),e=(s,o,r)=>UK(this,null,function*(){return!tn(s)||!s.length?!0:!(yield Promise.all(s.map(l=>l(o,r)))).some(l=>l!==!0?(n.value=String(l),!0):!1)});return{errorMessage:n,validate:e,resetValidation:()=>{n.value=""},validateWithTrigger:(s,o,r,a,l)=>UK(this,null,function*(){s.includes(o)&&(yield e(r,a,l))&&(n.value="")})}}function oVe(n){fg(()=>window,"hashchange",n),fg(()=>window,"popstate",n)}function u_(){const n=se(!1);return eh(()=>{n.value=!1}),$m(()=>{n.value=!0}),{disabled:n}}const st=Nhe("var"),oe=JD,Xu=Yse;function Se(n){return{type:[Function,Array],default:n}}function or(n,e){return n===!1?null:(n===!0&&e&&(n=e),"var-elevation--".concat(n))}var rVe=Object.defineProperty,aVe=Object.defineProperties,lVe=Object.getOwnPropertyDescriptors,jK=Object.getOwnPropertySymbols,cVe=Object.prototype.hasOwnProperty,dVe=Object.prototype.propertyIsEnumerable,KK=(n,e,t)=>e in n?rVe(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,Qse=(n,e)=>{for(var t in e||(e={}))cVe.call(e,t)&&KK(n,t,e[t]);if(jK)for(var t of jK(e))dVe.call(e,t)&&KK(n,t,e[t]);return n},uVe=(n,e)=>aVe(n,lVe(e));const{n:Jse}=st("ripple"),qK=250;function hVe(n){const{zIndex:e,position:t}=Um(n);n.style.overflow="hidden",n.style.overflowX="hidden",n.style.overflowY="hidden",t==="static"&&(n.style.position="relative"),e==="auto"&&(n.style.zIndex="1")}function fVe(n,e){const{top:t,left:i}=no(n),{clientWidth:s,clientHeight:o}=n,r=Math.sqrt(s**2+o**2)/2,a=r*2,l=e.touches[0].clientX-i,c=e.touches[0].clientY-t,d=(s-r*2)/2,u=(o-r*2)/2,h=l-r,f=c-r;return{x:h,y:f,centerX:d,centerY:u,size:a}}function eoe(n){const e=this._ripple;if(e.removeRipple(),e.disabled||e.tasker||!Ea.enableRipple)return;const t=()=>{e.tasker=null;const{x:i,y:s,centerX:o,centerY:r,size:a}=fVe(this,n),l=document.createElement("div");l.classList.add(Jse()),l.style.opacity="0",l.style.transform="translate(".concat(i,"px, ").concat(s,"px) scale3d(.3, .3, .3)"),l.style.width="".concat(a,"px"),l.style.height="".concat(a,"px"),e.color&&(l.style.backgroundColor=e.color),l.dataset.createdAt=String(performance.now()),hVe(this),this.appendChild(l),window.setTimeout(()=>{l.style.transform="translate(".concat(o,"px, ").concat(r,"px) scale3d(1, 1, 1)"),l.style.opacity=".25"},20)};e.tasker=window.setTimeout(t,30)}function Q5(){const n=this._ripple,e=()=>{const t=this.querySelectorAll(".".concat(Jse()));if(!t.length)return;const i=t[t.length-1],s=qK-performance.now()+Number(i.dataset.createdAt);window.setTimeout(()=>{i.style.opacity="0",window.setTimeout(()=>{var o;return(o=i.parentNode)==null?void 0:o.removeChild(i)},qK)},s)};n.tasker?window.setTimeout(e,30):e()}function toe(){if(!khe()||!Ea.enableRipple)return;const n=this._ripple;n.tasker&&window.clearTimeout(n.tasker),n.tasker=null}function gVe(n,e){var t;n._ripple=uVe(Qse({tasker:null},(t=e.value)!=null?t:{}),{removeRipple:Q5.bind(n)}),n.addEventListener("touchstart",eoe,{passive:!0}),n.addEventListener("touchmove",toe,{passive:!0}),n.addEventListener("dragstart",Q5,{passive:!0}),document.addEventListener("touchend",n._ripple.removeRipple,{passive:!0}),document.addEventListener("touchcancel",n._ripple.removeRipple,{passive:!0}),document.addEventListener("dragend",n._ripple.removeRipple,{passive:!0})}function pVe(n){n.removeEventListener("touchstart",eoe),n.removeEventListener("touchmove",toe),n.removeEventListener("dragstart",Q5),document.removeEventListener("touchend",n._ripple.removeRipple),document.removeEventListener("touchcancel",n._ripple.removeRipple),document.removeEventListener("dragend",n._ripple.removeRipple)}function mVe(n,e){var t,i,s,o,r,a;const l={color:(t=e.value)==null?void 0:t.color,disabled:(i=e.value)==null?void 0:i.disabled};(l.color!==((s=n._ripple)==null?void 0:s.color)||l.disabled!==((o=n._ripple)==null?void 0:o.disabled))&&(n._ripple=Qse({tasker:l.disabled?null:(r=n._ripple)==null?void 0:r.tasker,removeRipple:(a=n._ripple)==null?void 0:a.removeRipple},l))}const _Ve={mounted:gVe,unmounted:pVe,updated:mVe,install(n){n.directive("ripple",this)}};var Ns=_Ve;const ZS={show:Boolean,position:{type:String,default:"center"},transition:String,overlay:{type:Boolean,default:!0},overlayClass:String,overlayStyle:Object,lockScroll:{type:Boolean,default:!0},closeOnClickOverlay:{type:Boolean,default:!0},defaultStyle:{type:Boolean,default:!0},safeArea:Boolean,safeAreaTop:Boolean,teleport:{type:[String,Object,Boolean],default:"body"},onOpen:Se(),onOpened:Se(),onClose:Se(),onClosed:Se(),onClickOverlay:Se(),"onUpdate:show":Se(),onRouteChange:Se()};function ioe(){Object.keys(Ea.locks).length<=0?document.body.classList.remove("var--lock"):document.body.classList.add("var--lock")}function Mk(n){Ea.locks[n]=1,ioe()}function Rk(n){delete Ea.locks[n],ioe()}function XS(n,e){const{uid:t}=ih();e&&ht(e,i=>{i===!1?Rk(t):i===!0&&n()===!0&&Mk(t)}),ht(n,i=>{e&&e()===!1||(i===!0?Mk(t):Rk(t))}),BB(()=>{e&&e()===!1||n()===!0&&Mk(t)}),Cd(()=>{e&&e()===!1||n()===!0&&Rk(t)}),eh(()=>{e&&e()===!1||n()===!0&&Mk(t)}),$m(()=>{e&&e()===!1||n()===!0&&Rk(t)})}function QS(n,e){const t=se(Ea.zIndex);return ht(n,i=>{i&&(Ea.zIndex+=e,t.value=Ea.zIndex)},{immediate:!0}),{zIndex:t}}const noe=Symbol("POPUP_BIND_POPUP_ITEM_KEY");function vVe(){const{bindParent:n,parentProvider:e,index:t}=Ho(noe);return{index:t,popup:e,bindPopup:n}}function bVe(){const{bindChildren:n,childProviders:e,length:t}=$o(noe);return{length:t,popupItems:e,bindPopupItems:n}}var CVe=Object.defineProperty,GK=Object.getOwnPropertySymbols,wVe=Object.prototype.hasOwnProperty,yVe=Object.prototype.propertyIsEnumerable,YK=(n,e,t)=>e in n?CVe(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,SVe=(n,e)=>{for(var t in e||(e={}))wVe.call(e,t)&&YK(n,t,e[t]);if(GK)for(var t of GK(e))yVe.call(e,t)&&YK(n,t,e[t]);return n};const{name:LVe,n:Tl,classes:XR}=st("popup");var soe=et({name:LVe,inheritAttrs:!1,props:ZS,setup(n,{slots:e,attrs:t}){const i=VWe(()=>n.show,!0),{zIndex:s}=QS(()=>n.show,3),{disabled:o}=u_(),{bindPopupItems:r}=bVe();XS(()=>n.show,()=>n.lockScroll),ht(()=>n.show,u=>{oe(u?n.onOpen:n.onClose)}),r({show:ve(()=>n.show)}),oVe(()=>oe(n.onRouteChange));function a(){const{closeOnClickOverlay:u,onClickOverlay:h}=n;oe(h),u&&oe(n["onUpdate:show"],!1)}function l(){const{overlayClass:u="",overlayStyle:h}=n;return Oe("div",{class:XR(Tl("overlay"),u),style:SVe({zIndex:s.value-1},h),onClick:a},null)}function c(){return wi(Oe("div",fn({class:XR(Tl("content"),Tl("--".concat(n.position)),[n.defaultStyle,Tl("--content-background-color")],[n.defaultStyle,Tl("$-elevation--3")],[n.safeArea,Tl("--safe-area")],[n.safeAreaTop,Tl("--safe-area-top")]),style:{zIndex:s.value}},t),[i.value&&oe(e.default)]),[[hl,n.show]])}function d(){return Oe(On,{name:Tl("$-fade"),onAfterEnter:n.onOpened,onAfterLeave:n.onClosed},{default:()=>[wi(Oe("div",{class:XR(Tl("$--box"),Tl()),style:{zIndex:s.value-2}},[n.overlay&&l(),Oe(On,{name:n.transition||Tl("$-pop-".concat(n.position))},{default:()=>[c()]})]),[[hl,n.show]])]})}return()=>{const{teleport:u}=n;return u?Oe(Bd,{to:u,disabled:o.value},{default:()=>[d()]}):d()}}});lt(soe);var gg=soe;const Ss={name:String,size:[Number,String],color:String,namespace:{type:String,default:"var-icon"},transition:{type:[Number,String],default:0},animationClass:String,onClick:Se()};function Oa(n,e){throw Error("Varlet [".concat(n,"]: ").concat(e))}function ZK(n,e){console.warn("Varlet [".concat(n,"]: ").concat(e))}function kVe(n){const{left:e}=no(n);return e+(document.body.scrollLeft||document.documentElement.scrollLeft)}function XK(n){const{top:e}=no(n);return e+(document.body.scrollTop||document.documentElement.scrollTop)}function QR(n){const{transform:e}=Um(n);return+e.slice(e.lastIndexOf(",")+2,e.length-1)}function pg(n){let e=n;for(;e&&!(!e.parentNode||(e=e.parentNode,e===document.body||e===document.documentElement));){const t=/(scroll|auto)/,{overflowY:i,overflow:s}=Um(e);if(t.test(i)||t.test(s))return e}return window}function DVe(n){const e=[];let t=n;for(;!qB(t);)t=pg(t),e.push(t);return e}function ooe(n,e){if(Us(n)){const t=document.querySelector(n);return t||Oa(e,"target element cannot found"),t}if(She(n))return n;Oa(e,'type of prop "target" should be a selector or an element object')}function EVe(){const{width:n,height:e}=no(window);return{vw:n,vh:e,vMin:Math.min(n,e),vMax:Math.max(n,e)}}const roe=n=>Us(n)&&n.endsWith("rem"),IVe=n=>Us(n)&&n.endsWith("em")&&!n.endsWith("rem"),TVe=n=>Us(n)&&n.endsWith("px")||qr(n),xVe=n=>Us(n)&&n.endsWith("%"),aoe=n=>Us(n)&&n.endsWith("vw"),loe=n=>Us(n)&&n.endsWith("vh"),coe=n=>Us(n)&&n.endsWith("vmin"),doe=n=>Us(n)&&n.endsWith("vmax"),NVe=n=>Us(n)&&n.startsWith("calc("),AVe=n=>Us(n)&&n.startsWith("var("),jn=n=>{if(qr(n))return n;if(TVe(n))return+n.replace("px","");if(!nh())return 0;const{vw:e,vh:t,vMin:i,vMax:s}=EVe();if(aoe(n))return+n.replace("vw","")*e/100;if(loe(n))return+n.replace("vh","")*t/100;if(coe(n))return+n.replace("vmin","")*i/100;if(doe(n))return+n.replace("vmax","")*s/100;if(roe(n)){const o=+n.replace("rem",""),r=Um(document.documentElement).fontSize;return o*parseFloat(r)}return Us(n)?Ie(n):0},ri=n=>{if(n!=null)return xVe(n)||aoe(n)||loe(n)||IVe(n)||roe(n)||NVe(n)||AVe(n)||coe(n)||doe(n)?n:"".concat(jn(n),"px")},dr=(n,e=1)=>{if(n==null)return;const t=ri(n),i=t.match(/(vh|%|r?em|px|vw|vmin|vmax)$/)[0];return"".concat(parseFloat(t)*e).concat(i)};function $y(n,{top:e=0,left:t=0,duration:i=300,animation:s}){const o=Date.now(),r=hb(n),a=GB(n);return new Promise(l=>{const c=()=>{const d=(Date.now()-o)/i;if(d<1){const u=r+(e-r)*s(d),h=a+(t-a)*s(d);n.scrollTo(h,u),requestAnimationFrame(c)}else n.scrollTo(t,e),l()};requestAnimationFrame(c)})}function uoe(n){return Object.entries(n!=null?n:{}).reduce((e,[t,i])=>{const s=t.startsWith("--")?t:"--".concat(JY(t));return e[s]=i,e},{})}function cT(n){return n==="start"||n==="end"?"flex-".concat(n):n}var MVe=(n,e,t)=>new Promise((i,s)=>{var o=l=>{try{a(t.next(l))}catch(c){s(c)}},r=l=>{try{a(t.throw(l))}catch(c){s(c)}},a=l=>l.done?i(l.value):Promise.resolve(l.value).then(o,r);a((t=t.apply(n,e)).next())});const{name:RVe,n:PVe,classes:OVe}=st("icon");function FVe(n,e){return q(),ei(m0(n.isURL(n.name)?"img":"i"),{class:B(n.classes(n.n(),[n.namespace!==n.n(),n.namespace],"".concat(n.namespace,"--set"),[n.isURL(n.name),n.n("image"),"".concat(n.namespace,"-").concat(n.nextName)],[n.animateInProgress,n.animationClass==null?n.n("--shrinking"):n.animationClass])),style:Fe({color:n.color,"transition-duration":"".concat(n.toNumber(n.transition),"ms"),width:n.isURL(n.name)?n.toSizeUnit(n.size):null,height:n.isURL(n.name)?n.toSizeUnit(n.size):null,fontSize:n.toSizeUnit(n.size)}),src:n.isURL(n.name)?n.nextName:null,onClick:n.onClick},null,8,["class","style","src","onClick"])}const hoe=et({name:RVe,props:Ss,setup(n){const e=se(""),t=se(!1);ht(()=>n.name,i,{immediate:!0});function i(s,o){return MVe(this,null,function*(){const{transition:r}=n;if(o==null||Ie(r)===0){e.value=s;return}t.value=!0,yield Fn(),setTimeout(()=>{o!=null&&(e.value=s),t.value=!1},Ie(r))})}return{nextName:e,animateInProgress:t,n:PVe,classes:OVe,isURL:Lhe,toNumber:Ie,toSizeUnit:ri}}});hoe.render=FVe;var foe=hoe;lt(foe);var Wn=foe,BVe=Object.defineProperty,QK=Object.getOwnPropertySymbols,WVe=Object.prototype.hasOwnProperty,VVe=Object.prototype.propertyIsEnumerable,JK=(n,e,t)=>e in n?BVe(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,HVe=(n,e)=>{for(var t in e||(e={}))WVe.call(e,t)&&JK(n,t,e[t]);if(QK)for(var t of QK(e))VVe.call(e,t)&&JK(n,t,e[t]);return n};const $Ve=HVe({show:Boolean,title:String,actions:{type:Array,default:()=>[]},closeOnClickAction:{type:Boolean,default:!0},onSelect:Se(),"onUpdate:show":Se()},yi(ZS,["overlay","overlayClass","overlayStyle","lockScroll","closeOnClickOverlay","safeArea","teleport","onOpen","onClose","onOpened","onClosed","onClickOverlay","onRouteChange"]));var goe={dialogTitle:"提示",dialogConfirmButtonText:"确认",dialogCancelButtonText:"取消",actionSheetTitle:"请选择",listLoadingText:"加载中",listFinishedText:"没有更多了",listErrorText:"加载失败",pickerTitle:"请选择",pickerConfirmButtonText:"确认",pickerCancelButtonText:"取消",datePickerMonthDict:{"01":{name:"一月",abbr:"一月"},"02":{name:"二月",abbr:"二月"},"03":{name:"三月",abbr:"三月"},"04":{name:"四月",abbr:"四月"},"05":{name:"五月",abbr:"五月"},"06":{name:"六月",abbr:"六月"},"07":{name:"七月",abbr:"七月"},"08":{name:"八月",abbr:"八月"},"09":{name:"九月",abbr:"九月"},10:{name:"十月",abbr:"十月"},11:{name:"十一月",abbr:"十一月"},12:{name:"十二月",abbr:"十二月"}},datePickerWeekDict:{0:{name:"星期日",abbr:"日"},1:{name:"星期一",abbr:"一"},2:{name:"星期二",abbr:"二"},3:{name:"星期三",abbr:"三"},4:{name:"星期四",abbr:"四"},5:{name:"星期五",abbr:"五"},6:{name:"星期六",abbr:"六"}},datePickerSelected:"个被选择",datePickerHint:"选择日期",paginationItem:"条",paginationPage:"页",paginationJump:"前往",timePickerHint:"选择时间"},zVe={dialogTitle:"Hint",dialogConfirmButtonText:"Confirm",dialogCancelButtonText:"Cancel",actionSheetTitle:"Select One",listLoadingText:"Loading",listFinishedText:"No more",listErrorText:"Load fail",pickerTitle:"Pick it",pickerConfirmButtonText:"Confirm",pickerCancelButtonText:"Cancel",datePickerMonthDict:{"01":{name:"January",abbr:"JAN"},"02":{name:"February",abbr:"FEB"},"03":{name:"March",abbr:"MAR"},"04":{name:"April",abbr:"APR"},"05":{name:"May",abbr:"MAY"},"06":{name:"June",abbr:"JUN"},"07":{name:"July",abbr:"JUL"},"08":{name:"August",abbr:"AUG"},"09":{name:"September",abbr:"SEP"},10:{name:"October",abbr:"OCT"},11:{name:"November",abbr:"NOV"},12:{name:"December",abbr:"DEC"}},datePickerWeekDict:{0:{name:"Sunday",abbr:"S"},1:{name:"Monday",abbr:"M"},2:{name:"Tuesday",abbr:"T"},3:{name:"Wednesday",abbr:"W"},4:{name:"Thursday",abbr:"T"},5:{name:"Friday",abbr:"F"},6:{name:"Saturday",abbr:"S"}},datePickerSelected:" selected",datePickerHint:"SELECT DATE",paginationItem:"",paginationPage:"page",paginationJump:"Go to",timePickerHint:"SELECT TIME"},poe={dialogTitle:"提示",dialogConfirmButtonText:"確認",dialogCancelButtonText:"取消",actionSheetTitle:"請選擇",listLoadingText:"載入中",listFinishedText:"沒有更多了",listErrorText:"載入失敗",pickerTitle:"請選擇",pickerConfirmButtonText:"確認",pickerCancelButtonText:"取消",datePickerMonthDict:{"01":{name:"一月",abbr:"一月"},"02":{name:"二月",abbr:"二月"},"03":{name:"三月",abbr:"三月"},"04":{name:"四月",abbr:"四月"},"05":{name:"五月",abbr:"五月"},"06":{name:"六月",abbr:"六月"},"07":{name:"七月",abbr:"七月"},"08":{name:"八月",abbr:"八月"},"09":{name:"九月",abbr:"九月"},10:{name:"十月",abbr:"十月"},11:{name:"十一月",abbr:"十一月"},12:{name:"十二月",abbr:"十二月"}},datePickerWeekDict:{0:{name:"星期日",abbr:"日"},1:{name:"星期一",abbr:"一"},2:{name:"星期二",abbr:"二"},3:{name:"星期三",abbr:"三"},4:{name:"星期四",abbr:"四"},5:{name:"星期五",abbr:"五"},6:{name:"星期六",abbr:"六"}},datePickerSelected:"個被選擇",paginationItem:"條",paginationPage:"頁",paginationJump:"前往"},UVe=poe,jVe=Object.defineProperty,eq=Object.getOwnPropertySymbols,KVe=Object.prototype.hasOwnProperty,qVe=Object.prototype.propertyIsEnumerable,tq=(n,e,t)=>e in n?jVe(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,iq=(n,e)=>{for(var t in e||(e={}))KVe.call(e,t)&&tq(n,t,e[t]);if(eq)for(var t of eq(e))qVe.call(e,t)&&tq(n,t,e[t]);return n};function moe(){const n={},e=se({}),t=(o,r)=>{r.lang=o,n[o]=r},i=o=>{if(!n[o])return console.warn("The ".concat(o," does not exist. You can mount a language package using the add method")),{};e.value=n[o]};return{packs:n,pack:e,add:t,use:i,merge:(o,r)=>{if(!n[o]){console.warn("The ".concat(o," does not exist. You can mount a language package using the add method"));return}n[o]=iq(iq({},n[o]),r),i(o)}}}const{packs:GVe,pack:Xs,add:_oe,use:voe,merge:YVe}=moe();_oe("zh-CN",goe);voe("zh-CN");var J5={zhCN:goe,enUS:zVe,zhTW:poe,zhHK:UVe,packs:GVe,pack:Xs,add:_oe,use:voe,merge:YVe,useLocale:moe};const{name:ZVe,n:XVe,classes:QVe}=st("action-sheet"),JVe=["onClick"];function eHe(n,e){const t=gt("var-icon"),i=gt("var-popup"),s=hn("ripple");return q(),ei(i,fn({class:n.n("popup-radius"),position:"bottom",show:n.popupShow,overlay:n.overlay,"overlay-class":n.overlayClass,"overlay-style":n.overlayStyle,"lock-scroll":n.lockScroll,"close-on-click-overlay":n.closeOnClickOverlay,teleport:n.teleport,"safe-area":n.safeArea},{"onUpdate:show":n.handlePopupUpdateShow},{onOpen:n.onOpen,onClose:n.onClose,onClosed:n.onClosed,onOpened:n.onOpened,onRouteChange:n.onRouteChange}),{default:Lt(()=>[me("div",fn({class:n.classes(n.n(),n.n("$--box"))},n.$attrs),[xe(n.$slots,"title",{},()=>{var o;return[me("div",{class:B(n.n("title"))},ut((o=n.title)!=null?o:n.pack.actionSheetTitle),3)]}),xe(n.$slots,"actions",{},()=>[(q(!0),re(li,null,ss(n.actions,o=>wi((q(),re("div",{class:B(n.classes(n.n("action-item"),o.className,[o.disabled,n.n("--disabled")])),key:o.name,style:Fe({color:o.color}),onClick:r=>n.handleSelect(o)},[o.icon?(q(),ei(t,{key:0,class:B(n.n("action-icon")),"var-action-sheet-cover":"",namespace:o.namespace,name:o.icon,size:o.iconSize},null,8,["class","namespace","name","size"])):Qe("v-if",!0),me("div",{class:B(n.n("action-name"))},ut(o.name),3)],14,JVe)),[[s,{disabled:o.disabled}]])),128))])],16)]),_:3},16,["class","show","overlay","overlay-class","overlay-style","lock-scroll","close-on-click-overlay","teleport","safe-area","onOpen","onClose","onClosed","onOpened","onRouteChange"])}const boe=et({name:ZVe,directives:{Ripple:Ns},components:{VarPopup:gg,VarIcon:Wn},inheritAttrs:!1,props:$Ve,setup(n){const e=se(!1);ht(()=>n.show,s=>{e.value=s},{immediate:!0});function t(s){if(s.disabled)return;const{closeOnClickAction:o,onSelect:r}=n;oe(r,s),o&&oe(n["onUpdate:show"],!1)}function i(s){oe(n["onUpdate:show"],s)}return{popupShow:e,pack:Xs,n:XVe,classes:QVe,handlePopupUpdateShow:i,handleSelect:t}}});boe.render=eHe;var rA=boe,tHe=Object.defineProperty,nq=Object.getOwnPropertySymbols,iHe=Object.prototype.hasOwnProperty,nHe=Object.prototype.propertyIsEnumerable,sq=(n,e,t)=>e in n?tHe(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,oq=(n,e)=>{for(var t in e||(e={}))iHe.call(e,t)&&sq(n,t,e[t]);if(nq)for(var t of nq(e))nHe.call(e,t)&&sq(n,t,e[t]);return n};let qh,I6={};function sHe(n={}){return oq(oq({},I6),n)}function h_(n){return nh()?new Promise(e=>{h_.close();const t=Cn(sHe(n));t.teleport="body",qh=t;const{unmountInstance:i}=K0(rA,t,{onSelect:s=>{oe(t.onSelect,s),e(s)},onClose:()=>{oe(t.onClose),e("close")},onClosed:()=>{oe(t.onClosed),i(),qh===t&&(qh=null)},onRouteChange:()=>{i(),qh===t&&(qh=null)},"onUpdate:show":s=>{t.show=s}});t.show=!0}):Promise.resolve()}h_.setDefaultOptions=function(n){I6=n};h_.resetDefaultOptions=function(){I6={}};h_.close=function(){if(qh!=null){const n=qh;qh=null,Fn().then(()=>{n.show=!1})}};h_.Component=rA;lt(rA);lt(rA,h_);var e3=h_;const oHe={color:String,textColor:String,title:String,titlePosition:{type:String,default:"left"},elevation:{type:[Boolean,String,Number],default:!0},round:Boolean,image:String,imageLinearGradient:String,safeAreaTop:Boolean},{name:rHe,n:aHe,classes:lHe}=st("app-bar");function cHe(n,e){return q(),re("div",{class:B(n.classes(n.n(),n.n("$--box"),[n.safeAreaTop,n.n("--safe-area-top")],[n.round,n.n("--round")],n.formatElevation(n.elevation,3))),style:Fe(n.rootStyles)},[me("div",{class:B(n.n("toolbar"))},[me("div",{class:B(n.n("left"))},[xe(n.$slots,"left"),n.titlePosition==="left"?(q(),re("div",{key:0,class:B(n.n("title")),style:Fe({paddingLeft:n.paddingLeft})},[xe(n.$slots,"default",{},()=>[Mi(ut(n.title),1)])],6)):Qe("v-if",!0)],2),n.titlePosition==="center"?(q(),re("div",{key:0,class:B(n.n("title"))},[xe(n.$slots,"default",{},()=>[Mi(ut(n.title),1)])],2)):Qe("v-if",!0),me("div",{class:B(n.n("right"))},[n.titlePosition==="right"?(q(),re("div",{key:0,class:B(n.n("title")),style:Fe({paddingRight:n.paddingRight})},[xe(n.$slots,"default",{},()=>[Mi(ut(n.title),1)])],6)):Qe("v-if",!0),xe(n.$slots,"right")],2)],2),xe(n.$slots,"content")],6)}const Coe=et({name:rHe,props:oHe,setup(n,{slots:e}){const t=se(),i=se(),s=ve(()=>{const{image:r,color:a,textColor:l,imageLinearGradient:c}=n;if(r!=null){const d=c?"linear-gradient(".concat(c,"), "):"";return{"background-image":"".concat(d,"url(").concat(r,")"),"background-position":"center center","background-size":"cover"}}return{background:a,color:l}});Vo(o),Cg(o);function o(){t.value=e.left?0:void 0,i.value=e.right?0:void 0}return{rootStyles:s,paddingLeft:t,paddingRight:i,n:aHe,classes:lHe,formatElevation:or}}});Coe.render=cHe;var woe=Coe;lt(woe);var t3=woe;const rq=n=>Us(n)?n.startsWith("data:image")||/\.(png|jpg|gif|jpeg|svg|webp|ico)$/i.test(n):!1,aq=n=>Us(n)?n.startsWith("data:video")||/\.(mp4|webm|ogg)$/.test(n):!1,dHe=n=>{const e=[];return{cache:e,has(t){return this.cache.includes(t)},add(t){this.has(t)||(this.cache.length===n&&e.shift(),this.cache.push(t))},remove(t){this.has(t)&&QD(this.cache,t)},clear(){this.cache.length=0}}},i3=n=>n,lq=n=>n**3,yoe=n=>n<.5?lq(n*2)/2:1-lq((1-n)*2)/2,Bm=(n="",e,t="")=>{if(n.length>=e)return n;const i=e-n.length,s=Math.floor(i/t.length);return t.repeat(s)+t.slice(0,i%t.length)+n};var uHe=Object.defineProperty,cq=Object.getOwnPropertySymbols,hHe=Object.prototype.hasOwnProperty,fHe=Object.prototype.propertyIsEnumerable,dq=(n,e,t)=>e in n?uHe(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,gHe=(n,e)=>{for(var t in e||(e={}))hHe.call(e,t)&&dq(n,t,e[t]);if(cq)for(var t of cq(e))fHe.call(e,t)&&dq(n,t,e[t]);return n},aA=(n,e,t)=>new Promise((i,s)=>{var o=l=>{try{a(t.next(l))}catch(c){s(c)}},r=l=>{try{a(t.throw(l))}catch(c){s(c)}},a=l=>l.done?i(l.value):Promise.resolve(l.value).then(o,r);a((t=t.apply(n,e)).next())});const pHe="background-image",mHe="lazy-loading",_He="lazy-error",uq="lazy-attempt",vHe=["scroll","wheel","mousewheel","resize","animationend","transitionend","touchmove"],n3="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==",a0=[],dT=[],Soe=dHe(100),Ks={loading:n3,error:n3,attempt:3,throttleWait:300,events:vHe};let T6=YB(JS,Ks.throttleWait);function lA(n,e){n._lazy.arg===pHe?n.style.backgroundImage="url(".concat(e,")"):n.setAttribute("src",e)}function bHe(n){n._lazy.loading&&lA(n,n._lazy.loading),JS()}function CHe(n){n._lazy.error&&lA(n,n._lazy.error),n._lazy.state="error",N6(n),JS()}function Loe(n,e){lA(n,e),n._lazy.state="success",N6(n),JS()}function wHe(n){var e;dT.includes(n)||(dT.push(n),(e=Ks.events)==null||e.forEach(t=>{n.addEventListener(t,T6,{passive:!0})}))}function yHe(){dT.forEach(n=>{var e;(e=Ks.events)==null||e.forEach(t=>{n.removeEventListener(t,T6)})}),dT.length=0}function SHe(n,e){var t,i;const s={loading:(t=n.getAttribute(mHe))!=null?t:Ks.loading,error:(i=n.getAttribute(_He))!=null?i:Ks.error,attempt:n.getAttribute(uq)?Number(n.getAttribute(uq)):Ks.attempt};n._lazy=gHe({src:e.value,arg:e.arg,currentAttempt:0,state:"pending",attemptLock:!1},s),lA(n,n3),oe(Ks.filter,n._lazy)}function LHe(n,e){const t=new Image;t.src=e,n._lazy.preloadImage=t,t.addEventListener("load",()=>{n._lazy.attemptLock=!1,Soe.add(e),Loe(n,e)}),t.addEventListener("error",()=>{n._lazy.attemptLock=!1,n._lazy.currentAttempt>=n._lazy.attempt?CHe(n):koe(n)})}function koe(n){if(n._lazy.attemptLock)return;n._lazy.attemptLock=!0,n._lazy.currentAttempt++;const{src:e}=n._lazy;if(Soe.has(e)){Loe(n,e),n._lazy.attemptLock=!1;return}bHe(n),LHe(n,e)}function x6(n){return aA(this,null,function*(){yield Cr(),Ehe(n)&&koe(n)})}function JS(){a0.forEach(n=>x6(n))}function kHe(n){return aA(this,null,function*(){!a0.includes(n)&&a0.push(n),DVe(n).forEach(wHe),yield x6(n)})}function N6(n){QD(a0,n),a0.length===0&&yHe()}function DHe(n,e){const{src:t,arg:i}=n._lazy;return t!==e.value||i!==e.arg}function Doe(n,e){return aA(this,null,function*(){SHe(n,e),yield kHe(n)})}function EHe(n,e){return aA(this,null,function*(){if(!DHe(n,e)){a0.includes(n)&&(yield x6(n));return}yield Doe(n,e)})}function IHe(n={}){const{events:e,loading:t,error:i,attempt:s,throttleWait:o,filter:r}=n;Ks.events=e!=null?e:Ks.events,Ks.loading=t!=null?t:Ks.loading,Ks.error=i!=null?i:Ks.error,Ks.attempt=s!=null?s:Ks.attempt,Ks.throttleWait=o!=null?o:Ks.throttleWait,Ks.filter=r}const THe={mounted:Doe,unmounted:N6,updated:EHe,install(n,e){IHe(e),T6=YB(JS,Ks.throttleWait),n.directive("lazy",this)}};var zy=THe;const xHe={round:{type:Boolean,default:!0},size:{type:[String,Number],default:"normal"},alt:String,color:String,src:String,fit:{type:String,default:"cover"},bordered:Boolean,borderColor:String,loading:String,error:String,lazy:Boolean,hoverable:Boolean,onClick:Se(),onLoad:Se(),onError:Se()},NHe=n=>["mini","small","normal","large"].includes(n),{name:AHe,n:MHe,classes:RHe}=st("avatar"),PHe=["src","alt","lazy-loading","lazy-error"],OHe=["src","alt"];function FHe(n,e){const t=hn("lazy");return q(),re("div",{ref:"avatarElement",class:B(n.classes(n.n(),n.n("$--box"),[n.isInternalSize(n.size),n.n("--".concat(n.size))],[n.round,n.n("--round")],[n.bordered,n.n("--bordered")],[n.hoverable,n.n("--hoverable")])),style:Fe({width:n.isInternalSize(n.size)?void 0:n.toSizeUnit(n.size),height:n.isInternalSize(n.size)?void 0:n.toSizeUnit(n.size),borderColor:n.borderColor,backgroundColor:n.color}),onClick:e[3]||(e[3]=(...i)=>n.handleClick&&n.handleClick(...i))},[n.src?(q(),re(li,{key:0},[n.lazy?wi((q(),re("img",{key:0,class:B(n.n("image")),src:n.src,alt:n.alt,style:Fe({objectFit:n.fit}),"lazy-loading":n.loading,"lazy-error":n.error,onLoad:e[0]||(e[0]=(...i)=>n.handleLoad&&n.handleLoad(...i))},null,46,PHe)),[[t,n.src]]):(q(),re("img",{key:1,class:B(n.n("image")),src:n.src,alt:n.alt,style:Fe({objectFit:n.fit}),onLoad:e[1]||(e[1]=(...i)=>n.handleLoad&&n.handleLoad(...i)),onError:e[2]||(e[2]=(...i)=>n.handleError&&n.handleError(...i))},null,46,OHe))],64)):(q(),re("div",{key:1,ref:"textElement",class:B(n.n("text")),style:Fe({transform:"scale(".concat(n.scale,")")})},[xe(n.$slots,"default")],6))],6)}const Eoe=et({name:AHe,directives:{Lazy:zy},props:xHe,setup(n){const e=se(null),t=se(null),i=se(1);Vo(s),Cg(s);function s(){if(!e.value||!t.value){i.value=1;return}const l=e.value.offsetWidth,c=t.value.offsetWidth;l>c?i.value=1:i.value=l/c}function o(l){const c=l.currentTarget,{lazy:d,onLoad:u,onError:h}=n;d?(c._lazy.state==="success"&&oe(u,l),c._lazy.state==="error"&&oe(h,l)):oe(u,l)}function r(l){oe(n.onError,l)}function a(l){oe(n.onClick,l)}return{avatarElement:e,textElement:t,scale:i,n:MHe,classes:RHe,isInternalSize:NHe,toSizeUnit:ri,handleLoad:o,handleError:r,handleClick:a}}});Eoe.render=FHe;var Ioe=Eoe;lt(Ioe);var s3=Ioe;const BHe={offset:[Number,String],vertical:Boolean},{name:WHe,n:VHe,classes:HHe}=st("avatar-group");function $He(n,e){return q(),re("div",{class:B(n.classes(n.n(),[n.vertical,n.n("--column"),n.n("--row")])),style:Fe(n.rootStyles)},[xe(n.$slots,"default")],6)}const Toe=et({name:WHe,props:BHe,setup(n){return{rootStyles:ve(()=>n.offset==null?{}:{"--avatar-group-offset":ri(n.offset)}),n:VHe,classes:HHe,toSizeUnit:ri}}});Toe.render=$He;var xoe=Toe;lt(xoe);var o3=xoe;const hf={type:{type:String,default:"circle"},radius:[String,Number],size:{type:String,default:"normal"},color:String,description:String,loading:Boolean},{name:zHe,n:UHe,classes:jHe}=st("loading"),KHe=n=>(vg(""),n=n(),bg(),n),qHe=KHe(()=>me("svg",{viewBox:"25 25 50 50"},[me("circle",{cx:"50",cy:"50",r:"20",fill:"none"})],-1)),GHe=[qHe];function YHe(n,e){return q(),re("div",{class:B(n.n())},[n.$slots.default?(q(),re("div",{key:0,class:B(n.classes(n.n("content"),[n.loading,n.n("content--active")]))},[xe(n.$slots,"default"),n.loading?(q(),re("div",{key:0,class:B(n.n("content-mask"))},null,2)):Qe("v-if",!0)],2)):Qe("v-if",!0),n.isShow?(q(),re("div",{key:1,class:B(n.classes(n.n("$--box"),n.n("body"),[n.$slots.default,n.n("inside")]))},[n.type==="circle"?(q(),re("div",{key:0,class:B(n.n("circle"))},[me("span",{class:B(n.classes(n.n("circle-block"),n.n("circle-block--".concat(n.size)))),style:Fe({width:n.multiplySizeUnit(n.radius,2),height:n.multiplySizeUnit(n.radius,2),color:n.color})},GHe,6)],2)):Qe("v-if",!0),(q(!0),re(li,null,ss(n.loadingTypeDict,(t,i)=>(q(),re(li,{key:i},[n.type===i?(q(),re("div",{key:0,class:B(n.classes(n.n(i),n.n("".concat(i,"--").concat(n.size))))},[(q(!0),re(li,null,ss(t,s=>(q(),re("div",{key:s+i,style:Fe({backgroundColor:n.color}),class:B(n.classes(n.n("".concat(i,"-item")),n.n("".concat(i,"-item--").concat(n.size))))},null,6))),128))],2)):Qe("v-if",!0)],64))),128)),n.$slots.description||n.description?(q(),re("div",{key:1,class:B(n.classes(n.n("description"),n.n("description--".concat(n.size)))),style:Fe({color:n.color})},[xe(n.$slots,"description",{},()=>[Mi(ut(n.description),1)])],6)):Qe("v-if",!0)],2)):Qe("v-if",!0)],2)}const Noe=et({name:zHe,props:hf,setup(n,{slots:e}){const t=ve(()=>oe(e.default)?n.loading:!0);return{loadingTypeDict:{wave:5,cube:4,rect:8,disappear:3},isShow:t,n:UHe,classes:jHe,multiplySizeUnit:dr}}});Noe.render=YHe;var Aoe=Noe;lt(Aoe);var l0=Aoe;const ZHe={hovering:{type:Boolean,default:!0}},{name:XHe,n:QHe,classes:JHe}=st("hover-overlay");function e$e(n,e){return q(),re("div",{class:B(n.classes(n.n(),[n.hovering,n.n("--hovering")]))},null,2)}const Moe=et({name:XHe,props:ZHe,setup:()=>({n:QHe,classes:JHe})});Moe.render=e$e;var Roe=Moe;lt(Roe);function Pd(){const n=se(!1);return{hovering:n,handleHovering:t=>{n.value=t}}}var ml=Roe;function Poe(n){if(!n)return!1;const e=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);return!!(n==="desktop"&&e||n==="mobile"&&!e)}function t$e(n){const e=n.getAttribute("style");return e?e.split(";").filter(Boolean).reduce((t,i)=>{const[s,o]=i.split(":").map(r=>r.trim());return t[ZB(s)]=o,t},{}):{}}function i$e(n){const{value:e}=n._hover,t=t$e(n);Object.keys(e).forEach(i=>{const s=ZB(i);e[s]!=null&&t[s]&&(n._hover.rawStyle[s]=t[s])})}function A6(n,e){Object.keys(e).forEach(t=>{const i=e[t];i!=null&&(n.style[t]=i)})}function n$e(n){Object.keys(n._hover.value).forEach(e=>{n._hover.value[e]!=null&&(n.style[e]="")})}function Ooe(n){n$e(n),A6(n,n._hover.rawStyle)}function Foe(){const{value:n}=this._hover;if(this._hover.hovering=!0,v0(n)){n(this._hover.hovering);return}A6(this,n)}function Boe(){if(this._hover.hovering=!1,v0(this._hover.value)){this._hover.value(this._hover.hovering);return}Ooe(this)}function Woe(n,e){var t,i;const{arg:s,value:o}=e;Poe(s)||(n._hover={value:o,hovering:(i=(t=n._hover)==null?void 0:t.hovering)!=null?i:!1,rawStyle:{}},i$e(n),n.addEventListener("mouseenter",Foe),n.addEventListener("mouseleave",Boe))}function Voe(n,e){Poe(e.arg)||(Ooe(n),n.removeEventListener("mouseenter",Foe),n.removeEventListener("mouseleave",Boe))}function s$e(n,e){n._hover&&Voe(n,e)}function o$e(n,e){return!v0(e.value)&&n._hover.hovering}function r$e(n,e){Woe(n,e),o$e(n,e)&&A6(n,e.value)}const a$e={mounted:Woe,unmounted:Voe,beforeUpdate:s$e,updated:r$e,install(n){n.directive("hover",this)}};var Fa=a$e,l$e=Object.defineProperty,c$e=Object.defineProperties,d$e=Object.getOwnPropertyDescriptors,hq=Object.getOwnPropertySymbols,u$e=Object.prototype.hasOwnProperty,h$e=Object.prototype.propertyIsEnumerable,fq=(n,e,t)=>e in n?l$e(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,f$e=(n,e)=>{for(var t in e||(e={}))u$e.call(e,t)&&fq(n,t,e[t]);if(hq)for(var t of hq(e))h$e.call(e,t)&&fq(n,t,e[t]);return n},g$e=(n,e)=>c$e(n,d$e(e));const p$e={type:String,nativeType:{type:String,default:"button"},size:String,loading:Boolean,round:Boolean,block:Boolean,text:Boolean,outline:Boolean,disabled:Boolean,autoLoading:Boolean,ripple:{type:Boolean,default:!0},color:String,textColor:String,elevation:{type:[Boolean,Number,String],default:!0},loadingRadius:[Number,String],loadingType:yi(hf,"type"),loadingSize:yi(hf,"size"),loadingColor:g$e(f$e({},yi(hf,"color")),{default:"currentColor"}),onClick:Se(),onTouchstart:Se()},Hoe=Symbol("BUTTON_GROUP_BIND_BUTTON_KEY");function m$e(){const{bindChildren:n,childProviders:e,length:t}=$o(Hoe);return{length:t,buttons:e,bindButtons:n}}function _$e(){const{bindParent:n,parentProvider:e,index:t}=Ho(Hoe);return{index:t,buttonGroup:e,bindButtonGroup:n}}const{name:v$e,n:b$e,classes:C$e}=st("button"),w$e=["type","disabled"];function y$e(n,e){const t=gt("var-loading"),i=gt("var-hover-overlay"),s=hn("ripple"),o=hn("hover");return wi((q(),re("button",{class:B(n.classes(n.n(),n.n("$--box"),n.n("--".concat(n.states.size)),[n.block,"".concat(n.n("$--flex")," ").concat(n.n("--block")),n.n("$--inline-flex")],[n.disabled,n.n("--disabled")],[n.states.text,"".concat(n.n("--text-".concat(n.states.type))," ").concat(n.n("--text")),"".concat(n.n("--".concat(n.states.type))," ").concat(n.states.elevation)],[n.states.text&&n.disabled,n.n("--text-disabled")],[n.round,n.n("--round")],[n.states.outline,n.n("--outline")])),style:Fe({color:n.states.textColor,background:n.states.color}),type:n.nativeType,disabled:n.disabled,onClick:e[0]||(e[0]=(...r)=>n.handleClick&&n.handleClick(...r)),onTouchstart:e[1]||(e[1]=(...r)=>n.handleTouchstart&&n.handleTouchstart(...r))},[n.loading||n.pending?(q(),ei(t,{key:0,class:B(n.n("loading")),"var-button-cover":"",color:n.loadingColor,type:n.loadingType,size:n.loadingSize,radius:n.loadingRadius},null,8,["class","color","type","size","radius"])):Qe("v-if",!0),me("div",{class:B(n.classes(n.n("content"),[n.loading||n.pending,n.n("--hidden")]))},[xe(n.$slots,"default")],2),Oe(i,{hovering:n.disabled?!1:n.hovering},null,8,["hovering"])],46,w$e)),[[s,{disabled:n.disabled||!n.ripple}],[o,n.handleHovering,"desktop"]])}const $oe=et({name:v$e,components:{VarLoading:l0,VarHoverOverlay:ml},directives:{Ripple:Ns,Hover:Fa},props:p$e,setup(n){const e=se(!1),{buttonGroup:t}=_$e(),{hovering:i,handleHovering:s}=Pd(),o=ve(()=>{if(!t)return{elevation:or(n.elevation,2),type:n.type!=null?n.type:"default",size:n.size!=null?n.size:"normal",color:n.color,text:n.text,textColor:n.textColor,outline:n.outline};const{type:c,size:d,color:u,textColor:h,mode:f}=t;return{elevation:"",type:n.type!=null?n.type:c.value,size:n.size!=null?n.size:d.value,color:n.color!=null?n.color:u.value,textColor:n.textColor!=null?n.textColor:h.value,text:f.value!=="normal",outline:f.value==="outline"}});function r(c){n.autoLoading&&(e.value=!0,c=tn(c)?c:[c],Promise.all(c).then(()=>{e.value=!1}).catch(()=>{e.value=!1}))}function a(c){const{loading:d,disabled:u,onClick:h}=n;!h||d||u||e.value||r(oe(h,c))}function l(c){const{loading:d,disabled:u,onTouchstart:h}=n;!h||d||u||e.value||r(oe(h,c))}return{pending:e,states:o,hovering:i,n:b$e,classes:C$e,handleHovering:s,handleClick:a,handleTouchstart:l}}});$oe.render=y$e;var zoe=$oe;lt(zoe);var ia=zoe;const S$e={visibilityHeight:{type:[Number,String],default:200},duration:{type:Number,default:300},right:[Number,String],elevation:{type:[Boolean,Number,String],default:!0},bottom:[Number,String],target:[String,Object],onClick:Se()},{name:L$e,n:k$e,classes:D$e}=st("back-top");function E$e(n,e){const t=gt("var-icon"),i=gt("var-button");return q(),ei(Bd,{to:"body",disabled:n.disabled},[me("div",fn({class:n.classes(n.n(),[n.show,n.n("--active")]),ref:"backTopEl",style:{right:n.toSizeUnit(n.right),bottom:n.toSizeUnit(n.bottom)}},n.$attrs,{onClick:e[0]||(e[0]=Ia((...s)=>n.handleClick&&n.handleClick(...s),["stop"]))}),[xe(n.$slots,"default",{},()=>[Oe(i,{elevation:n.elevation,type:"primary",round:"","var-back-top-cover":""},{default:Lt(()=>[Oe(t,{name:"chevron-up"})]),_:1},8,["elevation"])])],16)],8,["disabled"])}const Uoe=et({name:L$e,components:{VarButton:ia,VarIcon:Wn},inheritAttrs:!1,props:S$e,setup(n){const e=se(!1),t=se(null),i=se(!0);let s;const o=YB(()=>{e.value=hb(s)>=jn(n.visibilityHeight)},200);bd(()=>{a(),l(),i.value=!1}),eh(l),oA(c);function r(d){oe(n.onClick,d);const u=GB(s);$y(s,{left:u,duration:n.duration,animation:yoe})}function a(){s=n.target?ooe(n.target,"BackTop"):pg(t.value)}function l(){s.addEventListener("scroll",o)}function c(){s.removeEventListener("scroll",o)}return{disabled:i,show:e,backTopEl:t,toSizeUnit:ri,n:k$e,classes:D$e,handleClick:r}}});Uoe.render=E$e;var joe=Uoe;lt(joe);var r3=joe;const I$e={type:{type:String,default:"default"},position:{type:String,default:"right-top"},hidden:Boolean,value:{type:[String,Number],default:0},maxValue:[String,Number],dot:Boolean,icon:yi(Ss,"name"),namespace:yi(Ss,"namespace"),color:String},{name:T$e,n:x$e,classes:N$e}=st("badge");function A$e(n,e){const t=gt("var-icon");return q(),re("div",{class:B(n.classes(n.n(),n.n("$--box")))},[xe(n.$slots,"default"),Oe(On,{name:n.n("$-badge-fade"),persisted:""},{default:Lt(()=>[wi(me("span",fn({class:n.classes(n.n("content"),n.n("--".concat(n.type)),[n.$slots.default,n.n("--".concat(n.position))],[n.dot,n.n("--dot")],[n.icon,n.n("--icon")]),style:{background:n.color}},n.$attrs),[n.icon?(q(),ei(t,{key:0,class:B(n.n("icon")),"var-badge-cover":"",name:n.icon,namespace:n.namespace},null,8,["class","name","namespace"])):Qe("v-if",!0),xe(n.$slots,"value",{},()=>[!n.icon&&!n.dot?(q(),re("span",{key:0,class:B(n.n("value"))},ut(n.value),3)):Qe("v-if",!0)])],16),[[hl,!n.hidden]])]),_:3},8,["name"])],2)}const Koe=et({name:T$e,components:{VarIcon:Wn},inheritAttrs:!1,props:I$e,setup(n){return{value:ve(()=>{const{value:t,maxValue:i}=n;return t!=null&&i!=null&&Ie(t)>Ie(i)?"".concat(i,"+"):t}),n:x$e,classes:N$e}}});Koe.render=A$e;var qoe=Koe;lt(qoe);var uT=qoe;const M$e={active:{type:[Number,String],default:0},zIndex:{type:[Number,String],default:1},fixed:Boolean,border:Boolean,safeArea:Boolean,activeColor:String,inactiveColor:String,fabProps:Object,onChange:Se(),onBeforeChange:Se(),onFabClick:Se(),"onUpdate:active":Se()},Goe=Symbol("BOTTOM_NAVIGATION_BIND_BOTTOM_NAVIGATION_ITEM_KEY");function R$e(){const{childProviders:n,length:e,bindChildren:t}=$o(Goe);return{length:e,bottomNavigationItems:n,bindBottomNavigationItem:t}}var P$e=Object.defineProperty,gq=Object.getOwnPropertySymbols,O$e=Object.prototype.hasOwnProperty,F$e=Object.prototype.propertyIsEnumerable,pq=(n,e,t)=>e in n?P$e(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,mq=(n,e)=>{for(var t in e||(e={}))O$e.call(e,t)&&pq(n,t,e[t]);if(gq)for(var t of gq(e))F$e.call(e,t)&&pq(n,t,e[t]);return n};const{name:B$e,n:W$e,classes:V$e}=st("bottom-navigation"),{n:cA}=st("bottom-navigation-item"),_q=cA("--right-half-space"),vq=cA("--left-half-space"),bq=cA("--right-space"),H$e={type:"primary"};function $$e(n,e){const t=gt("var-button");return q(),re("div",{class:B(n.classes(n.n(),n.n("$--box"),[n.fixed,n.n("--fixed")],[n.border,n.n("--border")],[n.safeArea,n.n("--safe-area")])),ref:"bottomNavigationDom",style:Fe("z-index:".concat(n.zIndex))},[xe(n.$slots,"default"),n.$slots.fab?(q(),ei(t,fn({key:0,class:n.classes(n.n("fab"),[n.length%2,n.n("--fab-right"),n.n("--fab-center")]),"var-bottom-navigation__fab":"",onClick:n.handleFabClick},n.fabProps,{round:""}),{default:Lt(()=>[xe(n.$slots,"fab")]),_:3},16,["class","onClick"])):Qe("v-if",!0)],6)}const Yoe=et({name:B$e,components:{VarButton:ia},props:M$e,setup(n,{slots:e}){const t=se(null),i=ve(()=>n.active),s=ve(()=>n.activeColor),o=ve(()=>n.inactiveColor),r=se({}),{length:a,bottomNavigationItems:l,bindBottomNavigationItem:c}=R$e();c({active:i,activeColor:s,inactiveColor:o,onToggle:p}),ht(()=>a.value,u),ht(()=>n.fabProps,S=>{r.value=mq(mq({},H$e),S)},{immediate:!0,deep:!0}),Vo(()=>{e.fab&&C(a.value)}),Cg(()=>{b(),e.fab&&C(a.value)});function u(){a.value===0||h()||f()||g()}function h(){return l.find(({name:S})=>i.value===S.value)}function f(){return l.find(({index:S})=>i.value===S.value)}function g(){qr(i.value)&&(i.value<0?oe(n["onUpdate:active"],0):i.value>a.value-1&&oe(n["onUpdate:active"],a.value-1))}function p(S){i.value!==S&&(n.onBeforeChange?_(S):v(S))}function _(S){const k=qk(oe(n.onBeforeChange,S));Promise.all(k).then(D=>{D.every(Boolean)&&v(S)})}function v(S){oe(n["onUpdate:active"],S),oe(n.onChange,S)}function b(){y().forEach(k=>{k.classList.remove(_q,vq,bq)})}function C(S){const k=y(),D=k.length,x=S%2===0;k.forEach((A,T)=>{w(x,A,T,D)})}function w(S,k,D,x){const A=D===x-1;if(!S&&A){k.classList.add(bq);return}const T=D===x/2-1,P=D===x/2;T?k.classList.add(_q):P&&k.classList.add(vq)}function y(){return Array.from(t.value.querySelectorAll(".".concat(cA())))}function L(){oe(n.onFabClick)}return{length:a,bottomNavigationDom:t,fabProps:r,n:W$e,classes:V$e,handleFabClick:L}}});Yoe.render=$$e;var Zoe=Yoe;lt(Zoe);var a3=Zoe;const z$e={name:String,label:String,icon:yi(Ss,"name"),namespace:yi(Ss,"namespace"),badge:{type:[Boolean,Object],default:!1},onClick:Se()};function U$e(){const{parentProvider:n,index:e,bindParent:t}=Ho(Goe);return t||Oa("BottomNavigationItem"," must in "),{index:e,bottomNavigation:n,bindBottomNavigation:t}}const{name:j$e,n:K$e,classes:q$e}=st("bottom-navigation-item"),G$e={type:"danger",dot:!0};function Y$e(n,e){const t=gt("var-icon"),i=gt("var-badge"),s=hn("ripple");return wi((q(),re("button",{class:B(n.classes(n.n(),n.n("$--box"),[n.active===n.index||n.active===n.name,n.n("--active")])),style:Fe({color:n.computeColorStyle()}),onClick:e[0]||(e[0]=(...o)=>n.handleClick&&n.handleClick(...o))},[n.icon&&!n.$slots.icon?(q(),ei(t,{key:0,name:n.icon,namespace:n.namespace,class:B(n.n("icon")),"var-bottom-navigation-item-cover":""},null,8,["name","namespace","class"])):Qe("v-if",!0),xe(n.$slots,"icon",{active:n.active===n.index||n.active===n.name}),n.badge?(q(),ei(i,fn({key:1},n.badgeProps,{class:n.n("badge"),"var-bottom-navigation-item-cover":""}),null,16,["class"])):Qe("v-if",!0),me("span",{class:B(n.n("label"))},[n.$slots.default?Qe("v-if",!0):(q(),re(li,{key:0},[Mi(ut(n.label),1)],64)),xe(n.$slots,"default")],2)],6)),[[s]])}const Xoe=et({name:j$e,components:{VarBadge:uT,VarIcon:Wn},directives:{Ripple:Ns},props:z$e,setup(n){const e=ve(()=>n.name),t=ve(()=>n.badge),i=se({}),{index:s,bottomNavigation:o,bindBottomNavigation:r}=U$e(),{active:a,activeColor:l,inactiveColor:c}=o;r({name:e,index:s}),ht(()=>t.value,f=>{i.value=f===!0?G$e:t.value},{immediate:!0});function u(){return a.value===e.value||a.value===s.value?l.value:c.value}function h(){var f;const g=(f=e.value)!=null?f:s.value;oe(n.onClick,g),oe(o.onToggle,g)}return{index:s,active:a,badge:t,badgeProps:i,n:K$e,classes:q$e,computeColorStyle:u,handleClick:h}}});Xoe.render=Y$e;var Qoe=Xoe;lt(Qoe);var l3=Qoe;const Z$e={separator:String,onClick:Se()},Joe=Symbol("BREADCRUMBS_BIND_BREADCRUMB_KEY");function X$e(){const{childProviders:n,bindChildren:e,length:t}=$o(Joe);return{length:t,breadcrumbList:n,bindBreadcrumbList:e}}function Q$e(){const{parentProvider:n,bindParent:e,index:t}=Ho(Joe);return e||Oa("Breadcrumb"," must in "),{index:t,breadcrumb:n,bindBreadcrumb:e}}const{name:J$e,n:eze,classes:tze}=st("breadcrumb");function ize(n,e){return q(),re("div",{class:B(n.n())},[me("div",{class:B(n.classes(n.n("content"),[!n.isLast,n.n("--active")])),onClick:e[0]||(e[0]=(...t)=>n.handleClick&&n.handleClick(...t))},[xe(n.$slots,"default")],2),n.isLast?Qe("v-if",!0):xe(n.$slots,"separator",{key:0},()=>{var t;return[me("div",{class:B(n.n("separator"))},ut((t=n.separator)!=null?t:n.parentSeparator),3)]})],2)}const ere=et({name:J$e,props:Z$e,setup(n){const{index:e,breadcrumb:t,bindBreadcrumb:i}=Q$e(),s=ve(()=>e.value===t.length.value-1),o=ve(()=>t.separator.value);i(null);function r(a){s.value||oe(n.onClick,a)}return{n:eze,classes:tze,isLast:s,parentSeparator:o,handleClick:r}}});ere.render=ize;var tre=ere;lt(tre);var c3=tre;const nze={separator:{type:String,default:"/"}},{name:sze,n:oze}=st("breadcrumbs");function rze(n,e){return q(),re("div",{class:B(n.n())},[xe(n.$slots,"default")],2)}const ire=et({name:sze,props:nze,setup(n){const e=ve(()=>n.separator),{bindBreadcrumbList:t,length:i}=X$e();return t({length:i,separator:e}),{n:oze}}});ire.render=rze;var nre=ire;lt(nre);var d3=nre;const aze={type:{type:String,default:"default"},size:{type:String,default:"normal"},color:String,textColor:String,mode:{type:String,default:"normal"},elevation:{type:[Boolean,Number,String],default:!0},vertical:Boolean},{name:lze,n:cze,classes:dze}=st("button-group");function uze(n,e){return q(),re("div",{class:B(n.classes(n.n(),n.n("$--box"),[n.mode,"".concat(n.n("--mode-".concat(n.mode)))],[n.vertical,n.n("--vertical"),n.n("--horizontal")],[n.mode==="normal",n.formatElevation(n.elevation,2)]))},[xe(n.$slots,"default")],2)}const sre=et({name:lze,props:aze,setup(n){const{bindButtons:e}=m$e(),t={elevation:ve(()=>n.elevation),type:ve(()=>n.type),size:ve(()=>n.size),color:ve(()=>n.color),textColor:ve(()=>n.textColor),mode:ve(()=>n.mode)};return e(t),{n:cze,classes:dze,formatElevation:or}}});sre.render=uze;var ore=sre;lt(ore);var u3=ore;const hze={src:String,fit:{type:String,default:"cover"},imageHeight:[String,Number],imageWidth:[String,Number],outline:Boolean,layout:{type:String,default:"column"},floating:Boolean,floatingDuration:{type:Number,default:250},alt:String,title:String,subtitle:String,description:String,elevation:{type:[Boolean,Number,String],default:!0},ripple:Boolean,onClick:Se(),"onUpdate:floating":Se()};var Cq=(n,e,t)=>new Promise((i,s)=>{var o=l=>{try{a(t.next(l))}catch(c){s(c)}},r=l=>{try{a(t.throw(l))}catch(c){s(c)}},a=l=>l.done?i(l.value):Promise.resolve(l.value).then(o,r);a((t=t.apply(n,e)).next())});const{name:fze,n:gze,classes:pze}=st("card"),mze=500,_ze=["src","alt"];function vze(n,e){const t=gt("var-icon"),i=gt("var-button"),s=hn("ripple");return wi((q(),re("div",{ref:"card",class:B(n.classes(n.n(),[n.isRow,n.n("--layout-row")],[n.outline,n.n("--outline")],n.formatElevation(n.elevation,1))),style:Fe({zIndex:n.floated?n.zIndex:void 0}),onClick:e[0]||(e[0]=(...o)=>n.handleClick&&n.handleClick(...o))},[me("div",{ref:"cardFloater",class:B(n.n("floater")),style:Fe({width:n.floaterWidth,height:n.floaterHeight,top:n.floaterTop,left:n.floaterLeft,overflow:n.floaterOverflow,position:n.floaterPosition,transition:n.floated?"background-color ".concat(n.floatingDuration,"ms, color ").concat(n.floatingDuration,"ms, width ").concat(n.floatingDuration,"ms, height ").concat(n.floatingDuration,"ms, top ").concat(n.floatingDuration,"ms, left ").concat(n.floatingDuration,"ms"):void 0})},[xe(n.$slots,"image",{},()=>[n.src?(q(),re("img",{key:0,class:B(n.n("image")),style:Fe({objectFit:n.fit,height:n.toSizeUnit(n.imageHeight),width:n.toSizeUnit(n.imageWidth)}),src:n.src,alt:n.alt},null,14,_ze)):Qe("v-if",!0)]),me("div",{class:B(n.n("container"))},[xe(n.$slots,"title",{},()=>[n.title?(q(),re("div",{key:0,class:B(n.n("title"))},ut(n.title),3)):Qe("v-if",!0)]),xe(n.$slots,"subtitle",{},()=>[n.subtitle?(q(),re("div",{key:0,class:B(n.n("subtitle"))},ut(n.subtitle),3)):Qe("v-if",!0)]),xe(n.$slots,"description",{},()=>[n.description?(q(),re("div",{key:0,class:B(n.n("description"))},ut(n.description),3)):Qe("v-if",!0)]),n.$slots.extra?(q(),re("div",{key:0,class:B(n.n("footer"))},[xe(n.$slots,"extra")],2)):Qe("v-if",!0),n.$slots["floating-content"]&&!n.isRow?(q(),re("div",{key:1,class:B(n.n("floating-content")),style:Fe({height:n.contentHeight,opacity:n.opacity,transition:"opacity ".concat(n.floatingDuration*2,"ms")})},[xe(n.$slots,"floating-content")],6)):Qe("v-if",!0)],2),n.showFloatingButtons?(q(),re("div",{key:0,class:B(n.classes(n.n("floating-buttons"),n.n("$--box"))),style:Fe({zIndex:n.zIndex,opacity:n.opacity,transition:"opacity ".concat(n.floatingDuration*2,"ms")})},[xe(n.$slots,"close-button",{},()=>[Oe(i,{"var-card-cover":"",round:"",class:B(n.classes(n.n("close-button"),n.n("$-elevation--6"))),onClick:Ia(n.close,["stop"])},{default:Lt(()=>[Oe(t,{"var-card-cover":"",name:"window-close",class:B(n.n("close-button-icon"))},null,8,["class"])]),_:1},8,["class","onClick"])])],6)):Qe("v-if",!0)],6),me("div",{class:B(n.n("holder")),style:Fe({width:n.holderWidth,height:n.holderHeight})},null,6)],6)),[[s,{disabled:!n.ripple||n.floater}]])}const rre=et({name:fze,directives:{Ripple:Ns},components:{VarIcon:Wn,VarButton:ia},props:hze,setup(n){const e=se(null),t=se(null),i=se("auto"),s=se("auto"),o=se("100%"),r=se("100%"),a=se("auto"),l=se("auto"),c=se(void 0),d=se("hidden"),u=se("0px"),h=se("0"),f=ve(()=>n.layout==="row"),g=se(!1),p=se(!1),{zIndex:_}=QS(()=>n.floating,1);let v="auto",b="auto",C=null;const w=se(null);XS(()=>n.floating,()=>!f.value),ht(()=>n.floating,D=>{f.value||Fn(()=>{D?y():L()})},{immediate:!0});function y(){return Cq(this,null,function*(){clearTimeout(w.value),clearTimeout(C),w.value=null,w.value=setTimeout(()=>Cq(this,null,function*(){const{width:D,height:x,left:A,top:T}=no(e.value);i.value=ri(D),s.value=ri(x),o.value=i.value,r.value=s.value,a.value=ri(T),l.value=ri(A),c.value="fixed",v=a.value,b=l.value,g.value=!0,yield Cr(),a.value="0",l.value="0",o.value="100vw",r.value="100vh",u.value="auto",h.value="1",d.value="auto",p.value=!0}),n.ripple?mze:0)})}function L(){clearTimeout(C),clearTimeout(w.value),w.value=null,o.value=i.value,r.value=s.value,a.value=v,l.value=b,u.value="0px",h.value="0",g.value=!1,C=setTimeout(()=>{i.value="auto",s.value="auto",o.value="100%",r.value="100%",a.value="auto",l.value="auto",v="auto",b="auto",d.value="hidden",c.value=void 0,p.value=!1},n.floatingDuration)}function S(){oe(n["onUpdate:floating"],!1)}function k(D){oe(n.onClick,D)}return{card:e,cardFloater:t,holderWidth:i,holderHeight:s,floater:w,floaterWidth:o,floaterHeight:r,floaterTop:a,floaterLeft:l,floaterPosition:c,floaterOverflow:d,contentHeight:u,opacity:h,zIndex:_,isRow:f,showFloatingButtons:g,floated:p,n:gze,classes:pze,toSizeUnit:ri,close:S,formatElevation:or,handleClick:k}}});rre.render=vze;var are=rre;lt(are);var h3=are;const bze={title:[Number,String],icon:yi(Ss,"name"),namespace:yi(Ss,"namespace"),description:String,border:Boolean,borderOffset:[Number,String],iconClass:String,titleClass:String,descriptionClass:String,extraClass:String,ripple:Boolean,onClick:Se()},{name:Cze,n:wze,classes:yze}=st("cell");function Sze(n,e){const t=gt("var-icon"),i=hn("ripple");return wi((q(),re("div",{class:B(n.classes(n.n(),[n.border,n.n("--border")],[n.onClick,n.n("--cursor")])),style:Fe(n.borderOffsetStyles),onClick:e[0]||(e[0]=(...s)=>n.handleClick&&n.handleClick(...s))},[xe(n.$slots,"icon",{},()=>[n.icon?(q(),re("div",{key:0,class:B(n.classes(n.n("icon"),n.iconClass))},[Oe(t,{name:n.icon,namespace:n.namespace},null,8,["name","namespace"])],2)):Qe("v-if",!0)]),me("div",{class:B(n.n("content"))},[xe(n.$slots,"default",{},()=>[n.title?(q(),re("div",{key:0,class:B(n.classes(n.n("title"),n.titleClass))},ut(n.title),3)):Qe("v-if",!0)]),xe(n.$slots,"description",{},()=>[n.description?(q(),re("div",{key:0,class:B(n.classes(n.n("description"),n.descriptionClass))},ut(n.description),3)):Qe("v-if",!0)])],2),n.$slots.extra?(q(),re("div",{key:0,class:B(n.classes(n.n("extra"),n.extraClass))},[xe(n.$slots,"extra")],2)):Qe("v-if",!0)],6)),[[i,{disabled:!n.ripple}]])}const lre=et({name:Cze,components:{VarIcon:Wn},directives:{Ripple:Ns},props:bze,setup(n){const e=ve(()=>n.borderOffset==null?{}:{"--cell-border-left":ri(n.borderOffset),"--cell-border-right":ri(n.borderOffset)});function t(i){oe(n.onClick,i)}return{borderOffsetStyles:e,n:wze,classes:yze,toSizeUnit:ri,handleClick:t}}});lre.render=Sze;var cre=lre;lt(cre);var hT=cre;const Lze={errorMessage:{type:String,default:""},extraMessage:{type:String,default:""}},{name:kze,n:Dze}=st("form-details"),Eze={key:0},Ize={key:0};function Tze(n,e){return q(),ei(On,{name:n.n()},{default:Lt(()=>[n.errorMessage||n.extraMessage||n.$slots["extra-message"]?(q(),re("div",{key:0,class:B(n.n())},[me("div",{class:B(n.n("error-message"))},[Oe(On,{name:n.n("message")},{default:Lt(()=>[n.errorMessage?(q(),re("div",Eze,ut(n.errorMessage),1)):Qe("v-if",!0)]),_:1},8,["name"])],2),me("div",{class:B(n.n("extra-message"))},[Oe(On,{name:n.n("message")},{default:Lt(()=>[xe(n.$slots,"extra-message",{},()=>[n.extraMessage?(q(),re("div",Ize,ut(n.extraMessage),1)):Qe("v-if",!0)])]),_:3},8,["name"])],2)],2)):Qe("v-if",!0)]),_:3},8,["name"])}const dre=et({name:kze,props:Lze,setup:()=>({n:Dze})});dre.render=Tze;var ure=dre;lt(ure);var na=ure;const xze={modelValue:{type:[String,Number,Boolean,Object,Array],default:!1},checkedValue:{type:[String,Number,Boolean,Object,Array],default:!0},uncheckedValue:{type:[String,Number,Boolean,Object,Array],default:!1},checkedColor:String,uncheckedColor:String,disabled:Boolean,readonly:Boolean,indeterminate:Boolean,iconSize:[String,Number],ripple:{type:Boolean,default:!0},validateTrigger:{type:Array,default:()=>["onChange"]},rules:Array,onClick:Se(),onChange:Se(),"onUpdate:modelValue":Se(),"onUpdate:indeterminate":Se()},hre=Symbol("CHECKBOX_GROUP_BIND_CHECKBOX_KEY");function Nze(){const{bindChildren:n,childProviders:e,length:t}=$o(hre);return{length:t,checkboxes:e,bindCheckboxes:n}}function Aze(){const{bindParent:n,parentProvider:e,index:t}=Ho(hre);return{index:t,checkboxGroup:e,bindCheckboxGroup:n}}var Mze=Object.defineProperty,Rze=Object.defineProperties,Pze=Object.getOwnPropertyDescriptors,wq=Object.getOwnPropertySymbols,Oze=Object.prototype.hasOwnProperty,Fze=Object.prototype.propertyIsEnumerable,yq=(n,e,t)=>e in n?Mze(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,Bze=(n,e)=>{for(var t in e||(e={}))Oze.call(e,t)&&yq(n,t,e[t]);if(wq)for(var t of wq(e))Fze.call(e,t)&&yq(n,t,e[t]);return n},Wze=(n,e)=>Rze(n,Pze(e));const fre=Symbol("FORM_BIND_FORM_ITEM_KEY");function kl(){const{parentProvider:n,index:e,bindParent:t}=Ho(fre),i=ih();return{index:e,form:n,bindForm:t?o=>{t(Wze(Bze({},o),{instance:i}))}:null}}function Vze(){const{childProviders:n,length:e,bindChildren:t}=$o(fre);return{length:e,formItems:n,bindFormItems:t}}const{name:Hze,n:$ze,classes:zze}=st("checkbox");function Uze(n,e){const t=gt("var-icon"),i=gt("var-hover-overlay"),s=gt("var-form-details"),o=hn("hover"),r=hn("ripple");return q(),re("div",{class:B(n.n("wrap")),onClick:e[0]||(e[0]=(...a)=>n.handleClick&&n.handleClick(...a))},[me("div",{class:B(n.n())},[wi((q(),re("div",{class:B(n.classes(n.n("action"),[n.checked||n.isIndeterminate,n.n("--checked"),n.n("--unchecked")],[n.errorMessage||n.checkboxGroupErrorMessage,n.n("--error")],[n.formDisabled||n.disabled,n.n("--disabled")])),style:Fe({color:n.checked||n.isIndeterminate?n.checkedColor:n.uncheckedColor})},[n.isIndeterminate?xe(n.$slots,"indeterminate-icon",{key:0},()=>[Oe(t,{class:B(n.classes(n.n("icon"),[n.withAnimation,n.n("--with-animation")])),name:"minus-box",size:n.iconSize,"var-checkbox-cover":""},null,8,["class","size"])]):Qe("v-if",!0),n.checked&&!n.isIndeterminate?xe(n.$slots,"checked-icon",{key:1},()=>[Oe(t,{class:B(n.classes(n.n("icon"),[n.withAnimation,n.n("--with-animation")])),name:"checkbox-marked",size:n.iconSize,"var-checkbox-cover":""},null,8,["class","size"])]):Qe("v-if",!0),!n.checked&&!n.isIndeterminate?xe(n.$slots,"unchecked-icon",{key:2},()=>[Oe(t,{class:B(n.classes(n.n("icon"),[n.withAnimation,n.n("--with-animation")])),name:"checkbox-blank-outline",size:n.iconSize,"var-checkbox-cover":""},null,8,["class","size"])]):Qe("v-if",!0),Oe(i,{hovering:!n.disabled&&!n.formDisabled&&n.hovering},null,8,["hovering"])],6)),[[o,n.handleHovering,"desktop"],[r,{disabled:n.formReadonly||n.readonly||n.formDisabled||n.disabled||!n.ripple}]]),me("div",{class:B(n.classes(n.n("text"),[n.errorMessage||n.checkboxGroupErrorMessage,n.n("--error")],[n.formDisabled||n.disabled,n.n("--disabled")]))},[xe(n.$slots,"default")],2)],2),Oe(s,{"error-message":n.errorMessage},null,8,["error-message"])],2)}const gre=et({name:Hze,directives:{Ripple:Ns,Hover:Fa},components:{VarIcon:Wn,VarFormDetails:na,VarHoverOverlay:ml},props:xze,setup(n){const e=Xu(n,"modelValue"),t=Xu(n,"indeterminate"),i=ve(()=>e.value===n.checkedValue),s=ve(()=>n.checkedValue),o=se(!1),{checkboxGroup:r,bindCheckboxGroup:a}=Aze(),{hovering:l,handleHovering:c}=Pd(),{form:d,bindForm:u}=kl(),{errorMessage:h,validateWithTrigger:f,validate:g,resetValidation:p}=Ll(),_={checkedValue:s,checked:i,sync:w,validate:k,resetValidation:p,reset:L,resetWithAnimation:y};oe(a,_),oe(u,_);function v(D){Fn(()=>{const{validateTrigger:x,rules:A,modelValue:T}=n;f(x,D,A,T)})}function b(D){const{checkedValue:x,onChange:A}=n;e.value=D,t.value=!1,oe(A,e.value),v("onChange"),D===x?r==null||r.onChecked(x):r==null||r.onUnchecked(x)}function C(D){const{disabled:x,readonly:A,checkedValue:T,uncheckedValue:P,onClick:W}=n;if(d!=null&&d.disabled.value||x||(oe(W,D),d!=null&&d.readonly.value||A))return;o.value=!0;const $=r?r.checkedCount.value>=Number(r.max.value):!1;!i.value&&$||b(i.value?P:T)}function w(D){const{checkedValue:x,uncheckedValue:A}=n;e.value=D.includes(x)?x:A}function y(){o.value=!1}function L(){e.value=n.uncheckedValue,p()}function S(D){const{checkedValue:x,uncheckedValue:A}=n;![x,A].includes(D)&&(D=i.value?A:x),b(D)}function k(){return g(n.rules,n.modelValue)}return{isIndeterminate:t,withAnimation:o,checked:i,errorMessage:h,checkboxGroupErrorMessage:r==null?void 0:r.errorMessage,formDisabled:d==null?void 0:d.disabled,formReadonly:d==null?void 0:d.readonly,hovering:l,n:$ze,classes:zze,handleHovering:c,handleClick:C,toggle:S,reset:L,validate:k,resetValidation:p}}});gre.render=Uze;var pre=gre;lt(pre);var Uy=pre;const jze={modelValue:{type:Array,default:()=>[]},max:[String,Number],direction:{type:String,default:"horizontal"},validateTrigger:{type:Array,default:()=>["onChange"]},rules:Array,onChange:Se(),"onUpdate:modelValue":Se()},{name:Kze,n:qze,classes:Gze}=st("checkbox-group");function Yze(n,e){const t=gt("var-form-details");return q(),re("div",{class:B(n.n("wrap"))},[me("div",{class:B(n.classes(n.n(),n.n("--".concat(n.direction))))},[xe(n.$slots,"default")],2),Oe(t,{"error-message":n.errorMessage},null,8,["error-message"])],2)}const mre=et({name:Kze,components:{VarFormDetails:na},props:jze,setup(n){const e=ve(()=>n.max),t=ve(()=>n.modelValue.length),{length:i,checkboxes:s,bindCheckboxes:o}=Nze(),{bindForm:r}=kl(),{errorMessage:a,validateWithTrigger:l,validate:c,resetValidation:d}=Ll(),u=ve(()=>a.value),h={max:e,checkedCount:t,onChecked:p,onUnchecked:_,validate:L,resetValidation:d,reset:y,errorMessage:u};ht(()=>n.modelValue,v,{deep:!0}),ht(()=>i.value,v),o(h),oe(r,h);function f(S){Fn(()=>{const{validateTrigger:k,rules:D,modelValue:x}=n;l(k,S,D,x)})}function g(S){oe(n["onUpdate:modelValue"],S),oe(n.onChange,S),f("onChange")}function p(S){const{modelValue:k}=n;k.includes(S)||g([...k,S])}function _(S){const{modelValue:k}=n;k.includes(S)&&g(k.filter(D=>D!==S))}function v(){return s.forEach(({sync:S})=>S(n.modelValue))}function b(){s.forEach(S=>S.resetWithAnimation())}function C(){const S=s.map(({checkedValue:D})=>D.value),k=UW(S);return b(),oe(n["onUpdate:modelValue"],k),k}function w(){const S=s.filter(({checked:D})=>!D.value).map(({checkedValue:D})=>D.value),k=UW(S);return b(),oe(n["onUpdate:modelValue"],k),k}function y(){oe(n["onUpdate:modelValue"],[]),d()}function L(){return c(n.rules,n.modelValue)}return{errorMessage:a,n:qze,classes:Gze,checkAll:C,inverseAll:w,reset:y,validate:L,resetValidation:d}}});mre.render=Yze;var _re=mre;lt(_re);var f3=_re;const Zze={type:{type:String,default:"default"},size:{type:String,default:"normal"},color:String,textColor:String,iconName:yi(Ss,"name"),namespace:yi(Ss,"namespace"),plain:Boolean,round:{type:Boolean,default:!0},block:Boolean,closable:Boolean,closeable:Boolean,onClose:Se()},{name:Xze,n:Sh,classes:Qze}=st("chip");function Jze(n,e){const t=gt("var-icon");return q(),ei(On,{name:n.n("$-fade")},{default:Lt(()=>[me("span",fn({class:n.classes(n.n(),n.n("$--box"),...n.contentClass),style:n.chipStyles},n.$attrs),[xe(n.$slots,"left"),me("span",{class:B(n.n("text-".concat(n.size)))},[xe(n.$slots,"default")],2),xe(n.$slots,"right"),n.closeable||n.closable?(q(),re("span",{key:0,class:B(n.n("--close")),onClick:e[0]||(e[0]=(...i)=>n.handleClose&&n.handleClose(...i))},[Oe(t,{name:"".concat(n.iconName?n.iconName:"close-circle"),namespace:n.namespace},null,8,["name","namespace"])],2)):Qe("v-if",!0)],16)]),_:3},8,["name"])}const vre=et({name:Xze,components:{VarIcon:Wn},inheritAttrs:!1,props:Zze,setup(n){const e=ve(()=>{const{plain:s,textColor:o,color:r}=n;return s?{color:o||r,borderColor:r}:{color:o,background:r}}),t=ve(()=>{const{size:s,block:o,type:r,plain:a,round:l}=n,c=Sh(o?"$--flex":"$--inline-flex"),d=a?"".concat(Sh("plain")," ").concat(Sh("plain-".concat(r))):Sh("--".concat(r)),u=l?Sh("--round"):null;return[Sh("--".concat(s)),c,d,u]});function i(s){oe(n.onClose,s)}return{chipStyles:e,contentClass:t,n:Sh,classes:Qze,handleClose:i}}});vre.render=Jze;var bre=vre;lt(bre);var fT=bre;const eUe={span:{type:[String,Number],default:24},offset:{type:[String,Number],default:0},direction:{type:String,default:"row"},justify:String,align:String,xs:[Object,Number,String],sm:[Object,Number,String],md:[Object,Number,String],lg:[Object,Number,String],xl:[Object,Number,String],onClick:Se()},Cre=Symbol("ROW_BIND_COL_KEY");function tUe(){const{bindChildren:n,childProviders:e,length:t}=$o(Cre);return{length:t,cols:e,bindCols:n}}function iUe(){const{parentProvider:n,index:e,bindParent:t}=Ho(Cre);return{index:e,row:n,bindRow:t}}const{name:nUe,n:Pk,classes:sUe}=st("col");function oUe(n,e){return q(),re("div",{class:B(n.classes(n.n(),n.n("$--box"),[n.span>=0,n.n("--span-".concat(n.span))],[n.offset,n.n("--offset-".concat(n.offset))],...n.getSize("xs",n.xs),...n.getSize("sm",n.sm),...n.getSize("md",n.md),...n.getSize("lg",n.lg),...n.getSize("xl",n.xl))),style:Fe({flexDirection:n.direction,justifyContent:n.padStartFlex(n.justify),alignItems:n.padStartFlex(n.align),paddingLeft:n.toSizeUnit(n.padding.left),paddingRight:n.toSizeUnit(n.padding.right),paddingTop:n.toSizeUnit(n.padding.top),paddingBottom:n.toSizeUnit(n.padding.bottom)}),onClick:e[0]||(e[0]=(...t)=>n.handleClick&&n.handleClick(...t))},[xe(n.$slots,"default")],6)}const wre=et({name:nUe,props:eUe,setup(n){const e=ve(()=>Ie(n.span)),t=ve(()=>Ie(n.offset)),i=se({left:0,right:0,top:0,bottom:0}),{row:s,bindRow:o}=iUe(),r={setPadding(c){i.value=c}};ht([()=>n.span,()=>n.offset],()=>{s==null||s.computePadding()}),oe(o,r);function a(c,d){const u=[];if(d==null)return u;if(ju(d)){const{offset:h,span:f}=d;Number(f)>=0&&u.push(Pk("--span-".concat(c,"-").concat(f))),h&&u.push(Pk("--offset-".concat(c,"-").concat(h)))}else Number(d)>=0&&u.push(Pk("--span-".concat(c,"-").concat(d)));return u}function l(c){oe(n.onClick,c)}return{span:e,offset:t,padding:i,n:Pk,classes:sUe,toNumber:Ie,toSizeUnit:ri,getSize:a,handleClick:l,padStartFlex:cT}}});wre.render=oUe;var yre=wre;lt(yre);var g3=yre;const Sre=Symbol("COLLAPSE_BIND_COLLAPSE_ITEM_KEY");function rUe(){const{childProviders:n,length:e,bindChildren:t}=$o(Sre);return{length:e,collapseItem:n,bindCollapseItem:t}}const aUe={modelValue:[Array,String,Number],accordion:Boolean,offset:{type:Boolean,default:!0},divider:{type:Boolean,default:!0},elevation:{type:[Boolean,String,Number],default:!0},onChange:Se(),"onUpdate:modelValue":Se()},{name:lUe,n:cUe}=st("collapse");function dUe(n,e){return q(),re("div",{class:B(n.n())},[xe(n.$slots,"default")],2)}const Lre=et({name:lUe,props:aUe,setup(n){const e=ve(()=>n.modelValue),t=ve(()=>n.offset),i=ve(()=>n.divider),s=ve(()=>n.elevation),{length:o,collapseItem:r,bindCollapseItem:a}=rUe(),l={active:e,offset:t,divider:i,elevation:s,updateItem:u};ht(()=>o.value,()=>Fn().then(g)),ht(()=>n.modelValue,()=>Fn().then(g)),a(l);function c(){return!n.accordion&&!tn(n.modelValue)?(console.error('[Varlet] Collapse: type of prop "modelValue" should be an Array'),!1):n.accordion&&tn(n.modelValue)?(console.error('[Varlet] Collapse: type of prop "modelValue" should be a String or Number'),!1):!0}function d(p,_){return c()?_?n.accordion?p:[...n.modelValue,p]:n.accordion?null:n.modelValue.filter(v=>v!==p):null}function u(p,_){const v=d(p,_);oe(n["onUpdate:modelValue"],v),oe(n.onChange,v)}function h(){if(n.accordion)return r.find(({name:_})=>n.modelValue===_.value);const p=r.filter(({name:_})=>_.value===void 0?!1:n.modelValue.includes(_.value));return p.length?p:void 0}function f(){return n.accordion?r.find(({index:p,name:_})=>_.value===void 0&&n.modelValue===p.value):r.filter(({index:p,name:_})=>_.value===void 0&&n.modelValue.includes(p.value))}function g(){if(!c())return;const p=h()||f();if(n.accordion&&!p||!n.accordion&&!p.length){r.forEach(_=>{_.init(n.accordion,!1)});return}r.forEach(_=>{const v=n.accordion?p===_:p.includes(_);_.init(n.accordion,v)})}return{divider:i,n:cUe}}});Lre.render=dUe;var kre=Lre;lt(kre);var p3=kre;function uUe(){const{parentProvider:n,index:e,bindParent:t}=Ho(Sre);return t||Oa("Collapse"," must in "),{index:e,collapse:n,bindCollapse:t}}const hUe={name:[String,Number],title:String,icon:{type:String,default:"chevron-down"},disabled:Boolean};var Sq=(n,e,t)=>new Promise((i,s)=>{var o=l=>{try{a(t.next(l))}catch(c){s(c)}},r=l=>{try{a(t.throw(l))}catch(c){s(c)}},a=l=>l.done?i(l.value):Promise.resolve(l.value).then(o,r);a((t=t.apply(n,e)).next())});const{name:fUe,n:gUe,classes:pUe}=st("collapse-item");function mUe(n,e){const t=gt("var-icon");return q(),re("div",{class:B(n.classes(n.n(),[n.offset&&n.isShow,n.n("--active")],[n.disabled,n.n("--disable")])),style:Fe("--collapse-divider-top: ".concat(n.divider?"var(--collapse-border-top)":"none"))},[me("div",{class:B(n.classes(n.n("shadow"),n.formatElevation(n.elevation,2)))},null,2),me("div",{class:B(n.n("header")),onClick:e[0]||(e[0]=i=>n.toggle())},[me("div",{class:B(n.n("header-title"))},[xe(n.$slots,"title",{},()=>[Mi(ut(n.title),1)])],2),me("div",{class:B(n.n("header-icon"))},[xe(n.$slots,"icon",{},()=>[Oe(t,{name:n.icon,transition:250,class:B(n.classes(n.n("header-icon"),[n.isShow&&n.icon==="chevron-down",n.n("header-open")],[n.disabled,n.n("header--disable")]))},null,8,["name","class"])])],2)],2),wi(me("div",{class:B(n.n("content")),ref:"contentEl",onTransitionend:e[1]||(e[1]=(...i)=>n.transitionend&&n.transitionend(...i)),onTransitionstart:e[2]||(e[2]=(...i)=>n.start&&n.start(...i))},[me("div",{class:B(n.n("content-wrap"))},[xe(n.$slots,"default")],2)],34),[[hl,n.showContent]])],6)}const Dre=et({name:fUe,components:{VarIcon:Wn},props:hUe,setup(n){const e=se(!1),t=se(!1),i=se(null),s=ve(()=>n.name),{index:o,collapse:r,bindCollapse:a}=uUe(),{active:l,offset:c,divider:d,elevation:u,updateItem:h}=r,f={index:o,name:s,init:v};let g=!0;ht(e,y=>{y?p():_()}),a(f);function p(){return Sq(this,null,function*(){if(!i.value||(i.value.style.height="",t.value=!0,yield Gk(),!i.value))return;const{offsetHeight:y}=i.value;i.value.style.height="0px",yield Gk(),i.value&&(i.value.style.height=y+"px",g&&(yield Cr(),g&&w()))})}function _(){return Sq(this,null,function*(){if(!i.value)return;const{offsetHeight:y}=i.value;i.value.style.height=y+"px",yield Gk(),i.value.style.height="0px"})}function v(y,L){l.value===void 0||y&&tn(l.value)||L===e.value||(e.value=L,b(!0))}function b(y){n.disabled||y||h(n.name||o.value,!e.value)}function C(){g=!1}function w(){e.value||(t.value=!1),i.value.style.height=""}return{isShow:e,showContent:t,offset:c,divider:d,elevation:u,contentEl:i,n:gUe,start:C,classes:pUe,toggle:b,transitionend:w,formatElevation:or}}});Dre.render=mUe;var Ere=Dre;lt(Ere);var m3=Ere;const _Ue={time:{type:[String,Number],default:0},format:{type:String,default:"HH : mm : ss"},autoStart:{type:Boolean,default:!0},onEnd:Se(),onChange:Se()},{name:vUe,n:bUe}=st("countdown"),_3=1e3,v3=60*_3,b3=60*v3,Lq=24*b3;function CUe(n,e){return q(),re("div",{class:B(n.n())},[xe(n.$slots,"default",pf(_0(n.timeData)),()=>[Mi(ut(n.showTime),1)])],2)}const Ire=et({name:vUe,props:_Ue,setup(n){const e=se(""),t=se({days:0,hours:0,minutes:0,seconds:0,milliseconds:0});let i=0,s=!1,o=0,r=0,a;ht(()=>n.time,()=>{f(),n.autoStart&&u()},{immediate:!0}),eh(()=>{a!=null&&(s=a,s===!0&&u(!0))}),$m(()=>{a=s,h()}),Cd(h);function l(g,p){const _=Object.values(p),v=["DD","HH","mm","ss"],b=[24,60,60,1e3];if(v.forEach((C,w)=>{g.includes(C)?g=g.replace(C,Bm("".concat(_[w]),2,"0")):_[w+1]+=_[w]*b[w]}),g.includes("S")){const C=Bm("".concat(_[_.length-1]),3,"0");g.includes("SSS")?g=g.replace("SSS",C):g.includes("SS")?g=g.replace("SS",C.slice(0,2)):g=g.replace("S",C.slice(0,1))}return g}function c(g){const p=Math.floor(g/Lq),_=Math.floor(g%Lq/b3),v=Math.floor(g%b3/v3),b=Math.floor(g%v3/_3),C=Math.floor(g%_3),w={days:p,hours:_,minutes:v,seconds:b,milliseconds:C};t.value=w,oe(n.onChange,t.value),e.value=l(n.format,w)}function d(){const{time:g,onEnd:p}=n,_=performance.now();if(i||(i=_+Ie(g)),r=i-_,r<0&&(r=0),c(r),r===0){oe(p);return}s&&(o=aw(d))}function u(g=!1){s&&!g||(s=!0,i=performance.now()+(r||Ie(n.time)),d())}function h(){s=!1,jW(o)}function f(){i=0,s=!1,jW(o),d()}return{showTime:e,timeData:t,n:bUe,start:u,pause:h,reset:f}}});Ire.render=CUe;var Tre=Ire;lt(Tre);var C3=Tre;/*! + *-----------------------------------------------------------------------------*/var pOe=Object.defineProperty,mOe=Object.getOwnPropertyDescriptor,_Oe=Object.getOwnPropertyNames,vOe=Object.prototype.hasOwnProperty,ej=(n,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of _Oe(e))!vOe.call(n,s)&&s!==t&&pOe(n,s,{get:()=>e[s],enumerable:!(i=mOe(e,s))||i.enumerable});return n},bOe=(n,e,t)=>(ej(n,e,"default"),t&&ej(t,e,"default")),COe="5.0.2",Kb={};bOe(Kb,PS);var iie=(n=>(n[n.None=0]="None",n[n.CommonJS=1]="CommonJS",n[n.AMD=2]="AMD",n[n.UMD=3]="UMD",n[n.System=4]="System",n[n.ES2015=5]="ES2015",n[n.ESNext=99]="ESNext",n))(iie||{}),nie=(n=>(n[n.None=0]="None",n[n.Preserve=1]="Preserve",n[n.React=2]="React",n[n.ReactNative=3]="ReactNative",n[n.ReactJSX=4]="ReactJSX",n[n.ReactJSXDev=5]="ReactJSXDev",n))(nie||{}),sie=(n=>(n[n.CarriageReturnLineFeed=0]="CarriageReturnLineFeed",n[n.LineFeed=1]="LineFeed",n))(sie||{}),oie=(n=>(n[n.ES3=0]="ES3",n[n.ES5=1]="ES5",n[n.ES2015=2]="ES2015",n[n.ES2016=3]="ES2016",n[n.ES2017=4]="ES2017",n[n.ES2018=5]="ES2018",n[n.ES2019=6]="ES2019",n[n.ES2020=7]="ES2020",n[n.ESNext=99]="ESNext",n[n.JSON=100]="JSON",n[n.Latest=99]="Latest",n))(oie||{}),rie=(n=>(n[n.Classic=1]="Classic",n[n.NodeJs=2]="NodeJs",n))(rie||{}),aie=class{constructor(n,e,t,i,s){an(this,"_onDidChange",new Kb.Emitter);an(this,"_onDidExtraLibsChange",new Kb.Emitter);an(this,"_extraLibs");an(this,"_removedExtraLibs");an(this,"_eagerModelSync");an(this,"_compilerOptions");an(this,"_diagnosticsOptions");an(this,"_workerOptions");an(this,"_onDidExtraLibsChangeTimeout");an(this,"_inlayHintsOptions");an(this,"_modeConfiguration");this._extraLibs=Object.create(null),this._removedExtraLibs=Object.create(null),this._eagerModelSync=!1,this.setCompilerOptions(n),this.setDiagnosticsOptions(e),this.setWorkerOptions(t),this.setInlayHintsOptions(i),this.setModeConfiguration(s),this._onDidExtraLibsChangeTimeout=-1}get onDidChange(){return this._onDidChange.event}get onDidExtraLibsChange(){return this._onDidExtraLibsChange.event}get modeConfiguration(){return this._modeConfiguration}get workerOptions(){return this._workerOptions}get inlayHintsOptions(){return this._inlayHintsOptions}getExtraLibs(){return this._extraLibs}addExtraLib(n,e){let t;if(typeof e>"u"?t="ts:extralib-".concat(Math.random().toString(36).substring(2,15)):t=e,this._extraLibs[t]&&this._extraLibs[t].content===n)return{dispose:()=>{}};let i=1;return this._removedExtraLibs[t]&&(i=this._removedExtraLibs[t]+1),this._extraLibs[t]&&(i=this._extraLibs[t].version+1),this._extraLibs[t]={content:n,version:i},this._fireOnDidExtraLibsChangeSoon(),{dispose:()=>{let s=this._extraLibs[t];s&&s.version===i&&(delete this._extraLibs[t],this._removedExtraLibs[t]=i,this._fireOnDidExtraLibsChangeSoon())}}}setExtraLibs(n){for(const e in this._extraLibs)this._removedExtraLibs[e]=this._extraLibs[e].version;if(this._extraLibs=Object.create(null),n&&n.length>0)for(const e of n){const t=e.filePath||"ts:extralib-".concat(Math.random().toString(36).substring(2,15)),i=e.content;let s=1;this._removedExtraLibs[t]&&(s=this._removedExtraLibs[t]+1),this._extraLibs[t]={content:i,version:s}}this._fireOnDidExtraLibsChangeSoon()}_fireOnDidExtraLibsChangeSoon(){this._onDidExtraLibsChangeTimeout===-1&&(this._onDidExtraLibsChangeTimeout=window.setTimeout(()=>{this._onDidExtraLibsChangeTimeout=-1,this._onDidExtraLibsChange.fire(void 0)},0))}getCompilerOptions(){return this._compilerOptions}setCompilerOptions(n){this._compilerOptions=n||Object.create(null),this._onDidChange.fire(void 0)}getDiagnosticsOptions(){return this._diagnosticsOptions}setDiagnosticsOptions(n){this._diagnosticsOptions=n||Object.create(null),this._onDidChange.fire(void 0)}setWorkerOptions(n){this._workerOptions=n||Object.create(null),this._onDidChange.fire(void 0)}setInlayHintsOptions(n){this._inlayHintsOptions=n||Object.create(null),this._onDidChange.fire(void 0)}setMaximumWorkerIdleTime(n){}setEagerModelSync(n){this._eagerModelSync=n}getEagerModelSync(){return this._eagerModelSync}setModeConfiguration(n){this._modeConfiguration=n||Object.create(null),this._onDidChange.fire(void 0)}},wOe=COe,lie={completionItems:!0,hovers:!0,documentSymbols:!0,definitions:!0,references:!0,documentHighlights:!0,rename:!0,diagnostics:!0,documentRangeFormattingEdits:!0,signatureHelp:!0,onTypeFormattingEdits:!0,codeActions:!0,inlayHints:!0},cie=new aie({allowNonTsExtensions:!0,target:99},{noSemanticValidation:!1,noSyntaxValidation:!1,onlyVisible:!1},{},{},lie),die=new aie({allowNonTsExtensions:!0,allowJs:!0,target:99},{noSemanticValidation:!0,noSyntaxValidation:!1,onlyVisible:!1},{},{},lie),yOe=()=>cN().then(n=>n.getTypeScriptWorker()),SOe=()=>cN().then(n=>n.getJavaScriptWorker());Kb.languages.typescript={ModuleKind:iie,JsxEmit:nie,NewLineKind:sie,ScriptTarget:oie,ModuleResolutionKind:rie,typescriptVersion:wOe,typescriptDefaults:cie,javascriptDefaults:die,getTypeScriptWorker:yOe,getJavaScriptWorker:SOe};function cN(){return tt(()=>import("./tsMode-1d146d19.js"),[],import.meta.url)}Kb.languages.onLanguage("typescript",()=>cN().then(n=>n.setupTypeScript(cie)));Kb.languages.onLanguage("javascript",()=>cN().then(n=>n.setupJavaScript(die)));class LOe extends oa{constructor(){super({id:"diffEditor.toggleCollapseUnchangedRegions",title:{value:m("toggleCollapseUnchangedRegions","Toggle Collapse Unchanged Regions"),original:"Toggle Collapse Unchanged Regions"},icon:Me.map,toggled:fe.has("config.diffEditor.hideUnchangedRegions.enabled"),precondition:fe.has("isInDiffEditor"),menu:{when:fe.has("isInDiffEditor"),id:M.EditorTitle,order:22,group:"navigation"}})}run(e,...t){const i=e.get(zt),s=!i.getValue("diffEditor.hideUnchangedRegions.enabled");i.updateValue("diffEditor.hideUnchangedRegions.enabled",s)}}Ui(LOe);class uie extends oa{constructor(){super({id:"diffEditor.toggleShowMovedCodeBlocks",title:{value:m("toggleShowMovedCodeBlocks","Toggle Show Moved Code Blocks"),original:"Toggle Show Moved Code Blocks"},precondition:fe.has("isInDiffEditor")})}run(e,...t){const i=e.get(zt),s=!i.getValue("diffEditor.experimental.showMoves");i.updateValue("diffEditor.experimental.showMoves",s)}}Ui(uie);class hie extends oa{constructor(){super({id:"diffEditor.toggleUseInlineViewWhenSpaceIsLimited",title:{value:m("toggleUseInlineViewWhenSpaceIsLimited","Toggle Use Inline View When Space Is Limited"),original:"Toggle Use Inline View When Space Is Limited"},precondition:fe.has("isInDiffEditor")})}run(e,...t){const i=e.get(zt),s=!i.getValue("diffEditor.useInlineViewWhenSpaceIsLimited");i.updateValue("diffEditor.useInlineViewWhenSpaceIsLimited",s)}}Ui(hie);Ls.appendMenuItem(M.EditorTitle,{command:{id:new hie().desc.id,title:m("useInlineViewWhenSpaceIsLimited","Use Inline View When Space Is Limited"),toggled:fe.has("config.diffEditor.useInlineViewWhenSpaceIsLimited"),precondition:fe.has("isInDiffEditor")},order:11,group:"1_diff",when:fe.and(O.diffEditorRenderSideBySideInlineBreakpointReached,fe.has("isInDiffEditor"))});Ls.appendMenuItem(M.EditorTitle,{command:{id:new uie().desc.id,title:m("showMoves","Show Moved Code Blocks"),icon:Me.move,toggled:S0.create("config.diffEditor.experimental.showMoves",!0),precondition:fe.has("isInDiffEditor")},order:10,group:"1_diff",when:fe.has("isInDiffEditor")});const dN={value:m("diffEditor","Diff Editor"),original:"Diff Editor"};class kOe extends Cc{constructor(){super({id:"diffEditor.switchSide",title:{value:m("switchSide","Switch Side"),original:"Switch Side"},icon:Me.arrowSwap,precondition:fe.has("isInDiffEditor"),f1:!0,category:dN})}runEditorCommand(e,t,i){const s=O0(e);if(s instanceof vm){if(i&&i.dryRun)return{destinationSelection:s.mapToOtherSide().destinationSelection};s.switchSide()}}}Ui(kOe);class DOe extends Cc{constructor(){super({id:"diffEditor.exitCompareMove",title:{value:m("exitCompareMove","Exit Compare Move"),original:"Exit Compare Move"},icon:Me.close,precondition:O.comparingMovedCode,f1:!1,category:dN,keybinding:{weight:1e4,primary:9}})}runEditorCommand(e,t,...i){const s=O0(e);s instanceof vm&&s.exitCompareMove()}}Ui(DOe);class EOe extends Cc{constructor(){super({id:"diffEditor.collapseAllUnchangedRegions",title:{value:m("collapseAllUnchangedRegions","Collapse All Unchanged Regions"),original:"Collapse All Unchanged Regions"},icon:Me.fold,precondition:fe.has("isInDiffEditor"),f1:!0,category:dN})}runEditorCommand(e,t,...i){const s=O0(e);s instanceof vm&&s.collapseAllUnchangedRegions()}}Ui(EOe);class IOe extends Cc{constructor(){super({id:"diffEditor.showAllUnchangedRegions",title:{value:m("showAllUnchangedRegions","Show All Unchanged Regions"),original:"Show All Unchanged Regions"},icon:Me.unfold,precondition:fe.has("isInDiffEditor"),f1:!0,category:dN})}runEditorCommand(e,t,...i){const s=O0(e);s instanceof vm&&s.showAllUnchangedRegions()}}Ui(IOe);const fie={value:m("accessibleDiffViewer","Accessible Diff Viewer"),original:"Accessible Diff Viewer"};class P0 extends oa{constructor(){super({id:P0.id,title:{value:m("editor.action.accessibleDiffViewer.next","Go to Next Difference"),original:"Go to Next Difference"},category:fie,precondition:fe.has("isInDiffEditor"),keybinding:{primary:65,weight:100},f1:!0})}run(e){const t=O0(e);t==null||t.accessibleDiffViewerNext()}}P0.id="editor.action.accessibleDiffViewer.next";Ls.appendMenuItem(M.EditorTitle,{command:{id:P0.id,title:m("Open Accessible Diff Viewer","Open Accessible Diff Viewer"),precondition:fe.has("isInDiffEditor")},order:10,group:"2_diff",when:fe.and(O.accessibleDiffViewerVisible.negate(),fe.has("isInDiffEditor"))});class FS extends oa{constructor(){super({id:FS.id,title:{value:m("editor.action.accessibleDiffViewer.prev","Go to Previous Difference"),original:"Go to Previous Difference"},category:fie,precondition:fe.has("isInDiffEditor"),keybinding:{primary:1089,weight:100},f1:!0})}run(e){const t=O0(e);t==null||t.accessibleDiffViewerPrev()}}FS.id="editor.action.accessibleDiffViewer.prev";function O0(n){var e;const t=n.get(ai),i=t.listDiffEditors(),s=(e=t.getFocusedCodeEditor())!==null&&e!==void 0?e:t.getActiveCodeEditor();if(!s)return null;for(let r=0,a=i.length;r=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},NOe=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},uN=globalThis&&globalThis.__awaiter||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())})},cF;const hN=new Ve("selectionAnchorSet",!1);let Yu=cF=class{static get(e){return e.getContribution(cF.ID)}constructor(e,t){this.editor=e,this.selectionAnchorSetContextKey=hN.bindTo(t),this.modelChangeListener=e.onDidChangeModel(()=>this.selectionAnchorSetContextKey.reset())}setSelectionAnchor(){if(this.editor.hasModel()){const e=this.editor.getPosition();this.editor.changeDecorations(t=>{this.decorationId&&t.removeDecoration(this.decorationId),this.decorationId=t.addDecoration(Je.fromPositions(e,e),{description:"selection-anchor",stickiness:1,hoverMessage:new Bs().appendText(m("selectionAnchor","Selection Anchor")),className:"selection-anchor"})}),this.selectionAnchorSetContextKey.set(!!this.decorationId),to(m("anchorSet","Anchor set at {0}:{1}",e.lineNumber,e.column))}}goToSelectionAnchor(){if(this.editor.hasModel()&&this.decorationId){const e=this.editor.getModel().getDecorationRange(this.decorationId);e&&this.editor.setPosition(e.getStartPosition())}}selectFromAnchorToCursor(){if(this.editor.hasModel()&&this.decorationId){const e=this.editor.getModel().getDecorationRange(this.decorationId);if(e){const t=this.editor.getPosition();this.editor.setSelection(Je.fromPositions(e.getStartPosition(),t)),this.cancelSelectionAnchor()}}}cancelSelectionAnchor(){if(this.decorationId){const e=this.decorationId;this.editor.changeDecorations(t=>{t.removeDecoration(e),this.decorationId=void 0}),this.selectionAnchorSetContextKey.set(!1)}}dispose(){this.cancelSelectionAnchor(),this.modelChangeListener.dispose()}};Yu.ID="editor.contrib.selectionAnchorController";Yu=cF=xOe([NOe(1,bt)],Yu);class AOe extends Ue{constructor(){super({id:"editor.action.setSelectionAnchor",label:m("setSelectionAnchor","Set Selection Anchor"),alias:"Set Selection Anchor",precondition:void 0,kbOpts:{kbExpr:O.editorTextFocus,primary:qn(2089,2080),weight:100}})}run(e,t){var i;return uN(this,void 0,void 0,function*(){(i=Yu.get(t))===null||i===void 0||i.setSelectionAnchor()})}}class MOe extends Ue{constructor(){super({id:"editor.action.goToSelectionAnchor",label:m("goToSelectionAnchor","Go to Selection Anchor"),alias:"Go to Selection Anchor",precondition:hN})}run(e,t){var i;return uN(this,void 0,void 0,function*(){(i=Yu.get(t))===null||i===void 0||i.goToSelectionAnchor()})}}class ROe extends Ue{constructor(){super({id:"editor.action.selectFromAnchorToCursor",label:m("selectFromAnchorToCursor","Select from Anchor to Cursor"),alias:"Select from Anchor to Cursor",precondition:hN,kbOpts:{kbExpr:O.editorTextFocus,primary:qn(2089,2089),weight:100}})}run(e,t){var i;return uN(this,void 0,void 0,function*(){(i=Yu.get(t))===null||i===void 0||i.selectFromAnchorToCursor()})}}class POe extends Ue{constructor(){super({id:"editor.action.cancelSelectionAnchor",label:m("cancelSelectionAnchor","Cancel Selection Anchor"),alias:"Cancel Selection Anchor",precondition:hN,kbOpts:{kbExpr:O.editorTextFocus,primary:9,weight:100}})}run(e,t){var i;return uN(this,void 0,void 0,function*(){(i=Yu.get(t))===null||i===void 0||i.cancelSelectionAnchor()})}}ti(Yu.ID,Yu,4);De(AOe);De(MOe);De(ROe);De(POe);const OOe=F("editorOverviewRuler.bracketMatchForeground",{dark:"#A0A0A0",light:"#A0A0A0",hcDark:"#A0A0A0",hcLight:"#A0A0A0"},m("overviewRulerBracketMatchForeground","Overview ruler marker color for matching brackets."));class FOe extends Ue{constructor(){super({id:"editor.action.jumpToBracket",label:m("smartSelect.jumpBracket","Go to Bracket"),alias:"Go to Bracket",precondition:void 0,kbOpts:{kbExpr:O.editorTextFocus,primary:3165,weight:100}})}run(e,t){var i;(i=ll.get(t))===null||i===void 0||i.jumpToBracket()}}class BOe extends Ue{constructor(){super({id:"editor.action.selectToBracket",label:m("smartSelect.selectToBracket","Select to Bracket"),alias:"Select to Bracket",precondition:void 0,description:{description:"Select to Bracket",args:[{name:"args",schema:{type:"object",properties:{selectBrackets:{type:"boolean",default:!0}}}}]}})}run(e,t,i){var s;let o=!0;i&&i.selectBrackets===!1&&(o=!1),(s=ll.get(t))===null||s===void 0||s.selectToBracket(o)}}class WOe extends Ue{constructor(){super({id:"editor.action.removeBrackets",label:m("smartSelect.removeBrackets","Remove Brackets"),alias:"Remove Brackets",precondition:void 0,kbOpts:{kbExpr:O.editorTextFocus,primary:2561,weight:100}})}run(e,t){var i;(i=ll.get(t))===null||i===void 0||i.removeBrackets(this.id)}}class VOe{constructor(e,t,i){this.position=e,this.brackets=t,this.options=i}}class ll extends te{static get(e){return e.getContribution(ll.ID)}constructor(e){super(),this._editor=e,this._lastBracketsData=[],this._lastVersionId=0,this._decorations=this._editor.createDecorationsCollection(),this._updateBracketsSoon=this._register(new Si(()=>this._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 Je(r.lineNumber,r.column,r.lineNumber,r.column):new Je(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(I.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 Je(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(Y.compare);const a=[];let l=0,c=0;const d=s.length;for(let u=0,h=o.length;u0&&(t.pushUndoStop(),t.executeCommands(this.id,s),t.pushUndoStop())}}De(UOe);var jOe=globalThis&&globalThis.__awaiter||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 Cm="9_cutcopypaste",KOe=nc||document.queryCommandSupported("cut"),pie=nc||document.queryCommandSupported("copy"),qOe=typeof navigator.clipboard>"u"||Ta?document.queryCommandSupported("paste"):!0;function R7(n){return n.register(),n}const GOe=KOe?R7(new k0({id:"editor.action.clipboardCutAction",precondition:void 0,kbOpts:nc?{primary:2102,win:{primary:2102,secondary:[1044]},weight:100}:void 0,menuOpts:[{menuId:M.MenubarEditMenu,group:"2_ccp",title:m({key:"miCut",comment:["&& denotes a mnemonic"]},"Cu&&t"),order:1},{menuId:M.EditorContext,group:Cm,title:m("actions.clipboard.cutLabel","Cut"),when:O.writable,order:1},{menuId:M.CommandPalette,group:"",title:m("actions.clipboard.cutLabel","Cut"),order:1},{menuId:M.SimpleEditorContext,group:Cm,title:m("actions.clipboard.cutLabel","Cut"),when:O.writable,order:1}]})):void 0,YOe=pie?R7(new k0({id:"editor.action.clipboardCopyAction",precondition:void 0,kbOpts:nc?{primary:2081,win:{primary:2081,secondary:[2067]},weight:100}:void 0,menuOpts:[{menuId:M.MenubarEditMenu,group:"2_ccp",title:m({key:"miCopy",comment:["&& denotes a mnemonic"]},"&&Copy"),order:2},{menuId:M.EditorContext,group:Cm,title:m("actions.clipboard.copyLabel","Copy"),order:2},{menuId:M.CommandPalette,group:"",title:m("actions.clipboard.copyLabel","Copy"),order:1},{menuId:M.SimpleEditorContext,group:Cm,title:m("actions.clipboard.copyLabel","Copy"),order:2}]})):void 0;Ls.appendMenuItem(M.MenubarEditMenu,{submenu:M.MenubarCopy,title:{value:m("copy as","Copy As"),original:"Copy As"},group:"2_ccp",order:3});Ls.appendMenuItem(M.EditorContext,{submenu:M.EditorContextCopy,title:{value:m("copy as","Copy As"),original:"Copy As"},group:Cm,order:3});Ls.appendMenuItem(M.EditorContext,{submenu:M.EditorContextShare,title:{value:m("share","Share"),original:"Share"},group:"11_share",order:-1,when:fe.and(fe.notEquals("resourceScheme","output"),O.editorTextFocus)});Ls.appendMenuItem(M.EditorTitleContext,{submenu:M.EditorTitleContextShare,title:{value:m("share","Share"),original:"Share"},group:"11_share",order:-1});Ls.appendMenuItem(M.ExplorerContext,{submenu:M.ExplorerContextShare,title:{value:m("share","Share"),original:"Share"},group:"11_share",order:-1});const _R=qOe?R7(new k0({id:"editor.action.clipboardPasteAction",precondition:void 0,kbOpts:nc?{primary:2100,win:{primary:2100,secondary:[1043]},linux:{primary:2100,secondary:[1043]},weight:100}:void 0,menuOpts:[{menuId:M.MenubarEditMenu,group:"2_ccp",title:m({key:"miPaste",comment:["&& denotes a mnemonic"]},"&&Paste"),order:4},{menuId:M.EditorContext,group:Cm,title:m("actions.clipboard.pasteLabel","Paste"),when:O.writable,order:4},{menuId:M.CommandPalette,group:"",title:m("actions.clipboard.pasteLabel","Paste"),order:1},{menuId:M.SimpleEditorContext,group:Cm,title:m("actions.clipboard.pasteLabel","Paste"),when:O.writable,order:4}]})):void 0;class ZOe extends Ue{constructor(){super({id:"editor.action.clipboardCopyWithSyntaxHighlightingAction",label:m("actions.clipboard.copyWithSyntaxHighlightingLabel","Copy With Syntax Highlighting"),alias:"Copy With Syntax Highlighting",precondition:void 0,kbOpts:{kbExpr:O.textInputFocus,primary:0,weight:100}})}run(e,t){!t.hasModel()||!t.getOption(37)&&t.getSelection().isEmpty()||(fO.forceCopyWithSyntaxHighlighting=!0,t.focus(),t.getContainerDomNode().ownerDocument.execCommand("copy"),fO.forceCopyWithSyntaxHighlighting=!1)}}function mie(n,e){n&&(n.addImplementation(1e4,"code-editor",(t,i)=>{const s=t.get(ai).getFocusedCodeEditor();if(s&&s.hasTextFocus()){const o=s.getOption(37),r=s.getSelection();return r&&r.isEmpty()&&!o||s.getContainerDomNode().ownerDocument.execCommand(e),!0}return!1}),n.addImplementation(0,"generic-dom",(t,i)=>(sx().execCommand(e),!0)))}mie(GOe,"cut");mie(YOe,"copy");_R&&(_R.addImplementation(1e4,"code-editor",(n,e)=>{const t=n.get(ai),i=n.get(ch),s=t.getFocusedCodeEditor();return s&&s.hasTextFocus()?!s.getContainerDomNode().ownerDocument.execCommand("paste")&&yg?(()=>jOe(void 0,void 0,void 0,function*(){const r=yield i.readText();if(r!==""){const a=Bw.INSTANCE.get(r);let l=!1,c=null,d=null;a&&(l=s.getOption(37)&&!!a.isFromEmptySelection,c=typeof a.multicursorText<"u"?a.multicursorText:null,d=a.mode),s.trigger("keyboard","paste",{text:r,pasteOnNewLine:l,multicursorText:c,mode:d})}}))():!0:!1}),_R.addImplementation(0,"generic-dom",(n,e)=>(sx().execCommand("paste"),!0)));pie&&De(ZOe);var XOe=globalThis&&globalThis.__awaiter||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 pt{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+pt.sep)}intersects(e){return this.contains(e)||e.contains(this)}append(e){return new pt(this.value+pt.sep+e)}}pt.sep=".";pt.None=new pt("@@none@@");pt.Empty=new pt("");pt.QuickFix=new pt("quickfix");pt.Refactor=new pt("refactor");pt.RefactorExtract=pt.Refactor.append("extract");pt.RefactorInline=pt.Refactor.append("inline");pt.RefactorMove=pt.Refactor.append("move");pt.RefactorRewrite=pt.Refactor.append("rewrite");pt.Notebook=new pt("notebook");pt.Source=new pt("source");pt.SourceOrganizeImports=pt.Source.append("organizeImports");pt.SourceFixAll=pt.Source.append("fixAll");pt.SurroundWith=pt.Refactor.append("surround");var Dr;(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"})(Dr||(Dr={}));function QOe(n,e){return!(n.include&&!n.include.intersects(e)||n.excludes&&n.excludes.some(t=>_ie(e,t,n.include))||!n.includeSourceActions&&pt.Source.contains(e))}function JOe(n,e){const t=e.kind?new pt(e.kind):void 0;return!(n.include&&(!t||!n.include.contains(t))||n.excludes&&t&&n.excludes.some(i=>_ie(t,i,n.include))||!n.includeSourceActions&&t&&pt.Source.contains(t)||n.onlyIncludePreferredActions&&!e.isPreferred)}function _ie(n,e,t){return!(!e.contains(n)||t&&e.contains(t))}class Jc{static fromUser(e,t){return!e||typeof e!="object"?new Jc(t.kind,t.apply,!1):new Jc(Jc.getKindFromUser(e,t.kind),Jc.getApplyFromUser(e,t.apply),Jc.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 pt(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 e4e{constructor(e,t,i){this.action=e,this.provider=t,this.highlightRange=i}resolve(e){var t;return XOe(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){Bn(s)}i&&(this.action.edit=i.edit)}return this})}}var RI=globalThis&&globalThis.__awaiter||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 vie="editor.action.codeAction",P7="editor.action.quickFix",bie="editor.action.autoFix",Cie="editor.action.refactor",wie="editor.action.sourceAction",O7="editor.action.organizeImports",F7="editor.action.fixAll";class FC extends te{static codeActionsPreferredComparator(e,t){return e.isPreferred&&!t.isPreferred?-1:!e.isPreferred&&t.isPreferred?1:0}static codeActionsComparator({action:e},{action:t}){return io(e.diagnostics)?io(t.diagnostics)?FC.codeActionsPreferredComparator(e,t):-1:io(t.diagnostics)?1:FC.codeActionsPreferredComparator(e,t)}constructor(e,t,i){super(),this.documentation=t,this._register(i),this.allActions=[...e].sort(FC.codeActionsComparator),this.validActions=this.allActions.filter(({action:s})=>!s.disabled)}get hasAutoFix(){return this.validActions.some(({action:e})=>!!e.kind&&pt.QuickFix.contains(new pt(e.kind))&&!!e.isPreferred)}}const tj={actions:[],documentation:void 0};function BC(n,e,t,i,s,o){var r;return RI(this,void 0,void 0,function*(){const a=i.filter||{},l=Object.assign(Object.assign({},a),{excludes:[...a.excludes||[],pt.Notebook]}),c={only:(r=a.include)===null||r===void 0?void 0:r.value,trigger:i.type},d=new I7(e,o),u=i.type===2,h=t4e(n,e,u?l:a),f=new be,g=h.map(_=>RI(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 tj;const b=((v==null?void 0:v.actions)||[]).filter(w=>w&&JOe(a,w)),C=n4e(_,b,a.include);return{actions:b.map(w=>new e4e(w,_)),documentation:C}}catch(v){if(bc(v))throw v;return Bn(v),tj}})),p=n.onDidChange(()=>{const _=n.all(e);yn(_,h)||d.cancel()});try{const _=yield Promise.all(g),v=_.map(C=>C.actions).flat(),b=[...wd(_.map(C=>C.documentation)),...i4e(n,e,i,v)];return new FC(v,b,f)}finally{p.dispose(),d.dispose()}})}function t4e(n,e,t){return n.all(e).filter(i=>i.providedCodeActionKinds?i.providedCodeActionKinds.some(s=>QOe(t,new pt(s))):!0)}function*i4e(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 n4e(n,e,t){if(!n.documentation)return;const i=n.documentation.map(s=>({kind:new pt(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 pt(s.kind)))return o.command}}var PI;(function(n){n.OnSave="onSave",n.FromProblemsView="fromProblemsView",n.FromCodeActions="fromCodeActions"})(PI||(PI={}));function s4e(n,e,t,i,s=Ft.None){var o;return RI(this,void 0,void 0,function*(){const r=n.get(kS),a=n.get(gn),l=n.get(ra),c=n.get(Nn);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!==PI.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=o4e(d);c.error(typeof u=="string"?u:m("applyCodeActionFailed","An unknown error occurred while applying the code action"))}})}function o4e(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 RI(this,void 0,void 0,function*(){if(!(e instanceof ct))throw La();const{codeActionProvider:o}=n.get(Ze),r=n.get(Zi).getModel(e);if(!r)throw La();const a=Je.isISelection(t)?Je.liftSelection(t):I.isIRange(t)?r.validateRange(t):void 0;if(!a)throw La();const l=typeof i=="string"?new pt(i):void 0,c=yield BC(o,r,a,{type:1,triggerAction:Dr.Default,filter:{includeSourceActions:!0,include:l}},Fu.None,Ft.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 r4e=globalThis&&globalThis.__decorate||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},a4e=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},dF;let OI=dF=class{constructor(e){this.keybindingService=e}getResolver(){const e=new kg(()=>this.keybindingService.getKeybindings().filter(t=>dF.codeActionCommands.indexOf(t.command)>=0).filter(t=>t.resolvedKeybinding).map(t=>{let i=t.commandArgs;return t.command===O7?i={kind:pt.SourceOrganizeImports.value}:t.command===F7&&(i={kind:pt.SourceFixAll.value}),Object.assign({resolvedKeybinding:t.resolvedKeybinding},Jc.fromUser(i,{kind:pt.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 pt(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)}};OI.codeActionCommands=[Cie,vie,wie,O7,F7];OI=dF=r4e([a4e(0,Di)],OI);F("symbolIcon.arrayForeground",{dark:Te,light:Te,hcDark:Te,hcLight:Te},m("symbolIcon.arrayForeground","The foreground color for array symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));F("symbolIcon.booleanForeground",{dark:Te,light:Te,hcDark:Te,hcLight:Te},m("symbolIcon.booleanForeground","The foreground color for boolean symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));F("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."));F("symbolIcon.colorForeground",{dark:Te,light:Te,hcDark:Te,hcLight:Te},m("symbolIcon.colorForeground","The foreground color for color symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));F("symbolIcon.constantForeground",{dark:Te,light:Te,hcDark:Te,hcLight:Te},m("symbolIcon.constantForeground","The foreground color for constant symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));F("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."));F("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."));F("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."));F("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."));F("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."));F("symbolIcon.fileForeground",{dark:Te,light:Te,hcDark:Te,hcLight:Te},m("symbolIcon.fileForeground","The foreground color for file symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));F("symbolIcon.folderForeground",{dark:Te,light:Te,hcDark:Te,hcLight:Te},m("symbolIcon.folderForeground","The foreground color for folder symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));F("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."));F("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."));F("symbolIcon.keyForeground",{dark:Te,light:Te,hcDark:Te,hcLight:Te},m("symbolIcon.keyForeground","The foreground color for key symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));F("symbolIcon.keywordForeground",{dark:Te,light:Te,hcDark:Te,hcLight:Te},m("symbolIcon.keywordForeground","The foreground color for keyword symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));F("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."));F("symbolIcon.moduleForeground",{dark:Te,light:Te,hcDark:Te,hcLight:Te},m("symbolIcon.moduleForeground","The foreground color for module symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));F("symbolIcon.namespaceForeground",{dark:Te,light:Te,hcDark:Te,hcLight:Te},m("symbolIcon.namespaceForeground","The foreground color for namespace symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));F("symbolIcon.nullForeground",{dark:Te,light:Te,hcDark:Te,hcLight:Te},m("symbolIcon.nullForeground","The foreground color for null symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));F("symbolIcon.numberForeground",{dark:Te,light:Te,hcDark:Te,hcLight:Te},m("symbolIcon.numberForeground","The foreground color for number symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));F("symbolIcon.objectForeground",{dark:Te,light:Te,hcDark:Te,hcLight:Te},m("symbolIcon.objectForeground","The foreground color for object symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));F("symbolIcon.operatorForeground",{dark:Te,light:Te,hcDark:Te,hcLight:Te},m("symbolIcon.operatorForeground","The foreground color for operator symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));F("symbolIcon.packageForeground",{dark:Te,light:Te,hcDark:Te,hcLight:Te},m("symbolIcon.packageForeground","The foreground color for package symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));F("symbolIcon.propertyForeground",{dark:Te,light:Te,hcDark:Te,hcLight:Te},m("symbolIcon.propertyForeground","The foreground color for property symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));F("symbolIcon.referenceForeground",{dark:Te,light:Te,hcDark:Te,hcLight:Te},m("symbolIcon.referenceForeground","The foreground color for reference symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));F("symbolIcon.snippetForeground",{dark:Te,light:Te,hcDark:Te,hcLight:Te},m("symbolIcon.snippetForeground","The foreground color for snippet symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));F("symbolIcon.stringForeground",{dark:Te,light:Te,hcDark:Te,hcLight:Te},m("symbolIcon.stringForeground","The foreground color for string symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));F("symbolIcon.structForeground",{dark:Te,light:Te,hcDark:Te,hcLight:Te},m("symbolIcon.structForeground","The foreground color for struct symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));F("symbolIcon.textForeground",{dark:Te,light:Te,hcDark:Te,hcLight:Te},m("symbolIcon.textForeground","The foreground color for text symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));F("symbolIcon.typeParameterForeground",{dark:Te,light:Te,hcDark:Te,hcLight:Te},m("symbolIcon.typeParameterForeground","The foreground color for type parameter symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));F("symbolIcon.unitForeground",{dark:Te,light:Te,hcDark:Te,hcLight:Te},m("symbolIcon.unitForeground","The foreground color for unit symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));F("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 yie=Object.freeze({kind:pt.Empty,title:m("codeAction.widget.id.more","More Actions...")}),l4e=Object.freeze([{kind:pt.QuickFix,title:m("codeAction.widget.id.quickfix","Quick Fix")},{kind:pt.RefactorExtract,title:m("codeAction.widget.id.extract","Extract"),icon:Me.wrench},{kind:pt.RefactorInline,title:m("codeAction.widget.id.inline","Inline"),icon:Me.wrench},{kind:pt.RefactorRewrite,title:m("codeAction.widget.id.convert","Rewrite"),icon:Me.wrench},{kind:pt.RefactorMove,title:m("codeAction.widget.id.move","Move"),icon:Me.wrench},{kind:pt.SurroundWith,title:m("codeAction.widget.id.surround","Surround With"),icon:Me.symbolSnippet},{kind:pt.Source,title:m("codeAction.widget.id.source","Source Action"),icon:Me.symbolFile},yie]);function c4e(n,e,t){if(!e)return n.map(o=>{var r;return{kind:"action",item:o,group:yie,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=l4e.map(o=>({group:o,actions:[]}));for(const o of n){const r=o.action.kind?new pt(o.action.kind):pt.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 d4e=globalThis&&globalThis.__decorate||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},u4e=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},uF,yv;(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})(yv||(yv={}));let wm=uF=class extends te{constructor(e,t){super(),this._editor=e,this._onClick=this._register(new j),this.onClick=this._onClick.event,this._state=yv.Hidden,this._domNode=ye("div.lightBulbWidget"),this._register(Ii.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(Gbe(this._domNode,i=>{if(this.state.type!==1)return;this._editor.focus(),i.preventDefault();const{top:s,height:o}=Un(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(We.runAndSubscribe(t.onDidUpdateKeybindings,()=>{var i,s,o,r;this._preferredKbLabel=(s=(i=t.lookupKeybinding(bie))===null||i===void 0?void 0:i.getLabel())!==null&&s!==void 0?s:void 0,this._quickFixKbLabel=(r=(o=t.lookupKeybinding(P7))===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=Dx(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 yv.Showing(e,t,i,{position:{lineNumber:g,column:1},preference:uF._posPref}),this._editor.layoutContentWidget(this)}hide(){this.state!==yv.Hidden&&(this.state=yv.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(...dt.asClassNameArray(Me.lightBulb)),this._domNode.classList.add(...dt.asClassNameArray(Me.lightbulbAutofix)),this._preferredKbLabel)){this.title=m("preferredcodeActionWithKb","Show Code Actions. Preferred Quick Fix Available ({0})",this._preferredKbLabel);return}this._domNode.classList.remove(...dt.asClassNameArray(Me.lightbulbAutofix)),this._domNode.classList.add(...dt.asClassNameArray(Me.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}};wm.ID="editor.contrib.lightbulbWidget";wm._posPref=[0];wm=uF=d4e([u4e(1,Di)],wm);var h4e=globalThis&&globalThis.__decorate||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},ij=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},Sie=globalThis&&globalThis.__awaiter||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())})},hF;let Zu=hF=class{constructor(e,t,i){this._options=e,this._languageService=t,this._openerService=i,this._onDidRenderAsync=new j,this.onDidRenderAsync=this._onDidRenderAsync.event}dispose(){this._onDidRenderAsync.dispose()}render(e,t,i){if(!e)return{element:document.createElement("span"),dispose:()=>{}};const s=new be,o=s.add(Bx(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)=>Sie(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=Yr);const c=yield LEe(this._languageService,s,l),d=document.createElement("span");if(d.innerHTML=(a=(r=hF._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);Vs(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=>Lie(this._openerService,i,e.isTrusted),disposables:t}}}};Zu._ttpTokenizer=sh("tokenizeToString",{createHTML(n){return n}});Zu=hF=h4e([ij(1,qi),ij(2,Ir)],Zu);function Lie(n,e,t){return Sie(this,void 0,void 0,function*(){try{return yield n.open(e,{fromUserGesture:!0,allowContributedOpeners:!0,allowCommands:f4e(t)})}catch(i){return Dt(i),!1}})}function f4e(n){return n===!0?!0:n&&Array.isArray(n.enabledCommands)?n.enabledCommands:!1}var g4e=globalThis&&globalThis.__decorate||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},nj=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},TD;let Sr=TD=class{static get(e){return e.getContribution(TD.ID)}constructor(e,t,i){this._openerService=i,this._messageWidget=new Ts,this._messageListeners=new be,this._mouseOverMessage=!1,this._editor=e,this._visible=TD.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){to(Lf(e)?e.value:e),this._visible.set(!0),this._messageWidget.clear(),this._messageListeners.clear(),this._message=Lf(e)?Bx(e,{actionHandler:{callback:s=>Lie(this._openerService,s,Lf(e)?e.isTrusted:void 0),disposables:this._messageListeners}}):void 0,this._messageWidget.value=new sj(this._editor,t,typeof e=="string"?e:this._message.element),this._messageListeners.add(We.debounce(this._editor.onDidBlurEditorText,(s,o)=>o,0)(()=>{this._mouseOverMessage||this._messageWidget.value&&Ws(al(),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(ce(this._messageWidget.value.getDomNode(),Pe.MOUSE_ENTER,()=>this._mouseOverMessage=!0,!0)),this._messageListeners.add(ce(this._messageWidget.value.getDomNode(),Pe.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 I(t.lineNumber-3,1,s.target.position.lineNumber+3,1))}))}closeMessage(){this._visible.reset(),this._messageListeners.clear(),this._messageWidget.value&&this._messageListeners.add(sj.fadeOut(this._messageWidget.value))}};Sr.ID="editor.contrib.messageController";Sr.MESSAGE_VISIBLE=new Ve("messageVisible",!1,m("messageVisible","Whether the editor is currently showing an inline message"));Sr=TD=g4e([nj(1,bt),nj(2,Ir)],Sr);const p4e=fs.bindToContribution(Sr.get);Re(new p4e({id:"leaveEditorMessage",precondition:Sr.MESSAGE_VISIBLE,handler:n=>n.closeMessage(),kbOpts:{weight:100+30,primary:9}}));let sj=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)}};ti(Sr.ID,Sr,4);var kie=globalThis&&globalThis.__decorate||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},fF=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},m4e=globalThis&&globalThis.__awaiter||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 Die="acceptSelectedCodeAction",Eie="previewSelectedCodeAction";class _4e{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 gF=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 xS(e,$r);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=dt.asClassName(e.group.icon),e.group.icon.color&&(i.icon.style.color=He(e.group.icon.color.id))):(i.icon.className=dt.asClassName(Me.lightBulb),i.icon.style.color="var(--vscode-editorLightBulb-foreground)"),!e.item||!e.label)return;i.text.textContent=Iie(e.label),i.keybinding.set(e.keybinding),o0e(!!e.keybinding,i.keybinding.element);const a=(o=this._keybindingService.lookupKeybinding(Die))===null||o===void 0?void 0:o.getLabel(),l=(r=this._keybindingService.lookupKeybinding(Eie))===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){}};gF=kie([fF(1,Di)],gF);class v4e extends UIEvent{constructor(){super("acceptSelectedAction")}}class oj extends UIEvent{constructor(){super("previewSelectedAction")}}function b4e(n){if(n.kind==="action")return n.label}let pF=class extends te{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 Tn),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 wl(e,this.domNode,a,[new gF(t,this._keybindingService),new _4e],{keyboardSupport:!1,typeNavigationEnabled:!0,keyboardNavigationLabelProvider:{getKeyboardNavigationLabel:b4e},accessibilityProvider:{getAriaLabel:l=>{if(l.kind==="action"){let c=l.label?Iie(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(e_),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="".concat(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 oj:new v4e;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 oj):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 m4e(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([])}};pF=kie([fF(4,rh),fF(5,Di)],pF);function Iie(n){return n.replace(/\r\n|\r|\n/g," ")}var C4e=globalThis&&globalThis.__decorate||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=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};F("actionBar.toggledBackground",{dark:Ip,light:Ip,hcDark:Ip,hcLight:Ip},m("actionBar.toggledBackground","Background color for toggled action items in action bar."));const ym={Visible:new Ve("codeActionMenuVisible",!1,m("codeActionMenuVisible","Whether the action widget list is visible"))},o_=Wt("actionWidgetService");let Sm=class extends te{get isVisible(){return ym.Visible.getValue(this._contextKeyService)||!1}constructor(e,t,i){super(),this._contextViewService=e,this._contextKeyService=t,this._instantiationService=i,this._list=this._register(new Ts)}show(e,t,i,s,o,r,a){const l=ym.Visible.bindTo(this._contextKeyService),c=this._instantiationService.createInstance(pF,e,t,i,s);this._contextViewService.showContextView({getAnchor:()=>o,render:d=>(l.set(!0),this._renderWidget(d,c,a!=null?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 be,a=document.createElement("div"),l=e.appendChild(a);l.classList.add("context-view-block"),r.add(ce(l,Pe.MOUSE_DOWN,g=>g.stopPropagation()));const c=document.createElement("div"),d=e.appendChild(c);d.classList.add("context-view-pointerBlock"),r.add(ce(d,Pe.POINTER_MOVE,()=>d.remove())),r.add(ce(d,Pe.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="".concat(h,"px");const f=r.add(Ld(e));return r.add(f.onDidBlur(()=>this.hide())),r}_createActionBar(e,t){if(!t.length)return;const i=ye(e),s=new Pa(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)}};Sm=C4e([vR(0,rh),vR(1,bt),vR(2,_t)],Sm);Gt(o_,Sm,1);const BS=100+1e3;Ui(class extends oa{constructor(){super({id:"hideCodeActionWidget",title:{value:m("hideCodeActionWidget.title","Hide action widget"),original:"Hide action widget"},precondition:ym.Visible,keybinding:{weight:BS,primary:9,secondary:[1033]}})}run(n){n.get(o_).hide()}});Ui(class extends oa{constructor(){super({id:"selectPrevCodeAction",title:{value:m("selectPrevCodeAction.title","Select previous action"),original:"Select previous action"},precondition:ym.Visible,keybinding:{weight:BS,primary:16,secondary:[2064],mac:{primary:16,secondary:[2064,302]}}})}run(n){const e=n.get(o_);e instanceof Sm&&e.focusPrevious()}});Ui(class extends oa{constructor(){super({id:"selectNextCodeAction",title:{value:m("selectNextCodeAction.title","Select next action"),original:"Select next action"},precondition:ym.Visible,keybinding:{weight:BS,primary:18,secondary:[2066],mac:{primary:18,secondary:[2066,300]}}})}run(n){const e=n.get(o_);e instanceof Sm&&e.focusNext()}});Ui(class extends oa{constructor(){super({id:Die,title:{value:m("acceptSelected.title","Accept selected action"),original:"Accept selected action"},precondition:ym.Visible,keybinding:{weight:BS,primary:3,secondary:[2137]}})}run(n){const e=n.get(o_);e instanceof Sm&&e.acceptSelected()}});Ui(class extends oa{constructor(){super({id:Eie,title:{value:m("previewSelected.title","Preview selected action"),original:"Preview selected action"},precondition:ym.Visible,keybinding:{weight:BS,primary:2051}})}run(n){const e=n.get(o_);e instanceof Sm&&e.acceptSelected(!0)}});var w4e=globalThis&&globalThis.__awaiter||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 Tie=new Ve("supportedCodeAction","");class y4e extends te{constructor(e,t,i,s=250){super(),this._editor=e,this._markerService=t,this._signalChange=i,this._delay=s,this._autoTriggerTimer=this._register(new _l),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=>_9(i,t.uri))&&this._tryAutoTrigger()}_tryAutoTrigger(){this._autoTriggerTimer.cancelAndSet(()=>{this.trigger({type:2,triggerAction:Dr.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 yp;(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(bc(r))return xie;throw r})}cancel(){this._cancellablePromise.cancel()}}n.Triggered=e})(yp||(yp={}));const xie=Object.freeze({allActions:[],validActions:[],dispose:()=>{},documentation:[],hasAutoFix:!1});class S4e extends te{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 Ts),this._state=yp.Empty,this._onDidChangeState=this._register(new j),this.onDidChangeState=this._onDidChangeState.event,this._disposed=!1,this._supportedCodeActions=Tie.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(yp.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(yp.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 y4e(this._editor,this._markerService,i=>{var s;if(!i){this.setState(yp.Empty);return}const o=i.selection.getStartPosition(),r=Xn(a=>w4e(this,void 0,void 0,function*(){var l,c,d,u,h,f;if(this._settingEnabledNearbyQuickfixes()&&i.trigger.type===1&&(i.trigger.triggerAction===Dr.QuickFix||!((c=(l=i.trigger.filter)===null||l===void 0?void 0:l.include)===null||c===void 0)&&c.contains(pt.QuickFix))){const g=yield BC(this._registry,e,i.selection,i.trigger,Fu.None,a);if(a.isCancellationRequested)return xie;if(!((d=g.validActions)===null||d===void 0?void 0:d.some(_=>_.action.kind?pt.QuickFix.contains(new pt(_.action.kind)):!1))){const _=this._markerService.read({resource:e.uri});if(_.length>0){const v=i.selection.getPosition();let b=v,C=Number.MAX_VALUE,w=!1;for(const y of _){const L=y.endColumn,S=y.endLineNumber,k=y.startLineNumber;(S===v.lineNumber||k===v.lineNumber)&&Math.abs(v.column-L){D.highlightRange=D.action.isPreferred}),k.push(...S.validActions)),{validActions:k,allActions:g.allActions,documentation:g.documentation,hasAutoFix:g.hasAutoFix,dispose:()=>{g.dispose()}}}}}}return BC(this._registry,e,i.selection,i.trigger,Fu.None,a)}));i.trigger.type===1&&((s=this._progressService)===null||s===void 0||s.showWhile(r,250)),this.setState(new yp.Triggered(i.trigger,o,r))},void 0),this._codeActionOracle.value.trigger({type:2,triggerAction:Dr.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 L4e=globalThis&&globalThis.__decorate||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},Zd=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},v1=globalThis&&globalThis.__awaiter||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())})},xD;const k4e="quickfix-edit-highlight";let ig=xD=class extends te{static get(e){return e.getContribution(xD.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 Ts),this._showDisabled=!1,this._disposed=!1,this._editor=e,this._model=this._register(new S4e(this._editor,o.codeActionProvider,t,i,r,l)),this._register(this._model.onDidChangeState(u=>this.update(u))),this._lightBulbWidget=new kg(()=>{const u=this._editor.getContribution(wm.ID);return u&&this._register(u.onClick(h=>this.showCodeActionList(h.actions,h,{includeDisabledActions:!1,fromLightbulb:!0}))),u}),this._resolver=s.createInstance(OI),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=Sr.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 v1(this,void 0,void 0,function*(){try{yield this._instantiationService.invokeFunction(s4e,e,PI.FromCodeActions,{preview:i,editor:this._editor})}finally{t&&this._trigger({type:2,triggerAction:Dr.QuickFix,filter:{}})}})}update(e){var t,i,s,o,r,a,l;return v1(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){Dt(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=Sr.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=Sr.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 v1(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=Y.isIPosition(t)?this.toCoords(t):t,l={onSelect:(c,d)=>v1(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)=>v1(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:xD.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;Yf(m("editingNewSelection","Context: {0} at line {1} and column {2}.",g,f.startLineNumber,f.startColumn))}else s.clear()}};this._actionWidgetService.show("codeActionWidget",!0,c4e(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=Un(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}};ig.ID="editor.contrib.codeActionController";ig.DECORATION=kt.register({description:"quickfix-highlight",className:k4e});ig=xD=L4e([Zd(1,zd),Zd(2,bt),Zd(3,_t),Zd(4,Ze),Zd(5,Tg),Zd(6,gn),Zd(7,zt),Zd(8,o_),Zd(9,_t)],ig);bl((n,e)=>{((s,o)=>{o&&e.addRule(".monaco-editor ".concat(s," { background-color: ").concat(o,"; }"))})(".quickfix-edit-highlight",n.getColor(ld));const i=n.getColor(tf);i&&e.addRule(".monaco-editor .quickfix-edit-highlight { border: 1px ".concat(ac(n.type)?"dotted":"solid"," ").concat(i,"; box-sizing: border-box; }"))});function WS(n){return fe.regex(Tie.keys()[0],new RegExp("(\\s|^)"+Xr(n.value)+"\\b"))}const B7={type:"object",defaultSnippets:[{body:{kind:""}}],properties:{kind:{type:"string",description:m("args.schema.kind","Kind of the code action to run.")},apply:{type:"string",description:m("args.schema.apply","Controls when the returned actions are applied."),default:"ifSingle",enum:["first","ifSingle","never"],enumDescriptions:[m("args.schema.apply.first","Always apply the first returned code action."),m("args.schema.apply.ifSingle","Apply the first returned code action if it is the only one."),m("args.schema.apply.never","Do not apply the returned code actions.")]},preferred:{type:"boolean",default:!1,description:m("args.schema.preferred","Controls if only preferred code actions should be returned.")}}};function r_(n,e,t,i,s=Dr.Default){if(n.hasModel()){const o=ig.get(n);o==null||o.manualTriggerAtCurrentPosition(e,s,t,i)}}class D4e extends Ue{constructor(){super({id:P7,label:m("quickfix.trigger.label","Quick Fix..."),alias:"Quick Fix...",precondition:fe.and(O.writable,O.hasCodeActionsProvider),kbOpts:{kbExpr:O.textInputFocus,primary:2137,weight:100}})}run(e,t){return r_(t,m("editor.action.quickFix.noneMessage","No code actions available"),void 0,void 0,Dr.QuickFix)}}class E4e extends fs{constructor(){super({id:vie,precondition:fe.and(O.writable,O.hasCodeActionsProvider),description:{description:"Trigger a code action",args:[{name:"args",schema:B7}]}})}runEditorCommand(e,t,i){const s=Jc.fromUser(i,{kind:pt.Empty,apply:"ifSingle"});return r_(t,typeof(i==null?void 0:i.kind)=="string"?s.preferred?m("editor.action.codeAction.noneMessage.preferred.kind","No preferred code actions for '{0}' available",i.kind):m("editor.action.codeAction.noneMessage.kind","No code actions for '{0}' available",i.kind):s.preferred?m("editor.action.codeAction.noneMessage.preferred","No preferred code actions available"):m("editor.action.codeAction.noneMessage","No code actions available"),{include:s.kind,includeSourceActions:!0,onlyIncludePreferredActions:s.preferred},s.apply)}}class I4e extends Ue{constructor(){super({id:Cie,label:m("refactor.label","Refactor..."),alias:"Refactor...",precondition:fe.and(O.writable,O.hasCodeActionsProvider),kbOpts:{kbExpr:O.textInputFocus,primary:3120,mac:{primary:1328},weight:100},contextMenuOpts:{group:"1_modification",order:2,when:fe.and(O.writable,WS(pt.Refactor))},description:{description:"Refactor...",args:[{name:"args",schema:B7}]}})}run(e,t,i){const s=Jc.fromUser(i,{kind:pt.Refactor,apply:"never"});return r_(t,typeof(i==null?void 0:i.kind)=="string"?s.preferred?m("editor.action.refactor.noneMessage.preferred.kind","No preferred refactorings for '{0}' available",i.kind):m("editor.action.refactor.noneMessage.kind","No refactorings for '{0}' available",i.kind):s.preferred?m("editor.action.refactor.noneMessage.preferred","No preferred refactorings available"):m("editor.action.refactor.noneMessage","No refactorings available"),{include:pt.Refactor.contains(s.kind)?s.kind:pt.None,onlyIncludePreferredActions:s.preferred},s.apply,Dr.Refactor)}}class T4e extends Ue{constructor(){super({id:wie,label:m("source.label","Source Action..."),alias:"Source Action...",precondition:fe.and(O.writable,O.hasCodeActionsProvider),contextMenuOpts:{group:"1_modification",order:2.1,when:fe.and(O.writable,WS(pt.Source))},description:{description:"Source Action...",args:[{name:"args",schema:B7}]}})}run(e,t,i){const s=Jc.fromUser(i,{kind:pt.Source,apply:"never"});return r_(t,typeof(i==null?void 0:i.kind)=="string"?s.preferred?m("editor.action.source.noneMessage.preferred.kind","No preferred source actions for '{0}' available",i.kind):m("editor.action.source.noneMessage.kind","No source actions for '{0}' available",i.kind):s.preferred?m("editor.action.source.noneMessage.preferred","No preferred source actions available"):m("editor.action.source.noneMessage","No source actions available"),{include:pt.Source.contains(s.kind)?s.kind:pt.None,includeSourceActions:!0,onlyIncludePreferredActions:s.preferred},s.apply,Dr.SourceAction)}}class x4e extends Ue{constructor(){super({id:O7,label:m("organizeImports.label","Organize Imports"),alias:"Organize Imports",precondition:fe.and(O.writable,WS(pt.SourceOrganizeImports)),kbOpts:{kbExpr:O.textInputFocus,primary:1581,weight:100}})}run(e,t){return r_(t,m("editor.action.organize.noneMessage","No organize imports action available"),{include:pt.SourceOrganizeImports,includeSourceActions:!0},"ifSingle",Dr.OrganizeImports)}}class N4e extends Ue{constructor(){super({id:F7,label:m("fixAll.label","Fix All"),alias:"Fix All",precondition:fe.and(O.writable,WS(pt.SourceFixAll))})}run(e,t){return r_(t,m("fixAll.noneMessage","No fix all action available"),{include:pt.SourceFixAll,includeSourceActions:!0},"ifSingle",Dr.FixAll)}}class A4e extends Ue{constructor(){super({id:bie,label:m("autoFix.label","Auto Fix..."),alias:"Auto Fix...",precondition:fe.and(O.writable,WS(pt.QuickFix)),kbOpts:{kbExpr:O.textInputFocus,primary:1625,mac:{primary:2649},weight:100}})}run(e,t){return r_(t,m("editor.action.autoFix.noneMessage","No auto fixes available"),{include:pt.QuickFix,onlyIncludePreferredActions:!0},"ifSingle",Dr.AutoFix)}}ti(ig.ID,ig,3);ti(wm.ID,wm,4);De(D4e);De(I4e);De(T4e);De(x4e);De(A4e);De(N4e);Re(new E4e);en.as(wc.Configuration).registerConfiguration(Object.assign(Object.assign({},Mx),{properties:{"editor.codeActionWidget.showHeaders":{type:"boolean",scope:5,description:m("showCodeActionHeaders","Enable/disable showing group headers in the Code Action menu."),default:!0}}}));en.as(wc.Configuration).registerConfiguration(Object.assign(Object.assign({},Mx),{properties:{"editor.codeActionWidget.includeNearbyQuickfixes":{type:"boolean",scope:5,description:m("includeNearbyQuickfixes","Enable/disable showing nearest quickfix within a line when not currently on a diagnostic."),default:!1}}}));var rj=globalThis&&globalThis.__awaiter||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 mF{constructor(){this.lenses=[],this._disposables=new be}dispose(){this._disposables.dispose()}get isDisposed(){return this._disposables.isDisposed}add(e,t){this._disposables.add(e);for(const i of e.lenses)this.lenses.push({symbol:i,provider:t})}}function Nie(n,e,t){return rj(this,void 0,void 0,function*(){const i=n.ordered(e),s=new Map,o=new mF,r=i.map((a,l)=>rj(this,void 0,void 0,function*(){s.set(a,l);try{const c=yield Promise.resolve(a.provideCodeLenses(e,t));c&&o.add(c,a)}catch(c){Bn(c)}}));return yield Promise.all(r),o.lenses=o.lenses.sort((a,l)=>a.symbol.range.startLineNumberl.symbol.range.startLineNumber?1:s.get(a.provider)s.get(l.provider)?1:a.symbol.range.startColumnl.symbol.range.startColumn?1:0),o})}qt.registerCommand("_executeCodeLensProvider",function(n,...e){let[t,i]=e;bi(ct.isUri(t)),bi(typeof i=="number"||!i);const{codeLensProvider:s}=n.get(Ze),o=n.get(Zi).getModel(t);if(!o)throw La();const r=[],a=new be;return Nie(s,o,Ft.None).then(l=>{a.add(l);const c=[];for(const d of l.lenses)i==null||d.symbol.command?r.push(d.symbol):i-- >0&&d.provider.resolveCodeLens&&c.push(Promise.resolve(d.provider.resolveCodeLens(o,d.symbol,Ft.None)).then(u=>r.push(u||d.symbol)));return Promise.all(c)}).then(()=>r).finally(()=>{setTimeout(()=>a.dispose(),100)})});var M4e=globalThis&&globalThis.__decorate||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},R4e=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};const Aie=Wt("ICodeLensCache");class aj{constructor(e,t){this.lineCount=e,this.data=t}}let _F=class{constructor(e){this._fakeProvider=new class{provideCodeLenses(){throw new Error("not supported")}},this._cache=new Dg(20,.75);const t="codelens/cache";yu(()=>e.remove(t,1));const i="codelens/cache2",s=e.get(i,1,"{}");this._deserialize(s),We.once(e.onWillSaveState)(o=>{o.reason===lI.SHUTDOWN&&e.store(i,this._serialize(),1,1)})}put(e,t){const i=t.lenses.map(r=>{var a;return{range:r.symbol.range,command:r.symbol.command&&{id:"",title:(a=r.symbol.command)===null||a===void 0?void 0:a.title}}}),s=new mF;s.add({lenses:i,dispose:()=>{}},this._fakeProvider);const o=new aj(e.getLineCount(),s);this._cache.set(e.uri.toString(),o)}get(e){const t=this._cache.get(e.uri.toString());return t&&t.lineCount===e.getLineCount()?t.data:void 0}delete(e){this._cache.delete(e.uri.toString())}_serialize(){const e=Object.create(null);for(const[t,i]of this._cache){const s=new Set;for(const o of i.data.lenses)s.add(o.symbol.range.startLineNumber);e[t]={lineCount:i.lineCount,lines:[...s.values()]}}return JSON.stringify(e)}_deserialize(e){try{const t=JSON.parse(e);for(const i in t){const s=t[i],o=[];for(const a of s.lines)o.push({range:new I(a,1,a,11)});const r=new mF;r.add({lenses:o,dispose(){}},this._fakeProvider),this._cache.set(i,new aj(s.lineCount,r))}}catch{}}};_F=M4e([R4e(0,yl)],_F);Gt(Aie,_F,1);class P4e{constructor(e,t,i){this.afterColumn=1073741824,this.afterLineNumber=e,this.heightInPx=t,this._onHeight=i,this.suppressMouseDown=!0,this.domNode=document.createElement("div")}onComputedHeight(e){this._lastHeight===void 0?this._lastHeight=e:this._lastHeight!==e&&(this._lastHeight=e,this._onHeight())}isVisible(){return this._lastHeight!==0&&this.domNode.hasAttribute("monaco-visible-view-zone")}}class fN{constructor(e,t){this.allowEditorOverflow=!1,this.suppressMouseDown=!0,this._commands=new Map,this._isEmpty=!0,this._editor=e,this._id="codelens.widget-".concat(fN._idPool++),this.updatePosition(t),this._domNode=document.createElement("span"),this._domNode.className="codelens-decoration"}withCommands(e,t){this._commands.clear();const i=[];let s=!1;for(let o=0;o{c.symbol.command&&l.push(c.symbol),i.addDecoration({range:c.symbol.range,options:lj},u=>this._decorationIds[d]=u),a?a=I.plusRange(a,c.symbol.range):a=I.lift(c.symbol.range)}),this._viewZone=new P4e(a.startLineNumber-1,o,r),this._viewZoneId=s.addZone(this._viewZone),l.length>0&&(this._createContentWidgetIfNecessary(),this._contentWidget.withCommands(l,!1))}_createContentWidgetIfNecessary(){this._contentWidget?this._editor.layoutContentWidget(this._contentWidget):(this._contentWidget=new fN(this._editor,this._viewZone.afterLineNumber+1),this._editor.addContentWidget(this._contentWidget))}dispose(e,t){this._decorationIds.forEach(e.removeDecoration,e),this._decorationIds=[],t==null||t.removeZone(this._viewZoneId),this._contentWidget&&(this._editor.removeContentWidget(this._contentWidget),this._contentWidget=void 0),this._isDisposed=!0}isDisposed(){return this._isDisposed}isValid(){return this._decorationIds.some((e,t)=>{const i=this._editor.getModel().getDecorationRange(e),s=this._data[t].symbol;return!!(i&&I.isEmpty(s.range)===i.isEmpty())})}updateCodeLensSymbols(e,t){this._decorationIds.forEach(t.removeDecoration,t),this._decorationIds=[],this._data=e,this._data.forEach((i,s)=>{t.addDecoration({range:i.symbol.range,options:lj},o=>this._decorationIds[s]=o)})}updateHeight(e,t){this._viewZone.heightInPx=e,t.layoutZone(this._viewZoneId),this._contentWidget&&this._editor.layoutContentWidget(this._contentWidget)}computeIfNecessary(e){if(!this._viewZone.isVisible())return null;for(let t=0;t=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},b1=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},Mie=globalThis&&globalThis.__awaiter||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 qb=class{constructor(e,t,i,s,o,r){this._editor=e,this._languageFeaturesService=t,this._commandService=s,this._notificationService=o,this._codeLensCache=r,this._disposables=new be,this._localToDispose=new be,this._lenses=[],this._oldCodeLensModels=new be,this._provideCodeLensDebounce=i.for(t.codeLensProvider,"CodeLensProvide",{min:250}),this._resolveCodeLensesDebounce=i.for(t.codeLensProvider,"CodeLensResolve",{min:250,salt:"resolve"}),this._resolveCodeLensesScheduler=new Si(()=>this._resolveCodeLensesInViewport(),this._resolveCodeLensesDebounce.default()),this._disposables.add(this._editor.onDidChangeModel(()=>this._onModelChange())),this._disposables.add(this._editor.onDidChangeModelLanguage(()=>this._onModelChange())),this._disposables.add(this._editor.onDidChangeConfiguration(a=>{(a.hasChanged(50)||a.hasChanged(19)||a.hasChanged(18))&&this._updateLensStyle(),a.hasChanged(17)&&this._onModelChange()})),this._disposables.add(t.codeLensProvider.onDidChange(this._onModelChange,this)),this._onModelChange(),this._updateLensStyle()}dispose(){var e;this._localDispose(),this._disposables.dispose(),this._oldCodeLensModels.dispose(),(e=this._currentCodeLensModel)===null||e===void 0||e.dispose()}_getLayoutInfo(){const e=Math.max(1.3,this._editor.getOption(66)/this._editor.getOption(52));let t=this._editor.getOption(19);return(!t||t<5)&&(t=this._editor.getOption(52)*.9|0),{fontSize:t,codeLensHeight:t*e|0}}_updateLensStyle(){const{codeLensHeight:e,fontSize:t}=this._getLayoutInfo(),i=this._editor.getOption(18),s=this._editor.getOption(50),{style:o}=this._editor.getContainerDomNode();o.setProperty("--vscode-editorCodeLens-lineHeight","".concat(e,"px")),o.setProperty("--vscode-editorCodeLens-fontSize","".concat(t,"px")),o.setProperty("--vscode-editorCodeLens-fontFeatureSettings",s.fontFeatureSettings),i&&(o.setProperty("--vscode-editorCodeLens-fontFamily",i),o.setProperty("--vscode-editorCodeLens-fontFamilyDefault",wr.fontFamily)),this._editor.changeViewZones(r=>{for(const a of this._lenses)a.updateHeight(e,r)})}_localDispose(){var e,t,i;(e=this._getCodeLensModelPromise)===null||e===void 0||e.cancel(),this._getCodeLensModelPromise=void 0,(t=this._resolveCodeLensesPromise)===null||t===void 0||t.cancel(),this._resolveCodeLensesPromise=void 0,this._localToDispose.clear(),this._oldCodeLensModels.clear(),(i=this._currentCodeLensModel)===null||i===void 0||i.dispose()}_onModelChange(){this._localDispose();const e=this._editor.getModel();if(!e||!this._editor.getOption(17)||e.isTooLargeForTokenization())return;const t=this._codeLensCache.get(e);if(t&&this._renderCodeLensSymbols(t),!this._languageFeaturesService.codeLensProvider.has(e)){t&&this._localToDispose.add(Kf(()=>{const s=this._codeLensCache.get(e);t===s&&(this._codeLensCache.delete(e),this._onModelChange())},30*1e3));return}for(const s of this._languageFeaturesService.codeLensProvider.all(e))if(typeof s.onDidChange=="function"){const o=s.onDidChange(()=>i.schedule());this._localToDispose.add(o)}const i=new Si(()=>{var s;const o=Date.now();(s=this._getCodeLensModelPromise)===null||s===void 0||s.cancel(),this._getCodeLensModelPromise=Xn(r=>Nie(this._languageFeaturesService.codeLensProvider,e,r)),this._getCodeLensModelPromise.then(r=>{this._currentCodeLensModel&&this._oldCodeLensModels.add(this._currentCodeLensModel),this._currentCodeLensModel=r,this._codeLensCache.put(e,r);const a=this._provideCodeLensDebounce.update(e,Date.now()-o);i.delay=a,this._renderCodeLensSymbols(r),this._resolveCodeLensesInViewportSoon()},Dt)},this._provideCodeLensDebounce.get(e));this._localToDispose.add(i),this._localToDispose.add(vt(()=>this._resolveCodeLensesScheduler.cancel())),this._localToDispose.add(this._editor.onDidChangeModelContent(()=>{var s;this._editor.changeDecorations(o=>{this._editor.changeViewZones(r=>{const a=[];let l=-1;this._lenses.forEach(d=>{!d.isValid()||l===d.getLineNumber()?a.push(d):(d.update(r),l=d.getLineNumber())});const c=new bR;a.forEach(d=>{d.dispose(c,r),this._lenses.splice(this._lenses.indexOf(d),1)}),c.commit(o)})}),i.schedule(),this._resolveCodeLensesScheduler.cancel(),(s=this._resolveCodeLensesPromise)===null||s===void 0||s.cancel(),this._resolveCodeLensesPromise=void 0})),this._localToDispose.add(this._editor.onDidFocusEditorWidget(()=>{i.schedule()})),this._localToDispose.add(this._editor.onDidBlurEditorText(()=>{i.cancel()})),this._localToDispose.add(this._editor.onDidScrollChange(s=>{s.scrollTopChanged&&this._lenses.length>0&&this._resolveCodeLensesInViewportSoon()})),this._localToDispose.add(this._editor.onDidLayoutChange(()=>{this._resolveCodeLensesInViewportSoon()})),this._localToDispose.add(vt(()=>{if(this._editor.getModel()){const s=mc.capture(this._editor);this._editor.changeDecorations(o=>{this._editor.changeViewZones(r=>{this._disposeAllLenses(o,r)})}),s.restore(this._editor)}else this._disposeAllLenses(void 0,void 0)})),this._localToDispose.add(this._editor.onMouseDown(s=>{if(s.target.type!==9)return;let o=s.target.element;if((o==null?void 0:o.tagName)==="SPAN"&&(o=o.parentElement),(o==null?void 0:o.tagName)==="A")for(const r of this._lenses){const a=r.getCommand(o);if(a){this._commandService.executeCommand(a.id,...a.arguments||[]).catch(l=>this._notificationService.error(l));break}}})),i.schedule()}_disposeAllLenses(e,t){const i=new bR;for(const s of this._lenses)s.dispose(i,t);e&&i.commit(e),this._lenses.length=0}_renderCodeLensSymbols(e){if(!this._editor.hasModel())return;const t=this._editor.getModel().getLineCount(),i=[];let s;for(const a of e.lenses){const l=a.symbol.range.startLineNumber;l<1||l>t||(s&&s[s.length-1].symbol.range.startLineNumber===l?s.push(a):(s=[a],i.push(s)))}if(!i.length&&!this._lenses.length)return;const o=mc.capture(this._editor),r=this._getLayoutInfo();this._editor.changeDecorations(a=>{this._editor.changeViewZones(l=>{const c=new bR;let d=0,u=0;for(;uthis._resolveCodeLensesInViewportSoon())),d++,u++)}for(;dthis._resolveCodeLensesInViewportSoon())),u++;c.commit(a)})}),o.restore(this._editor)}_resolveCodeLensesInViewportSoon(){this._editor.getModel()&&this._resolveCodeLensesScheduler.schedule()}_resolveCodeLensesInViewport(){var e;(e=this._resolveCodeLensesPromise)===null||e===void 0||e.cancel(),this._resolveCodeLensesPromise=void 0;const t=this._editor.getModel();if(!t)return;const i=[],s=[];if(this._lenses.forEach(a=>{const l=a.computeIfNecessary(t);l&&(i.push(l),s.push(a))}),i.length===0)return;const o=Date.now(),r=Xn(a=>{const l=i.map((c,d)=>{const u=new Array(c.length),h=c.map((f,g)=>!f.symbol.command&&typeof f.provider.resolveCodeLens=="function"?Promise.resolve(f.provider.resolveCodeLens(t,f.symbol,a)).then(p=>{u[g]=p},Bn):(u[g]=f.symbol,Promise.resolve(void 0)));return Promise.all(h).then(()=>{!a.isCancellationRequested&&!s[d].isDisposed()&&s[d].updateCommands(u)})});return Promise.all(l)});this._resolveCodeLensesPromise=r,this._resolveCodeLensesPromise.then(()=>{const a=this._resolveCodeLensesDebounce.update(t,Date.now()-o);this._resolveCodeLensesScheduler.delay=a,this._currentCodeLensModel&&this._codeLensCache.put(t,this._currentCodeLensModel),this._oldCodeLensModels.clear(),r===this._resolveCodeLensesPromise&&(this._resolveCodeLensesPromise=void 0)},a=>{Dt(a),r===this._resolveCodeLensesPromise&&(this._resolveCodeLensesPromise=void 0)})}getModel(){var e;return Mie(this,void 0,void 0,function*(){return yield this._getCodeLensModelPromise,yield this._resolveCodeLensesPromise,!((e=this._currentCodeLensModel)===null||e===void 0)&&e.isDisposed?void 0:this._currentCodeLensModel})}};qb.ID="css.editor.codeLens";qb=O4e([b1(1,Ze),b1(2,Va),b1(3,gn),b1(4,Nn),b1(5,Aie)],qb);ti(qb.ID,qb,1);De(class extends Ue{constructor(){super({id:"codelens.showLensesInCurrentLine",precondition:O.hasCodeLensProvider,label:m("showLensOnLine","Show CodeLens Commands For Current Line"),alias:"Show CodeLens Commands For Current Line"})}run(e,t){return Mie(this,void 0,void 0,function*(){if(!t.hasModel())return;const i=e.get(yc),s=e.get(gn),o=e.get(Nn),r=t.getSelection().positionLineNumber,a=t.getContribution(qb.ID);if(!a)return;const l=yield a.getModel();if(!l)return;const c=[];for(const h of l.lenses)h.symbol.command&&h.symbol.range.startLineNumber===r&&c.push({label:h.symbol.command.title,command:h.symbol.command});if(c.length===0)return;const d=yield i.pick(c,{canPickMany:!1,placeHolder:m("placeHolder","Select a command")});if(!d)return;let u=d.command;if(l.isDisposed){const h=yield a.getModel(),f=h==null?void 0:h.lenses.find(g=>{var p;return g.symbol.range.startLineNumber===r&&((p=g.symbol.command)===null||p===void 0?void 0:p.title)===u.title});if(!f||!f.symbol.command)return;u=f.symbol.command}try{yield s.executeCommand(u.id,...u.arguments||[])}catch(h){o.error(h)}})}});var F4e=globalThis&&globalThis.__decorate||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},CR=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},B4e=globalThis&&globalThis.__awaiter||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 W7{constructor(e,t){this._editorWorkerClient=new K8(e,!1,"editorWorkerService",t)}provideDocumentColors(e,t){return B4e(this,void 0,void 0,function*(){return this._editorWorkerClient.computeDefaultDocumentColors(e.uri)})}provideColorPresentations(e,t,i){const s=t.range,o=t.color,r=o.alpha,a=new ee(new jt(Math.round(255*o.red),Math.round(255*o.green),Math.round(255*o.blue),r)),l=r?ee.Format.CSS.formatRGB(a):ee.Format.CSS.formatRGBA(a),c=r?ee.Format.CSS.formatHSL(a):ee.Format.CSS.formatHSLA(a),d=r?ee.Format.CSS.formatHex(a):ee.Format.CSS.formatHexA(a),u=[];return u.push({label:l,textEdit:{range:s,text:l}}),u.push({label:c,textEdit:{range:s,text:c}}),u.push({label:d,textEdit:{range:s,text:d}}),u}}let vF=class extends te{constructor(e,t,i){super(),this._register(i.colorProvider.register("*",new W7(e,t)))}};vF=F4e([CR(0,Zi),CR(1,Ni),CR(2,Ze)],vF);Jx(vF);var VS=globalThis&&globalThis.__awaiter||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 Rie(n,e,t,i=!0){return VS(this,void 0,void 0,function*(){return V7(new W4e,n,e,t,i)})}function Pie(n,e,t,i){return Promise.resolve(t.provideColorPresentations(n,e,i))}class W4e{constructor(){}compute(e,t,i,s){return VS(this,void 0,void 0,function*(){const o=yield e.provideDocumentColors(t,i);if(Array.isArray(o))for(const r of o)s.push({colorInfo:r,provider:e});return Array.isArray(o)})}}class V4e{constructor(){}compute(e,t,i,s){return VS(this,void 0,void 0,function*(){const o=yield e.provideDocumentColors(t,i);if(Array.isArray(o))for(const r of o)s.push({range:r.range,color:[r.color.red,r.color.green,r.color.blue,r.color.alpha]});return Array.isArray(o)})}}class H4e{constructor(e){this.colorInfo=e}compute(e,t,i,s){return VS(this,void 0,void 0,function*(){const o=yield e.provideColorPresentations(t,this.colorInfo,Ft.None);return Array.isArray(o)&&s.push(...o),Array.isArray(o)})}}function V7(n,e,t,i,s){return VS(this,void 0,void 0,function*(){let o=!1,r;const a=[],l=e.ordered(t);for(let c=l.length-1;c>=0;c--){const d=l[c];if(d instanceof W7)r=d;else try{(yield n.compute(d,t,i,a))&&(o=!0)}catch(u){Bn(u)}}return o?a:r&&s?(yield n.compute(r,t,i,a),a):[]})}function Oie(n,e){const{colorProvider:t}=n.get(Ze),i=n.get(Zi).getModel(e);if(!i)throw La();const s=n.get(zt).getValue("editor.defaultColorDecorators",{resource:e});return{model:i,colorProviderRegistry:t,isDefaultColorDecoratorsEnabled:s}}qt.registerCommand("_executeDocumentColorProvider",function(n,...e){const[t]=e;if(!(t instanceof ct))throw La();const{model:i,colorProviderRegistry:s,isDefaultColorDecoratorsEnabled:o}=Oie(n,t);return V7(new V4e,s,i,Ft.None,o)});qt.registerCommand("_executeColorPresentationProvider",function(n,...e){const[t,i]=e,{uri:s,range:o}=i;if(!(s instanceof ct)||!Array.isArray(t)||t.length!==4||!I.isIRange(o))throw La();const{model:r,colorProviderRegistry:a,isDefaultColorDecoratorsEnabled:l}=Oie(n,s),[c,d,u,h]=t;return V7(new H4e({range:o,color:{red:c,green:d,blue:u,alpha:h}}),a,r,Ft.None,l)});var $4e=globalThis&&globalThis.__decorate||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},wR=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},dj=globalThis&&globalThis.__awaiter||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())})},bF;const Fie=Object.create({});let ng=bF=class extends te{constructor(e,t,i,s){super(),this._editor=e,this._configurationService=t,this._languageFeaturesService=i,this._localToDispose=this._register(new be),this._decorationsIds=[],this._colorDatas=new Map,this._colorDecoratorIds=this._editor.createDecorationsCollection(),this._ruleFactory=new mS(this._editor),this._decoratorLimitReporter=new z4e,this._colorDecorationClassRefs=this._register(new be),this._debounceInformation=s.for(i.colorProvider,"Document Colors",{min:bF.RECOMPUTE_TIME}),this._register(e.onDidChangeModel(()=>{this._isColorDecoratorsEnabled=this.isEnabled(),this.updateColors()})),this._register(e.onDidChangeModelLanguage(()=>this.updateColors())),this._register(i.colorProvider.onDidChange(()=>this.updateColors())),this._register(e.onDidChangeConfiguration(o=>{const r=this._isColorDecoratorsEnabled;this._isColorDecoratorsEnabled=this.isEnabled(),this._isDefaultColorDecoratorsEnabled=this._editor.getOption(145);const a=r!==this._isColorDecoratorsEnabled||o.hasChanged(21),l=o.hasChanged(145);(a||l)&&(this._isColorDecoratorsEnabled?this.updateColors():this.removeAllDecorations())})),this._timeoutTimer=null,this._computePromise=null,this._isColorDecoratorsEnabled=this.isEnabled(),this._isDefaultColorDecoratorsEnabled=this._editor.getOption(145),this.updateColors()}isEnabled(){const e=this._editor.getModel();if(!e)return!1;const t=e.getLanguageId(),i=this._configurationService.getValue(t);if(i&&typeof i=="object"){const s=i.colorDecorators;if(s&&s.enable!==void 0&&!s.enable)return s.enable}return this._editor.getOption(20)}static get(e){return e.getContribution(this.ID)}dispose(){this.stop(),this.removeAllDecorations(),super.dispose()}updateColors(){if(this.stop(),!this._isColorDecoratorsEnabled)return;const e=this._editor.getModel();!e||!this._languageFeaturesService.colorProvider.has(e)||(this._localToDispose.add(this._editor.onDidChangeModelContent(()=>{this._timeoutTimer||(this._timeoutTimer=new _l,this._timeoutTimer.cancelAndSet(()=>{this._timeoutTimer=null,this.beginCompute()},this._debounceInformation.get(e)))})),this.beginCompute())}beginCompute(){return dj(this,void 0,void 0,function*(){this._computePromise=Xn(e=>dj(this,void 0,void 0,function*(){const t=this._editor.getModel();if(!t)return[];const i=new so(!1),s=yield Rie(this._languageFeaturesService.colorProvider,t,e,this._isDefaultColorDecoratorsEnabled);return this._debounceInformation.update(t,i.elapsed()),s}));try{const e=yield this._computePromise;this.updateDecorations(e),this.updateColorDecorators(e),this._computePromise=null}catch(e){Dt(e)}})}stop(){this._timeoutTimer&&(this._timeoutTimer.cancel(),this._timeoutTimer=null),this._computePromise&&(this._computePromise.cancel(),this._computePromise=null),this._localToDispose.clear()}updateDecorations(e){const t=e.map(i=>({range:{startLineNumber:i.colorInfo.range.startLineNumber,startColumn:i.colorInfo.range.startColumn,endLineNumber:i.colorInfo.range.endLineNumber,endColumn:i.colorInfo.range.endColumn},options:kt.EMPTY}));this._editor.changeDecorations(i=>{this._decorationsIds=i.deltaDecorations(this._decorationsIds,t),this._colorDatas=new Map,this._decorationsIds.forEach((s,o)=>this._colorDatas.set(s,e[o]))})}updateColorDecorators(e){this._colorDecorationClassRefs.clear();const t=[],i=this._editor.getOption(21);for(let o=0;othis._colorDatas.has(s.id));return i.length===0?null:this._colorDatas.get(i[0].id)}isColorDecoration(e){return this._colorDecoratorIds.has(e)}};ng.ID="editor.contrib.colorDetector";ng.RECOMPUTE_TIME=1e3;ng=bF=$4e([wR(1,zt),wR(2,Ze),wR(3,Va)],ng);class z4e{constructor(){this._onDidChange=new j,this._computed=0,this._limited=!1}update(e,t){(e!==this._computed||t!==this._limited)&&(this._computed=e,this._limited=t,this._onDidChange.fire())}}ti(ng.ID,ng,1);class U4e{get color(){return this._color}set color(e){this._color.equals(e)||(this._color=e,this._onDidChangeColor.fire(e))}get presentation(){return this.colorPresentations[this.presentationIndex]}get colorPresentations(){return this._colorPresentations}set colorPresentations(e){this._colorPresentations=e,this.presentationIndex>e.length-1&&(this.presentationIndex=0),this._onDidChangePresentation.fire(this.presentation)}constructor(e,t,i){this.presentationIndex=i,this._onColorFlushed=new j,this.onColorFlushed=this._onColorFlushed.event,this._onDidChangeColor=new j,this.onDidChangeColor=this._onDidChangeColor.event,this._onDidChangePresentation=new j,this.onDidChangePresentation=this._onDidChangePresentation.event,this.originalColor=e,this._color=e,this._colorPresentations=t}selectNextColorPresentation(){this.presentationIndex=(this.presentationIndex+1)%this.colorPresentations.length,this.flushColor(),this._onDidChangePresentation.fire(this.presentation)}guessColorPresentation(e,t){let i=-1;for(let s=0;s{this.backgroundColor=r.getColor(ME)||ee.white})),this._register(ce(this._pickedColorNode,Pe.CLICK,()=>this.model.selectNextColorPresentation())),this._register(ce(this._originalColorNode,Pe.CLICK,()=>{this.model.color=this.model.originalColor,this.model.flushColor()})),this._register(t.onDidChangeColor(this.onDidChangeColor,this)),this._register(t.onDidChangePresentation(this.onDidChangePresentation,this)),this._pickedColorNode.style.backgroundColor=ee.Format.CSS.format(t.color)||"",this._pickedColorNode.classList.toggle("light",t.color.rgba.a<.5?this.backgroundColor.isLighter():t.color.isLighter()),this.onDidChangeColor(this.model.color),this.showingStandaloneColorPicker&&(this._domNode.classList.add("standalone-colorpicker"),this._closeButton=this._register(new K4e(this._domNode)))}get closeButton(){return this._closeButton}get pickedColorNode(){return this._pickedColorNode}get originalColorNode(){return this._originalColorNode}onDidChangeColor(e){this._pickedColorNode.style.backgroundColor=ee.Format.CSS.format(e)||"",this._pickedColorNode.classList.toggle("light",e.rgba.a<.5?this.backgroundColor.isLighter():e.isLighter()),this.onDidChangePresentation()}onDidChangePresentation(){this._pickedColorPresentation.textContent=this.model.presentation?this.model.presentation.label:""}}class K4e extends te{constructor(e){super(),this._onClicked=this._register(new j),this.onClicked=this._onClicked.event,this._button=document.createElement("div"),this._button.classList.add("close-button"),ge(e,this._button);const t=document.createElement("div");t.classList.add("close-button-inner-div"),ge(this._button,t),ge(t,Hr(".button"+dt.asCSSSelector(Sn("color-picker-close",Me.close,m("closeIcon","Icon to close the color picker"))))).classList.add("close-icon"),this._button.onclick=()=>{this._onClicked.fire()}}}class q4e extends te{constructor(e,t,i,s=!1){super(),this.model=t,this.pixelRatio=i,this._insertButton=null,this._domNode=Hr(".colorpicker-body"),ge(e,this._domNode),this._saturationBox=new G4e(this._domNode,this.model,this.pixelRatio),this._register(this._saturationBox),this._register(this._saturationBox.onDidChange(this.onDidSaturationValueChange,this)),this._register(this._saturationBox.onColorFlushed(this.flushColor,this)),this._opacityStrip=new Y4e(this._domNode,this.model,s),this._register(this._opacityStrip),this._register(this._opacityStrip.onDidChange(this.onDidOpacityChange,this)),this._register(this._opacityStrip.onColorFlushed(this.flushColor,this)),this._hueStrip=new Z4e(this._domNode,this.model,s),this._register(this._hueStrip),this._register(this._hueStrip.onDidChange(this.onDidHueChange,this)),this._register(this._hueStrip.onColorFlushed(this.flushColor,this)),s&&(this._insertButton=this._register(new X4e(this._domNode)),this._domNode.classList.add("standalone-colorpicker"))}flushColor(){this.model.flushColor()}onDidSaturationValueChange({s:e,v:t}){const i=this.model.color.hsva;this.model.color=new ee(new id(i.h,e,t,i.a))}onDidOpacityChange(e){const t=this.model.color.hsva;this.model.color=new ee(new id(t.h,t.s,t.v,e))}onDidHueChange(e){const t=this.model.color.hsva,i=(1-e)*360;this.model.color=new ee(new id(i===360?0:i,t.s,t.v,t.a))}get domNode(){return this._domNode}get saturationBox(){return this._saturationBox}get enterButton(){return this._insertButton}layout(){this._saturationBox.layout(),this._opacityStrip.layout(),this._hueStrip.layout()}}class G4e extends te{constructor(e,t,i){super(),this.model=t,this.pixelRatio=i,this._onDidChange=new j,this.onDidChange=this._onDidChange.event,this._onColorFlushed=new j,this.onColorFlushed=this._onColorFlushed.event,this._domNode=Hr(".saturation-wrap"),ge(e,this._domNode),this._canvas=document.createElement("canvas"),this._canvas.className="saturation-box",ge(this._domNode,this._canvas),this.selection=Hr(".saturation-selection"),ge(this._domNode,this.selection),this.layout(),this._register(ce(this._domNode,Pe.POINTER_DOWN,s=>this.onPointerDown(s))),this._register(this.model.onDidChangeColor(this.onDidChangeColor,this)),this.monitor=null}get domNode(){return this._domNode}onPointerDown(e){if(!e.target||!(e.target instanceof Element))return;this.monitor=this._register(new I0);const t=Un(this._domNode);e.target!==this.selection&&this.onDidChangePosition(e.offsetX,e.offsetY),this.monitor.startMonitoring(e.target,e.pointerId,e.buttons,s=>this.onDidChangePosition(s.pageX-t.left,s.pageY-t.top),()=>null);const i=ce(e.target.ownerDocument,Pe.POINTER_UP,()=>{this._onColorFlushed.fire(),i.dispose(),this.monitor&&(this.monitor.stopMonitoring(!0),this.monitor=null)},!0)}onDidChangePosition(e,t){const i=Math.max(0,Math.min(1,e/this.width)),s=Math.max(0,Math.min(1,1-t/this.height));this.paintSelection(i,s),this._onDidChange.fire({s:i,v:s})}layout(){this.width=this._domNode.offsetWidth,this.height=this._domNode.offsetHeight,this._canvas.width=this.width*this.pixelRatio,this._canvas.height=this.height*this.pixelRatio,this.paint();const e=this.model.color.hsva;this.paintSelection(e.s,e.v)}paint(){const e=this.model.color.hsva,t=new ee(new id(e.h,1,1,1)),i=this._canvas.getContext("2d"),s=i.createLinearGradient(0,0,this._canvas.width,0);s.addColorStop(0,"rgba(255, 255, 255, 1)"),s.addColorStop(.5,"rgba(255, 255, 255, 0.5)"),s.addColorStop(1,"rgba(255, 255, 255, 0)");const o=i.createLinearGradient(0,0,0,this._canvas.height);o.addColorStop(0,"rgba(0, 0, 0, 0)"),o.addColorStop(1,"rgba(0, 0, 0, 1)"),i.rect(0,0,this._canvas.width,this._canvas.height),i.fillStyle=ee.Format.CSS.format(t),i.fill(),i.fillStyle=s,i.fill(),i.fillStyle=o,i.fill()}paintSelection(e,t){this.selection.style.left="".concat(e*this.width,"px"),this.selection.style.top="".concat(this.height-t*this.height,"px")}onDidChangeColor(e){if(this.monitor&&this.monitor.isMonitoring())return;this.paint();const t=e.hsva;this.paintSelection(t.s,t.v)}}class Bie extends te{constructor(e,t,i=!1){super(),this.model=t,this._onDidChange=new j,this.onDidChange=this._onDidChange.event,this._onColorFlushed=new j,this.onColorFlushed=this._onColorFlushed.event,i?(this.domNode=ge(e,Hr(".standalone-strip")),this.overlay=ge(this.domNode,Hr(".standalone-overlay"))):(this.domNode=ge(e,Hr(".strip")),this.overlay=ge(this.domNode,Hr(".overlay"))),this.slider=ge(this.domNode,Hr(".slider")),this.slider.style.top="0px",this._register(ce(this.domNode,Pe.POINTER_DOWN,s=>this.onPointerDown(s))),this._register(t.onDidChangeColor(this.onDidChangeColor,this)),this.layout()}layout(){this.height=this.domNode.offsetHeight-this.slider.offsetHeight;const e=this.getValue(this.model.color);this.updateSliderPosition(e)}onDidChangeColor(e){const t=this.getValue(e);this.updateSliderPosition(t)}onPointerDown(e){if(!e.target||!(e.target instanceof Element))return;const t=this._register(new I0),i=Un(this.domNode);this.domNode.classList.add("grabbing"),e.target!==this.slider&&this.onDidChangeTop(e.offsetY),t.startMonitoring(e.target,e.pointerId,e.buttons,o=>this.onDidChangeTop(o.pageY-i.top),()=>null);const s=ce(e.target.ownerDocument,Pe.POINTER_UP,()=>{this._onColorFlushed.fire(),s.dispose(),t.stopMonitoring(!0),this.domNode.classList.remove("grabbing")},!0)}onDidChangeTop(e){const t=Math.max(0,Math.min(1,1-e/this.height));this.updateSliderPosition(t),this._onDidChange.fire(t)}updateSliderPosition(e){this.slider.style.top="".concat((1-e)*this.height,"px")}}class Y4e extends Bie{constructor(e,t,i=!1){super(e,t,i),this.domNode.classList.add("opacity-strip"),this.onDidChangeColor(this.model.color)}onDidChangeColor(e){super.onDidChangeColor(e);const{r:t,g:i,b:s}=e.rgba,o=new ee(new jt(t,i,s,1)),r=new ee(new jt(t,i,s,0));this.overlay.style.background="linear-gradient(to bottom, ".concat(o," 0%, ").concat(r," 100%)")}getValue(e){return e.hsva.a}}class Z4e extends Bie{constructor(e,t,i=!1){super(e,t,i),this.domNode.classList.add("hue-strip")}getValue(e){return 1-e.hsva.h/360}}class X4e extends te{constructor(e){super(),this._onClicked=this._register(new j),this.onClicked=this._onClicked.event,this._button=ge(e,document.createElement("button")),this._button.classList.add("insert-button"),this._button.textContent="Insert",this._button.onclick=t=>{this._onClicked.fire()}}get button(){return this._button}}class Q4e extends vl{constructor(e,t,i,s,o=!1){super(),this.model=t,this.pixelRatio=i,this._register(vw.onDidChange(()=>this.layout()));const r=Hr(".colorpicker-widget");e.appendChild(r),this.header=this._register(new j4e(r,this.model,s,o)),this.body=this._register(new q4e(r,this.model,this.pixelRatio,o))}layout(){this.body.layout()}}var Wie=globalThis&&globalThis.__decorate||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},Vie=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},Gb=globalThis&&globalThis.__awaiter||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 J4e{constructor(e,t,i,s){this.owner=e,this.range=t,this.model=i,this.provider=s,this.forceShowAtRange=!0}isValidForHoverAnchor(e){return e.type===1&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}}let FI=class{constructor(e,t){this._editor=e,this._themeService=t,this.hoverOrdinal=2}computeSync(e,t){return[]}computeAsync(e,t,i){return Mn.fromPromise(this._computeAsync(e,t,i))}_computeAsync(e,t,i){return Gb(this,void 0,void 0,function*(){if(!this._editor.hasModel())return[];const s=ng.get(this._editor);if(!s)return[];for(const o of t){if(!s.isColorDecoration(o))continue;const r=s.getColorData(o.range.getStartPosition());if(r)return[yield Hie(this,this._editor.getModel(),r.colorInfo,r.provider)]}return[]})}renderHoverParts(e,t){return $ie(this,this._editor,this._themeService,t,e)}};FI=Wie([Vie(1,os)],FI);class eFe{constructor(e,t,i,s){this.owner=e,this.range=t,this.model=i,this.provider=s}}let my=class{constructor(e,t){this._editor=e,this._themeService=t,this._color=null}createColorHover(e,t,i){return Gb(this,void 0,void 0,function*(){if(!this._editor.hasModel()||!ng.get(this._editor))return null;const o=yield Rie(i,this._editor.getModel(),Ft.None);let r=null,a=null;for(const u of o){const h=u.colorInfo;I.containsRange(h.range,e.range)&&(r=h,a=u.provider)}const l=r!=null?r:e,c=a!=null?a:t,d=!!r;return{colorHover:yield Hie(this,this._editor.getModel(),l,c),foundInEditor:d}})}updateEditorModel(e){return Gb(this,void 0,void 0,function*(){if(!this._editor.hasModel())return;const t=e.model;let i=new I(e.range.startLineNumber,e.range.startColumn,e.range.endLineNumber,e.range.endColumn);this._color&&(yield ND(this._editor.getModel(),t,this._color,i,e),i=zie(this._editor,i,t))})}renderHoverParts(e,t){return $ie(this,this._editor,this._themeService,t,e)}set color(e){this._color=e}get color(){return this._color}};my=Wie([Vie(1,os)],my);function Hie(n,e,t,i){return Gb(this,void 0,void 0,function*(){const s=e.getValueInRange(t.range),{red:o,green:r,blue:a,alpha:l}=t.color,c=new jt(Math.round(o*255),Math.round(r*255),Math.round(a*255),l),d=new ee(c),u=yield Pie(e,t,i,Ft.None),h=new U4e(d,[],0);return h.colorPresentations=u||[],h.guessColorPresentation(d,s),n instanceof FI?new J4e(n,I.lift(t.range),h,i):new eFe(n,I.lift(t.range),h,i)})}function $ie(n,e,t,i,s){if(i.length===0||!e.hasModel())return te.None;if(s.setMinimumDimensions){const h=e.getOption(66)+8;s.setMinimumDimensions(new ii(302,h))}const o=new be,r=i[0],a=e.getModel(),l=r.model,c=o.add(new Q4e(s.fragment,l,e.getOption(141),t,n instanceof my));s.setColorPicker(c);let d=!1,u=new I(r.range.startLineNumber,r.range.startColumn,r.range.endLineNumber,r.range.endColumn);if(n instanceof my){const h=i[0].model.color;n.color=h,ND(a,l,h,u,r),o.add(l.onColorFlushed(f=>{n.color=f}))}else o.add(l.onColorFlushed(h=>Gb(this,void 0,void 0,function*(){yield ND(a,l,h,u,r),d=!0,u=zie(e,u,l,s)})));return o.add(l.onDidChangeColor(h=>{ND(a,l,h,u,r)})),o.add(e.onDidChangeModelContent(h=>{d?d=!1:(s.hide(),e.focus())})),o}function zie(n,e,t,i){let s,o;if(t.presentation.textEdit){s=[t.presentation.textEdit],o=new I(t.presentation.textEdit.range.startLineNumber,t.presentation.textEdit.range.startColumn,t.presentation.textEdit.range.endLineNumber,t.presentation.textEdit.range.endColumn);const r=n.getModel()._setTrackedRange(null,o,3);n.pushUndoStop(),n.executeEdits("colorpicker",s),o=n.getModel()._getTrackedRange(r)||o}else s=[{range:e,text:t.presentation.label,forceMoveMarkers:!1}],o=e.setEndPosition(e.endLineNumber,e.startColumn+t.presentation.label.length),n.pushUndoStop(),n.executeEdits("colorpicker",s);return t.presentation.additionalTextEdits&&(s=[...t.presentation.additionalTextEdits],n.executeEdits("colorpicker",s),i&&i.hide()),n.pushUndoStop(),o}function ND(n,e,t,i,s){return Gb(this,void 0,void 0,function*(){const o=yield Pie(n,{range:i,color:{red:t.rgba.r/255,green:t.rgba.g/255,blue:t.rgba.b/255,alpha:t.rgba.a}},s.provider,Ft.None);e.colorPresentations=o||[]})}function CF(n,e){return!!n[e]}class yR{constructor(e,t){this.target=e.target,this.isLeftClick=e.event.leftButton,this.isMiddleClick=e.event.middleButton,this.isRightClick=e.event.rightButton,this.hasTriggerModifier=CF(e.event,t.triggerModifier),this.hasSideBySideModifier=CF(e.event,t.triggerSideBySideModifier),this.isNoneOrSingleMouseDown=e.event.detail<=1}}class uj{constructor(e,t){this.keyCodeIsTriggerKey=e.keyCode===t.triggerKey,this.keyCodeIsSideBySideKey=e.keyCode===t.triggerSideBySideKey,this.hasTriggerModifier=CF(e,t.triggerModifier)}}class ok{constructor(e,t,i,s){this.triggerKey=e,this.triggerModifier=t,this.triggerSideBySideKey=i,this.triggerSideBySideModifier=s}equals(e){return this.triggerKey===e.triggerKey&&this.triggerModifier===e.triggerModifier&&this.triggerSideBySideKey===e.triggerSideBySideKey&&this.triggerSideBySideModifier===e.triggerSideBySideModifier}}function hj(n){return n==="altKey"?Kt?new ok(57,"metaKey",6,"altKey"):new ok(5,"ctrlKey",6,"altKey"):Kt?new ok(6,"altKey",57,"metaKey"):new ok(6,"altKey",5,"ctrlKey")}class gN extends te{constructor(e,t){var i;super(),this._onMouseMoveOrRelevantKeyDown=this._register(new j),this.onMouseMoveOrRelevantKeyDown=this._onMouseMoveOrRelevantKeyDown.event,this._onExecute=this._register(new j),this.onExecute=this._onExecute.event,this._onCancel=this._register(new j),this.onCancel=this._onCancel.event,this._editor=e,this._extractLineNumberFromMouseEvent=(i=t==null?void 0:t.extractLineNumberFromMouseEvent)!==null&&i!==void 0?i:s=>s.target.position?s.target.position.lineNumber:0,this._opts=hj(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=hj(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 yR(s,this._opts)))),this._register(this._editor.onMouseDown(s=>this._onEditorMouseDown(new yR(s,this._opts)))),this._register(this._editor.onMouseUp(s=>this._onEditorMouseUp(new yR(s,this._opts)))),this._register(this._editor.onKeyDown(s=>this._onEditorKeyDown(new uj(s,this._opts)))),this._register(this._editor.onKeyUp(s=>this._onEditorKeyUp(new uj(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 tFe=globalThis&&globalThis.__decorate||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},Xd=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let sg=class extends Ob{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){UT(this._overwriteOptions,e,!0),super.updateOptions(this._overwriteOptions)}};sg=tFe([Xd(4,_t),Xd(5,ai),Xd(6,gn),Xd(7,bt),Xd(8,os),Xd(9,Nn),Xd(10,oh),Xd(11,Ni),Xd(12,Ze)],sg);const fj=new ee(new jt(0,122,204)),iFe={showArrow:!0,showFrame:!0,className:"",frameColor:fj,arrowColor:fj,keepEditorSelection:!1},nFe="vs.editor.contrib.zoneWidget";class sFe{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 oFe{constructor(e,t){this._id=e,this._domNode=t}getId(){return this._id}getDomNode(){return this._domNode}getPosition(){return null}}class pN{constructor(e){this._editor=e,this._ruleName=pN._IdGenerator.nextId(),this._decorations=this._editor.createDecorationsCollection(),this._color=null,this._height=-1}dispose(){this.hide(),sH(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(){sH(this._ruleName),jP(".monaco-editor ".concat(this._ruleName),"border-style: solid; border-color: transparent; border-bottom-color: ".concat(this._color,"; border-width: ").concat(this._height,"px; bottom: -").concat(this._height,"px; margin-left: -").concat(this._height,"px; "))}show(e){e.column===1&&(e={lineNumber:e.lineNumber,column:2}),this._decorations.set([{range:I.fromPositions(e),options:{description:"zone-widget-arrow",className:this._ruleName,stickiness:1}}])}hide(){this._decorations.clear()}}pN._IdGenerator=new K9(".arrow-decoration-");class rFe{constructor(e,t={}){this._arrow=null,this._overlayWidget=null,this._resizeSash=null,this._viewZone=null,this._disposables=new be,this.container=null,this._isShowing=!1,this.editor=e,this._positionMarkerId=this.editor.createDecorationsCollection(),this.options=du(t),UT(this.options,iFe,!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 pN(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="".concat(e,"px"),this.container){const i=e-this._decoratingElementsHeight();this.container.style.height="".concat(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=I.isIRange(e)?I.lift(e):I.fromPositions(e);this._isShowing=!0,this._showImpl(i,t),this._isShowing=!1,this._positionMarkerId.set([{range:i,options:kt.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="".concat(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 sFe(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 oFe(nFe+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 I(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 qs(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 Uie=globalThis&&globalThis.__decorate||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},jie=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};const Kie=Wt("IPeekViewService");Gt(Kie,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 tr;(function(n){n.inPeekEditor=new Ve("inReferenceSearchEditor",!0,m("inReferenceSearchEditor","Whether the current code editor is embedded inside peek")),n.notInPeekEditor=n.inPeekEditor.toNegated()})(tr||(tr={}));let _y=class{constructor(e,t){e instanceof sg&&tr.inPeekEditor.bindTo(t)}dispose(){}};_y.ID="editor.contrib.referenceController";_y=Uie([jie(1,bt)],_y);ti(_y.ID,_y,0);function aFe(n){const e=n.get(ai).getFocusedCodeEditor();return e instanceof sg?e.getParentEditor():e}const lFe={headerBackgroundColor:ee.white,primaryHeadingColor:ee.fromHex("#333333"),secondaryHeadingColor:ee.fromHex("#6c6c6cb3")};let BI=class extends rFe{constructor(e,t,i){super(e,t),this.instantiationService=i,this._onDidClose=new j,this.onDidClose=this._onDidClose.event,UT(this.options,lFe,!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=ye(".head"),this._bodyElement=ye(".body"),this._fillHead(this._headElement),this._fillBody(this._bodyElement),e.appendChild(this._headElement),e.appendChild(this._bodyElement)}_fillHead(e,t){this._titleElement=ye(".peekview-title"),this.options.supportOnTitleClick&&(this._titleElement.classList.add("clickable"),In(this._titleElement,"click",o=>this._onTitleClick(o))),ge(this._headElement,this._titleElement),this._fillTitleIcon(this._titleElement),this._primaryHeading=ye("span.filename"),this._secondaryHeading=ye("span.dirname"),this._metaHeading=ye("span.meta"),ge(this._titleElement,this._primaryHeading,this._secondaryHeading,this._metaHeading);const i=ye(".peekview-actions");ge(this._headElement,i);const s=this._getActionBarOptions();this._actionbarWidget=new Pa(i,s),this._disposables.add(this._actionbarWidget),t||this._actionbarWidget.push(new Ro("peekview.close",m("label.close","Close"),dt.asClassName(Me.close),!0,()=>(this.dispose(),Promise.resolve())),{label:!1,icon:!0})}_fillTitleIcon(e){}_getActionBarOptions(){return{actionViewItemProvider:cNe.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:Ds(this._secondaryHeading))}setMetaTitle(e){this._metaHeading&&(e?(this._metaHeading.innerText=e,mr(this._metaHeading)):Lo(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="".concat(e,"px"),this._headElement.style.lineHeight=this._headElement.style.height)}_doLayoutBody(e,t){this._bodyElement&&(this._bodyElement.style.height="".concat(e,"px"))}};BI=Uie([jie(2,_t)],BI);const cFe=F("peekViewTitle.background",{dark:"#252526",light:"#F3F3F3",hcDark:ee.black,hcLight:ee.white},m("peekViewTitleBackground","Background color of the peek view title area.")),qie=F("peekViewTitleLabel.foreground",{dark:ee.white,light:ee.black,hcDark:ee.white,hcLight:Ja},m("peekViewTitleForeground","Color of the peek view title.")),Gie=F("peekViewTitleDescription.foreground",{dark:"#ccccccb3",light:"#616161",hcDark:"#FFFFFF99",hcLight:"#292929"},m("peekViewTitleInfoForeground","Color of the peek view title info.")),dFe=F("peekView.border",{dark:Xo,light:Xo,hcDark:$t,hcLight:$t},m("peekViewBorder","Color of the peek view borders and arrow.")),uFe=F("peekViewResult.background",{dark:"#252526",light:"#F3F3F3",hcDark:ee.black,hcLight:ee.white},m("peekViewResultsBackground","Background color of the peek view result list."));F("peekViewResult.lineForeground",{dark:"#bbbbbb",light:"#646465",hcDark:ee.white,hcLight:Ja},m("peekViewResultsMatchForeground","Foreground color for line nodes in the peek view result list."));F("peekViewResult.fileForeground",{dark:ee.white,light:"#1E1E1E",hcDark:ee.white,hcLight:Ja},m("peekViewResultsFileForeground","Foreground color for file nodes in the peek view result list."));F("peekViewResult.selectionBackground",{dark:"#3399ff33",light:"#3399ff33",hcDark:null,hcLight:null},m("peekViewResultsSelectionBackground","Background color of the selected entry in the peek view result list."));F("peekViewResult.selectionForeground",{dark:ee.white,light:"#6C6C6C",hcDark:ee.white,hcLight:Ja},m("peekViewResultsSelectionForeground","Foreground color of the selected entry in the peek view result list."));const lf=F("peekViewEditor.background",{dark:"#001F33",light:"#F2F8FC",hcDark:ee.black,hcLight:ee.white},m("peekViewEditorBackground","Background color of the peek view editor."));F("peekViewEditorGutter.background",{dark:lf,light:lf,hcDark:lf,hcLight:lf},m("peekViewEditorGutterBackground","Background color of the gutter in the peek view editor."));F("peekViewEditorStickyScroll.background",{dark:lf,light:lf,hcDark:lf,hcLight:lf},m("peekViewEditorStickScrollBackground","Background color of sticky scroll in the peek view editor."));F("peekViewResult.matchHighlightBackground",{dark:"#ea5c004d",light:"#ea5c004d",hcDark:null,hcLight:null},m("peekViewResultsMatchHighlight","Match highlight color in the peek view result list."));F("peekViewEditor.matchHighlightBackground",{dark:"#ff8f0099",light:"#f5d802de",hcDark:null,hcLight:null},m("peekViewEditorMatchHighlight","Match highlight color in the peek view editor."));F("peekViewEditor.matchHighlightBorder",{dark:null,light:null,hcDark:$i,hcLight:$i},m("peekViewEditorMatchHighlightBorder","Match highlight border in the peek view editor."));var hFe=globalThis&&globalThis.__awaiter||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 og{constructor(e,t,i,s){this.isProviderFirst=e,this.parent=t,this.link=i,this._rangeCallback=s,this.id=i4.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,Ra(this.uri),this.range.startLineNumber,this.range.startColumn):m("aria.oneReference","in {0} on line {1} at column {2}",Ra(this.uri),this.range.startLineNumber,this.range.startColumn)}}class fFe{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 I(s,l.startColumn,s,o),d=new I(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 vy{constructor(e,t){this.parent=e,this.uri=t,this.children=[],this._previews=new Js}dispose(){fi(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}",Ra(this.uri),this.uri.fsPath):m("aria.fileReferences.N","{0} symbols in {1}, full path {2}",e,Ra(this.uri),this.uri.fsPath)}resolve(e){return hFe(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 fFe(i))}catch(i){Dt(i)}return this})}}class Lr{constructor(e,t){this.groups=[],this.references=[],this._onDidChangeReferenceRange=new j,this.onDidChangeReferenceRange=this._onDidChangeReferenceRange.event,this._links=e,this._title=t;const[i]=e;e.sort(Lr._compareReferences);let s;for(const o of e)if((!s||!zi.isEqual(s.uri,o.uri,!0))&&(s=new vy(this,o.uri),this.groups.push(s)),s.children.length===0||Lr._compareReferences(o,s.children[s.children.length-1])!==0){const r=new og(i===o,s,o,a=>this._onDidChangeReferenceRange.fire(a));this.references.push(r),s.children.push(r)}}dispose(){fi(this.groups),this._onDidChangeReferenceRange.dispose(),this.groups.length=0}clone(){return new Lr(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:om(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()&&I.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 zi.compare(e.uri,t.uri)||I.compareRangesUsingStarts(e.range,t.range)}}var mN=globalThis&&globalThis.__decorate||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},_N=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},wF;let yF=class{constructor(e){this._resolverService=e}hasChildren(e){return e instanceof Lr||e instanceof vy}getChildren(e){if(e instanceof Lr)return e.groups;if(e instanceof vy)return e.resolve(this._resolverService).then(t=>t.children);throw new Error("bad tree")}};yF=mN([_N(0,sr)],yF);class gFe{getHeight(){return 23}getTemplateId(e){return e instanceof vy?by.id:HS.id}}let SF=class{constructor(e){this._keybindingService=e}getKeyboardNavigationLabel(e){var t;if(e instanceof og){const i=(t=e.parent.getPreview(e))===null||t===void 0?void 0:t.preview(e.range);if(i)return i.value}return Ra(e.uri)}};SF=mN([_N(0,Di)],SF);class pFe{getId(e){return e instanceof og?e.id:e.uri}}let LF=class extends te{constructor(e,t){super(),this._labelService=t;const i=document.createElement("div");i.classList.add("reference-file"),this.file=this._register(new yI(i,{supportHighlights:!0})),this.badge=new D4(ge(i,ye(".count")),{},Mee),e.appendChild(i)}set(e,t){const i=Ix(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))}};LF=mN([_N(1,Fb)],LF);let by=wF=class{constructor(e){this._instantiationService=e,this.templateId=wF.id}renderTemplate(e){return this._instantiationService.createInstance(LF,e)}renderElement(e,t,i){i.set(e.element,DS(e.filterData))}disposeTemplate(e){e.dispose()}};by.id="FileReferencesRenderer";by=wF=mN([_N(0,_t)],by);class mFe{constructor(e){this.label=new Ef(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("".concat(Ra(e.uri),":").concat(e.range.startLineNumber+1,":").concat(e.range.startColumn+1));else{const{value:o,highlight:r}=s;t&&!lc.isDefault(t)?(this.label.element.classList.toggle("referenceMatch",!1),this.label.set(o,DS(t))):(this.label.element.classList.toggle("referenceMatch",!0),this.label.set(o,[r]))}}}class HS{constructor(){this.templateId=HS.id}renderTemplate(e){return new mFe(e)}renderElement(e,t,i){i.set(e.element,e.filterData)}disposeTemplate(){}}HS.id="OneReferenceRenderer";class _Fe{getWidgetAriaLabel(){return m("treeAriaLabel","References")}getAriaLabel(e){return e.ariaMessage}}var vFe=globalThis&&globalThis.__decorate||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},Qd=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},gj=globalThis&&globalThis.__awaiter||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 vN{constructor(e,t){this._editor=e,this._model=t,this._decorations=new Map,this._decorationIgnoreSet=new Set,this._callOnDispose=new be,this._callOnModelChange=new be,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(CFe,"ReferencesWidget",this._treeContainer,new gFe,[this._instantiationService.createInstance(by),this._instantiationService.createInstance(HS)],this._instantiationService.createInstance(yF),i),this._splitView.addView({onDidChange:We.None,element:this._previewContainer,minimumSize:200,maximumSize:Number.MAX_VALUE,layout:o=>{this._preview.layout({height:this._dim.height,width:o})}},vI.Distribute),this._splitView.addView({onDidChange:We.None,element:this._treeContainer,minimumSize:100,maximumSize:Number.MAX_VALUE,layout:o=>{this._treeContainer.style.height="".concat(this._dim.height,"px"),this._treeContainer.style.width="".concat(o,"px"),this._tree.layout(this._dim.height,o)}},vI.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 og&&(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")}),Lo(this._treeContainer)}_onWidth(e){this._dim&&this._doLayoutBody(this._dim.height,e)}_doLayoutBody(e,t){super._doLayoutBody(e,t),this._dim=new ii(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"),mr(this._messageContainer),Promise.resolve(void 0)):(Lo(this._messageContainer),this._decorationsManager=new vN(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"),mr(this._treeContainer),mr(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 og)return e;if(e instanceof vy&&e.children.length>0)return e.children[0]}revealReference(e){return gj(this,void 0,void 0,function*(){yield this._revealReference(e,!1),this._onDidSelectReference.fire({element:e,kind:"goto",source:"tree"})})}_revealReference(e,t){return gj(this,void 0,void 0,function*(){if(this._revealedReference===e)return;this._revealedReference=e,e.uri.scheme!==Nt.inMemory?this.setTitle(Xke(e.uri),this._uriLabel.getUriLabel(Ix(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}fi(this._previewModelReference);const o=s.object;if(o){const r=this._preview.getModel()===o.textEditorModel?0:1,a=I.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()})}};kF=vFe([Qd(3,os),Qd(4,sr),Qd(5,_t),Qd(6,Kie),Qd(7,Fb),Qd(8,Tx),Qd(9,Di),Qd(10,qi),Qd(11,Ni)],kF);var wFe=globalThis&&globalThis.__decorate||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},N_=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},pj=globalThis&&globalThis.__awaiter||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())})},AD;const a_=new Ve("referenceSearchVisible",!1,m("referenceSearchVisible","Whether reference peek is visible, like 'Peek References' or 'Peek Definition'"));let rg=AD=class{static get(e){return e.getContribution(AD.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 be,this._requestIdPool=0,this._ignoreModelChangeEvent=!1,this._referenceSearchVisible=a_.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=bFe.fromJSON(this._storageService.get(o,0,"{}"));this._widget=this._instantiationService.createInstance(kF,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 Y(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 pj(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 pj(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=I.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=AD.get(o),l=this._model.clone();this.closeWidget(),o.focus(),a==null||a.toggleWidget(s,Xn(c=>Promise.resolve(l)),(r=this._peekMode)!==null&&r!==void 0?r:!1)}},o=>{this._ignoreModelChangeEvent=!1,Dt(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)}};rg.ID="editor.contrib.referencesController";rg=AD=wFe([N_(2,bt),N_(3,ai),N_(4,Nn),N_(5,_t),N_(6,yl),N_(7,zt)],rg);function l_(n,e){const t=aFe(n);if(!t)return;const i=rg.get(t);i&&e(i)}er.registerCommandAndKeybindingRule({id:"togglePeekWidgetFocus",weight:100,primary:qn(2089,60),when:fe.or(a_,tr.inPeekEditor),handler(n){l_(n,e=>{e.changeFocusBetweenPreviewAndReferences()})}});er.registerCommandAndKeybindingRule({id:"goToNextReference",weight:100-10,primary:62,secondary:[70],when:fe.or(a_,tr.inPeekEditor),handler(n){l_(n,e=>{e.goToNextOrPreviousReference(!0)})}});er.registerCommandAndKeybindingRule({id:"goToPreviousReference",weight:100-10,primary:1086,secondary:[1094],when:fe.or(a_,tr.inPeekEditor),handler(n){l_(n,e=>{e.goToNextOrPreviousReference(!1)})}});qt.registerCommandAlias("goToNextReferenceFromEmbeddedEditor","goToNextReference");qt.registerCommandAlias("goToPreviousReferenceFromEmbeddedEditor","goToPreviousReference");qt.registerCommandAlias("closeReferenceSearchEditor","closeReferenceSearch");qt.registerCommand("closeReferenceSearch",n=>l_(n,e=>e.closeWidget()));er.registerKeybindingRule({id:"closeReferenceSearch",weight:100-101,primary:9,secondary:[1033],when:fe.and(tr.inPeekEditor,fe.not("config.editor.stablePeek"))});er.registerKeybindingRule({id:"closeReferenceSearch",weight:200+50,primary:9,secondary:[1033],when:fe.and(a_,fe.not("config.editor.stablePeek"))});er.registerCommandAndKeybindingRule({id:"revealReference",weight:200,primary:3,mac:{primary:3,secondary:[2066]},when:fe.and(a_,ete,l7.negate(),c7.negate()),handler(n){var e;const i=(e=n.get($a).lastFocusedList)===null||e===void 0?void 0:e.getFocus();Array.isArray(i)&&i[0]instanceof og&&l_(n,s=>s.revealReference(i[0]))}});er.registerCommandAndKeybindingRule({id:"openReferenceToSide",weight:100,primary:2051,mac:{primary:259},when:fe.and(a_,ete,l7.negate(),c7.negate()),handler(n){var e;const i=(e=n.get($a).lastFocusedList)===null||e===void 0?void 0:e.getFocus();Array.isArray(i)&&i[0]instanceof og&&l_(n,s=>s.openReference(i[0],!0,!0))}});qt.registerCommand("openReference",n=>{var e;const i=(e=n.get($a).lastFocusedList)===null||e===void 0?void 0:e.getFocus();Array.isArray(i)&&i[0]instanceof og&&l_(n,s=>s.openReference(i[0],!1,!0))});var Yie=globalThis&&globalThis.__decorate||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},J1=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};const H7=new Ve("hasSymbols",!1,m("hasSymbols","Whether there are symbol locations that can be navigated via keyboard-only.")),bN=Wt("ISymbolNavigationService");let DF=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=H7.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 EF(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(_9(u.uri,a.uri))c=!0,d=d||I.containsPosition(u.range,l);else if(c)break;(!c||!d)&&this.reset()});this._currentState=rl(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:I.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)}};DF=Yie([J1(0,bt),J1(1,ai),J1(2,Nn),J1(3,Di)],DF);Gt(bN,DF,1);Re(new class extends fs{constructor(){super({id:"editor.gotoNextSymbolFromResult",precondition:H7,kbOpts:{weight:100,primary:70}})}runEditorCommand(n,e){return n.get(bN).revealNext(e)}});er.registerCommandAndKeybindingRule({id:"editor.gotoNextSymbolFromResult.cancel",weight:100,when:H7,primary:9,handler(n){n.get(bN).reset()}});let EF=class{constructor(e){this._listener=new Map,this._disposables=new be,this._onDidChange=new j,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(),fi(this._listener.values())}_onDidAddEditor(e){this._listener.set(e,rl(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)}};EF=Yie([J1(0,ai)],EF);var $7=globalThis&&globalThis.__awaiter||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 $S(n,e,t,i){return $7(this,void 0,void 0,function*(){const o=t.ordered(n).map(a=>Promise.resolve(i(a,n,e)).then(void 0,l=>{Bn(l)})),r=yield Promise.all(o);return wd(r.flat())})}function CN(n,e,t,i){return $S(e,t,n,(s,o,r)=>s.provideDefinition(o,r,i))}function Zie(n,e,t,i){return $S(e,t,n,(s,o,r)=>s.provideDeclaration(o,r,i))}function Xie(n,e,t,i){return $S(e,t,n,(s,o,r)=>s.provideImplementation(o,r,i))}function Qie(n,e,t,i){return $S(e,t,n,(s,o,r)=>s.provideTypeDefinition(o,r,i))}function wN(n,e,t,i,s){return $S(e,t,n,(o,r,a)=>$7(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 zS(n){return $7(this,void 0,void 0,function*(){const e=yield n(),t=new Lr(e,""),i=t.references.map(s=>s.link);return t.dispose(),i})}$d("_executeDefinitionProvider",(n,e,t)=>{const i=n.get(Ze),s=CN(i.definitionProvider,e,t,Ft.None);return zS(()=>s)});$d("_executeTypeDefinitionProvider",(n,e,t)=>{const i=n.get(Ze),s=Qie(i.typeDefinitionProvider,e,t,Ft.None);return zS(()=>s)});$d("_executeDeclarationProvider",(n,e,t)=>{const i=n.get(Ze),s=Zie(i.declarationProvider,e,t,Ft.None);return zS(()=>s)});$d("_executeReferenceProvider",(n,e,t)=>{const i=n.get(Ze),s=wN(i.referenceProvider,e,t,!1,Ft.None);return zS(()=>s)});$d("_executeImplementationProvider",(n,e,t)=>{const i=n.get(Ze),s=Xie(i.implementationProvider,e,t,Ft.None);return zS(()=>s)});var cl=globalThis&&globalThis.__awaiter||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())})},C1,w1,y1,rk,ak,lk,ck,dk;Ls.appendMenuItem(M.EditorContext,{submenu:M.EditorContextPeek,title:m("peek.submenu","Peek"),group:"navigation",order:100});class Yb{static is(e){return!e||typeof e!="object"?!1:!!(e instanceof Yb||Y.isIPosition(e.position)&&e.model)}constructor(e,t){this.model=e,this.position=t}}class mo extends Cc{static all(){return mo._allSymbolNavigationCommands.values()}static _patchConfig(e){const t=Object.assign(Object.assign({},e),{f1:!0});if(t.menu)for(const i of Pt.wrap(t.menu))(i.id===M.EditorContext||i.id===M.EditorContextPeek)&&(i.when=fe.and(e.precondition,i.when));return t}constructor(e,t){super(mo._patchConfig(t)),this.configuration=e,mo._allSymbolNavigationCommands.set(t.id,this)}runEditorCommand(e,t,i,s){if(!t.hasModel())return Promise.resolve(void 0);const o=e.get(Nn),r=e.get(ai),a=e.get(Tg),l=e.get(bN),c=e.get(Ze),d=e.get(_t),u=t.getModel(),h=t.getPosition(),f=Yb.is(i)?i:new Yb(u,h),g=new tg(t,5),p=rx(this._getLocationModel(c,f.model,f.position,g.token),g.token).then(_=>cl(this,void 0,void 0,function*(){var v;if(!_||g.token.isCancellationRequested)return;to(_.ariaMessage);let b;if(_.referenceAt(u.uri,h)){const w=this._getAlternativeCommand(t);!mo._activeAlternativeCommands.has(w)&&mo._allSymbolNavigationCommands.has(w)&&(b=mo._allSymbolNavigationCommands.get(w))}const C=_.references.length;if(C===0){if(!this.configuration.muteMessage){const w=u.getWordAtPosition(h);(v=Sr.get(t))===null||v===void 0||v.showMessage(this._getNoResultFoundMessage(w),h)}}else if(C===1&&b)mo._activeAlternativeCommands.add(this.desc.id),d.invokeFunction(w=>b.runEditorCommand(w,t,i,s).finally(()=>{mo._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 cl(this,void 0,void 0,function*(){const r=this._getGoToPreference(i);if(!(i instanceof sg)&&(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 cl(this,void 0,void 0,function*(){let r;if(mve(i)&&(r=i.targetSelectionRange),r||(r=i.range),!r)return;const a=yield t.openCodeEditor({resource:i.uri,options:{selection:I.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=rg.get(e);s&&e.hasModel()?s.toggleWidget(i!=null?i:e.getSelection(),Xn(o=>Promise.resolve(t)),this.configuration.openInPeek):t.dispose()}}mo._allSymbolNavigationCommands=new Map;mo._activeAlternativeCommands=new Set;class US extends mo{_getLocationModel(e,t,i,s){return cl(this,void 0,void 0,function*(){return new Lr(yield CN(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}}Ui((C1=class extends US{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:C1.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:fe.and(O.hasDefinitionProvider,O.isInWalkThroughSnippet.toNegated()),keybinding:[{when:O.editorTextFocus,primary:70,weight:100},{when:fe.and(O.editorTextFocus,Xee),primary:2118,weight:100}],menu:[{id:M.EditorContext,group:"navigation",order:1.1},{id:M.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:2}]}),qt.registerCommandAlias("editor.action.goToDeclaration",C1.id)}},C1.id="editor.action.revealDefinition",C1));Ui((w1=class extends US{constructor(){super({openToSide:!0,openInPeek:!1,muteMessage:!1},{id:w1.id,title:{value:m("actions.goToDeclToSide.label","Open Definition to the Side"),original:"Open Definition to the Side"},precondition:fe.and(O.hasDefinitionProvider,O.isInWalkThroughSnippet.toNegated()),keybinding:[{when:O.editorTextFocus,primary:qn(2089,70),weight:100},{when:fe.and(O.editorTextFocus,Xee),primary:qn(2089,2118),weight:100}]}),qt.registerCommandAlias("editor.action.openDeclarationToTheSide",w1.id)}},w1.id="editor.action.revealDefinitionAside",w1));Ui((y1=class extends US{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:y1.id,title:{value:m("actions.previewDecl.label","Peek Definition"),original:"Peek Definition"},precondition:fe.and(O.hasDefinitionProvider,tr.notInPeekEditor,O.isInWalkThroughSnippet.toNegated()),keybinding:{when:O.editorTextFocus,primary:582,linux:{primary:3140},weight:100},menu:{id:M.EditorContextPeek,group:"peek",order:2}}),qt.registerCommandAlias("editor.action.previewDeclaration",y1.id)}},y1.id="editor.action.peekDefinition",y1));class Jie extends mo{_getLocationModel(e,t,i,s){return cl(this,void 0,void 0,function*(){return new Lr(yield Zie(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}}Ui((rk=class extends Jie{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:rk.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:fe.and(O.hasDeclarationProvider,O.isInWalkThroughSnippet.toNegated()),menu:[{id:M.EditorContext,group:"navigation",order:1.3},{id:M.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")}},rk.id="editor.action.revealDeclaration",rk));Ui(class extends Jie{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:"editor.action.peekDeclaration",title:{value:m("actions.peekDecl.label","Peek Declaration"),original:"Peek Declaration"},precondition:fe.and(O.hasDeclarationProvider,tr.notInPeekEditor,O.isInWalkThroughSnippet.toNegated()),menu:{id:M.EditorContextPeek,group:"peek",order:3}})}});class ene extends mo{_getLocationModel(e,t,i,s){return cl(this,void 0,void 0,function*(){return new Lr(yield Qie(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}}Ui((ak=class extends ene{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:ak.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:fe.and(O.hasTypeDefinitionProvider,O.isInWalkThroughSnippet.toNegated()),keybinding:{when:O.editorTextFocus,primary:0,weight:100},menu:[{id:M.EditorContext,group:"navigation",order:1.4},{id:M.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:3}]})}},ak.ID="editor.action.goToTypeDefinition",ak));Ui((lk=class extends ene{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:lk.ID,title:{value:m("actions.peekTypeDefinition.label","Peek Type Definition"),original:"Peek Type Definition"},precondition:fe.and(O.hasTypeDefinitionProvider,tr.notInPeekEditor,O.isInWalkThroughSnippet.toNegated()),menu:{id:M.EditorContextPeek,group:"peek",order:4}})}},lk.ID="editor.action.peekTypeDefinition",lk));class tne extends mo{_getLocationModel(e,t,i,s){return cl(this,void 0,void 0,function*(){return new Lr(yield Xie(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}}Ui((ck=class extends tne{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:ck.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:fe.and(O.hasImplementationProvider,O.isInWalkThroughSnippet.toNegated()),keybinding:{when:O.editorTextFocus,primary:2118,weight:100},menu:[{id:M.EditorContext,group:"navigation",order:1.45},{id:M.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:4}]})}},ck.ID="editor.action.goToImplementation",ck));Ui((dk=class extends tne{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:dk.ID,title:{value:m("actions.peekImplementation.label","Peek Implementations"),original:"Peek Implementations"},precondition:fe.and(O.hasImplementationProvider,tr.notInPeekEditor,O.isInWalkThroughSnippet.toNegated()),keybinding:{when:O.editorTextFocus,primary:3142,weight:100},menu:{id:M.EditorContextPeek,group:"peek",order:5}})}},dk.ID="editor.action.peekImplementation",dk));class ine extends mo{_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}}Ui(class extends ine{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:fe.and(O.hasReferenceProvider,tr.notInPeekEditor,O.isInWalkThroughSnippet.toNegated()),keybinding:{when:O.editorTextFocus,primary:1094,weight:100},menu:[{id:M.EditorContext,group:"navigation",order:1.45},{id:M.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:5}]})}_getLocationModel(e,t,i,s){return cl(this,void 0,void 0,function*(){return new Lr(yield wN(e.referenceProvider,t,i,!0,s),m("ref.title","References"))})}});Ui(class extends ine{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:fe.and(O.hasReferenceProvider,tr.notInPeekEditor,O.isInWalkThroughSnippet.toNegated()),menu:{id:M.EditorContextPeek,group:"peek",order:6}})}_getLocationModel(e,t,i,s){return cl(this,void 0,void 0,function*(){return new Lr(yield wN(e.referenceProvider,t,i,!1,s),m("ref.title","References"))})}});class yFe extends mo{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:fe.and(tr.notInPeekEditor,O.isInWalkThroughSnippet.toNegated())}),this._references=t,this._gotoMultipleBehaviour=i}_getLocationModel(e,t,i,s){return cl(this,void 0,void 0,function*(){return new Lr(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:ct},{name:"position",description:"The position at which to start",constraint:Y.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)=>cl(void 0,void 0,void 0,function*(){bi(ct.isUri(e)),bi(Y.isIPosition(t)),bi(Array.isArray(i)),bi(typeof s>"u"||typeof s=="string"),bi(typeof r>"u"||typeof r=="boolean");const a=n.get(ai),l=yield a.openCodeEditor({resource:e},a.getFocusedCodeEditor());if(Ad(l))return l.setPosition(t),l.revealPositionInCenterIfOutsideViewport(t,0),l.invokeWithinContext(c=>{const d=new class extends yFe{_getNoResultFoundMessage(u){return o||super._getNoResultFoundMessage(u)}}({muteMessage:!o,openInPeek:!!r,openToSide:!1},i,s);c.get(_t).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:ct},{name:"position",description:"The position at which to start",constraint:Y.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)=>cl(void 0,void 0,void 0,function*(){n.get(gn).executeCommand("editor.action.goToLocations",e,t,i,s,void 0,!0)})});qt.registerCommand({id:"editor.action.findReferences",handler:(n,e,t)=>{bi(ct.isUri(e)),bi(Y.isIPosition(t));const i=n.get(Ze),s=n.get(ai);return s.openCodeEditor({resource:e},s.getFocusedCodeEditor()).then(o=>{if(!Ad(o)||!o.hasModel())return;const r=rg.get(o);if(!r)return;const a=Xn(c=>wN(i.referenceProvider,o.getModel(),Y.lift(t),!1,c).then(d=>new Lr(d,m("ref.title","References")))),l=new I(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 SFe=globalThis&&globalThis.__decorate||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},SR=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},mj=globalThis&&globalThis.__awaiter||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())})},eC;let Lm=eC=class{constructor(e,t,i,s){this.textModelResolverService=t,this.languageService=i,this.languageFeaturesService=s,this.toUnhook=new be,this.toUnhookForKeyboard=new be,this.currentWordAtPosition=null,this.previousPromise=null,this.editor=e,this.linkDecorations=this.editor.createDecorationsCollection();const o=new gN(e);this.toUnhook.add(o),this.toUnhook.add(o.onMouseMoveOrRelevantKeyDown(([r,a])=>{this.startFindDefinitionFromMouse(r,a!=null?a:void 0)})),this.toUnhook.add(o.onExecute(r=>{this.isEnabled(r)&&this.gotoDefinition(r.target.position,r.hasSideBySideModifier).catch(a=>{Dt(a)}).finally(()=>{this.removeLinkDecorations()})})),this.toUnhook.add(o.onCancel(()=>{this.removeLinkDecorations(),this.currentWordAtPosition=null}))}static get(e){return e.getContribution(eC.ID)}startFindDefinitionFromCursor(e){return mj(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 mj(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 Wte(this.editor,15);this.previousPromise&&(this.previousPromise.cancel(),this.previousPromise=null),this.previousPromise=Xn(a=>this.findDefinition(e,a));let o;try{o=yield this.previousPromise}catch(a){Dt(a);return}if(!o||!o.length||!s.validate(this.editor)){this.removeLinkDecorations();return}const r=o[0].originSelectionRange?I.lift(o[0].originSelectionRange):new I(e.lineNumber,i.startColumn,e.lineNumber,i.endColumn);if(o.length>1){let a=r;for(const{originSelectionRange:l}of o)l&&(a=I.plusRange(a,l));this.addDecoration(a,new Bs().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 Bs().appendCodeblock(h||"",u):void 0),l.dispose()})}})}getPreviewValue(e,t,i){let s=i.range;return s.endLineNumber-s.startLineNumber>=eC.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 US({openToSide:t,openInPeek:s,muteMessage:!0},{title:{value:"",original:""},id:"",precondition:void 0}).run(i)})}isInPeekEditor(e){const t=e.get(bt);return tr.inPeekEditor.getValue(t)}dispose(){this.toUnhook.dispose(),this.toUnhookForKeyboard.dispose()}};Lm.ID="editor.contrib.gotodefinitionatposition";Lm.MAX_SOURCE_PREVIEW_LINES=8;Lm=eC=SFe([SR(1,sr),SR(2,qi),SR(3,Ze)],Lm);ti(Lm.ID,Lm,2);const uk=ye;class nne extends te{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 bS(this.contentsDomNode,{consumeMouseWheelIfScrollbarIsNeeded:!0})),this.containerDomNode.appendChild(this.scrollbar.getDomNode())}onContentsChanged(){this.scrollbar.scanDomNode()}}class z7 extends te{static render(e,t,i){return new z7(e,t,i)}constructor(e,t,i){super(),this.actionContainer=ge(e,uk("div.action-container")),this.actionContainer.setAttribute("tabindex","0"),this.action=ge(this.actionContainer,uk("a.action")),this.action.setAttribute("role","button"),t.iconClass&&ge(this.action,uk("span.icon.".concat(t.iconClass)));const s=ge(this.action,uk("span"));s.textContent=i?"".concat(t.label," (").concat(i,")"):t.label,this._register(ce(this.actionContainer,Pe.CLICK,o=>{o.stopPropagation(),o.preventDefault(),t.run(this.actionContainer)})),this._register(ce(this.actionContainer,Pe.KEY_DOWN,o=>{const r=new Oi(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 LFe(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 kFe=globalThis&&globalThis.__awaiter||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())})},DFe=globalThis&&globalThis.__asyncValues||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 EFe=class{constructor(e,t,i){this.value=e,this.isComplete=t,this.hasLoadingMessage=i}};class sne extends te{constructor(e,t){super(),this._editor=e,this._computer=t,this._onResult=this._register(new j),this.onResult=this._onResult.event,this._firstWaitScheduler=this._register(new Si(()=>this._triggerAsyncComputation(),0)),this._secondWaitScheduler=this._register(new Si(()=>this._triggerSyncComputation(),0)),this._loadingMessageScheduler=this._register(new Si(()=>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=v0e(e=>this._computer.computeAsync(e)),kFe(this,void 0,void 0,function*(){var e,t,i,s;try{try{for(var o=!0,r=DFe(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){Dt(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 EFe(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 LR{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}}class MD{constructor(e,t,i,s,o,r){this.priority=e,this.owner=t,this.range=i,this.initialMousePosX=s,this.initialMousePosY=o,this.supportsMarkerHover=r,this.type=2}equals(e){return e.type===2&&this.owner===e.owner}canAdoptVisibleHover(e,t){return e.type===2&&this.owner===e.owner}}const c_=new class{constructor(){this._participants=[]}register(e){this._participants.push(e)}getAll(){return this._participants}};class U7{constructor(){this._onDidWillResize=new j,this.onDidWillResize=this._onDidWillResize.event,this._onDidResize=new j,this.onDidResize=this._onDidResize.event,this._sashListener=new be,this._size=new ii(0,0),this._minSize=new ii(0,0),this._maxSize=new ii(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER),this.domNode=document.createElement("div"),this._eastSash=new qs(this.domNode,{getVerticalSashLeft:()=>this._size.width},{orientation:0}),this._westSash=new qs(this.domNode,{getVerticalSashLeft:()=>0},{orientation:0}),this._northSash=new qs(this.domNode,{getHorizontalSashTop:()=>0},{orientation:1,orthogonalEdge:mI.North}),this._southSash=new qs(this.domNode,{getHorizontalSashTop:()=>this._size.height},{orientation:1,orthogonalEdge:mI.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(We.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(We.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(We.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(We.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 ii(t,e);ii.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 IFe=30,TFe=24;class xFe extends te{constructor(e,t=new ii(10,10)){super(),this._editor=e,this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this._resizableNode=this._register(new U7),this._contentPosition=null,this._isResizing=!1,this._resizableNode.domNode.style.position="absolute",this._resizableNode.minSize=ii.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 ii(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?Y.lift(this._contentPosition.position):void 0}_availableVerticalSpaceAbove(e){const t=this._editor.getDomNode(),i=this._editor.getScrolledVisiblePosition(e);return!t||!i?void 0:Un(t).top+i.top-IFe}_availableVerticalSpaceBelow(e){const t=this._editor.getDomNode(),i=this._editor.getScrolledVisiblePosition(e);if(!t||!i)return;const s=Un(t),o=L0(t.ownerDocument.body),r=s.top+i.top+i.height;return o.height-r-TFe}_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 j7=globalThis&&globalThis.__decorate||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},Pp=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},RD,Mc;const _j=ye;let WI=RD=class extends te{constructor(e,t,i){super(),this._editor=e,this._instantiationService=t,this._keybindingService=i,this._currentResult=null,this._widget=this._register(this._instantiationService.createInstance(xf,this._editor)),this._participants=[];for(const s of c_.getAll())this._participants.push(this._instantiationService.createInstance(s,this._editor));this._participants.sort((s,o)=>s.hoverOrdinal-o.hoverOrdinal),this._computer=new HI(this._editor,this._participants),this._hoverOperation=this._register(new sne(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 one(this._computer.anchor,o,s.isComplete))})),this._register(In(this._widget.getDomNode(),"keydown",s=>{s.equals(9)&&this.hide()})),this._register(nn.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 LR(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 LR(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}=RD.computeHoverRanges(this._editor,e.range,t),r=new be,a=r.add(new VI(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:RD._DECORATION_OPTIONS}]),r.add(vt(()=>{h.clear()}))}this._widget.showAt(l,new AFe(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 Y(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=I.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 Y(o,t.startColumn),showAtSecondaryPosition:l?l.getStartPosition():new Y(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()}};WI._DECORATION_OPTIONS=kt.register({description:"content-hover-highlight",className:"hoverHighlight"});WI=RD=j7([Pp(1,_t),Pp(2,Di)],WI);class one{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 NFe(this,this.anchor,t,this.isComplete)}}class NFe extends one{constructor(e,t,i,s){super(t,i,s),this.original=e}filter(e){return this.original.filter(e)}}class AFe{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 vj=30,kR=10,MFe=6;let xf=Mc=class extends xFe{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 ii(a,r);super(e,l),this._configurationService=i,this._accessibilityService=s,this._keybindingService=o,this._hover=this._register(new nne),this._minimumSize=l,this._hoverVisibleKey=O.hoverVisible.bindTo(t),this._hoverFocusedKey=O.hoverFocused.bindTo(t),ge(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(Ld(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 Mc.ID}static _applyDimensions(e,t,i){const s=typeof t=="number"?"".concat(t,"px"):t,o=typeof i=="number"?"".concat(i,"px"):i;e.style.width=s,e.style.height=o}_setContentsDomNodeDimensions(e,t){const i=this._hover.contentsDomNode;return Mc._applyDimensions(i,e,t)}_setContainerDomNodeDimensions(e,t){const i=this._hover.containerDomNode;return Mc._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"?"".concat(t,"px"):t,o=typeof i=="number"?"".concat(i,"px"):i;e.style.maxWidth=s,e.style.maxHeight=o}_setHoverWidgetMaxDimensions(e,t){Mc._applyMaxDimensions(this._hover.contentsDomNode,e,t),Mc._applyMaxDimensions(this._hover.containerDomNode,e,t),this._hover.containerDomNode.style.setProperty("--vscode-hover-maxWidth",typeof e=="number"?"".concat(e,"px"):e),this._layoutContentWidget()}_hasHorizontalScrollbar(){const e=this._hover.scrollbar.getScrollDimensions();return e.scrollWidth>e.width}_adjustContentsBottomPadding(){const e=this._hover.contentsDomNode,t="".concat(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-kR))}_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 ii(i,s),this._setHoverWidgetMaxDimensions(i,s)}_resize(e){var t,i;Mc._lastDimensions=new ii(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=MFe;return Array.from(this._hover.contentsDomNode.children).forEach(i=>{t+=i.clientHeight}),this._hasHorizontalScrollbar()&&(t+=kR),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=Un(this.getDomNode());typeof this._visibleData.closestMouseDistance>"u"&&(this._visibleData.closestMouseDistance=bj(this._visibleData.initialMousePosX,this._visibleData.initialMousePosY,i.left,i.top,i.width,i.height));const s=bj(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="".concat(e,"px"),i.style.lineHeight="".concat(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,Mc._lastDimensions.height),t=Math.max(this._editor.getLayoutInfo().width*.66,500,Mc._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=Ep(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=LFe(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 ii(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(Ko(i),Math.min(o,e)),this._setContentsDomNodeDimensions(Ko(s),Math.min(o,e-kR))}setMinimumDimensions(e){this._minimumSize=new ii(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 ii(e,this._minimumSize.height)}onContentsChanged(){var e;this._removeConstraintsRenderNormally();const t=this._hover.containerDomNode;let i=Ep(t),s=Ko(t);if(this._resizableNode.layout(i,s),this._setHoverWidgetDimensions(s,i),i=Ep(t),s=Ko(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=Ep(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-vj})}scrollRight(){const e=this._hover.scrollbar.getScrollPosition().scrollLeft;this._hover.scrollbar.setScrollPosition({scrollLeft:e+vj})}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})}};xf.ID="editor.contrib.resizableContentHoverWidget";xf._lastDimensions=new ii(0,0);xf=Mc=j7([Pp(1,bt),Pp(2,zt),Pp(3,oh),Pp(4,Di)],xf);let VI=class extends te{get hasContent(){return this._hasContent}constructor(e){super(),this._keybindingService=e,this._hasContent=!1,this.hoverElement=_j("div.hover-row.status-bar"),this.actionsElement=ge(this.hoverElement,_j("div.actions"))}addAction(e){const t=this._keybindingService.lookupKeybinding(e.commandId),i=t?t.getLabel():null;return this._hasContent=!0,this._register(z7.render(this.actionsElement,e,i))}append(e){const t=ge(this.actionsElement,e);return this._hasContent=!0,t}};VI=j7([Pp(0,Di)],VI);class HI{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 Mn.EMPTY;const i=HI._getLineDecorations(this._editor,t);return Mn.merge(this._participants.map(s=>s.computeAsync?s.computeAsync(t,i,e):Mn.EMPTY))}computeSync(){if(!this._editor.hasModel()||!this._anchor)return[];const e=HI._getLineDecorations(this._editor,this._anchor);let t=[];for(const i of this._participants)t=t.concat(i.computeSync(this._anchor,e));return wd(t)}}function bj(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 Cj=ye;class rb extends te{constructor(e,t,i){super(),this._renderDisposeables=this._register(new be),this._editor=e,this._isVisible=!1,this._messages=[],this._hover=this._register(new nne),this._hover.containerDomNode.classList.toggle("hidden",!this._isVisible),this._markdownRenderer=this._register(new Zu({editor:this._editor},t,i)),this._computer=new RFe(this._editor),this._hoverOperation=this._register(new sne(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 rb.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=Cj("div.hover-row.markdown-hover"),r=ge(o,Cj("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="".concat(t.glyphMarginLeft+t.glyphMarginWidth,"px"),this._hover.containerDomNode.style.top="".concat(Math.max(Math.round(a),0),"px")}}rb.ID="editor.contrib.modesGlyphHoverWidget";class RFe{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||Vb(o)||i.push(...u8(o).map(e))}return i}}var PFe=globalThis&&globalThis.__awaiter||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 OFe{constructor(e,t,i){this.provider=e,this.hover=t,this.ordinal=i}}function FFe(n,e,t,i,s){return PFe(this,void 0,void 0,function*(){try{const o=yield Promise.resolve(n.provideHover(t,i,s));if(o&&WFe(o))return new OFe(n,o,e)}catch(o){Bn(o)}})}function K7(n,e,t,i){const o=n.ordered(e).map((r,a)=>FFe(r,a,e,t,i));return Mn.fromPromises(o).coalesce()}function BFe(n,e,t,i){return K7(n,e,t,i).map(s=>s.hover).toPromise()}$d("_executeHoverProvider",(n,e,t)=>{const i=n.get(Ze);return BFe(i.hoverProvider,e,t,Ft.None)});function WFe(n){const e=typeof n.range<"u",t=typeof n.contents<"u"&&n.contents&&n.contents.length>0;return e&&t}var VFe=globalThis&&globalThis.__decorate||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},hk=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};const wj=ye;class Yl{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 $I=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 Yl(this,e.range,[new Bs().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 Yl(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 Yl(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||Vb(v))continue;g.options.beforeContentClassName&&(f=!0);const b=new I(e.range.startLineNumber,p,e.range.startLineNumber,_);r.push(new Yl(this,b,u8(v),f,a++))}return r}computeAsync(e,t,i){if(!this._editor.hasModel()||e.type!==1)return Mn.EMPTY;const s=this._editor.getModel();if(!this._languageFeaturesService.hoverProvider.has(s))return Mn.EMPTY;const o=new Y(e.range.startLineNumber,e.range.startColumn);return K7(this._languageFeaturesService.hoverProvider,s,o,i).filter(r=>!Vb(r.hover.contents)).map(r=>{const a=r.hover.range?I.lift(r.hover.range):e.range;return new Yl(this,a,r.hover.contents,!1,r.ordinal)})}renderHoverParts(e,t){return rne(e,t,this._editor,this._languageService,this._openerService)}};$I=VFe([hk(1,qi),hk(2,Ir),hk(3,zt),hk(4,Ze)],$I);function rne(n,e,t,i,s){e.sort((r,a)=>r.ordinal-a.ordinal);const o=new be;for(const r of e)for(const a of r.contents){if(Vb(a))continue;const l=wj("div.hover-row.markdown-hover"),c=ge(l,wj("div.hover-contents")),d=o.add(new Zu({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 ane=globalThis&&globalThis.__decorate||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},zI=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};class yj{constructor(e,t,i){this.marker=e,this.index=t,this.total=i}}let IF=class{constructor(e,t,i){this._markerService=t,this._configService=i,this._onDidChange=new j,this.onDidChange=this._onDidChange.event,this._dispoables=new be,this._markers=[],this._nextIdx=-1,ct.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=_w(a.resource.toString(),l.resource.toString());return c===0&&(s==="position"?c=I.compareRangesUsingStarts(a,l)||rn.compare(a.severity,l.severity):c=rn.compare(a.severity,l.severity)||I.compareRangesUsingStarts(a,l)),c},r=()=>{this._markers=this._markerService.read({resource:ct.isUri(e)?e:void 0,severities:rn.Error|rn.Warning|rn.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 yj(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=cw(this._markers,{resource:e.uri},(r,a)=>_w(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},A_=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},NF;class $Fe{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 be,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(In(this._relatedBlock,"click",a=>{a.preventDefault();const l=this._relatedDiagnostics.get(a.target);l&&i(l)})),this._scrollable=new tJ(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="-".concat(a.scrollLeft,"px"),r.style.top="-".concat(a.scrollTop,"px")})),this._disposables.add(this._scrollable)}dispose(){fi(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=Sd(i);this._lines=a.length,this._longestLineLength=0;for(const h of a)this._longestLineLength=Math.max(h.length+r,this._longestLineLength);Ds(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="(".concat(o,")"),f.classList.add("code"),h.appendChild(f)}else{this._codeLink=ye("a.code-link"),this._codeLink.setAttribute("href","".concat(o.target.toString())),this._codeLink.onclick=g=>{this._openerService.open(o.target,{allowCommands:!0}),g.preventDefault(),g.stopPropagation()};const f=ge(this._codeLink,ye("span"));f.innerText=o.value,h.appendChild(this._codeLink)}}if(Ds(this._relatedBlock),this._editor.applyFontInfo(this._relatedBlock),io(s)){const h=this._relatedBlock.appendChild(document.createElement("div"));h.style.paddingTop="".concat(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="".concat(this._labelService.getUriBasenameLabel(f.resource),"(").concat(f.startLineNumber,", ").concat(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="".concat(e,"px"),this._scrollable.getDomNode().style.width="".concat(t,"px"),this._scrollable.setScrollDimensions({width:t,height:e})}getHeightInLines(){return Math.min(17,this._lines)}getAriaLabel(e){let t="";switch(e.severity){case rn.Error:t=m("Error","Error");break;case rn.Warning:t=m("Warning","Warning");break;case rn.Info:t=m("Info","Info");break;case rn.Hint:t=m("Hint","Hint");break}let i=m("marker aria","{0} at {1}. ",t,e.startLineNumber+":"+e.startColumn);const s=this._editor.getModel();if(s&&e.startLineNumber<=s.getLineCount()&&e.startLineNumber>=1){const o=s.getLineContent(e.startLineNumber);i="".concat(o,", ").concat(i)}return i}}let Zb=NF=class extends BI{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 be,this._onDidSelectRelatedInformation=new j,this.onDidSelectRelatedInformation=this._onDidSelectRelatedInformation.event,this._severity=rn.Warning,this._backgroundColor=ee.white,this._applyTheme(t.getColorTheme()),this._callOnDispose.add(t.onDidColorThemeChange(this._applyTheme.bind(this))),this.create()}_applyTheme(e){this._backgroundColor=e.getColor(KFe);let t=AF,i=zFe;this._severity===rn.Warning?(t=PD,i=UFe):this._severity===rn.Info&&(t=MF,i=jFe);const s=e.getColor(t),o=e.getColor(i);this.style({arrowColor:s,frameColor:s,headerBackgroundColor:o,primaryHeadingColor:e.getColor(qie),secondaryHeadingColor:e.getColor(Gie)})}_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(NF.TitleMenu,this._contextKeyService);Pee(i,void 0,t),this._actionbarWidget.push(t,{label:!1,icon:!0,index:0}),i.dispose()}_fillTitleIcon(e){this._icon=ge(e,ye(""))}_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 $Fe(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=I.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(Ra(a.uri),l)}this._icon.className="codicon ".concat(xF.className(rn.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="".concat(e,"px")}_onWidth(e){this._message.layout(this._heightInPixel,e)}_relayout(){super._relayout(this.computeRequiredHeight())}computeRequiredHeight(){return 3+this._message.getHeightInLines()}};Zb.TitleMenu=new M("gotoErrorTitleMenu");Zb=NF=HFe([A_(1,os),A_(2,Ir),A_(3,Vd),A_(4,_t),A_(5,bt),A_(6,Fb)],Zb);const Sj=Pw(od,Nwe),Lj=Pw(Ur,Mw),kj=Pw(Xo,Rw),AF=F("editorMarkerNavigationError.background",{dark:Sj,light:Sj,hcDark:$t,hcLight:$t},m("editorMarkerNavigationError","Editor marker navigation widget error color.")),zFe=F("editorMarkerNavigationError.headerBackground",{dark:nt(AF,.1),light:nt(AF,.1),hcDark:null,hcLight:null},m("editorMarkerNavigationErrorHeaderBackground","Editor marker navigation widget error heading background.")),PD=F("editorMarkerNavigationWarning.background",{dark:Lj,light:Lj,hcDark:$t,hcLight:$t},m("editorMarkerNavigationWarning","Editor marker navigation widget warning color.")),UFe=F("editorMarkerNavigationWarning.headerBackground",{dark:nt(PD,.1),light:nt(PD,.1),hcDark:"#0C141F",hcLight:nt(PD,.2)},m("editorMarkerNavigationWarningBackground","Editor marker navigation widget warning heading background.")),MF=F("editorMarkerNavigationInfo.background",{dark:kj,light:kj,hcDark:$t,hcLight:$t},m("editorMarkerNavigationInfo","Editor marker navigation widget info color.")),jFe=F("editorMarkerNavigationInfo.headerBackground",{dark:nt(MF,.1),light:nt(MF,.1),hcDark:null,hcLight:null},m("editorMarkerNavigationInfoHeaderBackground","Editor marker navigation widget info heading background.")),KFe=F("editorMarkerNavigation.background",{dark:is,light:is,hcDark:is,hcLight:is},m("editorMarkerNavigationBackground","Editor marker navigation widget background."));var qFe=globalThis&&globalThis.__decorate||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},fk=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},cne=globalThis&&globalThis.__awaiter||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;let ag=tC=class{static get(e){return e.getContribution(tC.ID)}constructor(e,t,i,s,o){this._markerNavigationService=t,this._contextKeyService=i,this._editorService=s,this._instantiationService=o,this._sessionDispoables=new be,this._editor=e,this._widgetVisible=dne.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(Zb,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)||!I.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:I.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 Y(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 cne(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=tC.get(r))===null||i===void 0||i.close(),(s=tC.get(r))===null||s===void 0||s.nagivate(e,t))}else this._widget.showAtMarker(o.selected.marker,o.selected.index,o.selected.total)}})}};ag.ID="editor.contrib.markerController";ag=tC=qFe([fk(1,lne),fk(2,bt),fk(3,ai),fk(4,_t)],ag);class yN extends Ue{constructor(e,t,i){super(i),this._next=e,this._multiFile=t}run(e,t){var i;return cne(this,void 0,void 0,function*(){t.hasModel()&&((i=ag.get(t))===null||i===void 0||i.nagivate(this._next,this._multiFile))})}}class Nf extends yN{constructor(){super(!0,!1,{id:Nf.ID,label:Nf.LABEL,alias:"Go to Next Problem (Error, Warning, Info)",precondition:void 0,kbOpts:{kbExpr:O.focus,primary:578,weight:100},menuOpts:{menuId:Zb.TitleMenu,title:Nf.LABEL,icon:Sn("marker-navigation-next",Me.arrowDown,m("nextMarkerIcon","Icon for goto next marker.")),group:"navigation",order:1}})}}Nf.ID="editor.action.marker.next";Nf.LABEL=m("markerAction.next.label","Go to Next Problem (Error, Warning, Info)");class Zp extends yN{constructor(){super(!1,!1,{id:Zp.ID,label:Zp.LABEL,alias:"Go to Previous Problem (Error, Warning, Info)",precondition:void 0,kbOpts:{kbExpr:O.focus,primary:1602,weight:100},menuOpts:{menuId:Zb.TitleMenu,title:Zp.LABEL,icon:Sn("marker-navigation-previous",Me.arrowUp,m("previousMarkerIcon","Icon for goto previous marker.")),group:"navigation",order:2}})}}Zp.ID="editor.action.marker.prev";Zp.LABEL=m("markerAction.previous.label","Go to Previous Problem (Error, Warning, Info)");class GFe extends yN{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:O.focus,primary:66,weight:100},menuOpts:{menuId:M.MenubarGoMenu,title:m({key:"miGotoNextProblem",comment:["&& denotes a mnemonic"]},"Next &&Problem"),group:"6_problem_nav",order:1}})}}class YFe extends yN{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:O.focus,primary:1090,weight:100},menuOpts:{menuId:M.MenubarGoMenu,title:m({key:"miGotoPreviousProblem",comment:["&& denotes a mnemonic"]},"Previous &&Problem"),group:"6_problem_nav",order:2}})}}ti(ag.ID,ag,4);De(Nf);De(Zp);De(GFe);De(YFe);const dne=new Ve("markersNavigationVisible",!1),ZFe=fs.bindToContribution(ag.get);Re(new ZFe({id:"closeMarkersNavigation",precondition:dne,handler:n=>n.close(),kbOpts:{weight:100+50,kbExpr:O.focus,primary:9,secondary:[1033]}}));var XFe=globalThis&&globalThis.__decorate||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},DR=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};const Ka=ye;class QFe{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 Dj={type:1,filter:{include:pt.QuickFix},triggerAction:Dr.QuickFixHover};let RF=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 I(e.range.startLineNumber,l,e.range.startLineNumber,c);r.push(new QFe(this,u,d))}return r}renderHoverParts(e,t){if(!t.length)return te.None;const i=new be;t.forEach(o=>e.fragment.appendChild(this.renderMarkerHover(o,i)));const s=t.length===1?t[0]:t.sort((o,r)=>rn.compare(o.marker.severity,r.marker.severity))[0];return this.renderMarkerStatusbar(e,s,i),i}renderMarkerHover(e,t){const i=Ka("div.hover-row"),s=ge(i,Ka("div.marker.hover-contents")),{source:o,message:r,code:a,relatedInformation:l}=e.marker;this._editor.applyFontInfo(s);const c=ge(s,Ka("span"));if(c.style.whiteSpace="pre-wrap",c.innerText=r,o||a)if(a&&typeof a!="string"){const d=Ka("span");if(o){const g=ge(d,Ka("span"));g.innerText=o}const u=ge(d,Ka("a.code-link"));u.setAttribute("href",a.target.toString()),t.add(ce(u,"click",g=>{this._openerService.open(a.target,{allowCommands:!0}),g.preventDefault(),g.stopPropagation()}));const h=ge(u,Ka("span"));h.innerText=a.value;const f=ge(s,d);f.style.opacity="0.6",f.style.paddingLeft="6px"}else{const d=ge(s,Ka("span"));d.style.opacity="0.6",d.style.paddingLeft="6px",d.innerText=o&&a?"".concat(o,"(").concat(a,")"):o||"(".concat(a,")")}if(io(l))for(const{message:d,resource:u,startLineNumber:h,startColumn:f}of l){const g=ge(s,Ka("div"));g.style.marginTop="8px";const p=ge(g,Ka("a"));p.innerText="".concat(Ra(u),"(").concat(h,", ").concat(f,"): "),p.style.cursor="pointer",t.add(ce(p,"click",v=>{v.stopPropagation(),v.preventDefault(),this._openerService&&this._openerService.open(u,{fromUserGesture:!0,editorOptions:{selection:{startLineNumber:h,startColumn:f}}}).catch(Dt)}));const _=ge(g,Ka("span"));_.innerText=d,this._editor.applyFontInfo(_)}return i}renderMarkerStatusbar(e,t,i){if((t.marker.severity===rn.Error||t.marker.severity===rn.Warning||t.marker.severity===rn.Info)&&e.statusBar.addAction({label:m("view problem","View Problem"),commandId:Nf.ID,run:()=>{var s;e.hide(),(s=ag.get(this._editor))===null||s===void 0||s.showAtMarker(t.marker),this._editor.focus()}}),!this._editor.getOption(90)){const s=e.statusBar.append(Ka("div"));this.recentMarkerCodeActionsInfo&&(gI.makeKey(this.recentMarkerCodeActionsInfo.marker)===gI.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?te.None:i.add(Kf(()=>s.textContent=m("checkingForQuickFixes","Checking for quick fixes..."),200));s.textContent||(s.textContent=String.fromCharCode(160));const r=this.getCodeActions(t.marker);i.add(vt(()=>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(vt(()=>{l||a.dispose()})),e.statusBar.addAction({label:m("quick fixes","Quick Fix..."),commandId:P7,run:c=>{l=!0;const d=ig.get(this._editor),u=Un(c);e.hide(),d==null||d.showCodeActions(Dj,a,{x:u.left,y:u.top,width:u.width,height:u.height})}})},Dt)}}getCodeActions(e){return Xn(t=>BC(this._languageFeaturesService.codeActionProvider,this._editor.getModel(),new I(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn),Dj,Fu.None,t))}};RF=XFe([DR(1,X8),DR(2,Ir),DR(3,Ze)],RF);const une="editor.action.inlineSuggest.commit",hne="editor.action.inlineSuggest.showPrevious",fne="editor.action.inlineSuggest.showNext";var JFe=globalThis&&globalThis.__awaiter||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 e5e extends te{constructor(e,t,i={orientation:0}){super(),this.submenuActionViewItems=[],this.hasSecondaryActions=!1,this._onDidChangeDropdownVisibility=this._register(new K_e),this.onDidChangeDropdownVisibility=this._onDidChangeDropdownVisibility.event,this.disposables=this._register(new be),this.options=i,this.lookupKeybindings=typeof this.options.getKeyBinding=="function",this.toggleMenuAction=this._register(new Cy(()=>{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 Pa(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===Cy.ID)return this.toggleMenuActionViewItem=new aI(s,s.menuActions,t,{actionViewItemProvider:this.options.actionViewItemProvider,actionRunner:this.actionRunner,keybindingProvider:this.options.getKeyBinding,classNames:dt.asClassNameArray((r=i.moreIcon)!==null&&r!==void 0?r:Me.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 Sb){const a=new aI(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 Cy extends Ro{constructor(e,t){t=t||m("moreActions","More Actions..."),super(Cy.ID,t,void 0,!0),this._menuActions=[],this.toggleDropdownMenu=e}run(){return JFe(this,void 0,void 0,function*(){this.toggleDropdownMenu()})}get menuActions(){return this._menuActions}set menuActions(e){this._menuActions=e}}Cy.ID="toolbar.toggle.more";var t5e=globalThis&&globalThis.__decorate||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},S1=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let PF=class extends e5e{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 be);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))}}xV(a),xV(u),super.setActions(a,hs.join(u,l)),c.length>0&&this._sessionDisposables.add(ce(this.getElement(),"contextmenu",f=>{var g,p,_,v,b;const C=new ba(f),w=this.getItemAction(C.target);if(!w)return;C.preventDefault(),C.stopPropagation();let y=!1;if(d===1&&((g=this._options)===null||g===void 0?void 0:g.hiddenItemStrategy)===0){y=!0;for(let k=0;kthis._menuService.resetHiddenStates(i)}))),this._contextMenuService.showContextMenu({getAnchor:()=>C,getActions:()=>S,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})}))}};PF=t5e([S1(2,Vd),S1(3,bt),S1(4,Cl),S1(5,Di),S1(6,ra)],PF);var q7=globalThis&&globalThis.__decorate||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},Zl=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},OD;let OF=class extends te{constructor(e,t,i){super(),this.editor=e,this.model=t,this.instantiationService=i,this.alwaysShowToolbar=ks(this.editor.onDidChangeConfiguration,()=>this.editor.getOption(62).showToolbar==="always"),this.sessionPosition=void 0,this.position=Ut(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 Y(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(pr((s,o)=>{const r=this.model.read(s);if(!r||!this.alwaysShowToolbar.read(s))return;const a=o.add(this.instantiationService.createInstance(lg,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(vt(()=>e.removeContentWidget(a))),o.add(xi(l=>{this.position.read(l)&&r.lastTriggerKind.read(l)!==Ru.Explicit&&r.triggerExplicitly()}))}))}};OF=q7([Zl(2,_t)],OF);const i5e=Sn("inline-suggestion-hints-next",Me.chevronRight,m("parameterHintsNextIcon","Icon for show next parameter hint.")),n5e=Sn("inline-suggestion-hints-previous",Me.chevronLeft,m("parameterHintsPreviousIcon","Icon for show previous parameter hint."));let lg=OD=class extends te{static get dropDownVisible(){return this._dropDownVisible}createCommandAction(e,t,i){const s=new Ro(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".concat(OD.id++),this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this.nodes=vs("div.inlineSuggestionsHints",{className:this.withBorder?".withBorder":""},[vs("div@toolBar")]),this.previousAction=this.createCommandAction(hne,m("previous","Previous"),dt.asClassName(n5e)),this.availableSuggestionCountAction=new Ro("inlineSuggestionHints.availableSuggestionCount","",void 0,!1),this.nextAction=this.createCommandAction(fne,m("next","Next"),dt.asClassName(i5e)),this.inlineCompletionsActionsMenus=this._register(this._menuService.createMenu(M.InlineCompletionsActions,this._contextKeyService)),this.clearAvailableSuggestionCountLabelDebounced=this._register(new Si(()=>{this.availableSuggestionCountAction.label=""},100)),this.disableButtonsDebounced=this._register(new Si(()=>{this.previousAction.enabled=this.nextAction.enabled=!1},100)),this.lastCommands=[],this.toolBar=this._register(l.createInstance(FF,this.nodes.toolBar,M.InlineSuggestionToolbar,{menuOptions:{renderShortTitle:!0},toolbarOptions:{primaryGroup:h=>h.startsWith("primary")},actionViewItemProvider:(h,f)=>{if(h instanceof fl)return l.createInstance(o5e,h,void 0);if(h===this.availableSuggestionCountAction){const g=new s5e(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=>{OD._dropDownVisible=h})),this._register(xi(h=>{this._position.read(h),this.editor.layoutContentWidget(this)})),this._register(xi(h=>{const f=this._suggestionCount.read(h),g=this._currentSuggestionIdx.read(h);f!==void 0?(this.clearAvailableSuggestionCountLabelDebounced.cancel(),this.availableSuggestionCountAction.label="".concat(g+1,"/").concat(f)):this.clearAvailableSuggestionCountLabelDebounced.schedule(),f!==void 0&&f>1?(this.disableButtonsDebounced.cancel(),this.previousAction.enabled=this.nextAction.enabled=!0):this.disableButtonsDebounced.schedule()})),this._register(xi(h=>{const f=this._extraCommands.read(h);if(yn(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 fl&&g.push(v);g.length>0&&g.unshift(new hs),this.toolBar.setAdditionalSecondaryActions(g)}))}getId(){return this.id}getDomNode(){return this.nodes.root}getPosition(){return{position:this._position.get(),preference:[1,2],positionAffinity:3}}};lg._dropDownVisible=!1;lg.id=0;lg=OD=q7([Zl(6,gn),Zl(7,_t),Zl(8,Di),Zl(9,bt),Zl(10,Vd)],lg);class s5e extends Hb{constructor(){super(...arguments),this._className=void 0}setClass(e){this._className=e}render(e){super.render(e),this._className&&e.classList.add(this._className)}}let o5e=class extends gm{updateLabel(){const e=this._keybindingService.lookupKeybinding(this._action.id,this._contextKeyService);if(!e)return super.updateLabel();if(this.label){const t=vs("div.keybinding").root;new xS(t,$r,Object.assign({disableTitle:!0},RAe)).set(e),this.label.textContent=this._action.label,this.label.appendChild(t),this.label.classList.add("inlineSuggestionStatusBarItemLabel")}}},FF=class extends PF{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=[];Pee(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){yn(this.prependedPrimaryActions,e,(t,i)=>t===i)||(this.prependedPrimaryActions=e,this.updateToolbar())}setAdditionalSecondaryActions(e){yn(this.additionalActions,e,(t,i)=>t===i)||(this.additionalActions=e,this.updateToolbar())}};FF=q7([Zl(3,Vd),Zl(4,bt),Zl(5,Cl),Zl(6,Di),Zl(7,ra)],FF);var r5e=globalThis&&globalThis.__decorate||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},gk=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},BF;const a5e=!1;let ir=BF=class extends te{static get(e){return e.getContribution(BF.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 be,this._hoverActivatedByColorDecoratorClick=!1,this._isMouseDown=!1,this._hoverClicked=!1,this._contentWidget=null,this._glyphWidget=null,this._reactToEditorMouseMoveRunner=this._register(new Si(()=>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===xf.ID){this._hoverClicked=!0;return}i.type===12&&i.detail===rb.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===xf.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===xf.ID&&(!((r=this._contentWidget)===null||r===void 0)&&r.isColorPickerVisible)||this._isHoverSticky&&a.type===12&&a.detail===rb.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&&!a5e||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 rb(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)||lg.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(WI,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()}};ir.ID="editor.contrib.hover";ir=BF=r5e([gk(1,_t),gk(2,Ir),gk(3,qi),gk(4,Di)],ir);class l5e extends Ue{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:O.editorTextFocus,primary:qn(2089,2087),weight:100}})}run(e,t,i){if(!t.hasModel())return;const s=ir.get(t);if(!s)return;const o=t.getPosition(),r=new I(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 c5e extends Ue{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=ir.get(t);if(!i)return;const s=t.getPosition();if(!s)return;const o=new I(s.lineNumber,s.column,s.lineNumber,s.column),r=Lm.get(t);if(!r)return;r.startFindDefinitionFromCursor(s).then(()=>{i.showContentHover(o,1,1,!0)})}}class d5e extends Ue{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:O.hoverFocused,kbOpts:{kbExpr:O.hoverFocused,primary:16,weight:100}})}run(e,t){const i=ir.get(t);i&&i.scrollUp()}}class u5e extends Ue{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:O.hoverFocused,kbOpts:{kbExpr:O.hoverFocused,primary:18,weight:100}})}run(e,t){const i=ir.get(t);i&&i.scrollDown()}}class h5e extends Ue{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:O.hoverFocused,kbOpts:{kbExpr:O.hoverFocused,primary:15,weight:100}})}run(e,t){const i=ir.get(t);i&&i.scrollLeft()}}class f5e extends Ue{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:O.hoverFocused,kbOpts:{kbExpr:O.hoverFocused,primary:17,weight:100}})}run(e,t){const i=ir.get(t);i&&i.scrollRight()}}class g5e extends Ue{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:O.hoverFocused,kbOpts:{kbExpr:O.hoverFocused,primary:11,secondary:[528],weight:100}})}run(e,t){const i=ir.get(t);i&&i.pageUp()}}class p5e extends Ue{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:O.hoverFocused,kbOpts:{kbExpr:O.hoverFocused,primary:12,secondary:[530],weight:100}})}run(e,t){const i=ir.get(t);i&&i.pageDown()}}class m5e extends Ue{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:O.hoverFocused,kbOpts:{kbExpr:O.hoverFocused,primary:14,secondary:[2064],weight:100}})}run(e,t){const i=ir.get(t);i&&i.goToTop()}}class _5e extends Ue{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:O.hoverFocused,kbOpts:{kbExpr:O.hoverFocused,primary:13,secondary:[2066],weight:100}})}run(e,t){const i=ir.get(t);i&&i.goToBottom()}}ti(ir.ID,ir,2);De(l5e);De(c5e);De(d5e);De(u5e);De(h5e);De(f5e);De(g5e);De(p5e);De(m5e);De(_5e);c_.register($I);c_.register(RF);bl((n,e)=>{const t=n.getColor(Kwe);t&&(e.addRule(".monaco-editor .monaco-hover .hover-row:not(:first-child):not(:empty) { border-top: 1px solid ".concat(t.transparent(.5),"; }")),e.addRule(".monaco-editor .monaco-hover hr { border-top: 1px solid ".concat(t.transparent(.5),"; }")),e.addRule(".monaco-editor .monaco-hover hr { border-bottom: 0px solid ".concat(t.transparent(.5),"; }")))});class WF extends te{constructor(e){super(),this._editor=e,this._register(e.onMouseDown(t=>this.onMouseDown(t)))}dispose(){super.dispose()}onMouseDown(e){const t=this._editor.getOption(146);if(t!=="click"&&t!=="clickAndHover")return;const i=e.target;if(i.type!==6||!i.detail.injectedText||i.detail.injectedText.options.attachedData!==Fie||!i.range)return;const s=this._editor.getContribution(ir.ID);if(s&&!s.isColorPickerVisible){const o=new I(i.range.startLineNumber,i.range.startColumn+1,i.range.endLineNumber,i.range.endColumn+1);s.showContentHover(o,1,0,!1,!0)}}}WF.ID="editor.contrib.colorContribution";ti(WF.ID,WF,2);c_.register(FI);var gne=globalThis&&globalThis.__decorate||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},jl=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},Ej=globalThis&&globalThis.__awaiter||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())})},VF,HF;let cg=VF=class extends te{constructor(e,t,i,s,o,r,a){super(),this._editor=e,this._modelService=i,this._keybindingService=s,this._instantiationService=o,this._languageFeatureService=r,this._languageConfigurationService=a,this._standaloneColorPickerWidget=null,this._standaloneColorPickerVisible=O.standaloneColorPickerVisible.bindTo(t),this._standaloneColorPickerFocused=O.standaloneColorPickerFocused.bindTo(t)}showOrFocus(){var e;this._editor.hasModel()&&(this._standaloneColorPickerVisible.get()?this._standaloneColorPickerFocused.get()||(e=this._standaloneColorPickerWidget)===null||e===void 0||e.focus():this._standaloneColorPickerWidget=new UI(this._editor,this._standaloneColorPickerVisible,this._standaloneColorPickerFocused,this._instantiationService,this._modelService,this._keybindingService,this._languageFeatureService,this._languageConfigurationService))}hide(){var e;this._standaloneColorPickerFocused.set(!1),this._standaloneColorPickerVisible.set(!1),(e=this._standaloneColorPickerWidget)===null||e===void 0||e.hide(),this._editor.focus()}insertColor(){var e;(e=this._standaloneColorPickerWidget)===null||e===void 0||e.updateEditor(),this.hide()}static get(e){return e.getContribution(VF.ID)}};cg.ID="editor.contrib.standaloneColorPickerController";cg=VF=gne([jl(1,bt),jl(2,Zi),jl(3,Di),jl(4,_t),jl(5,Ze),jl(6,Ni)],cg);ti(cg.ID,cg,1);const Ij=8,v5e=22;let UI=HF=class extends te{constructor(e,t,i,s,o,r,a,l){var c;super(),this._editor=e,this._standaloneColorPickerVisible=t,this._standaloneColorPickerFocused=i,this._modelService=o,this._keybindingService=r,this._languageFeaturesService=a,this._languageConfigurationService=l,this.allowEditorOverflow=!0,this._position=void 0,this._body=document.createElement("div"),this._colorHover=null,this._selectionSetInEditor=!1,this._onResult=this._register(new j),this.onResult=this._onResult.event,this._standaloneColorPickerVisible.set(!0),this._standaloneColorPickerParticipant=s.createInstance(my,this._editor),this._position=(c=this._editor._getViewModel())===null||c===void 0?void 0:c.getPrimaryCursorState().modelState.position;const d=this._editor.getSelection(),u=d?{startLineNumber:d.startLineNumber,startColumn:d.startColumn,endLineNumber:d.endLineNumber,endColumn:d.endColumn}:{startLineNumber:0,endLineNumber:0,endColumn:0,startColumn:0},h=this._register(Ld(this._body));this._register(h.onDidBlur(f=>{this.hide()})),this._register(h.onDidFocus(f=>{this.focus()})),this._register(this._editor.onDidChangeCursorPosition(()=>{this._selectionSetInEditor?this._selectionSetInEditor=!1:this.hide()})),this._register(this._editor.onMouseMove(f=>{var g;const p=(g=f.target.element)===null||g===void 0?void 0:g.classList;p&&p.contains("colorpicker-color-decoration")&&this.hide()})),this._register(this.onResult(f=>{this._render(f.value,f.foundInEditor)})),this._start(u),this._body.style.zIndex="50",this._editor.addContentWidget(this)}updateEditor(){this._colorHover&&this._standaloneColorPickerParticipant.updateEditorModel(this._colorHover)}getId(){return HF.ID}getDomNode(){return this._body}getPosition(){if(!this._position)return null;const e=this._editor.getOption(60).above;return{position:this._position,secondaryPosition:this._position,preference:e?[1,2]:[2,1],positionAffinity:2}}hide(){this.dispose(),this._standaloneColorPickerVisible.set(!1),this._standaloneColorPickerFocused.set(!1),this._editor.removeContentWidget(this),this._editor.focus()}focus(){this._standaloneColorPickerFocused.set(!0),this._body.focus()}_start(e){return Ej(this,void 0,void 0,function*(){const t=yield this._computeAsync(e);t&&this._onResult.fire(new b5e(t.result,t.foundInEditor))})}_computeAsync(e){return Ej(this,void 0,void 0,function*(){if(!this._editor.hasModel())return null;const t={range:e,color:{red:0,green:0,blue:0,alpha:1}},i=yield this._standaloneColorPickerParticipant.createColorHover(t,new W7(this._modelService,this._languageConfigurationService),this._languageFeaturesService.colorProvider);return i?{result:i.colorHover,foundInEditor:i.foundInEditor}:null})}_render(e,t){const i=document.createDocumentFragment(),s=this._register(new VI(this._keybindingService));let o;const r={fragment:i,statusBar:s,setColorPicker:p=>o=p,onContentsChanged:()=>{},hide:()=>this.hide()};if(this._colorHover=e,this._register(this._standaloneColorPickerParticipant.renderHoverParts(r,[e])),o===void 0)return;this._body.classList.add("standalone-colorpicker-body"),this._body.style.maxHeight=Math.max(this._editor.getLayoutInfo().height/4,250)+"px",this._body.style.maxWidth=Math.max(this._editor.getLayoutInfo().width*.66,500)+"px",this._body.tabIndex=0,this._body.appendChild(i),o.layout();const a=o.body,l=a.saturationBox.domNode.clientWidth,c=a.domNode.clientWidth-l-v5e-Ij,d=o.body.enterButton;d==null||d.onClicked(()=>{this.updateEditor(),this.hide()});const u=o.header,h=u.pickedColorNode;h.style.width=l+Ij+"px";const f=u.originalColorNode;f.style.width=c+"px";const g=o.header.closeButton;g==null||g.onClicked(()=>{this.hide()}),t&&(d&&(d.button.textContent="Replace"),this._selectionSetInEditor=!0,this._editor.setSelection(e.range)),this._editor.layoutContentWidget(this)}};UI.ID="editor.contrib.standaloneColorPickerWidget";UI=HF=gne([jl(3,_t),jl(4,Zi),jl(5,Di),jl(6,Ze),jl(7,Ni)],UI);class b5e{constructor(e,t){this.value=e,this.foundInEditor=t}}class C5e extends Cc{constructor(){super({id:"editor.action.showOrFocusStandaloneColorPicker",title:{value:m("showOrFocusStandaloneColorPicker","Show or Focus Standalone Color Picker"),mnemonicTitle:m({key:"mishowOrFocusStandaloneColorPicker",comment:["&& denotes a mnemonic"]},"&&Show or Focus Standalone Color Picker"),original:"Show or Focus Standalone Color Picker"},precondition:void 0,menu:[{id:M.CommandPalette}]})}runEditorCommand(e,t){var i;(i=cg.get(t))===null||i===void 0||i.showOrFocus()}}class w5e extends Ue{constructor(){super({id:"editor.action.hideColorPicker",label:m({key:"hideColorPicker",comment:["Action that hides the color picker"]},"Hide the Color Picker"),alias:"Hide the Color Picker",precondition:O.standaloneColorPickerVisible.isEqualTo(!0),kbOpts:{primary:9,weight:100}})}run(e,t){var i;(i=cg.get(t))===null||i===void 0||i.hide()}}class y5e extends Ue{constructor(){super({id:"editor.action.insertColorWithStandaloneColorPicker",label:m({key:"insertColorWithStandaloneColorPicker",comment:["Action that inserts color with standalone color picker"]},"Insert Color with Standalone Color Picker"),alias:"Insert Color with Standalone Color Picker",precondition:O.standaloneColorPickerFocused.isEqualTo(!0),kbOpts:{primary:3,weight:100}})}run(e,t){var i;(i=cg.get(t))===null||i===void 0||i.insertColor()}}De(w5e);De(y5e);Ui(C5e);class cf{constructor(e,t,i){this.languageConfigurationService=i,this._selection=e,this._insertSpace=t,this._usedEndToken=null}static _haystackHasNeedleAtOffset(e,t,i){if(i<0)return!1;const s=t.length,o=e.length;if(i+s>o)return!1;for(let r=0;r=65&&a<=90&&a+32===l)&&!(l>=65&&l<=90&&l+32===a))return!1}return!0}_createOperationsForBlockComment(e,t,i,s,o,r){const a=e.startLineNumber,l=e.startColumn,c=e.endLineNumber,d=e.endColumn,u=o.getLineContent(a),h=o.getLineContent(c);let f=u.lastIndexOf(t,l-1+t.length),g=h.indexOf(i,d-1-i.length);if(f!==-1&&g!==-1)if(a===c)u.substring(f+t.length,g).indexOf(i)>=0&&(f=-1,g=-1);else{const _=u.substring(f+t.length),v=h.substring(0,g);(_.indexOf(i)>=0||v.indexOf(i)>=0)&&(f=-1,g=-1)}let p;f!==-1&&g!==-1?(s&&f+t.length0&&h.charCodeAt(g-1)===32&&(i=" "+i,g-=1),p=cf._createRemoveBlockCommentOperations(new I(a,f+t.length+1,c,g+1),t,i)):(p=cf._createAddBlockCommentOperations(e,t,i,this._insertSpace),this._usedEndToken=p.length===1?i:null);for(const _ of p)r.addTrackedEditOperation(_.range,_.text)}static _createRemoveBlockCommentOperations(e,t,i){const s=[];return I.isEmpty(e)?s.push(Yi.delete(new I(e.startLineNumber,e.startColumn-t.length,e.endLineNumber,e.endColumn+i.length))):(s.push(Yi.delete(new I(e.startLineNumber,e.startColumn-t.length,e.startLineNumber,e.startColumn))),s.push(Yi.delete(new I(e.endLineNumber,e.endColumn,e.endLineNumber,e.endColumn+i.length)))),s}static _createAddBlockCommentOperations(e,t,i,s){const o=[];return I.isEmpty(e)?o.push(Yi.replace(new I(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn),t+" "+i)):(o.push(Yi.insert(new Y(e.startLineNumber,e.startColumn),t+(s?" ":""))),o.push(Yi.insert(new Y(e.endLineNumber,e.endColumn),(s?" ":"")+i))),o}getEditOperations(e,t){const i=this._selection.startLineNumber,s=this._selection.startColumn;e.tokenization.tokenizeIfCheap(i);const o=e.getLanguageIdAtPosition(i,s),r=this.languageConfigurationService.getLanguageConfiguration(o).comments;!r||!r.blockCommentStartToken||!r.blockCommentEndToken||this._createOperationsForBlockComment(this._selection,r.blockCommentStartToken,r.blockCommentEndToken,this._insertSpace,e,t)}computeCursorState(e,t){const i=t.getInverseEditOperations();if(i.length===2){const s=i[0],o=i[1];return new Je(s.range.endLineNumber,s.range.endColumn,o.range.startLineNumber,o.range.startColumn)}else{const s=i[0].range,o=this._usedEndToken?-this._usedEndToken.length-1:0;return new Je(s.endLineNumber,s.endColumn+o,s.endLineNumber,s.endColumn+o)}}}class lu{constructor(e,t,i,s,o,r,a){this.languageConfigurationService=e,this._selection=t,this._tabSize=i,this._type=s,this._insertSpace=o,this._selectionId=null,this._deltaColumn=0,this._moveEndPositionDown=!1,this._ignoreEmptyLines=r,this._ignoreFirstLine=a||!1}static _gatherPreflightCommentStrings(e,t,i,s){e.tokenization.tokenizeIfCheap(t);const o=e.getLanguageIdAtPosition(t,1),r=s.getLanguageConfiguration(o).comments,a=r?r.lineCommentToken:null;if(!a)return null;const l=[];for(let c=0,d=i-t+1;co?t[l].commentStrOffset=r-1:t[l].commentStrOffset=r}}}class G7 extends Ue{constructor(e,t){super(t),this._type=e}run(e,t){const i=e.get(Ni);if(!t.hasModel())return;const s=t.getModel(),o=[],r=s.getOptions(),a=t.getOption(23),l=t.getSelections().map((d,u)=>({selection:d,index:u,ignoreFirstLine:!1}));l.sort((d,u)=>I.compareRangesUsingStarts(d.selection,u.selection));let c=l[0];for(let d=1;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},Xg=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},$F;let Xb=$F=class{static get(e){return e.getContribution($F.ID)}constructor(e,t,i,s,o,r,a,l){this._contextMenuService=t,this._contextViewService=i,this._contextKeyService=s,this._keybindingService=o,this._menuService=r,this._configurationService=a,this._workspaceContextService=l,this._toDispose=new be,this._contextMenuIsBeingShownCount=0,this._editor=e,this._toDispose.add(this._editor.onContextMenu(c=>this._onContextMenu(c))),this._toDispose.add(this._editor.onMouseWheel(c=>{if(this._contextMenuIsBeingShownCount>0){const d=this._contextViewService.getContextViewElement(),u=c.srcElement;u.shadowRoot&&cm(d)===u.shadowRoot||this._contextViewService.hideContextView()}})),this._toDispose.add(this._editor.onKeyDown(c=>{this._editor.getOption(24)&&c.keyCode===58&&(c.preventDefault(),c.stopPropagation(),this.showContextMenu())}))}_onContextMenu(e){if(!this._editor.hasModel())return;if(!this._editor.getOption(24)){this._editor.focus(),e.target.position&&!this._editor.getSelection().containsPosition(e.target.position)&&this._editor.setPosition(e.target.position);return}if(e.target.type===12||e.target.type===6&&e.target.detail.injectedText)return;if(e.event.preventDefault(),e.event.stopPropagation(),e.target.type===11)return this._showScrollbarContextMenu(e.event);if(e.target.type!==6&&e.target.type!==7&&e.target.type!==1)return;if(this._editor.focus(),e.target.position){let i=!1;for(const s of this._editor.getSelections())if(s.containsPosition(e.target.position)){i=!0;break}i||this._editor.setPosition(e.target.position)}let t=null;e.target.type!==1&&(t=e.event),this.showContextMenu(t)}showContextMenu(e){if(!this._editor.getOption(24)||!this._editor.hasModel())return;const t=this._getMenuActions(this._editor.getModel(),this._editor.isSimpleWidget?M.SimpleEditorContext:M.EditorContext);t.length>0&&this._doShowContextMenu(t,e)}_getMenuActions(e,t){const i=[],s=this._menuService.createMenu(t,this._contextKeyService),o=s.getActions({arg:e.uri});s.dispose();for(const r of o){const[,a]=r;let l=0;for(const c of a)if(c instanceof ww){const d=this._getMenuActions(e,c.item.submenu);d.length>0&&(i.push(new Sb(c.id,c.label,d)),l++)}else i.push(c),l++;l&&i.push(new hs)}return i.length&&i.pop(),i}_doShowContextMenu(e,t=null){if(!this._editor.hasModel())return;const i=this._editor.getOption(60);this._editor.updateOptions({hover:{enabled:!1}});let s=t;if(!s){this._editor.revealPosition(this._editor.getPosition(),1),this._editor.render();const r=this._editor.getScrolledVisiblePosition(this._editor.getPosition()),a=Un(this._editor.getDomNode()),l=a.left+r.left,c=a.top+r.top+r.height;s={x:l,y:c}}const o=this._editor.getOption(126)&&!uc;this._contextMenuIsBeingShownCount++,this._contextMenuService.showContextMenu({domForShadowRoot:o?this._editor.getDomNode():void 0,getAnchor:()=>s,getActions:()=>e,getActionViewItem:r=>{const a=this._keybindingFor(r);if(a)return new Hb(r,r,{label:!0,keybinding:a.getLabel(),isMenu:!0});const l=r;return typeof l.getActionViewItem=="function"?l.getActionViewItem():new Hb(r,r,{icon:!0,label:!0,isMenu:!0})},getKeyBinding:r=>this._keybindingFor(r),onHide:r=>{this._contextMenuIsBeingShownCount--,this._editor.updateOptions({hover:i})}})}_showScrollbarContextMenu(e){if(!this._editor.hasModel()||fTe(this._workspaceContextService.getWorkspace()))return;const t=this._editor.getOption(72);let i=0;const s=c=>({id:"menu-action-".concat(++i),label:c.label,tooltip:"",class:void 0,enabled:typeof c.enabled>"u"?!0:c.enabled,checked:c.checked,run:c.run}),o=(c,d)=>new Sb("menu-action-".concat(++i),c,d,void 0),r=(c,d,u,h,f)=>{if(!d)return s({label:c,enabled:d,run:()=>{}});const g=_=>()=>{this._configurationService.updateValue(u,_)},p=[];for(const _ of f)p.push(s({label:_.label,checked:h===_.value,run:g(_.value)}));return o(c,p)},a=[];a.push(s({label:m("context.minimap.minimap","Minimap"),checked:t.enabled,run:()=>{this._configurationService.updateValue("editor.minimap.enabled",!t.enabled)}})),a.push(new hs),a.push(s({label:m("context.minimap.renderCharacters","Render Characters"),enabled:t.enabled,checked:t.renderCharacters,run:()=>{this._configurationService.updateValue("editor.minimap.renderCharacters",!t.renderCharacters)}})),a.push(r(m("context.minimap.size","Vertical size"),t.enabled,"editor.minimap.size",t.size,[{label:m("context.minimap.size.proportional","Proportional"),value:"proportional"},{label:m("context.minimap.size.fill","Fill"),value:"fill"},{label:m("context.minimap.size.fit","Fit"),value:"fit"}])),a.push(r(m("context.minimap.slider","Slider"),t.enabled,"editor.minimap.showSlider",t.showSlider,[{label:m("context.minimap.slider.mouseover","Mouse Over"),value:"mouseover"},{label:m("context.minimap.slider.always","Always"),value:"always"}]));const l=this._editor.getOption(126)&&!uc;this._contextMenuIsBeingShownCount++,this._contextMenuService.showContextMenu({domForShadowRoot:l?this._editor.getDomNode():void 0,getAnchor:()=>e,getActions:()=>a,onHide:c=>{this._contextMenuIsBeingShownCount--,this._editor.focus()}})}_keybindingFor(e){return this._keybindingService.lookupKeybinding(e.id)}dispose(){this._contextMenuIsBeingShownCount>0&&this._contextViewService.hideContextView(),this._toDispose.dispose()}};Xb.ID="editor.contrib.contextmenu";Xb=$F=E5e([Xg(1,Cl),Xg(2,rh),Xg(3,bt),Xg(4,Di),Xg(5,Vd),Xg(6,zt),Xg(7,hm)],Xb);class I5e extends Ue{constructor(){super({id:"editor.action.showContextMenu",label:m("action.showContextMenu.label","Show Editor Context Menu"),alias:"Show Editor Context Menu",precondition:void 0,kbOpts:{kbExpr:O.textInputFocus,primary:1092,weight:100}})}run(e,t){var i;(i=Xb.get(t))===null||i===void 0||i.showContextMenu()}}ti(Xb.ID,Xb,2);De(I5e);class ER{constructor(e){this.selections=e}equals(e){const t=this.selections.length,i=e.selections.length;if(t!==i)return!1;for(let s=0;s{this._undoStack=[],this._redoStack=[]})),this._register(e.onDidChangeModelContent(t=>{this._undoStack=[],this._redoStack=[]})),this._register(e.onDidChangeCursorSelection(t=>{if(this._isCursorUndoRedo||!t.oldSelections||t.oldModelVersionId!==t.modelVersionId)return;const i=new ER(t.oldSelections);this._undoStack.length>0&&this._undoStack[this._undoStack.length-1].cursorState.equals(i)||(this._undoStack.push(new IR(i,e.getScrollTop(),e.getScrollLeft())),this._redoStack=[],this._undoStack.length>50&&this._undoStack.shift())}))}cursorUndo(){!this._editor.hasModel()||this._undoStack.length===0||(this._redoStack.push(new IR(new ER(this._editor.getSelections()),this._editor.getScrollTop(),this._editor.getScrollLeft())),this._applyState(this._undoStack.pop()))}cursorRedo(){!this._editor.hasModel()||this._redoStack.length===0||(this._undoStack.push(new IR(new ER(this._editor.getSelections()),this._editor.getScrollTop(),this._editor.getScrollLeft())),this._applyState(this._redoStack.pop()))}_applyState(e){this._isCursorUndoRedo=!0,this._editor.setSelections(e.cursorState.selections),this._editor.setScrollPosition({scrollTop:e.scrollTop,scrollLeft:e.scrollLeft}),this._isCursorUndoRedo=!1}}km.ID="editor.contrib.cursorUndoRedoController";class T5e extends Ue{constructor(){super({id:"cursorUndo",label:m("cursor.undo","Cursor Undo"),alias:"Cursor Undo",precondition:void 0,kbOpts:{kbExpr:O.textInputFocus,primary:2099,weight:100}})}run(e,t,i){var s;(s=km.get(t))===null||s===void 0||s.cursorUndo()}}class x5e extends Ue{constructor(){super({id:"cursorRedo",label:m("cursor.redo","Cursor Redo"),alias:"Cursor Redo",precondition:void 0})}run(e,t,i){var s;(s=km.get(t))===null||s===void 0||s.cursorRedo()}}ti(km.ID,km,0);De(T5e);De(x5e);class N5e{constructor(e,t,i){this.selection=e,this.targetPosition=t,this.copy=i,this.targetSelection=null}getEditOperations(e,t){const i=e.getValueInRange(this.selection);if(this.copy||t.addEditOperation(this.selection,null),t.addEditOperation(new I(this.targetPosition.lineNumber,this.targetPosition.column,this.targetPosition.lineNumber,this.targetPosition.column),i),this.selection.containsPosition(this.targetPosition)&&!(this.copy&&(this.selection.getEndPosition().equals(this.targetPosition)||this.selection.getStartPosition().equals(this.targetPosition)))){this.targetSelection=this.selection;return}if(this.copy){this.targetSelection=new Je(this.targetPosition.lineNumber,this.targetPosition.column,this.selection.endLineNumber-this.selection.startLineNumber+this.targetPosition.lineNumber,this.selection.startLineNumber===this.selection.endLineNumber?this.targetPosition.column+this.selection.endColumn-this.selection.startColumn:this.selection.endColumn);return}if(this.targetPosition.lineNumber>this.selection.endLineNumber){this.targetSelection=new Je(this.targetPosition.lineNumber-this.selection.endLineNumber+this.selection.startLineNumber,this.targetPosition.column,this.targetPosition.lineNumber,this.selection.startLineNumber===this.selection.endLineNumber?this.targetPosition.column+this.selection.endColumn-this.selection.startColumn:this.selection.endColumn);return}if(this.targetPosition.lineNumberthis._onEditorMouseDown(t))),this._register(this._editor.onMouseUp(t=>this._onEditorMouseUp(t))),this._register(this._editor.onMouseDrag(t=>this._onEditorMouseDrag(t))),this._register(this._editor.onMouseDrop(t=>this._onEditorMouseDrop(t))),this._register(this._editor.onMouseDropCanceled(()=>this._onEditorMouseDropCanceled())),this._register(this._editor.onKeyDown(t=>this.onEditorKeyDown(t))),this._register(this._editor.onKeyUp(t=>this.onEditorKeyUp(t))),this._register(this._editor.onDidBlurEditorWidget(()=>this.onEditorBlur())),this._register(this._editor.onDidBlurEditorText(()=>this.onEditorBlur())),this._mouseDown=!1,this._modifierPressed=!1,this._dragSelection=null}onEditorBlur(){this._removeDecoration(),this._dragSelection=null,this._mouseDown=!1,this._modifierPressed=!1}onEditorKeyDown(e){!this._editor.getOption(35)||this._editor.getOption(22)||(M_(e)&&(this._modifierPressed=!0),this._mouseDown&&M_(e)&&this._editor.updateOptions({mouseStyle:"copy"}))}onEditorKeyUp(e){!this._editor.getOption(35)||this._editor.getOption(22)||(M_(e)&&(this._modifierPressed=!1),this._mouseDown&&e.keyCode===Vu.TRIGGER_KEY_VALUE&&this._editor.updateOptions({mouseStyle:"default"}))}_onEditorMouseDown(e){this._mouseDown=!0}_onEditorMouseUp(e){this._mouseDown=!1,this._editor.updateOptions({mouseStyle:"text"})}_onEditorMouseDrag(e){const t=e.target;if(this._dragSelection===null){const s=(this._editor.getSelections()||[]).filter(o=>t.position&&o.containsPosition(t.position));if(s.length===1)this._dragSelection=s[0];else return}M_(e.event)?this._editor.updateOptions({mouseStyle:"copy"}):this._editor.updateOptions({mouseStyle:"default"}),t.position&&(this._dragSelection.containsPosition(t.position)?this._removeDecoration():this.showAt(t.position))}_onEditorMouseDropCanceled(){this._editor.updateOptions({mouseStyle:"text"}),this._removeDecoration(),this._dragSelection=null,this._mouseDown=!1}_onEditorMouseDrop(e){if(e.target&&(this._hitContent(e.target)||this._hitMargin(e.target))&&e.target.position){const t=new Y(e.target.position.lineNumber,e.target.position.column);if(this._dragSelection===null){let i=null;if(e.event.shiftKey){const s=this._editor.getSelection();if(s){const{selectionStartLineNumber:o,selectionStartColumn:r}=s;i=[new Je(o,r,t.lineNumber,t.column)]}}else i=(this._editor.getSelections()||[]).map(s=>s.containsPosition(t)?new Je(t.lineNumber,t.column,t.lineNumber,t.column):s);this._editor.setSelections(i||[],"mouse",3)}else(!this._dragSelection.containsPosition(t)||(M_(e.event)||this._modifierPressed)&&(this._dragSelection.getEndPosition().equals(t)||this._dragSelection.getStartPosition().equals(t)))&&(this._editor.pushUndoStop(),this._editor.executeCommand(Vu.ID,new N5e(this._dragSelection,t,M_(e.event)||this._modifierPressed)),this._editor.pushUndoStop())}this._editor.updateOptions({mouseStyle:"text"}),this._removeDecoration(),this._dragSelection=null,this._mouseDown=!1}showAt(e){this._dndDecorationIds.set([{range:new I(e.lineNumber,e.column,e.lineNumber,e.column),options:Vu._DECORATION_OPTIONS}]),this._editor.revealPosition(e,1)}_removeDecoration(){this._dndDecorationIds.clear()}_hitContent(e){return e.type===6||e.type===7}_hitMargin(e){return e.type===2||e.type===3||e.type===4}dispose(){this._removeDecoration(),this._dragSelection=null,this._mouseDown=!1,this._modifierPressed=!1,super.dispose()}}Vu.ID="editor.contrib.dragAndDrop";Vu.TRIGGER_KEY_VALUE=Kt?6:5;Vu._DECORATION_OPTIONS=kt.register({description:"dnd-target",className:"dnd-target"});ti(Vu.ID,Vu,2);const SN=function(){if(typeof crypto=="object"&&typeof crypto.randomUUID=="function")return crypto.randomUUID.bind(crypto);let n;typeof crypto=="object"&&typeof crypto.getRandomValues=="function"?n=crypto.getRandomValues.bind(crypto):n=function(i){for(let s=0;spne(this,void 0,void 0,function*(){return n}),asFile:()=>{},value:typeof n=="string"?n:void 0}}function A5e(n,e,t){const i={id:SN(),name:n,uri:e,data:t};return{asString:()=>pne(this,void 0,void 0,function*(){return""}),asFile:()=>i,value:void 0}}class mne{constructor(){this._entries=new Map}get size(){let e=0;for(const t of this._entries)e++;return e}has(e){return this._entries.has(this.toKey(e))}matches(e){const t=[...this._entries.keys()];return Pt.some(this,([i,s])=>s.asFile())&&t.push("files"),vne(jI(e),t)}get(e){var t;return(t=this._entries.get(this.toKey(e)))===null||t===void 0?void 0:t[0]}append(e,t){const i=this._entries.get(e);i?i.push(t):this._entries.set(this.toKey(e),[t])}replace(e,t){this._entries.set(this.toKey(e),[t])}delete(e){this._entries.delete(this.toKey(e))}*[Symbol.iterator](){for(const[e,t]of this._entries)for(const i of t)yield[e,i]}toKey(e){return jI(e)}}function jI(n){return n.toLowerCase()}function _ne(n,e){return vne(jI(n),e.map(jI))}function vne(n,e){if(n==="*/*")return e.length>0;if(e.includes(n))return!0;const t=n.match(/^([a-z]+)\/([a-z]+|\*)$/i);if(!t)return!1;const[i,s,o]=t;return o==="*"?e.some(r=>r.startsWith(s+"/")):!1}const LN=Object.freeze({create:n=>Vf(n.map(e=>e.toString())).join("\r\n"),split:n=>n.split("\r\n"),parse:n=>LN.split(n).filter(e=>!e.startsWith("#"))}),Tj={EDITORS:"CodeEditors",FILES:"CodeFiles"};class M5e{}const R5e={DragAndDropContribution:"workbench.contributions.dragAndDrop"};en.add(R5e.DragAndDropContribution,new M5e);class wy{constructor(){}static getInstance(){return wy.INSTANCE}hasData(e){return e&&e===this.proto}getData(e){if(this.hasData(e))return this.data}}wy.INSTANCE=new wy;var P5e=globalThis&&globalThis.__awaiter||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 bne(n){const e=new mne;for(const t of n.items){const i=t.type;if(t.kind==="string"){const s=new Promise(o=>t.getAsString(o));e.append(i,Y7(s))}else if(t.kind==="file"){const s=t.getAsFile();s&&e.append(i,O5e(s))}}return e}function O5e(n){const e=n.path?ct.parse(n.path):void 0;return A5e(n.name,e,()=>P5e(this,void 0,void 0,function*(){return new Uint8Array(yield n.arrayBuffer())}))}const F5e=Object.freeze([Tj.EDITORS,Tj.FILES,Jw.RESOURCES,Jw.INTERNAL_URI_LIST]);function Cne(n,e=!1){const t=bne(n),i=t.get(Jw.INTERNAL_URI_LIST);if(i)t.replace(wn.uriList,i);else if(e||!t.has(wn.uriList)){const s=[];for(const o of n.items){const r=o.getAsFile();if(r){const a=r.path;try{a?s.push(ct.file(a).toString()):s.push(ct.parse(r.name,!0).toString())}catch{}}}s.length&&t.replace(wn.uriList,Y7(LN.create(s)))}for(const s of F5e)t.delete(s);return t}function B5e(n,e,t){var i,s;return{edits:[...e.map(o=>new Ou(n,typeof t.insertText=="string"?{range:o,text:t.insertText,insertAsSnippet:!1}:{range:o,text:t.insertText.snippet,insertAsSnippet:!0})),...(s=(i=t.additionalEdit)===null||i===void 0?void 0:i.edits)!==null&&s!==void 0?s:[]]}}function wne(n){var e;function t(a,l){return"providerId"in a&&a.providerId===l.providerId||"mimeType"in a&&a.mimeType===l.handledMimeType}const i=new Map;for(const a of n)for(const l of(e=a.yieldTo)!==null&&e!==void 0?e:[])for(const c of n)if(c!==a&&t(l,c)){let d=i.get(a);d||(d=[],i.set(a,d)),d.push(c)}if(!i.size)return Array.from(n);const s=new Set,o=[];function r(a){if(!a.length)return[];const l=a[0];if(o.includes(l))return console.warn("Yield to cycle detected for ".concat(l.providerId)),a;if(s.has(l))return r(a.slice(1));let c=[];const d=i.get(l);return d&&(o.push(l),c=r(d),o.pop()),s.add(l),[...c,l,...r(a.slice(1))]}return r(Array.from(n))}var W5e=globalThis&&globalThis.__decorate||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},V5e=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},H5e=globalThis&&globalThis.__awaiter||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 $5e=kt.register({description:"inline-progress-widget",stickiness:1,showIfCollapsed:!0,after:{content:xX,inlineClassName:"inline-editor-progress-decoration",inlineClassNameAffectsLetterSpacing:!0}});class kN extends te{constructor(e,t,i,s,o){super(),this.typeId=e,this.editor=t,this.range=i,this.delegate=o,this.allowEditorOverflow=!1,this.suppressMouseDown=!0,this.create(s),this.editor.addContentWidget(this),this.editor.layoutContentWidget(this)}create(e){this.domNode=ye(".inline-progress-widget"),this.domNode.role="button",this.domNode.title=e;const t=ye("span.icon");this.domNode.append(t),t.classList.add(...dt.asClassNameArray(Me.loading),"codicon-modifier-spin");const i=()=>{const s=this.editor.getOption(66);this.domNode.style.height="".concat(s,"px"),this.domNode.style.width="".concat(Math.ceil(.8*s),"px")};i(),this._register(this.editor.onDidChangeConfiguration(s=>{(s.hasChanged(52)||s.hasChanged(66))&&i()})),this._register(ce(this.domNode,Pe.CLICK,s=>{this.delegate.cancel()}))}getId(){return kN.baseId+"."+this.typeId}getDomNode(){return this.domNode}getPosition(){return{position:{lineNumber:this.range.startLineNumber,column:this.range.startColumn},preference:[0]}}dispose(){super.dispose(),this.editor.removeContentWidget(this)}}kN.baseId="editor.widget.inlineProgressWidget";let KI=class extends te{constructor(e,t,i){super(),this.id=e,this._editor=t,this._instantiationService=i,this._showDelay=500,this._showPromise=this._register(new Ts),this._currentWidget=new Ts,this._operationIdPool=0,this._currentDecorations=t.createDecorationsCollection()}showWhile(e,t,i){return H5e(this,void 0,void 0,function*(){const s=this._operationIdPool++;this._currentOperation=s,this.clear(),this._showPromise.value=Kf(()=>{const o=I.fromPositions(e);this._currentDecorations.set([{range:o,options:$5e}]).length>0&&(this._currentWidget.value=this._instantiationService.createInstance(kN,this.id,this._editor,o,t,i))},this._showDelay);try{return yield i}finally{this._currentOperation===s&&(this.clear(),this._currentOperation=void 0)}})}clear(){this._showPromise.clear(),this._currentDecorations.clear(),this._currentWidget.clear()}};KI=W5e([V5e(2,_t)],KI);var yne=globalThis&&globalThis.__decorate||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},WC=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},xj=globalThis&&globalThis.__awaiter||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())})},zF;let qI=zF=class extends te{constructor(e,t,i,s,o,r,a,l,c,d){super(),this.typeId=e,this.editor=t,this.showCommand=s,this.range=o,this.edits=r,this.onSelectNewEdit=a,this._contextMenuService=l,this._keybindingService=d,this.allowEditorOverflow=!0,this.suppressMouseDown=!0,this.create(),this.visibleContext=i.bindTo(c),this.visibleContext.set(!0),this._register(vt(()=>this.visibleContext.reset())),this.editor.addContentWidget(this),this.editor.layoutContentWidget(this),this._register(vt(()=>this.editor.removeContentWidget(this))),this._register(this.editor.onDidChangeCursorPosition(u=>{o.containsPosition(u.position)||this.dispose()})),this._register(We.runAndSubscribe(d.onDidUpdateKeybindings,()=>{this._updateButtonTitle()}))}_updateButtonTitle(){var e;const t=(e=this._keybindingService.lookupKeybinding(this.showCommand.id))===null||e===void 0?void 0:e.getLabel();this.button.element.title=this.showCommand.label+(t?" (".concat(t,")"):"")}create(){this.domNode=ye(".post-edit-widget"),this.button=this._register(new k4(this.domNode,{supportIcons:!0})),this.button.label="$(insert)",this._register(ce(this.domNode,Pe.CLICK,()=>this.showSelector()))}getId(){return zF.baseId+"."+this.typeId}getDomNode(){return this.domNode}getPosition(){return{position:this.range.getEndPosition(),preference:[2]}}showSelector(){this._contextMenuService.showContextMenu({getAnchor:()=>{const e=Un(this.button.element);return{x:e.left+e.width,y:e.top+e.height}},getActions:()=>this.edits.allEdits.map((e,t)=>Bv({id:"",label:e.label,checked:t===this.edits.activeEditIndex,run:()=>{if(t!==this.edits.activeEditIndex)return this.onSelectNewEdit(t)}}))})}};qI.baseId="editor.widget.postEditWidget";qI=zF=yne([WC(7,Cl),WC(8,bt),WC(9,Di)],qI);let GI=class extends te{constructor(e,t,i,s,o,r){super(),this._id=e,this._editor=t,this._visibleContext=i,this._showCommand=s,this._instantiationService=o,this._bulkEditService=r,this._currentWidget=this._register(new Ts),this._register(We.any(t.onDidChangeModel,t.onDidChangeModelContent)(()=>this.clear()))}applyEditAndShowIfNeeded(e,t,i,s){var o,r;return xj(this,void 0,void 0,function*(){const a=this._editor.getModel();if(!a||!e.length)return;const l=t.allEdits[t.activeEditIndex];if(!l)return;let c=[];(typeof l.insertText=="string"?l.insertText==="":l.insertText.snippet==="")?c=[]:c=e.map(_=>new Ou(a.uri,typeof l.insertText=="string"?{range:_,text:l.insertText,insertAsSnippet:!1}:{range:_,text:l.insertText.snippet,insertAsSnippet:!0}));const u={edits:[...c,...(r=(o=l.additionalEdit)===null||o===void 0?void 0:o.edits)!==null&&r!==void 0?r:[]]},h=e[0],f=a.deltaDecorations([],[{range:h,options:{description:"paste-line-suffix",stickiness:0}}]);let g,p;try{g=yield this._bulkEditService.apply(u,{editor:this._editor,token:s}),p=a.getDecorationRange(f[0])}finally{a.deltaDecorations(f,[])}i&&g.isApplied&&t.allEdits.length>1&&this.show(p!=null?p:h,t,_=>xj(this,void 0,void 0,function*(){const v=this._editor.getModel();v&&(yield v.undo(),this.applyEditAndShowIfNeeded(e,{activeEditIndex:_,allEdits:t.allEdits},i,s))}))})}show(e,t,i){this.clear(),this._editor.hasModel()&&(this._currentWidget.value=this._instantiationService.createInstance(qI,this._id,this._editor,this._visibleContext,this._showCommand,e,t,i))}clear(){this._currentWidget.clear()}tryShowSelector(){var e;(e=this._currentWidget.value)===null||e===void 0||e.showSelector()}};GI=yne([WC(4,_t),WC(5,kS)],GI);var z5e=globalThis&&globalThis.__decorate||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_=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},Jd=globalThis&&globalThis.__awaiter||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())})},UF;const Sne="editor.changePasteType",Lne=new Ve("pasteWidgetVisible",!1,m("pasteWidgetVisible","Whether the paste widget is showing")),TR="application/vnd.code.copyMetadata";let Dm=UF=class extends te{static get(e){return e.getContribution(UF.ID)}constructor(e,t,i,s,o,r,a){super(),this._bulkEditService=i,this._clipboardService=s,this._languageFeaturesService=o,this._quickInputService=r,this._progressService=a,this._editor=e;const l=e.getContainerDomNode();this._register(ce(l,"copy",c=>this.handleCopy(c))),this._register(ce(l,"cut",c=>this.handleCopy(c))),this._register(ce(l,"paste",c=>this.handlePaste(c),!0)),this._pasteProgressManager=this._register(new KI("pasteIntoEditor",e,t)),this._postPasteWidgetManager=this._register(t.createInstance(GI,"pasteIntoEditor",e,Lne,{id:Sne,label:m("postPasteWidgetTitle","Show paste options...")}))}changePasteType(){this._postPasteWidgetManager.tryShowSelector()}pasteAs(e){this._editor.focus();try{this._pasteAsActionContext={preferredId:e},sx().execCommand("paste")}finally{this._pasteAsActionContext=void 0}}isPasteAsEnabled(){return this._editor.getOption(84).enabled&&!this._editor.getOption(90)}handleCopy(e){var t,i;if(!this._editor.hasTextFocus()||(yg&&this._clipboardService.writeResources([]),!e.clipboardData||!this.isPasteAsEnabled()))return;const s=this._editor.getModel(),o=this._editor.getSelections();if(!s||!(o!=null&&o.length))return;const r=this._editor.getOption(37);let a=o;const l=o.length===1&&o[0].isEmpty();if(l){if(!r)return;a=[new I(a[0].startLineNumber,1,a[0].startLineNumber,1+s.getLineLength(a[0].startLineNumber))]}const c=(t=this._editor._getViewModel())===null||t===void 0?void 0:t.getPlainTextToCopy(o,r,zs),u={multicursorText:Array.isArray(c)?c:null,pasteOnNewLine:l,mode:null},h=this._languageFeaturesService.documentPasteEditProvider.ordered(s).filter(v=>!!v.prepareDocumentPaste);if(!h.length){this.setCopyMetadata(e.clipboardData,{defaultPastePayload:u});return}const f=bne(e.clipboardData),g=h.flatMap(v=>{var b;return(b=v.copyMimeTypes)!==null&&b!==void 0?b:[]}),p=SN();this.setCopyMetadata(e.clipboardData,{id:p,providerCopyMimeTypes:g,defaultPastePayload:u});const _=Xn(v=>Jd(this,void 0,void 0,function*(){const b=wd(yield Promise.all(h.map(C=>Jd(this,void 0,void 0,function*(){try{return yield C.prepareDocumentPaste(s,a,f,v)}catch(w){console.error(w);return}}))));b.reverse();for(const C of b)for(const[w,y]of C)f.replace(w,y);return f}));(i=this._currentCopyOperation)===null||i===void 0||i.dataTransferPromise.cancel(),this._currentCopyOperation={handle:p,dataTransferPromise:_}}handlePaste(e){var t,i;return Jd(this,void 0,void 0,function*(){if(!e.clipboardData||!this._editor.hasTextFocus())return;(t=this._currentPasteOperation)===null||t===void 0||t.cancel(),this._currentPasteOperation=void 0;const s=this._editor.getModel(),o=this._editor.getSelections();if(!(o!=null&&o.length)||!s||!this.isPasteAsEnabled())return;const r=this.fetchCopyMetadata(e),a=Cne(e.clipboardData);a.delete(TR);const l=[...e.clipboardData.types,...(i=r==null?void 0:r.providerCopyMimeTypes)!==null&&i!==void 0?i:[],wn.uriList],c=this._languageFeaturesService.documentPasteEditProvider.ordered(s).filter(d=>{var u;return(u=d.pasteMimeTypes)===null||u===void 0?void 0:u.some(h=>_ne(h,l))});c.length&&(e.preventDefault(),e.stopImmediatePropagation(),this._pasteAsActionContext?this.showPasteAsPick(this._pasteAsActionContext.preferredId,c,o,a,r):this.doPasteInline(c,o,a,r))})}doPasteInline(e,t,i,s){const o=Xn(r=>Jd(this,void 0,void 0,function*(){const a=this._editor;if(!a.hasModel())return;const l=a.getModel(),c=new tg(a,3,void 0,r);try{if(yield this.mergeInDataFromCopy(i,s,c.token),c.token.isCancellationRequested)return;const d=e.filter(h=>Nj(h,i));if(!d.length||d.length===1&&d[0].id==="text"){yield this.applyDefaultPasteHandler(i,s,c.token);return}const u=yield this.getPasteEdits(d,i,l,t,c.token);if(c.token.isCancellationRequested)return;if(u.length===1&&u[0].providerId==="text"){yield this.applyDefaultPasteHandler(i,s,c.token);return}if(u.length){const h=a.getOption(84).showPasteSelector==="afterPaste";return this._postPasteWidgetManager.applyEditAndShowIfNeeded(t,{activeEditIndex:0,allEdits:u},h,c.token)}yield this.applyDefaultPasteHandler(i,s,c.token)}finally{c.dispose(),this._currentPasteOperation===o&&(this._currentPasteOperation=void 0)}}));this._pasteProgressManager.showWhile(t[0].getEndPosition(),m("pasteIntoEditorProgress","Running paste handlers. Click to cancel"),o),this._currentPasteOperation=o}showPasteAsPick(e,t,i,s,o){const r=Xn(a=>Jd(this,void 0,void 0,function*(){const l=this._editor;if(!l.hasModel())return;const c=l.getModel(),d=new tg(l,3,void 0,a);try{if(yield this.mergeInDataFromCopy(s,o,d.token),d.token.isCancellationRequested)return;let u=t.filter(p=>Nj(p,s));e&&(u=u.filter(p=>p.id===e));const h=yield this.getPasteEdits(u,s,c,i,d.token);if(d.token.isCancellationRequested||!h.length)return;let f;if(e)f=h.at(0);else{const p=yield this._quickInputService.pick(h.map(_=>({label:_.label,description:_.providerId,detail:_.detail,edit:_})),{placeHolder:m("pasteAsPickerPlaceholder","Select Paste Action")});f=p==null?void 0:p.edit}if(!f)return;const g=B5e(c.uri,i,f);yield this._bulkEditService.apply(g,{editor:this._editor})}finally{d.dispose(),this._currentPasteOperation===r&&(this._currentPasteOperation=void 0)}}));this._progressService.withProgress({location:10,title:m("pasteAsProgress","Running paste handlers")},()=>r)}setCopyMetadata(e,t){e.setData(TR,JSON.stringify(t))}fetchCopyMetadata(e){var t;if(!e.clipboardData)return;const i=e.clipboardData.getData(TR);if(i)try{return JSON.parse(i)}catch{return}const[s,o]=gO.getTextData(e.clipboardData);if(o)return{defaultPastePayload:{mode:o.mode,multicursorText:(t=o.multicursorText)!==null&&t!==void 0?t:null,pasteOnNewLine:!!o.isFromEmptySelection}}}mergeInDataFromCopy(e,t,i){var s;return Jd(this,void 0,void 0,function*(){if(t!=null&&t.id&&((s=this._currentCopyOperation)===null||s===void 0?void 0:s.handle)===t.id){const o=yield this._currentCopyOperation.dataTransferPromise;if(i.isCancellationRequested)return;for(const[r,a]of o)e.replace(r,a)}if(!e.has(wn.uriList)){const o=yield this._clipboardService.readResources();if(i.isCancellationRequested)return;o.length&&e.append(wn.uriList,Y7(LN.create(o)))}})}getPasteEdits(e,t,i,s,o){return Jd(this,void 0,void 0,function*(){const r=yield rx(Promise.all(e.map(l=>Jd(this,void 0,void 0,function*(){var c;try{const d=yield(c=l.provideDocumentPasteEdits)===null||c===void 0?void 0:c.call(l,i,s,t,o);if(d)return Object.assign(Object.assign({},d),{providerId:l.id})}catch(d){console.error(d)}}))),o),a=wd(r!=null?r:[]);return wne(a)})}applyDefaultPasteHandler(e,t,i){var s,o,r;return Jd(this,void 0,void 0,function*(){const a=(s=e.get(wn.text))!==null&&s!==void 0?s:e.get("text");if(!a)return;const l=yield a.asString();if(i.isCancellationRequested)return;const c={text:l,pasteOnNewLine:(o=t==null?void 0:t.defaultPastePayload.pasteOnNewLine)!==null&&o!==void 0?o:!1,multicursorText:(r=t==null?void 0:t.defaultPastePayload.multicursorText)!==null&&r!==void 0?r:null,mode:null};this._editor.trigger("keyboard","paste",c)})}};Dm.ID="editor.contrib.copyPasteActionController";Dm=UF=z5e([R_(1,_t),R_(2,kS),R_(3,ch),R_(4,Ze),R_(5,yc),R_(6,cee)],Dm);function Nj(n,e){var t;return!!(!((t=n.pasteMimeTypes)===null||t===void 0)&&t.some(i=>e.matches(i)))}var Z7=globalThis&&globalThis.__decorate||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},yy=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},Qb=globalThis&&globalThis.__awaiter||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 X7=m("builtIn","Built-in");class Q7{provideDocumentPasteEdits(e,t,i,s){return Qb(this,void 0,void 0,function*(){const o=yield this.getEdit(i,s);return o?{insertText:o.insertText,label:o.label,detail:o.detail,handledMimeType:o.handledMimeType,yieldTo:o.yieldTo}:void 0})}provideDocumentOnDropEdits(e,t,i,s){return Qb(this,void 0,void 0,function*(){const o=yield this.getEdit(i,s);return o?{insertText:o.insertText,label:o.label,handledMimeType:o.handledMimeType,yieldTo:o.yieldTo}:void 0})}}class kne extends Q7{constructor(){super(...arguments),this.id="text",this.dropMimeTypes=[wn.text],this.pasteMimeTypes=[wn.text]}getEdit(e,t){return Qb(this,void 0,void 0,function*(){const i=e.get(wn.text);if(!i||e.has(wn.uriList))return;const s=yield i.asString();return{handledMimeType:wn.text,label:m("text.label","Insert Plain Text"),detail:X7,insertText:s}})}}class Dne extends Q7{constructor(){super(...arguments),this.id="uri",this.dropMimeTypes=[wn.uriList],this.pasteMimeTypes=[wn.uriList]}getEdit(e,t){return Qb(this,void 0,void 0,function*(){const i=yield Ene(e);if(!i.length||t.isCancellationRequested)return;let s=0;const o=i.map(({uri:a,originalText:l})=>a.scheme===Nt.file?a.fsPath:(s++,l)).join(" ");let r;return s>0?r=i.length>1?m("defaultDropProvider.uriList.uris","Insert Uris"):m("defaultDropProvider.uriList.uri","Insert Uri"):r=i.length>1?m("defaultDropProvider.uriList.paths","Insert Paths"):m("defaultDropProvider.uriList.path","Insert Path"),{handledMimeType:wn.uriList,insertText:o,label:r,detail:X7}})}}let YI=class extends Q7{constructor(e){super(),this._workspaceContextService=e,this.id="relativePath",this.dropMimeTypes=[wn.uriList],this.pasteMimeTypes=[wn.uriList]}getEdit(e,t){return Qb(this,void 0,void 0,function*(){const i=yield Ene(e);if(!i.length||t.isCancellationRequested)return;const s=wd(i.map(({uri:o})=>{const r=this._workspaceContextService.getWorkspaceFolder(o);return r?tDe(r.uri,o):void 0}));if(s.length)return{handledMimeType:wn.uriList,insertText:s.join(" "),label:i.length>1?m("defaultDropProvider.uriList.relativePaths","Insert Relative Paths"):m("defaultDropProvider.uriList.relativePath","Insert Relative Path"),detail:X7}})}};YI=Z7([yy(0,hm)],YI);function Ene(n){return Qb(this,void 0,void 0,function*(){const e=n.get(wn.uriList);if(!e)return[];const t=yield e.asString(),i=[];for(const s of LN.parse(t))try{i.push({uri:ct.parse(s),originalText:s})}catch{}return i})}let jF=class extends te{constructor(e,t){super(),this._register(e.documentOnDropEditProvider.register("*",new kne)),this._register(e.documentOnDropEditProvider.register("*",new Dne)),this._register(e.documentOnDropEditProvider.register("*",new YI(t)))}};jF=Z7([yy(0,Ze),yy(1,hm)],jF);let KF=class extends te{constructor(e,t){super(),this._register(e.documentPasteEditProvider.register("*",new kne)),this._register(e.documentPasteEditProvider.register("*",new Dne)),this._register(e.documentPasteEditProvider.register("*",new YI(t)))}};KF=Z7([yy(0,Ze),yy(1,hm)],KF);ti(Dm.ID,Dm,0);Jx(KF);Re(new class extends fs{constructor(){super({id:Sne,precondition:Lne,kbOpts:{weight:100,primary:2137}})}runEditorCommand(n,e,t){var i;return(i=Dm.get(e))===null||i===void 0?void 0:i.changePasteType()}});De(class extends Ue{constructor(){super({id:"editor.action.pasteAs",label:m("pasteAs","Paste As..."),alias:"Paste As...",precondition:void 0,description:{description:"Paste as",args:[{name:"args",schema:{type:"object",properties:{id:{type:"string",description:m("pasteAs.id","The id of the paste edit to try applying. If not provided, the editor will show a picker.")}}}}]}})}run(n,e,t){var i;const s=typeof(t==null?void 0:t.id)=="string"?t.id:void 0;return(i=Dm.get(e))===null||i===void 0?void 0:i.pasteAs(s)}});class U5e{constructor(){this._dragOperations=new Map}removeDragOperationTransfer(e){if(e&&this._dragOperations.has(e)){const t=this._dragOperations.get(e);return this._dragOperations.delete(e),t}}}class Aj{constructor(e){this.identifier=e}}const Ine=Wt("treeViewsDndService");Gt(Ine,U5e,1);var j5e=globalThis&&globalThis.__decorate||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},pk=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},L1=globalThis&&globalThis.__awaiter||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())})},qF;const Tne="editor.experimental.dropIntoEditor.defaultProvider",xne="editor.changeDropType",Nne=new Ve("dropWidgetVisible",!1,m("dropWidgetVisible","Whether the drop widget is showing"));let Jb=qF=class extends te{static get(e){return e.getContribution(qF.ID)}constructor(e,t,i,s,o){super(),this._configService=i,this._languageFeaturesService=s,this._treeViewsDragAndDropService=o,this.treeItemsTransfer=wy.getInstance(),this._dropProgressManager=this._register(t.createInstance(KI,"dropIntoEditor",e)),this._postDropWidgetManager=this._register(t.createInstance(GI,"dropIntoEditor",e,Nne,{id:xne,label:m("postDropWidgetTitle","Show drop options...")})),this._register(e.onDropIntoEditor(r=>this.onDropIntoEditor(e,r.position,r.event)))}changeDropType(){this._postDropWidgetManager.tryShowSelector()}onDropIntoEditor(e,t,i){var s;return L1(this,void 0,void 0,function*(){if(!i.dataTransfer||!e.hasModel())return;(s=this._currentOperation)===null||s===void 0||s.cancel(),e.focus(),e.setPosition(t);const o=Xn(r=>L1(this,void 0,void 0,function*(){const a=new tg(e,1,void 0,r);try{const l=yield this.extractDataTransferData(i);if(l.size===0||a.token.isCancellationRequested)return;const c=e.getModel();if(!c)return;const d=this._languageFeaturesService.documentOnDropEditProvider.ordered(c).filter(h=>h.dropMimeTypes?h.dropMimeTypes.some(f=>l.matches(f)):!0),u=yield this.getDropEdits(d,c,t,l,a);if(a.token.isCancellationRequested)return;if(u.length){const h=this.getInitialActiveEditIndex(c,u),f=e.getOption(36).showDropSelector==="afterDrop";yield this._postDropWidgetManager.applyEditAndShowIfNeeded([I.fromPositions(t)],{activeEditIndex:h,allEdits:u},f,r)}}finally{a.dispose(),this._currentOperation===o&&(this._currentOperation=void 0)}}));this._dropProgressManager.showWhile(t,m("dropIntoEditorProgress","Running drop handlers. Click to cancel"),o),this._currentOperation=o})}getDropEdits(e,t,i,s,o){return L1(this,void 0,void 0,function*(){const r=yield rx(Promise.all(e.map(l=>L1(this,void 0,void 0,function*(){try{const c=yield l.provideDocumentOnDropEdits(t,i,s,o.token);if(c)return Object.assign(Object.assign({},c),{providerId:l.id})}catch(c){console.error(c)}}))),o.token),a=wd(r!=null?r:[]);return wne(a)})}getInitialActiveEditIndex(e,t){const i=this._configService.getValue(Tne,{resource:e.uri});for(const[s,o]of Object.entries(i)){const r=t.findIndex(a=>o===a.providerId&&a.handledMimeType&&_ne(s,[a.handledMimeType]));if(r>=0)return r}return 0}extractDataTransferData(e){return L1(this,void 0,void 0,function*(){if(!e.dataTransfer)return new mne;const t=Cne(e.dataTransfer);if(this.treeItemsTransfer.hasData(Aj.prototype)){const i=this.treeItemsTransfer.getData(Aj.prototype);if(Array.isArray(i))for(const s of i){const o=yield this._treeViewsDragAndDropService.removeDragOperationTransfer(s.identifier);if(o)for(const[r,a]of o)t.replace(r,a)}}return t})}};Jb.ID="editor.contrib.dropIntoEditorController";Jb=qF=j5e([pk(1,_t),pk(2,zt),pk(3,Ze),pk(4,Ine)],Jb);ti(Jb.ID,Jb,2);Re(new class extends fs{constructor(){super({id:xne,precondition:Nne,kbOpts:{weight:100,primary:2137}})}runEditorCommand(n,e,t){var i;(i=Jb.get(e))===null||i===void 0||i.changeDropType()}});Jx(jF);en.as(wc.Configuration).registerConfiguration(Object.assign(Object.assign({},Mx),{properties:{[Tne]:{type:"object",scope:5,description:m("defaultProviderDescription","Configures the default drop provider to use for content of a given mime type."),default:{},additionalProperties:{type:"string"}}}}));class go{constructor(e){this._editor=e,this._decorations=[],this._overviewRulerApproximateDecorations=[],this._findScopeDecorationIds=[],this._rangeHighlightDecorationId=null,this._highlightedDecorationId=null,this._startPosition=this._editor.getPosition()}dispose(){this._editor.removeDecorations(this._allDecorations()),this._decorations=[],this._overviewRulerApproximateDecorations=[],this._findScopeDecorationIds=[],this._rangeHighlightDecorationId=null,this._highlightedDecorationId=null}reset(){this._decorations=[],this._overviewRulerApproximateDecorations=[],this._findScopeDecorationIds=[],this._rangeHighlightDecorationId=null,this._highlightedDecorationId=null}getCount(){return this._decorations.length}getFindScope(){return this._findScopeDecorationIds[0]?this._editor.getModel().getDecorationRange(this._findScopeDecorationIds[0]):null}getFindScopes(){if(this._findScopeDecorationIds.length){const e=this._findScopeDecorationIds.map(t=>this._editor.getModel().getDecorationRange(t)).filter(t=>!!t);if(e.length)return e}return null}getStartPosition(){return this._startPosition}setStartPosition(e){this._startPosition=e,this.setCurrentFindMatch(null)}_getDecorationIndex(e){const t=this._decorations.indexOf(e);return t>=0?t+1:1}getDecorationRangeAt(e){const t=e{if(this._highlightedDecorationId!==null&&(s.changeDecorationOptions(this._highlightedDecorationId,go._FIND_MATCH_DECORATION),this._highlightedDecorationId=null),t!==null&&(this._highlightedDecorationId=t,s.changeDecorationOptions(this._highlightedDecorationId,go._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 I(o.startLineNumber,o.startColumn,r,a)}this._rangeHighlightDecorationId=s.addDecoration(o,go._RANGE_HIGHLIGHT_DECORATION)}}),i}set(e,t){this._editor.changeDecorations(i=>{let s=go._FIND_MATCH_DECORATION;const o=[];if(e.length>1e3){s=go._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 I(u,1,h,1),options:go._FIND_MATCH_ONLY_OVERVIEW_DECORATION}),u=p.startLineNumber,h=p.endLineNumber)}o.push({range:new I(u,1,h,1),options:go._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,go._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;rI.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 Mj(n,e,t){return n[0].indexOf(t)!==-1&&e.indexOf(t)!==-1&&n[0].split(t).length===e.split(t).length}function Rj(n,e,t){const i=e.split(t),s=n[0].split(t);let o="";return i.forEach((r,a)=>{o+=Ane([s[a]],r)+t}),o.slice(0,-1)}class Pj{constructor(e){this.staticValue=e,this.kind=0}}class q5e{constructor(e){this.pieces=e,this.kind=1}}class e0{static fromStaticValue(e){return new e0([Xp.staticValue(e)])}get hasReplacementPatterns(){return this._state.kind===1}constructor(e){!e||e.length===0?this._state=new Pj(""):e.length===1&&e[0].staticValue!==null?this._state=new Pj(e[0].staticValue):this._state=new q5e(e)}buildReplaceString(e,t){if(this._state.kind===0)return t?Ane(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("\n",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,fi(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)},Z5e)):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 I(a.startLineNumber,1,l,this._editor.getModel().getLineMaxColumn(l))}return a}));const s=this._findMatches(i,!1,df);this._decorations.set(s,i);const o=this._editor.getSelection();let r=this._decorations.getCurrentMatchesPosition(o);if(r===0&&s.length>0){const a=Ew(s.map(l=>l.range),l=>I.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 Y(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 Y(i,s)}_moveToNextMatch(e){if(!this._state.canNavigateForward()){const i=this._decorations.matchBeforePosition(e);i&&this._setCurrentFindMatch(i);return}if(this._decorations.getCount()VC._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>=df?this._largeReplaceAll():this._regularReplaceAll(e),this.research(!1)}_largeReplaceAll(){const t=new ip(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 u9(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 Je(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:He(e9),inputActiveOptionForeground:He(t9),inputActiveOptionBackground:He(Ip)};this.caseSensitive=this._register(new Vee(Object.assign({appendTitle:this._keybindingLabelFor(Ai.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 Hee(Object.assign({appendTitle:this._keybindingLabelFor(Ai.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 $ee(Object.assign({appendTitle:this._keybindingLabelFor(Ai.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(ce(this._domNode,Pe.MOUSE_LEAVE,o=>this._onMouseLeave())),this._register(ce(this._domNode,"mouseover",o=>this._onMouseOver()))}_keybindingLabelFor(e){const t=this._keybindingService.lookupKeybinding(e);return t?" (".concat(t.getLabel(),")"):""}dispose(){this._editor.removeOverlayWidget(this),super.dispose()}getId(){return EN.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")}}EN.ID="editor.contrib.findOptionsWidget";function wk(n,e){return n===1?!0:n===2?!1:e}class X5e extends te{get searchString(){return this._searchString}get replaceString(){return this._replaceString}get isRevealed(){return this._isRevealed}get isReplaceRevealed(){return this._isReplaceRevealed}get isRegex(){return wk(this._isRegexOverride,this._isRegex)}get wholeWord(){return wk(this._wholeWordOverride,this._wholeWord)}get matchCase(){return wk(this._matchCaseOverride,this._matchCase)}get preserveCase(){return wk(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 j),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"&&(I.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=>!I.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=df}}const Q5e=m("defaultLabel","input"),J5e=m("label.preserveCaseToggle","Preserve Case");class e3e extends M0{constructor(e){super({icon:Me.preserveCase,title:J5e+e.appendTitle,isChecked:e.isChecked,inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class t3e extends vl{constructor(e,t,i,s){super(),this._showOptionButtons=i,this.fixFocusOnOptionClickEnabled=!0,this.cachedOptionsWidth=0,this._onDidOptionChange=this._register(new j),this.onDidOptionChange=this._onDidOptionChange.event,this._onKeyDown=this._register(new j),this.onKeyDown=this._onKeyDown.event,this._onMouseDown=this._register(new j),this._onInput=this._register(new j),this._onKeyUp=this._register(new j),this._onPreserveCaseKeyDown=this._register(new j),this.onPreserveCaseKeyDown=this._onPreserveCaseKeyDown.event,this.contextViewProvider=t,this.placeholder=s.placeholder||"",this.validation=s.validation,this.label=s.label||Q5e;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 zee(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 e3e(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(),xt.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 Mne=globalThis&&globalThis.__decorate||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},Rne=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};const e6=new Ve("suggestWidgetVisible",!1,m("suggestWidgetVisible","Whether suggestion are visible")),t6="historyNavigationWidgetFocus",Pne="historyNavigationForwardsEnabled",One="historyNavigationBackwardsEnabled";let Hu;const yk=[];function Fne(n,e){if(yk.includes(e))throw new Error("Cannot register the same widget multiple times");yk.push(e);const t=new be,i=new Ve(t6,!1).bindTo(n),s=new Ve(Pne,!0).bindTo(n),o=new Ve(One,!0).bindTo(n),r=()=>{i.set(!0),Hu=e},a=()=>{i.set(!1),Hu===e&&(Hu=void 0)};return e.element===document.activeElement&&r(),t.add(e.onDidFocus(()=>r())),t.add(e.onDidBlur(()=>a())),t.add(vt(()=>{yk.splice(yk.indexOf(e),1),a()})),{historyNavigationForwardsEnablement:s,historyNavigationBackwardsEnablement:o,dispose(){t.dispose()}}}let GF=class extends Uee{constructor(e,t,i,s){super(e,t,i);const o=this._register(s.createScoped(this.inputBox.element));this._register(Fne(o,this.inputBox))}};GF=Mne([Rne(3,bt)],GF);let YF=class extends t3e{constructor(e,t,i,s,o=!1){super(e,t,o,i);const r=this._register(s.createScoped(this.inputBox.element));this._register(Fne(r,this.inputBox))}};YF=Mne([Rne(3,bt)],YF);er.registerCommandAndKeybindingRule({id:"history.showPrevious",weight:200,when:fe.and(fe.has(t6),fe.equals(One,!0),fe.not("isComposing"),e6.isEqualTo(!1)),primary:16,secondary:[528],handler:n=>{Hu==null||Hu.showPreviousValue()}});er.registerCommandAndKeybindingRule({id:"history.showNext",weight:200,when:fe.and(fe.has(t6),fe.equals(Pne,!0),fe.not("isComposing"),e6.isEqualTo(!1)),primary:18,secondary:[530],handler:n=>{Hu==null||Hu.showNextValue()}});function Oj(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 i3e=globalThis&&globalThis.__awaiter||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 n3e=Sn("find-selection",Me.selection,m("findSelectionIcon","Icon for 'Find in Selection' in the editor find widget.")),Fj=Sn("find-collapsed",Me.chevronRight,m("findCollapsedIcon","Icon to indicate that the editor find widget is collapsed.")),Bj=Sn("find-expanded",Me.chevronDown,m("findExpandedIcon","Icon to indicate that the editor find widget is expanded.")),s3e=Sn("find-replace",Me.replace,m("findReplaceIcon","Icon for 'Replace' in the editor find widget.")),o3e=Sn("find-replace-all",Me.replaceAll,m("findReplaceAllIcon","Icon for 'Replace All' in the editor find widget.")),r3e=Sn("find-previous-match",Me.arrowUp,m("findPreviousMatchIcon","Icon for 'Find Previous' in the editor find widget.")),a3e=Sn("find-next-match",Me.arrowDown,m("findNextMatchIcon","Icon for 'Find Next' in the editor find widget.")),l3e=m("label.findDialog","Find / Replace"),c3e=m("label.find","Find"),d3e=m("placeholder.find","Find"),u3e=m("label.previousMatchButton","Previous Match"),h3e=m("label.nextMatchButton","Next Match"),f3e=m("label.toggleSelectionFind","Find in Selection"),g3e=m("label.closeButton","Close"),p3e=m("label.replace","Replace"),m3e=m("placeholder.replace","Replace"),_3e=m("label.replaceButton","Replace"),v3e=m("label.replaceAllButton","Replace All"),b3e=m("label.toggleReplaceButton","Toggle Replace"),C3e=m("title.matchesCountLimit","Only the first {0} results are highlighted, but all find operations work on the entire text.",df),w3e=m("label.matchesLocation","{0} of {1}"),Wj=m("label.noResults","No results"),Tc=419,y3e=275,S3e=y3e-54;let k1=69;const L3e=33,Vj="ctrlEnterReplaceAll.windows.donotask",Hj=Kt?256:2048;class xR{constructor(e){this.afterLineNumber=e,this.heightInPx=L3e,this.suppressMouseDown=!1,this.domNode=document.createElement("div"),this.domNode.className="dock-find-viewzone"}}function $j(n,e,t){const i=!!e.match(/\n/);if(t&&i&&t.selectionStart>0){n.stopPropagation();return}}function zj(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 xR(0),this._showViewZone()),!h&&this._viewZone&&this._removeViewZone()}})),this.updateAccessibilitySupport(),this._register(this._codeEditor.onDidChangeCursorSelection(()=>{this._isVisible&&this._updateToggleSelectionFindButton()})),this._register(this._codeEditor.onDidFocusEditorWidget(()=>i3e(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=DN.bindTo(r),this._findFocusTracker=this._register(Ld(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=J7.bindTo(r),this._replaceFocusTracker=this._register(Ld(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 xR(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 IN.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=Ko(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,Dt)}_updateHistory(){this._state.searchString&&this._findInput.inputBox.addToHistory(),this._state.replaceString&&this._replaceInput.inputBox.addToHistory()}_updateMatchesCount(){this._matchesCount.style.minWidth=k1+"px",this._state.matchesCount>=df?this._matchesCount.title=C3e: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>=df&&(t+="+");let i=String(this._state.matchesPosition);i==="0"&&(i="?"),e=sm(w3e,i,t)}else e=Wj;this._matchesCount.appendChild(document.createTextNode(e)),to(this._getAriaLabel(e,this._state.currentMatch,this._state.searchString)),k1=Math.max(k1,this._matchesCount.clientWidth)}_getAriaLabel(e,t,i){if(e===Wj)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();if(o&&t.startLineNumber<=o.getLineCount()&&t.startLineNumber>=1){const r=o.getLineContent(t.startLineNumber);return"".concat(r,", ").concat(s)}return 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=Un(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=ZX(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 xR(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||!O8(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&&Ko(this._domNode)>Tc){this._domNode.style.maxWidth="".concat(i-28-s-15,"px"),this._replaceInput.width=Ko(this._findInput.domNode);return}if(Tc+28+s>=i&&(r=!0),Tc+28+s-k1>=i&&(a=!0),Tc+28+s-k1>=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="".concat(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=Ko(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="".concat(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&&!I.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(Hj|3))if(this._keybindingService.dispatchEvent(e,e.target)){e.preventDefault();return}else{this._findInput.inputBox.insertAtCursor("\n"),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 $j(e,this._findInput.getValue(),this._findInput.domNode.querySelector("textarea"));if(e.equals(18))return zj(e,this._findInput.getValue(),this._findInput.domNode.querySelector("textarea"))}_onReplaceInputKeyDown(e){if(e.equals(Hj|3))if(this._keybindingService.dispatchEvent(e,e.target)){e.preventDefault();return}else{zs&&nc&&!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(Vj,!0,0,0)),this._replaceInput.inputBox.insertAtCursor("\n"),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 $j(e,this._replaceInput.inputBox.value,this._replaceInput.inputBox.element.querySelector("textarea"));if(e.equals(18))return zj(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?" (".concat(t.getLabel(),")"):""}_buildDomNode(){this._findInput=this._register(new GF(null,this._contextViewProvider,{width:S3e,label:c3e,placeholder:d3e,appendCaseSensitiveLabel:this._keybindingLabelFor(Ai.ToggleCaseSensitiveCommand),appendWholeWordsLabel:this._keybindingLabelFor(Ai.ToggleWholeWordCommand),appendRegexLabel:this._keybindingLabelFor(Ai.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:()=>Oj(this._keybindingService),inputBoxStyles:dI,toggleStyles:cI},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()})),Co&&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 P_({label:u3e+this._keybindingLabelFor(Ai.PreviousMatchFindAction),icon:r3e,onTrigger:()=>{kp(this._codeEditor.getAction(Ai.PreviousMatchFindAction)).run().then(void 0,Dt)}})),this._nextBtn=this._register(new P_({label:h3e+this._keybindingLabelFor(Ai.NextMatchFindAction),icon:a3e,onTrigger:()=>{kp(this._codeEditor.getAction(Ai.NextMatchFindAction)).run().then(void 0,Dt)}}));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 M0({icon:n3e,title:f3e+this._keybindingLabelFor(Ai.ToggleSearchScopeCommand),isChecked:!1,inputActiveOptionBackground:He(Ip),inputActiveOptionBorder:He(e9),inputActiveOptionForeground:He(t9)})),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 P_({label:g3e+this._keybindingLabelFor(Ai.CloseFindWidgetCommand),icon:fte,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 YF(null,void 0,{label:p3e,placeholder:m3e,appendPreserveCaseLabel:this._keybindingLabelFor(Ai.TogglePreserveCaseCommand),history:[],flexibleHeight:!0,flexibleWidth:!0,flexibleMaxHeight:118,showHistoryHint:()=>Oj(this._keybindingService),inputBoxStyles:dI,toggleStyles:cI},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 P_({label:_3e+this._keybindingLabelFor(Ai.ReplaceOneAction),icon:s3e,onTrigger:()=>{this._controller.replace()},onKeyDown:l=>{l.equals(1026)&&(this._closeBtn.focus(),l.preventDefault())}})),this._replaceAllBtn=this._register(new P_({label:v3e+this._keybindingLabelFor(Ai.ReplaceAllAction),icon:o3e,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 P_({label:b3e,className:"codicon toggle left",onTrigger:()=>{this._state.change({isReplaceRevealed:!this._isReplaceVisible},!1),this._isReplaceVisible&&(this._replaceInput.width=Ko(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=l3e,this._domNode.role="dialog",this._domNode.style.width="".concat(Tc,"px"),this._domNode.appendChild(this._toggleReplaceBtn.domNode),this._domNode.appendChild(i),this._domNode.appendChild(this._closeBtn.domNode),this._domNode.appendChild(o),this._resizeSash=new qs(this._domNode,this,{orientation:0,size:2}),this._resized=!1;let a=Tc;this._register(this._resizeSash.onDidStart(()=>{a=Ko(this._domNode)})),this._register(this._resizeSash.onDidChange(l=>{this._resized=!0;const c=a+l.startX-l.currentX;if(cd||(this._domNode.style.width="".concat(c,"px"),this._isReplaceVisible&&(this._replaceInput.width=Ko(this._findInput.domNode)),this._findInput.inputBox.layout(),this._tryUpdateHeight())})),this._register(this._resizeSash.onDidReset(()=>{const l=Ko(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(...dt.asClassNameArray(Fj)),this._domNode.classList.add(...dt.asClassNameArray(Bj))):(this._domNode.classList.remove(...dt.asClassNameArray(Bj)),this._domNode.classList.add(...dt.asClassNameArray(Fj)))}}bl((n,e)=>{const t=(p,_)=>{_&&e.addRule(".monaco-editor ".concat(p," { background-color: ").concat(_,"; }"))};t(".findMatch",n.getColor(ld)),t(".currentFindMatch",n.getColor($we)),t(".findScope",n.getColor(zwe));const i=n.getColor(un);t(".find-widget",i);const s=n.getColor(nd);s&&e.addRule(".monaco-editor .find-widget { box-shadow: 0 0 8px 2px ".concat(s,"; }"));const o=n.getColor(J8);o&&e.addRule(".monaco-editor .find-widget { border-left: 1px solid ".concat(o,"; border-right: 1px solid ").concat(o,"; border-bottom: 1px solid ").concat(o,"; }"));const r=n.getColor(tf);r&&e.addRule(".monaco-editor .findMatch { border: 1px ".concat(ac(n.type)?"dotted":"solid"," ").concat(r,"; box-sizing: border-box; }"));const a=n.getColor(Uwe);a&&e.addRule(".monaco-editor .currentFindMatch { border: 2px solid ".concat(a,"; padding: 1px; box-sizing: border-box; }"));const l=n.getColor(jwe);l&&e.addRule(".monaco-editor .findScope { border: 1px ".concat(ac(n.type)?"dashed":"solid"," ").concat(l,"; }"));const c=n.getColor($t);c&&e.addRule(".monaco-editor .find-widget { border: 1px solid ".concat(c,"; }"));const d=n.getColor(rd);d&&e.addRule(".monaco-editor .find-widget { color: ".concat(d,"; }"));const u=n.getColor(uwe);u&&e.addRule(".monaco-editor .find-widget.no-results .matchesCount { color: ".concat(u,"; }"));const h=n.getColor(Mwe);if(h)e.addRule(".monaco-editor .find-widget .monaco-sash { background-color: ".concat(h,"; }"));else{const p=n.getColor(ad);p&&e.addRule(".monaco-editor .find-widget .monaco-sash { background-color: ".concat(p,"; }"))}const f=n.getColor(hO);f&&e.addRule("\n .monaco-editor .find-widget .button:not(.disabled):hover,\n .monaco-editor .find-widget .codicon-find-selection:hover {\n background-color: ".concat(f," !important;\n }\n "));const g=n.getColor(zr);g&&e.addRule(".monaco-editor .find-widget .monaco-inputbox.synthetic-focus { outline-color: ".concat(g,"; }"))});var Bne=globalThis&&globalThis.__decorate||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},Wl=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},Em=globalThis&&globalThis.__awaiter||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())})},ZF;const k3e=524288;function XF(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!!DN.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=Xr(e)),this._state.change({searchString:e},!1)}highlightFindOptions(e=!1){}_start(e,t){return Em(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=XF(this._editor,e.seedSearchStringFromSelection,e.seedSearchStringFromNonEmptySelection);s&&(this._state.isRegex?i.searchString=Xr(s):i.searchString=s)}else if(e.seedSearchStringFromSelection==="multiple"&&!e.updateSearchScope){const s=XF(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 VC(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 Em(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)}};Oo.ID="editor.contrib.findController";Oo=ZF=Bne([Wl(1,bt),Wl(2,yl),Wl(3,ch),Wl(4,Nn)],Oo);let QF=class extends Oo{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 Em(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 IN(this._editor,this,this._state,this._contextViewService,this._keybindingService,this._contextKeyService,this._themeService,this._storageService,this._notificationService)),this._findOptionsWidget=this._register(new EN(this._editor,this._state,this._keybindingService))}};QF=Bne([Wl(1,rh),Wl(2,bt),Wl(3,Di),Wl(4,os),Wl(5,Nn),Wl(6,yl),Wl(7,ch)],QF);const D3e=sQ(new nQ({id:Ai.StartFindAction,label:m("startFindAction","Find"),alias:"Find",precondition:fe.or(O.focus,fe.has("editorIsOpen")),kbOpts:{kbExpr:null,primary:2084,weight:100},menuOpts:{menuId:M.MenubarEditMenu,group:"3_find",title:m({key:"miFind",comment:["&& denotes a mnemonic"]},"&&Find"),order:1}}));D3e.addImplementation(0,(n,e,t)=>{const i=Oo.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 E3e={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.\nThe flag will not be saved for the future.\n0: Do Nothing\n1: True\n2: False')},wholeWord:{type:"boolean"},wholeWordOverride:{type:"number",description:m("actions.find.wholeWordOverride",'Overrides "Match Whole Word" flag.\nThe flag will not be saved for the future.\n0: Do Nothing\n1: True\n2: False')},matchCase:{type:"boolean"},matchCaseOverride:{type:"number",description:m("actions.find.matchCaseOverride",'Overrides "Math Case" flag.\nThe flag will not be saved for the future.\n0: Do Nothing\n1: True\n2: False')},preserveCase:{type:"boolean"},preserveCaseOverride:{type:"number",description:m("actions.find.preserveCaseOverride",'Overrides "Preserve Case" flag.\nThe flag will not be saved for the future.\n0: Do Nothing\n1: True\n2: False')},findInSelection:{type:"boolean"}}}}]};class I3e extends Ue{constructor(){super({id:Ai.StartFindWithArgs,label:m("startFindWithArgsAction","Find With Arguments"),alias:"Find With Arguments",precondition:void 0,kbOpts:{kbExpr:null,primary:0,weight:100},description:E3e})}run(e,t,i){return Em(this,void 0,void 0,function*(){const s=Oo.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 T3e extends Ue{constructor(){super({id:Ai.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 Em(this,void 0,void 0,function*(){const i=Oo.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 Wne extends Ue{run(e,t){return Em(this,void 0,void 0,function*(){const i=Oo.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 x3e extends Wne{constructor(){super({id:Ai.NextMatchFindAction,label:m("findNextMatchAction","Find Next"),alias:"Find Next",precondition:void 0,kbOpts:[{kbExpr:O.focus,primary:61,mac:{primary:2085,secondary:[61]},weight:100},{kbExpr:fe.and(O.focus,DN),primary:3,weight:100}]})}_run(e){return e.moveToNextMatch()?(e.editor.pushUndoStop(),!0):!1}}class N3e extends Wne{constructor(){super({id:Ai.PreviousMatchFindAction,label:m("findPreviousMatchAction","Find Previous"),alias:"Find Previous",precondition:void 0,kbOpts:[{kbExpr:O.focus,primary:1085,mac:{primary:3109,secondary:[1085]},weight:100},{kbExpr:fe.and(O.focus,DN),primary:1027,weight:100}]})}_run(e){return e.moveToPrevMatch()}}class A3e extends Ue{constructor(){super({id:Ai.GoToMatchFindAction,label:m("findMatchAction.goToMatch","Go to Match..."),alias:"Go to Match...",precondition:dh}),this._highlightDecorations=[]}run(e,t,i){const s=Oo.get(t);if(!s)return;const o=s.getState().matchesCount;if(o<1){e.get(Nn).notify({severity:Nx.Warning,message:m("findMatchAction.noResults","No matches. Try searching for something else.")});return}const a=e.get(yc).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(rJ),position:Qr.Full}}}])})}}class Vne extends Ue{run(e,t){return Em(this,void 0,void 0,function*(){const i=Oo.get(t);if(!i)return;const s=XF(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 M3e extends Vne{constructor(){super({id:Ai.NextSelectionMatchFindAction,label:m("nextSelectionMatchFindAction","Find Next Selection"),alias:"Find Next Selection",precondition:void 0,kbOpts:{kbExpr:O.focus,primary:2109,weight:100}})}_run(e){return e.moveToNextMatch()}}class R3e extends Vne{constructor(){super({id:Ai.PreviousSelectionMatchFindAction,label:m("previousSelectionMatchFindAction","Find Previous Selection"),alias:"Find Previous Selection",precondition:void 0,kbOpts:{kbExpr:O.focus,primary:3133,weight:100}})}_run(e){return e.moveToPrevMatch()}}const P3e=sQ(new nQ({id:Ai.StartFindReplaceAction,label:m("startReplace","Replace"),alias:"Replace",precondition:fe.or(O.focus,fe.has("editorIsOpen")),kbOpts:{kbExpr:null,primary:2086,mac:{primary:2596},weight:100},menuOpts:{menuId:M.MenubarEditMenu,group:"3_find",title:m({key:"miReplace",comment:["&& denotes a mnemonic"]},"&&Replace"),order:2}}));P3e.addImplementation(0,(n,e,t)=>{if(!e.hasModel()||e.getOption(90))return!1;const i=Oo.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})});ti(Oo.ID,QF,0);De(I3e);De(T3e);De(x3e);De(N3e);De(A3e);De(M3e);De(R3e);const Sc=fs.bindToContribution(Oo.get);Re(new Sc({id:Ai.CloseFindWidgetCommand,precondition:dh,handler:n=>n.closeFindWidget(),kbOpts:{weight:100+5,kbExpr:fe.and(O.focus,fe.not("isComposing")),primary:9,secondary:[1033]}}));Re(new Sc({id:Ai.ToggleCaseSensitiveCommand,precondition:void 0,handler:n=>n.toggleCaseSensitive(),kbOpts:{weight:100+5,kbExpr:O.focus,primary:mk.primary,mac:mk.mac,win:mk.win,linux:mk.linux}}));Re(new Sc({id:Ai.ToggleWholeWordCommand,precondition:void 0,handler:n=>n.toggleWholeWords(),kbOpts:{weight:100+5,kbExpr:O.focus,primary:_k.primary,mac:_k.mac,win:_k.win,linux:_k.linux}}));Re(new Sc({id:Ai.ToggleRegexCommand,precondition:void 0,handler:n=>n.toggleRegex(),kbOpts:{weight:100+5,kbExpr:O.focus,primary:vk.primary,mac:vk.mac,win:vk.win,linux:vk.linux}}));Re(new Sc({id:Ai.ToggleSearchScopeCommand,precondition:void 0,handler:n=>n.toggleSearchScope(),kbOpts:{weight:100+5,kbExpr:O.focus,primary:bk.primary,mac:bk.mac,win:bk.win,linux:bk.linux}}));Re(new Sc({id:Ai.TogglePreserveCaseCommand,precondition:void 0,handler:n=>n.togglePreserveCase(),kbOpts:{weight:100+5,kbExpr:O.focus,primary:Ck.primary,mac:Ck.mac,win:Ck.win,linux:Ck.linux}}));Re(new Sc({id:Ai.ReplaceOneAction,precondition:dh,handler:n=>n.replace(),kbOpts:{weight:100+5,kbExpr:O.focus,primary:3094}}));Re(new Sc({id:Ai.ReplaceOneAction,precondition:dh,handler:n=>n.replace(),kbOpts:{weight:100+5,kbExpr:fe.and(O.focus,J7),primary:3}}));Re(new Sc({id:Ai.ReplaceAllAction,precondition:dh,handler:n=>n.replaceAll(),kbOpts:{weight:100+5,kbExpr:O.focus,primary:2563}}));Re(new Sc({id:Ai.ReplaceAllAction,precondition:dh,handler:n=>n.replaceAll(),kbOpts:{weight:100+5,kbExpr:fe.and(O.focus,J7),primary:void 0,mac:{primary:2051}}}));Re(new Sc({id:Ai.SelectAllMatchesAction,precondition:dh,handler:n=>n.selectAllMatches(),kbOpts:{weight:100+5,kbExpr:O.focus,primary:515}}));const O3e={0:" ",1:"u",2:"r"},Uj=65535,Vl=16777215,jj=4278190080;class NR{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<Uj)throw new Error("invalid startIndexes or endIndexes size");this._startIndexes=e,this._endIndexes=t,this._collapseStates=new NR(e.length),this._userDefinedStates=new NR(e.length),this._recoveredStates=new NR(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;iVl||r>Vl)throw new Error("startLineNumber or endLineNumber must not exceed "+Vl);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]&Vl}getEndLineNumber(e){return this._endIndexes[e]&Vl}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]&jj)>>>16);return t===Uj?-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 F3e{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 B3e{get regions(){return this._regions}get textModel(){return this._textModel}constructor(e,t){this._updateEventEmitter=new j,this.onDidChange=this._updateEventEmitter.event,this._textModel=e,this._decorationProvider=t,this._regions=new Or(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=Or.sanitizeAndMerge(this._regions,s,o);this.updatePost(Or.fromFoldRanges(r))}_getLinesChecksum(e,t){return SQ(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 W3e(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 V3e(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 zne(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 i6(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 n6(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 H3e(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 $3e(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 z3e(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||Xf(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 Kj(this._hiddenRanges,e)!==null}adjustSelections(e){let t=!1;const i=this._foldingModel.textModel;let s=null;const o=r=>((!s||!j3e(r,s))&&(s=Kj(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 j3e(n,e){return n>=e.startLineNumber&&n<=e.endLineNumber}function Kj(n,e){const t=Ew(n,i=>e=0&&n[t].endLineNumber>=e?n[t]:null}const K3e=5e3,q3e="indent";class s6{constructor(e,t,i){this.editorModel=e,this.languageConfigurationService=t,this.foldingRangesLimit=i,this.id=q3e}dispose(){}compute(e){const t=this.languageConfigurationService.getLanguageConfiguration(this.editorModel.getLanguageId()).foldingRules,i=t&&!!t.offSide,s=t&&t.markers;return Promise.resolve(Z3e(this.editorModel,i,s,this.foldingRangesLimit))}}let G3e=class{constructor(e){this._startIndexes=[],this._endIndexes=[],this._indentOccurrences=[],this._length=0,this._foldingRangesLimit=e}insertFirst(e,t,i){if(e>Vl||t>Vl)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 Or(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=Dx(u,o);(h{}};function Z3e(n,e,t,i=Y3e){const s=n.getOptions().tabSize,o=new G3e(i);let r;t&&(r=new RegExp("(".concat(t.start.source,")|(?:").concat(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=Dx(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 X3e=F("editor.foldBackground",{light:nt(ef,.3),dark:nt(ef,.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);F("editorGutter.foldingControlForeground",{dark:Jh,light:Jh,hcDark:Jh,hcLight:Jh},m("editorGutter.foldingControlForeground","Color of the folding control in the editor gutter."));const TN=Sn("folding-expanded",Me.chevronDown,m("foldingExpandedIcon","Icon for expanded ranges in the editor glyph margin.")),xN=Sn("folding-collapsed",Me.chevronRight,m("foldingCollapsedIcon","Icon for collapsed ranges in the editor glyph margin.")),Une=Sn("folding-manual-collapsed",xN,m("foldingManualCollapedIcon","Icon for manually collapsed ranges in the editor glyph margin.")),jne=Sn("folding-manual-expanded",TN,m("foldingManualExpandedIcon","Icon for manually expanded ranges in the editor glyph margin.")),o6={color:sn(X3e),position:yr.Inline};class An{constructor(e){this.editor=e,this.showFoldingControls="mouseover",this.showFoldingHighlights=!0}getDecorationOption(e,t,i){return t?An.HIDDEN_RANGE_DECORATION:this.showFoldingControls==="never"?e?this.showFoldingHighlights?An.NO_CONTROLS_COLLAPSED_HIGHLIGHTED_RANGE_DECORATION:An.NO_CONTROLS_COLLAPSED_RANGE_DECORATION:An.NO_CONTROLS_EXPANDED_RANGE_DECORATION:e?i?this.showFoldingHighlights?An.MANUALLY_COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION:An.MANUALLY_COLLAPSED_VISUAL_DECORATION:this.showFoldingHighlights?An.COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION:An.COLLAPSED_VISUAL_DECORATION:this.showFoldingControls==="mouseover"?i?An.MANUALLY_EXPANDED_AUTO_HIDE_VISUAL_DECORATION:An.EXPANDED_AUTO_HIDE_VISUAL_DECORATION:i?An.MANUALLY_EXPANDED_VISUAL_DECORATION:An.EXPANDED_VISUAL_DECORATION}changeDecorations(e){return this.editor.changeDecorations(e)}removeDecorations(e){this.editor.removeDecorations(e)}}An.COLLAPSED_VISUAL_DECORATION=kt.register({description:"folding-collapsed-visual-decoration",stickiness:0,afterContentClassName:"inline-folded",isWholeLine:!0,firstLineDecorationClassName:dt.asClassName(xN)});An.COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION=kt.register({description:"folding-collapsed-highlighted-visual-decoration",stickiness:0,afterContentClassName:"inline-folded",className:"folded-background",minimap:o6,isWholeLine:!0,firstLineDecorationClassName:dt.asClassName(xN)});An.MANUALLY_COLLAPSED_VISUAL_DECORATION=kt.register({description:"folding-manually-collapsed-visual-decoration",stickiness:0,afterContentClassName:"inline-folded",isWholeLine:!0,firstLineDecorationClassName:dt.asClassName(Une)});An.MANUALLY_COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION=kt.register({description:"folding-manually-collapsed-highlighted-visual-decoration",stickiness:0,afterContentClassName:"inline-folded",className:"folded-background",minimap:o6,isWholeLine:!0,firstLineDecorationClassName:dt.asClassName(Une)});An.NO_CONTROLS_COLLAPSED_RANGE_DECORATION=kt.register({description:"folding-no-controls-range-decoration",stickiness:0,afterContentClassName:"inline-folded",isWholeLine:!0});An.NO_CONTROLS_COLLAPSED_HIGHLIGHTED_RANGE_DECORATION=kt.register({description:"folding-no-controls-range-decoration",stickiness:0,afterContentClassName:"inline-folded",className:"folded-background",minimap:o6,isWholeLine:!0});An.EXPANDED_VISUAL_DECORATION=kt.register({description:"folding-expanded-visual-decoration",stickiness:1,isWholeLine:!0,firstLineDecorationClassName:"alwaysShowFoldIcons "+dt.asClassName(TN)});An.EXPANDED_AUTO_HIDE_VISUAL_DECORATION=kt.register({description:"folding-expanded-auto-hide-visual-decoration",stickiness:1,isWholeLine:!0,firstLineDecorationClassName:dt.asClassName(TN)});An.MANUALLY_EXPANDED_VISUAL_DECORATION=kt.register({description:"folding-manually-expanded-visual-decoration",stickiness:0,isWholeLine:!0,firstLineDecorationClassName:"alwaysShowFoldIcons "+dt.asClassName(jne)});An.MANUALLY_EXPANDED_AUTO_HIDE_VISUAL_DECORATION=kt.register({description:"folding-manually-expanded-auto-hide-visual-decoration",stickiness:0,isWholeLine:!0,firstLineDecorationClassName:dt.asClassName(jne)});An.NO_CONTROLS_EXPANDED_RANGE_DECORATION=kt.register({description:"folding-no-controls-range-decoration",stickiness:0,isWholeLine:!0});An.HIDDEN_RANGE_DECORATION=kt.register({description:"folding-hidden-range-decoration",stickiness:1});const Q3e={},J3e="syntax";class r6{constructor(e,t,i,s,o){this.editorModel=e,this.providers=t,this.handleFoldingRangesChange=i,this.foldingRangesLimit=s,this.fallbackRangeProvider=o,this.id=J3e,this.disposables=new be,o&&this.disposables.add(o);for(const r of t)typeof r.onDidChange=="function"&&this.disposables.add(r.onDidChange(i))}compute(e){return eBe(this.providers,this.editorModel,e).then(t=>{var i,s;return t?iBe(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 eBe(n,e,t){let i=null;const s=n.map((o,r)=>Promise.resolve(o.provideFoldingRanges(e,Q3e,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})}},Bn));return Promise.all(s).then(o=>i)}class tBe{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>Vl||t>Vl)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 tBe(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 nBe=globalThis&&globalThis.__decorate||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},D1=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},sBe=globalThis&&globalThis.__awaiter||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())})},Y_;const ro=new Ve("foldingEnabled",!1);let Md=Y_=class extends te{static get(e){return e.getContribution(Y_.ID)}static getFoldingRangeProviders(e,t){var i,s;const o=e.foldingRangeProvider.ordered(t);return(s=(i=Y_._foldingRangeSelector)===null||i===void 0?void 0:i.call(Y_,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 be),this.editor=e,this._foldingLimitReporter=new Kne(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 An(e),this.foldingDecorationProvider.showFoldingControls=a.get(109),this.foldingDecorationProvider.showFoldingHighlights=a.get(45),this.foldingEnabled=ro.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 B3e(e,this.foldingDecorationProvider),this.localToDispose.add(this.foldingModel),this.hiddenRangeModel=new U3e(this.foldingModel),this.localToDispose.add(this.hiddenRangeModel),this.localToDispose.add(this.hiddenRangeModel.onDidChange(t=>this.onHiddenRangesChanges(t))),this.updateScheduler=new pl(this.updateDebounceInfo.get(e)),this.cursorChangedScheduler=new Si(()=>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 s6(e,this.languageConfigurationService,this._foldingLimitReporter);if(this.rangeProvider=t,this._useFoldingProviders&&this.foldingModel){const i=Y_.getFoldingRangeProviders(this.languageFeaturesService,e);i.length>0&&(this.rangeProvider=new r6(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 so,i=this.getRangeProvider(e.textModel),s=this.foldingRegionPromise=Xn(o=>i.compute(o));return s.then(o=>{if(o&&s===this.foldingRegionPromise){let r;if(this._foldingImportsByDefault&&!this._currentModelHasFoldedImports){const d=o.setCollapsedAllOfType(xo.Imports.value,!0);d&&(r=mc.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=>(Dt(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,Dt)}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)}};Md.ID="editor.contrib.folding";Md=Y_=nBe([D1(1,bt),D1(2,Ni),D1(3,Nn),D1(4,Va),D1(5,Ze)],Md);class Kne{constructor(e){this.editor=e,this._onDidChange=new j,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 wo extends Ue{runEditorCommand(e,t,i){const s=e.get(Ni),o=Md.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 qne(n){if(!_r(n)){if(!Io(n))return!1;const e=n;if(!_r(e.levels)&&!Hf(e.levels)||!_r(e.direction)&&!Mo(e.direction)||!_r(e.selectionLines)&&(!Array.isArray(e.selectionLines)||!e.selectionLines.every(Hf)))return!1}return!0}class oBe extends wo{constructor(){super({id:"editor.unfold",label:m("unfoldAction.label","Unfold"),alias:"Unfold",precondition:ro,kbOpts:{kbExpr:O.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:\n * 'levels': Number of levels to unfold. If not set, defaults to 1.\n * 'direction': If 'up', unfold given number of levels up otherwise unfolds down.\n * '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.\n ",constraint:qne,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"?$ne(t,!1,o,r):F0(t,!1,o,r)}}class rBe extends wo{constructor(){super({id:"editor.unfoldRecursively",label:m("unFoldRecursivelyAction.label","Unfold Recursively"),alias:"Unfold Recursively",precondition:ro,kbOpts:{kbExpr:O.editorTextFocus,primary:qn(2089,2142),weight:100}})}invoke(e,t,i,s){F0(t,!1,Number.MAX_VALUE,this.getSelectedLines(i))}}class aBe extends wo{constructor(){super({id:"editor.fold",label:m("foldAction.label","Fold"),alias:"Fold",precondition:ro,kbOpts:{kbExpr:O.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:\n * 'levels': Number of levels to fold.\n * 'direction': If 'up', folds given number of levels up otherwise folds down.\n * '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.\n If no levels or direction is set, folds the region at the locations or if already collapsed, the first uncollapsed parent instead.\n ",constraint:qne,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"?W3e(t,!0,o):a==="up"?$ne(t,!0,r||1,o):F0(t,!0,r||1,o)}}class lBe extends wo{constructor(){super({id:"editor.toggleFold",label:m("toggleFoldAction.label","Toggle Fold"),alias:"Toggle Fold",precondition:ro,kbOpts:{kbExpr:O.editorTextFocus,primary:qn(2089,2090),weight:100}})}invoke(e,t,i){const s=this.getSelectedLines(i);Hne(t,1,s)}}class cBe extends wo{constructor(){super({id:"editor.foldRecursively",label:m("foldRecursivelyAction.label","Fold Recursively"),alias:"Fold Recursively",precondition:ro,kbOpts:{kbExpr:O.editorTextFocus,primary:qn(2089,2140),weight:100}})}invoke(e,t,i){const s=this.getSelectedLines(i);F0(t,!0,Number.MAX_VALUE,s)}}class dBe extends wo{constructor(){super({id:"editor.foldAllBlockComments",label:m("foldAllBlockComments.label","Fold All Block Comments"),alias:"Fold All Block Comments",precondition:ro,kbOpts:{kbExpr:O.editorTextFocus,primary:qn(2089,2138),weight:100}})}invoke(e,t,i,s,o){if(t.regions.hasTypes())n6(t,xo.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*"+Xr(a.blockCommentStartToken));i6(t,l,!0)}}}}class uBe extends wo{constructor(){super({id:"editor.foldAllMarkerRegions",label:m("foldAllMarkerRegions.label","Fold All Regions"),alias:"Fold All Regions",precondition:ro,kbOpts:{kbExpr:O.editorTextFocus,primary:qn(2089,2077),weight:100}})}invoke(e,t,i,s,o){if(t.regions.hasTypes())n6(t,xo.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);i6(t,l,!0)}}}}class hBe extends wo{constructor(){super({id:"editor.unfoldAllMarkerRegions",label:m("unfoldAllMarkerRegions.label","Unfold All Regions"),alias:"Unfold All Regions",precondition:ro,kbOpts:{kbExpr:O.editorTextFocus,primary:qn(2089,2078),weight:100}})}invoke(e,t,i,s,o){if(t.regions.hasTypes())n6(t,xo.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);i6(t,l,!1)}}}}class fBe extends wo{constructor(){super({id:"editor.foldAllExcept",label:m("foldAllExcept.label","Fold All Except Selected"),alias:"Fold All Except Selected",precondition:ro,kbOpts:{kbExpr:O.editorTextFocus,primary:qn(2089,2136),weight:100}})}invoke(e,t,i){const s=this.getSelectedLines(i);zne(t,!0,s)}}class gBe extends wo{constructor(){super({id:"editor.unfoldAllExcept",label:m("unfoldAllExcept.label","Unfold All Except Selected"),alias:"Unfold All Except Selected",precondition:ro,kbOpts:{kbExpr:O.editorTextFocus,primary:qn(2089,2134),weight:100}})}invoke(e,t,i){const s=this.getSelectedLines(i);zne(t,!1,s)}}class pBe extends wo{constructor(){super({id:"editor.foldAll",label:m("foldAllAction.label","Fold All"),alias:"Fold All",precondition:ro,kbOpts:{kbExpr:O.editorTextFocus,primary:qn(2089,2069),weight:100}})}invoke(e,t,i){F0(t,!0)}}class mBe extends wo{constructor(){super({id:"editor.unfoldAll",label:m("unfoldAllAction.label","Unfold All"),alias:"Unfold All",precondition:ro,kbOpts:{kbExpr:O.editorTextFocus,primary:qn(2089,2088),weight:100}})}invoke(e,t,i){F0(t,!1)}}class Im extends wo{getFoldingLevel(){return parseInt(this.id.substr(Im.ID_PREFIX.length))}invoke(e,t,i){V3e(t,this.getFoldingLevel(),!0,this.getSelectedLines(i))}}Im.ID_PREFIX="editor.foldLevel";Im.ID=n=>Im.ID_PREFIX+n;class _Be extends wo{constructor(){super({id:"editor.gotoParentFold",label:m("gotoParentFold.label","Go to Parent Fold"),alias:"Go to Parent Fold",precondition:ro,kbOpts:{kbExpr:O.editorTextFocus,weight:100}})}invoke(e,t,i){const s=this.getSelectedLines(i);if(s.length>0){const o=H3e(s[0],t);o!==null&&i.setSelection({startLineNumber:o,startColumn:1,endLineNumber:o,endColumn:1})}}}class vBe extends wo{constructor(){super({id:"editor.gotoPreviousFold",label:m("gotoPreviousFold.label","Go to Previous Folding Range"),alias:"Go to Previous Folding Range",precondition:ro,kbOpts:{kbExpr:O.editorTextFocus,weight:100}})}invoke(e,t,i){const s=this.getSelectedLines(i);if(s.length>0){const o=$3e(s[0],t);o!==null&&i.setSelection({startLineNumber:o,startColumn:1,endLineNumber:o,endColumn:1})}}}class bBe extends wo{constructor(){super({id:"editor.gotoNextFold",label:m("gotoNextFold.label","Go to Next Folding Range"),alias:"Go to Next Folding Range",precondition:ro,kbOpts:{kbExpr:O.editorTextFocus,weight:100}})}invoke(e,t,i){const s=this.getSelectedLines(i);if(s.length>0){const o=z3e(s[0],t);o!==null&&i.setSelection({startLineNumber:o,startColumn:1,endLineNumber:o,endColumn:1})}}}class CBe extends wo{constructor(){super({id:"editor.createFoldingRangeFromSelection",label:m("createManualFoldRange.label","Create Folding Range from Selection"),alias:"Create Folding Range from Selection",precondition:ro,kbOpts:{kbExpr:O.editorTextFocus,primary:qn(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=Or.sanitizeAndMerge(t.regions,o,(s=i.getModel())===null||s===void 0?void 0:s.getLineCount());t.updatePost(Or.fromFoldRanges(a))}}}}class wBe extends wo{constructor(){super({id:"editor.removeManualFoldingRanges",label:m("removeManualFoldingRanges.label","Remove Manual Folding Ranges"),alias:"Remove Manual Folding Ranges",precondition:ro,kbOpts:{kbExpr:O.editorTextFocus,primary:qn(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()}}}ti(Md.ID,Md,0);De(oBe);De(rBe);De(aBe);De(cBe);De(pBe);De(mBe);De(dBe);De(uBe);De(hBe);De(fBe);De(gBe);De(lBe);De(_Be);De(vBe);De(bBe);De(CBe);De(wBe);for(let n=1;n<=7;n++)u0e(new Im({id:Im.ID(n),label:m("foldLevelAction.label","Fold Level {0}",n),alias:"Fold Level ".concat(n),precondition:ro,kbOpts:{kbExpr:O.editorTextFocus,primary:qn(2089,2048|21+n),weight:100}}));qt.registerCommand("_executeFoldingRangeProvider",function(n,...e){return sBe(this,void 0,void 0,function*(){const[t]=e;if(!(t instanceof ct))throw La();const i=n.get(Ze),s=n.get(Zi).getModel(t);if(!s)throw La();const o=n.get(zt);if(!o.getValue("editor.folding",{resource:t}))return[];const r=n.get(Ni),a=o.getValue("editor.foldingStrategy",{resource:t}),l={get limit(){return o.getValue("editor.foldingMaximumRegions",{resource:t})},update:(f,g)=>{}},c=new s6(s,r,l);let d=c;if(a!=="indentation"){const f=Md.getFoldingRangeProviders(i,s);f.length&&(d=new r6(s,f,()=>{},l,c))}const u=yield d.compute(Ft.None),h=[];try{if(u)for(let f=0;f=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},ZI=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},a6=globalThis&&globalThis.__awaiter||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 Sy=class{constructor(e,t,i){this._editor=e,this._languageFeaturesService=t,this._workerService=i,this._disposables=new be,this._sessionDisposables=new be,this._disposables.add(t.onTypeFormattingEditProvider.onDidChange(this._update,this)),this._disposables.add(e.onDidChangeModel(()=>this._update())),this._disposables.add(e.onDidChangeModelLanguage(()=>this._update())),this._disposables.add(e.onDidChangeConfiguration(s=>{s.hasChanged(56)&&this._update()})),this._update()}dispose(){this._disposables.dispose(),this._sessionDisposables.dispose()}_update(){if(this._sessionDisposables.clear(),!this._editor.getOption(56)||!this._editor.hasModel())return;const e=this._editor.getModel(),[t]=this._languageFeaturesService.onTypeFormattingEditProvider.ordered(e);if(!t||!t.autoFormatTriggerCharacters)return;const i=new kE;for(const s of t.autoFormatTriggerCharacters)i.add(s.charCodeAt(0));this._sessionDisposables.add(this._editor.onDidType(s=>{const o=s.charCodeAt(s.length-1);i.has(o)&&this._trigger(String.fromCharCode(o))}))}_trigger(e){if(!this._editor.hasModel()||this._editor.getSelections().length>1||!this._editor.getSelection().isEmpty())return;const t=this._editor.getModel(),i=this._editor.getPosition(),s=new Tn,o=this._editor.onDidChangeModelContent(r=>{if(r.isFlush){s.cancel(),o.dispose();return}for(let a=0,l=r.changes.length;a{s.token.isCancellationRequested||io(r)&&(jb.execute(this._editor,r,!0),T7(r))}).finally(()=>{o.dispose()})}};Sy.ID="editor.contrib.autoFormat";Sy=Gne([ZI(1,Ze),ZI(2,Sl)],Sy);let Ly=class{constructor(e,t,i){this.editor=e,this._languageFeaturesService=t,this._instantiationService=i,this._callOnDispose=new be,this._callOnModel=new be,this._callOnDispose.add(e.onDidChangeConfiguration(()=>this._update())),this._callOnDispose.add(e.onDidChangeModel(()=>this._update())),this._callOnDispose.add(e.onDidChangeModelLanguage(()=>this._update())),this._callOnDispose.add(t.documentRangeFormattingEditProvider.onDidChange(this._update,this))}dispose(){this._callOnDispose.dispose(),this._callOnModel.dispose()}_update(){this._callOnModel.clear(),this.editor.getOption(55)&&this.editor.hasModel()&&this._languageFeaturesService.documentRangeFormattingEditProvider.has(this.editor.getModel())&&this._callOnModel.add(this.editor.onDidPaste(({range:e})=>this._trigger(e)))}_trigger(e){this.editor.hasModel()&&(this.editor.getSelections().length>1||this._instantiationService.invokeFunction(zte,this.editor,e,2,Fu.None,Ft.None).catch(Dt))}};Ly.ID="editor.contrib.formatOnPaste";Ly=Gne([ZI(1,Ze),ZI(2,_t)],Ly);class kBe extends Ue{constructor(){super({id:"editor.action.formatDocument",label:m("formatDocument.label","Format Document"),alias:"Format Document",precondition:fe.and(O.notInCompositeEditor,O.writable,O.hasDocumentFormattingProvider),kbOpts:{kbExpr:O.editorTextFocus,primary:1572,linux:{primary:3111},weight:100},contextMenuOpts:{group:"1_modification",order:1.3}})}run(e,t){return a6(this,void 0,void 0,function*(){if(t.hasModel()){const i=e.get(_t);yield e.get(Tg).showWhile(i.invokeFunction(SPe,t,1,Fu.None,Ft.None),250)}})}}class DBe extends Ue{constructor(){super({id:"editor.action.formatSelection",label:m("formatSelection.label","Format Selection"),alias:"Format Selection",precondition:fe.and(O.writable,O.hasDocumentSelectionFormattingProvider),kbOpts:{kbExpr:O.editorTextFocus,primary:qn(2089,2084),weight:100},contextMenuOpts:{when:O.hasNonEmptySelection,group:"1_modification",order:1.31}})}run(e,t){return a6(this,void 0,void 0,function*(){if(!t.hasModel())return;const i=e.get(_t),s=t.getModel(),o=t.getSelections().map(a=>a.isEmpty()?new I(a.startLineNumber,1,a.startLineNumber,s.getLineMaxColumn(a.startLineNumber)):a);yield e.get(Tg).showWhile(i.invokeFunction(zte,t,o,1,Fu.None,Ft.None),250)})}}ti(Sy.ID,Sy,2);ti(Ly.ID,Ly,2);De(kBe);De(DBe);qt.registerCommand("editor.action.format",n=>a6(void 0,void 0,void 0,function*(){const e=n.get(ai).getFocusedCodeEditor();if(!e||!e.hasModel())return;const t=n.get(gn);e.getSelection().isEmpty()?yield t.executeCommand("editor.action.formatDocument"):yield t.executeCommand("editor.action.formatSelection")}));var EBe=globalThis&&globalThis.__decorate||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},AR=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},IBe=globalThis&&globalThis.__awaiter||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 Sv{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="".concat(t.id,"/").concat(e):(i="".concat(t.id,"/").concat(e.name),t.children.get(i)!==void 0&&(i="".concat(t.id,"/").concat(e.name,"_").concat(e.range.startLineNumber,"_").concat(e.range.startColumn)));let s=i;for(let o=0;t.children.get(s)!==void 0;o++)s="".concat(i,"_").concat(o);return s}static empty(e){return e.children.size===0}}class JF extends Sv{constructor(e,t,i){super(),this.id=e,this.parent=t,this.symbol=i,this.children=new Map}}class Yne extends Sv{constructor(e,t,i,s){super(),this.id=e,this.parent=t,this.label=i,this.order=s,this.children=new Map}}class gu extends Sv{static create(e,t,i){const s=new Tn(i),o=new gu(t.uri),r=e.ordered(t),a=r.map((c,d)=>{var u;const h=Sv.findId("provider_".concat(d),o),f=new Yne(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||[])gu._makeOutlineElement(p,f);return f},g=>(Bn(g),f)).then(g=>{Sv.empty(g)?g.remove():o._groups.set(h,g)})}),l=e.onDidChange(()=>{const c=e.ordered(t);yn(c,r)||s.cancel()});return Promise.all(a).then(()=>s.token.isCancellationRequested&&!i.isCancellationRequested?gu.create(e,t,i):o._compact()).finally(()=>{s.dispose(),l.dispose(),s.dispose()})}static _makeOutlineElement(e,t){const i=Sv.findId(e,t),s=new JF(i,t,e);if(e.children)for(const o of e.children)gu._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=Pt.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 JF?e.push(t.symbol):e.push(...Pt.map(t.children.values(),i=>i.symbol));return e.sort((t,i)=>I.compareRangesUsingStarts(t.range,i.range))}asListOfDocumentSymbols(){const e=this.getTopLevelSymbols(),t=[];return gu._flattenDocumentSymbols(t,e,""),t.sort((i,s)=>Y.compare(I.getStartPosition(i.range),I.getStartPosition(s.range))||Y.compare(I.getEndPosition(s.range),I.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&&gu._flattenDocumentSymbols(e,s.children,s.name)}}const NN=Wt("IOutlineModelService");let e5=class{constructor(e,t,i){this._languageFeaturesService=e,this._disposables=new be,this._cache=new Dg(10,.7),this._debounceInformation=t.for(e.documentSymbolProvider,"DocumentSymbols",{min:350}),this._disposables.add(i.onModelRemoved(s=>{this._cache.delete(s.id)}))}dispose(){this._disposables.dispose()}getOrCreate(e,t){return IBe(this,void 0,void 0,function*(){const i=this._languageFeaturesService.documentSymbolProvider,s=i.ordered(e);let o=this._cache.get(e.id);if(!o||o.versionId!==e.getVersionId()||!yn(o.provider,s)){const a=new Tn;o={versionId:e.getVersionId(),provider:s,promiseCnt:0,source:a,promise:gu.create(i,e,a.token),model:void 0},this._cache.set(e.id,o);const l=Date.now();o.promise.then(c=>{o.model=c,this._debounceInformation.update(e,Date.now()-l)}).catch(c=>{this._cache.delete(e.id)})}if(o.model)return o.model;o.promiseCnt+=1;const r=t.onCancellationRequested(()=>{--o.promiseCnt===0&&(o.source.cancel(),this._cache.delete(e.id))});try{return yield o.promise}finally{r.dispose()}})}};e5=EBe([AR(0,Ze),AR(1,Va),AR(2,Zi)],e5);Gt(NN,e5,1);var TBe=globalThis&&globalThis.__awaiter||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())})};qt.registerCommand("_executeDocumentSymbolProvider",function(n,...e){return TBe(this,void 0,void 0,function*(){const[t]=e;bi(ct.isUri(t));const i=n.get(NN),o=yield n.get(sr).createModelReference(t);try{return(yield i.getOrCreate(o.object.textEditorModel,Ft.None)).getTopLevelSymbols()}finally{o.dispose()}})});class us extends te{constructor(e,t){super(),this.contextKeyService=e,this.model=t,this.inlineCompletionVisible=us.inlineSuggestionVisible.bindTo(this.contextKeyService),this.inlineCompletionSuggestsIndentation=us.inlineSuggestionHasIndentation.bindTo(this.contextKeyService),this.inlineCompletionSuggestsIndentationLessThanTabSize=us.inlineSuggestionHasIndentationLessThanTabSize.bindTo(this.contextKeyService),this.suppressSuggestions=us.suppressSuggestions.bindTo(this.contextKeyService),this._register(xi(i=>{const s=this.model.read(i),o=s==null?void 0:s.state.read(i),r=!!(o!=null&&o.inlineCompletion)&&(o==null?void 0:o.ghostText)!==void 0&&!(o!=null&&o.ghostText.isEmpty());this.inlineCompletionVisible.set(r),o!=null&&o.ghostText&&(o!=null&&o.inlineCompletion)&&this.suppressSuggestions.set(o.inlineCompletion.inlineCompletion.source.inlineCompletions.suppressSuggestions)})),this._register(xi(i=>{const s=this.model.read(i);let o=!1,r=!0;const a=s==null?void 0:s.ghostText.read(i);if(s!=null&&s.selectedSuggestItem&&a&&a.parts.length>0){const{column:l,lines:c}=a.parts[0],d=c[0],u=s.textModel.getLineIndentColumn(a.lineNumber);if(l<=u){let f=bo(d);f===-1&&(f=d.length-1),o=f>0;const g=s.textModel.getOptions().tabSize;r=Zn.visibleColumnFromColumn(d,f+1,g){const o=I.lift(s.range);return{startOffset:t.getOffset(o.getStartPosition()),endOffset:t.getOffset(o.getEndPosition()),text:s.text}});i.sort((s,o)=>o.startOffset-s.startOffset);for(const s of i)n=n.substring(0,s.startOffset)+s.text+n.substring(s.endOffset);return n}class NBe{constructor(e){this.lineStartOffsetByLineIdx=[],this.lineStartOffsetByLineIdx.push(0);for(let t=0;tt)throw new Rn("startColumn ".concat(e," cannot be after endColumnExclusive ").concat(t))}toRange(e){return new I(e,this.startColumn,e,this.endColumnExclusive)}equals(e){return this.startColumn===e.startColumn&&this.endColumnExclusive===e.endColumnExclusive}}function PBe(n,e){const t=new be,i=n.createDecorationsCollection();return t.add(b7({debugName:()=>"Apply decorations from ".concat(e.debugName)},s=>{const o=e.read(s);i.set(o)})),t.add({dispose:()=>{i.clear()}}),t}function t5(n,e){return new Y(n.lineNumber+e.lineNumber-1,e.lineNumber===1?n.column+e.column-1:e.column)}function i5(n){let e=1,t=1;for(const i of n)i==="\n"?(e++,t=1):t++;return new Y(e,t)}class XI{constructor(e,t){this.lineNumber=e,this.parts=t}equals(e){return this.lineNumber===e.lineNumber&&this.parts.length===e.parts.length&&this.parts.every((t,i)=>t.equals(e.parts[i]))}renderForScreenReader(e){if(this.parts.length===0)return"";const t=this.parts[this.parts.length-1],i=e.substr(0,t.column-1);return xBe(i,this.parts.map(o=>({range:{startLineNumber:1,endLineNumber:1,startColumn:o.column,endColumn:o.column},text:o.lines.join("\n")}))).substring(this.parts[0].column-1)}isEmpty(){return this.parts.every(e=>e.lines.length===0)}get lineCount(){return 1+this.parts.reduce((e,t)=>e+t.lines.length-1,0)}}class n5{constructor(e,t,i){this.column=e,this.lines=t,this.preview=i}equals(e){return this.column===e.column&&this.lines.length===e.lines.length&&this.lines.every((t,i)=>t===e.lines[i])}}class s5{constructor(e,t,i,s=0){this.lineNumber=e,this.columnRange=t,this.newLines=i,this.additionalReservedLineCount=s,this.parts=[new n5(this.columnRange.endColumnExclusive,this.newLines,!1)]}renderForScreenReader(e){return this.newLines.join("\n")}get lineCount(){return this.newLines.length}isEmpty(){return this.parts.every(e=>e.lines.length===0)}equals(e){return this.lineNumber===e.lineNumber&&this.columnRange.equals(e.columnRange)&&this.newLines.length===e.newLines.length&&this.newLines.every((t,i)=>t===e.newLines[i])&&this.additionalReservedLineCount===e.additionalReservedLineCount}}function qj(n,e){return n===e?!0:!n||!e?!1:n instanceof XI&&e instanceof XI||n instanceof s5&&e instanceof s5?n.equals(e):!1}var OBe=globalThis&&globalThis.__decorate||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},FBe=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};const Gj="ghost-text";let o5=class extends te{constructor(e,t,i){super(),this.editor=e,this.model=t,this.languageService=i,this.isDisposed=Pi(this,!1),this.currentTextModel=ks(this.editor.onDidChangeModel,()=>this.editor.getModel()),this.uiState=Ut(this,s=>{if(this.isDisposed.read(s))return;const o=this.currentTextModel.read(s);if(o!==this.model.targetTextModel.read(s))return;const r=this.model.ghostText.read(s);if(!r)return;const a=r instanceof s5?r.columnRange:void 0,l=[],c=[];function d(p,_){if(c.length>0){const v=c[c.length-1];_&&v.decorations.push(new br(v.content.length+1,v.content.length+1+p[0].length,_,0)),v.content+=p[0],p=p.slice(1)}for(const v of p)c.push({content:v,decorations:_?[new br(1,v.length+1,_,0)]:[]})}const u=o.getLineContent(r.lineNumber);let h,f=0;for(const p of r.parts){let _=p.lines;h===void 0?(l.push({column:p.column,text:_[0],preview:p.preview}),_=_.slice(1)):d([u.substring(f,p.column-1)],void 0),_.length>0&&(d(_,Gj),h===void 0&&p.column<=u.length&&(h=p.column)),f=p.column-1}h!==void 0&&d([u.substring(f)],void 0);const g=h!==void 0?new RBe(h,u.length+1):void 0;return{replacedRange:a,inlineTexts:l,additionalLines:c,hiddenRange:g,lineNumber:r.lineNumber,additionalReservedLineCount:this.model.minReservedLineCount.read(s),targetTextModel:o}}),this.decorations=Ut(this,s=>{const o=this.uiState.read(s);if(!o)return[];const r=[];o.replacedRange&&r.push({range:o.replacedRange.toRange(o.lineNumber),options:{inlineClassName:"inline-completion-text-to-replace",description:"GhostTextReplacement"}}),o.hiddenRange&&r.push({range:o.hiddenRange.toRange(o.lineNumber),options:{inlineClassName:"ghost-text-hidden",description:"ghost-text-hidden"}});for(const a of o.inlineTexts)r.push({range:I.fromPositions(new Y(o.lineNumber,a.column)),options:{description:Gj,after:{content:a.text,inlineClassName:a.preview?"ghost-text-decoration-preview":"ghost-text-decoration",cursorStops:Jl.Left},showIfCollapsed:!0}});return r}),this.additionalLinesWidget=this._register(new BBe(this.editor,this.languageService.languageIdCodec,Ut(s=>{const o=this.uiState.read(s);return o?{lineNumber:o.lineNumber,additionalLines:o.additionalLines,minReservedLineCount:o.additionalReservedLineCount,targetTextModel:o.targetTextModel}:void 0}))),this._register(vt(()=>{this.isDisposed.set(!0,void 0)})),this._register(PBe(this.editor,this.decorations))}ownsViewZone(e){return this.additionalLinesWidget.viewZoneId===e}};o5=OBe([FBe(2,qi)],o5);class BBe extends te{get viewZoneId(){return this._viewZoneId}constructor(e,t,i){super(),this.editor=e,this.languageIdCodec=t,this.lines=i,this._viewZoneId=void 0,this.editorOptionsChanged=Vr("editorOptionChanged",We.filter(this.editor.onDidChangeConfiguration,s=>s.hasChanged(33)||s.hasChanged(116)||s.hasChanged(98)||s.hasChanged(93)||s.hasChanged(51)||s.hasChanged(50)||s.hasChanged(66))),this._register(xi(s=>{const o=this.lines.read(s);this.editorOptionsChanged.read(s),o?this.updateLines(o.lineNumber,o.additionalLines,o.minReservedLineCount):this.clear()}))}dispose(){super.dispose(),this.clear()}clear(){this.editor.changeViewZones(e=>{this._viewZoneId&&(e.removeZone(this._viewZoneId),this._viewZoneId=void 0)})}updateLines(e,t,i){const s=this.editor.getModel();if(!s)return;const{tabSize:o}=s.getOptions();this.editor.changeViewZones(r=>{this._viewZoneId&&(r.removeZone(this._viewZoneId),this._viewZoneId=void 0);const a=Math.max(t.length,i);if(a>0){const l=document.createElement("div");WBe(l,o,t,this.editor.getOptions(),this.languageIdCodec),this._viewZoneId=r.addZone({afterLineNumber:e,heightInLines:a,domNode:l,afterColumnAffinity:1})}})}}function WBe(n,e,t,i,s){const o=i.get(33),r=i.get(116),a="none",l=i.get(93),c=i.get(51),d=i.get(50),u=i.get(66),h=new D0(1e4);h.appendString('
    ');for(let p=0,_=t.length;p<_;p++){const v=t[p],b=v.content;h.appendString('
    ');const C=cS(b),w=Cb(b),y=ts.createEmpty(b,s);gS(new Eg(d.isMonospace&&!o,d.canUseHalfwidthRightwardsArrow,b,!1,C,w,0,y,v.decorations,e,0,d.spaceWidth,d.middotWidth,d.wsmiddotWidth,r,a,l,c!==Br.OFF,null),h),h.appendString("
    ")}h.appendString("
    "),Vs(n,d);const f=h.build(),g=Yj?Yj.createHTML(f):f;n.innerHTML=g}const Yj=sh("editorGhostText",{createHTML:n=>n});function VBe(n,e){const t=new DJ,i=new IJ(t,c=>e.getLanguageConfiguration(c)),s=new EJ(new HBe([n]),i),o=CO(s,[],void 0,!0);let r="";const a=n.getLineContent();function l(c,d){if(c.kind===2)if(l(c.openingBracket,d),d=on(d,c.openingBracket.length),c.child&&(l(c.child,d),d=on(d,c.child.length)),c.closingBracket)l(c.closingBracket,d),d=on(d,c.closingBracket.length);else{const h=i.getSingleLanguageBracketTokens(c.openingBracket.languageId).findClosingTokenText(c.openingBracket.bracketIds);r+=h}else if(c.kind!==3){if(c.kind===0||c.kind===1)r+=a.substring(d,on(d,c.length));else if(c.kind===4)for(const u of c.children)l(u,d),d=on(d,u.length)}}return l(o,No),r}class HBe{constructor(e){this.lines=e,this.tokenization={getLineTokens:t=>this.lines[t-1]}}getLineCount(){return this.lines.length}getLineLength(e){return this.lines[e-1].getLineContent().length}}class Ya{constructor(){this.value="",this.pos=0}static isDigitCharacter(e){return e>=48&&e<=57}static isVariableCharacter(e){return e===95||e>=97&&e<=122||e>=65&&e<=90}text(e){this.value=e,this.pos=0}tokenText(e){return this.value.substr(e.pos,e.len)}next(){if(this.pos>=this.value.length)return{type:14,pos:this.pos,len:0};const e=this.pos;let t=0,i=this.value.charCodeAt(e),s;if(s=Ya._table[i],typeof s=="number")return this.pos+=1,{type:s,pos:e,len:1};if(Ya.isDigitCharacter(i)){s=8;do t+=1,i=this.value.charCodeAt(e+t);while(Ya.isDigitCharacter(i));return this.pos+=t,{type:s,pos:e,len:t}}if(Ya.isVariableCharacter(i)){s=9;do i=this.value.charCodeAt(e+ ++t);while(Ya.isVariableCharacter(i)||Ya.isDigitCharacter(i));return this.pos+=t,{type:s,pos:e,len:t}}s=10;do t+=1,i=this.value.charCodeAt(e+t);while(!isNaN(i)&&typeof Ya._table[i]>"u"&&!Ya.isDigitCharacter(i)&&!Ya.isVariableCharacter(i));return this.pos+=t,{type:s,pos:e,len:t}}}Ya._table={36:0,58:1,44:2,123:3,125:4,92:5,47:6,124:7,43:11,45:12,63:13};class B0{constructor(){this._children=[]}appendChild(e){return e instanceof Do&&this._children[this._children.length-1]instanceof Do?this._children[this._children.length-1].value+=e.value:(e.parent=this,this._children.push(e)),this}replace(e,t){const{parent:i}=e,s=i.children.indexOf(e),o=i.children.slice(0);o.splice(s,1,...t),i._children=o,function r(a,l){for(const c of a)c.parent=l,r(c.children,c)}(t,i)}get children(){return this._children}get rightMostDescendant(){return this._children.length>0?this._children[this._children.length-1].rightMostDescendant:this}get snippet(){let e=this;for(;;){if(!e)return;if(e instanceof jS)return e;e=e.parent}}toString(){return this.children.reduce((e,t)=>e+t.toString(),"")}len(){return 0}}class Do extends B0{constructor(e){super(),this.value=e}toString(){return this.value}len(){return this.value.length}clone(){return new Do(this.value)}}class Zne extends B0{}class pa extends Zne{static compareByIndex(e,t){return e.index===t.index?0:e.isFinalTabstop?1:t.isFinalTabstop||e.indext.index?1:0}constructor(e){super(),this.index=e}get isFinalTabstop(){return this.index===0}get choice(){return this._children.length===1&&this._children[0]instanceof W0?this._children[0]:void 0}clone(){const e=new pa(this.index);return this.transform&&(e.transform=this.transform.clone()),e._children=this.children.map(t=>t.clone()),e}}class W0 extends B0{constructor(){super(...arguments),this.options=[]}appendChild(e){return e instanceof Do&&(e.parent=this,this.options.push(e)),this}toString(){return this.options[0].value}len(){return this.options[0].len()}clone(){const e=new W0;return this.options.forEach(e.appendChild,e),e}}class l6 extends B0{constructor(){super(...arguments),this.regexp=new RegExp("")}resolve(e){const t=this;let i=!1,s=e.replace(this.regexp,function(){return i=!0,t._replace(Array.prototype.slice.call(arguments,0,-2))});return!i&&this._children.some(o=>o instanceof Hl&&!!o.elseValue)&&(s=this._replace([])),s}_replace(e){let t="";for(const i of this._children)if(i instanceof Hl){let s=e[i.index]||"";s=i.resolve(s),t+=s}else t+=i.toString();return t}toString(){return""}clone(){const e=new l6;return e.regexp=new RegExp(this.regexp.source,(this.regexp.ignoreCase?"i":"")+(this.regexp.global?"g":"")),e._children=this.children.map(t=>t.clone()),e}}class Hl extends B0{constructor(e,t,i,s){super(),this.index=e,this.shorthandName=t,this.ifValue=i,this.elseValue=s}resolve(e){return this.shorthandName==="upcase"?e?e.toLocaleUpperCase():"":this.shorthandName==="downcase"?e?e.toLocaleLowerCase():"":this.shorthandName==="capitalize"?e?e[0].toLocaleUpperCase()+e.substr(1):"":this.shorthandName==="pascalcase"?e?this._toPascalCase(e):"":this.shorthandName==="camelcase"?e?this._toCamelCase(e):"":e&&typeof this.ifValue=="string"?this.ifValue:!e&&typeof this.elseValue=="string"?this.elseValue:e||""}_toPascalCase(e){const t=e.match(/[a-z0-9]+/gi);return t?t.map(i=>i.charAt(0).toUpperCase()+i.substr(1)).join(""):e}_toCamelCase(e){const t=e.match(/[a-z0-9]+/gi);return t?t.map((i,s)=>s===0?i.charAt(0).toLowerCase()+i.substr(1):i.charAt(0).toUpperCase()+i.substr(1)).join(""):e}clone(){return new Hl(this.index,this.shorthandName,this.ifValue,this.elseValue)}}class ky extends Zne{constructor(e){super(),this.name=e}resolve(e){let t=e.resolve(this);return this.transform&&(t=this.transform.resolve(t||"")),t!==void 0?(this._children=[new Do(t)],!0):!1}clone(){const e=new ky(this.name);return this.transform&&(e.transform=this.transform.clone()),e._children=this.children.map(t=>t.clone()),e}}function Zj(n,e){const t=[...n];for(;t.length>0;){const i=t.shift();if(!e(i))break;t.unshift(...i.children)}}class jS extends B0{get placeholderInfo(){if(!this._placeholders){const e=[];let t;this.walk(function(i){return i instanceof pa&&(e.push(i),t=!t||t.indexs===e?(i=!0,!1):(t+=s.len(),!0)),i?t:-1}fullLen(e){let t=0;return Zj([e],i=>(t+=i.len(),!0)),t}enclosingPlaceholders(e){const t=[];let{parent:i}=e;for(;i;)i instanceof pa&&t.push(i),i=i.parent;return t}resolveVariables(e){return this.walk(t=>(t instanceof ky&&t.resolve(e)&&(this._placeholders=void 0),!0)),this}appendChild(e){return this._placeholders=void 0,super.appendChild(e)}replace(e,t){return this._placeholders=void 0,super.replace(e,t)}clone(){const e=new jS;return this._children=this.children.map(t=>t.clone()),e}walk(e){Zj(this.children,e)}}class t0{constructor(){this._scanner=new Ya,this._token={type:14,pos:0,len:0}}static escape(e){return e.replace(/\$|}|\\/g,"\\$&")}static guessNeedsClipboard(e){return/\${?CLIPBOARD/.test(e)}parse(e,t,i){const s=new jS;return this.parseFragment(e,s),this.ensureFinalTabstop(s,i!=null?i:!1,t!=null?t:!1),s}parseFragment(e,t){const i=t.children.length;for(this._scanner.text(e),this._token=this._scanner.next();this._parse(t););const s=new Map,o=[];t.walk(l=>(l instanceof pa&&(l.isFinalTabstop?s.set(0,void 0):!s.has(l.index)&&l.children.length>0?s.set(l.index,l.children):o.push(l)),!0));const r=(l,c)=>{const d=s.get(l.index);if(!d)return;const u=new pa(l.index);u.transform=l.transform;for(const h of d){const f=h.clone();u.appendChild(f),f instanceof pa&&s.has(f.index)&&!c.has(f.index)&&(c.add(f.index),r(f,c),c.delete(f.index))}t.replace(l,[u])},a=new Set;for(const l of o)r(l,a);return t.children.slice(i)}ensureFinalTabstop(e,t,i){(t||i&&e.placeholders.length>0)&&(e.placeholders.find(o=>o.index===0)||e.appendChild(new pa(0)))}_accept(e,t){if(e===void 0||this._token.type===e){const i=t?this._scanner.tokenText(this._token):!0;return this._token=this._scanner.next(),i}return!1}_backTo(e){return this._scanner.pos=e.pos+e.len,this._token=e,!1}_until(e){const t=this._token;for(;this._token.type!==e;){if(this._token.type===14)return!1;if(this._token.type===5){const s=this._scanner.next();if(s.type!==0&&s.type!==4&&s.type!==5)return!1}this._token=this._scanner.next()}const i=this._scanner.value.substring(t.pos,this._token.pos).replace(/\\(\$|}|\\)/g,"$1");return this._token=this._scanner.next(),i}_parse(e){return this._parseEscaped(e)||this._parseTabstopOrVariableName(e)||this._parseComplexPlaceholder(e)||this._parseComplexVariable(e)||this._parseAnything(e)}_parseEscaped(e){let t;return(t=this._accept(5,!0))?(t=this._accept(0,!0)||this._accept(4,!0)||this._accept(5,!0)||t,e.appendChild(new Do(t)),!0):!1}_parseTabstopOrVariableName(e){let t;const i=this._token;return this._accept(0)&&(t=this._accept(9,!0)||this._accept(8,!0))?(e.appendChild(/^\d+$/.test(t)?new pa(Number(t)):new ky(t)),!0):this._backTo(i)}_parseComplexPlaceholder(e){let t;const i=this._token;if(!(this._accept(0)&&this._accept(3)&&(t=this._accept(8,!0))))return this._backTo(i);const o=new pa(Number(t));if(this._accept(1))for(;;){if(this._accept(4))return e.appendChild(o),!0;if(!this._parse(o))return e.appendChild(new Do("${"+t+":")),o.children.forEach(e.appendChild,e),!0}else if(o.index>0&&this._accept(7)){const r=new W0;for(;;){if(this._parseChoiceElement(r)){if(this._accept(2))continue;if(this._accept(7)&&(o.appendChild(r),this._accept(4)))return e.appendChild(o),!0}return this._backTo(i),!1}}else return this._accept(6)?this._parseTransform(o)?(e.appendChild(o),!0):(this._backTo(i),!1):this._accept(4)?(e.appendChild(o),!0):this._backTo(i)}_parseChoiceElement(e){const t=this._token,i=[];for(;!(this._token.type===2||this._token.type===7);){let s;if((s=this._accept(5,!0))?s=this._accept(2,!0)||this._accept(7,!0)||this._accept(5,!0)||s:s=this._accept(void 0,!0),!s)return this._backTo(t),!1;i.push(s)}return i.length===0?(this._backTo(t),!1):(e.appendChild(new Do(i.join(""))),!0)}_parseComplexVariable(e){let t;const i=this._token;if(!(this._accept(0)&&this._accept(3)&&(t=this._accept(9,!0))))return this._backTo(i);const o=new ky(t);if(this._accept(1))for(;;){if(this._accept(4))return e.appendChild(o),!0;if(!this._parse(o))return e.appendChild(new Do("${"+t+":")),o.children.forEach(e.appendChild,e),!0}else return this._accept(6)?this._parseTransform(o)?(e.appendChild(o),!0):(this._backTo(i),!1):this._accept(4)?(e.appendChild(o),!0):this._backTo(i)}_parseTransform(e){const t=new l6;let i="",s="";for(;!this._accept(6);){let o;if(o=this._accept(5,!0)){o=this._accept(6,!0)||o,i+=o;continue}if(this._token.type!==14){i+=this._accept(void 0,!0);continue}return!1}for(;!this._accept(6);){let o;if(o=this._accept(5,!0)){o=this._accept(5,!0)||this._accept(6,!0)||o,t.appendChild(new Do(o));continue}if(!(this._parseFormatString(t)||this._parseAnything(t)))return!1}for(;!this._accept(4);){if(this._token.type!==14){s+=this._accept(void 0,!0);continue}return!1}try{t.regexp=new RegExp(i,s)}catch{return!1}return e.transform=t,!0}_parseFormatString(e){const t=this._token;if(!this._accept(0))return!1;let i=!1;this._accept(3)&&(i=!0);const s=this._accept(8,!0);if(s)if(i){if(this._accept(4))return e.appendChild(new Hl(Number(s))),!0;if(!this._accept(1))return this._backTo(t),!1}else return e.appendChild(new Hl(Number(s))),!0;else return this._backTo(t),!1;if(this._accept(6)){const o=this._accept(9,!0);return!o||!this._accept(4)?(this._backTo(t),!1):(e.appendChild(new Hl(Number(s),o)),!0)}else if(this._accept(11)){const o=this._until(4);if(o)return e.appendChild(new Hl(Number(s),void 0,o,void 0)),!0}else if(this._accept(12)){const o=this._until(4);if(o)return e.appendChild(new Hl(Number(s),void 0,void 0,o)),!0}else if(this._accept(13)){const o=this._until(1);if(o){const r=this._until(4);if(r)return e.appendChild(new Hl(Number(s),void 0,o,r)),!0}}else{const o=this._until(4);if(o)return e.appendChild(new Hl(Number(s),void 0,void 0,o)),!0}return this._backTo(t),!1}_parseAnything(e){return this._token.type!==14?(e.appendChild(new Do(this._scanner.tokenText(this._token))),this._accept(void 0),!0):!1}}var MR=globalThis&&globalThis.__awaiter||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 $Be(n,e,t,i,s=Ft.None,o){return MR(this,void 0,void 0,function*(){const r=jBe(e,t),a=n.all(t),l=new z8;for(const v of a)v.groupId&&l.add(v.groupId,v);function c(v){if(!v.yieldsToGroupIds)return[];const b=[];for(const C of v.yieldsToGroupIds||[]){const w=l.get(C);for(const y of w)b.push(y)}return b}const d=new Map,u=new Set;function h(v,b){if(b=[...b,v],u.has(v))return b;u.add(v);try{const C=c(v);for(const w of C){const y=h(w,b);if(y)return y}}finally{u.delete(v)}}function f(v){const b=d.get(v);if(b)return b;const C=h(v,[]);C&&Bn(new Error("Inline completions: cyclic yield-to dependency detected. Path: ".concat(C.map(y=>y.toString?y.toString():""+y).join(" -> "))));const w=new ax;return d.set(v,w.p),(()=>MR(this,void 0,void 0,function*(){if(!C){const y=c(v);for(const L of y){const S=yield f(L);if(S&&S.items.length>0)return}}try{return yield v.provideInlineCompletions(t,e,i,s)}catch(y){Bn(y);return}}))().then(y=>w.complete(y),y=>w.error(y)),w.p}const g=yield Promise.all(a.map(v=>MR(this,void 0,void 0,function*(){return{provider:v,completions:yield f(v)}}))),p=new Map,_=[];for(const v of g){const b=v.completions;if(!b)continue;const C=new UBe(b,v.provider);_.push(C);for(const w of b.items){const y=QI.from(w,C,r,t,o);p.set(y.hash(),y)}}return new zBe(Array.from(p.values()),new Set(p.keys()),_)})}class zBe{constructor(e,t,i){this.completions=e,this.hashs=t,this.providerResults=i}has(e){return this.hashs.has(e.hash())}dispose(){for(const e of this.providerResults)e.removeRef()}}class UBe{constructor(e,t){this.inlineCompletions=e,this.provider=t,this.refCount=1}addRef(){this.refCount++}removeRef(){this.refCount--,this.refCount===0&&this.provider.freeInlineCompletions(this.inlineCompletions)}}class QI{static from(e,t,i,s,o){let r,a,l=e.range?I.lift(e.range):i;if(typeof e.insertText=="string"){if(r=e.insertText,o&&e.completeBracketPairs){r=Xj(r,l.getStartPosition(),s,o);const c=r.length-e.insertText.length;c!==0&&(l=new I(l.startLineNumber,l.startColumn,l.endLineNumber,l.endColumn+c))}a=void 0}else if("snippet"in e.insertText){const c=e.insertText.snippet.length;if(o&&e.completeBracketPairs){e.insertText.snippet=Xj(e.insertText.snippet,l.getStartPosition(),s,o);const u=e.insertText.snippet.length-c;u!==0&&(l=new I(l.startLineNumber,l.startColumn,l.endLineNumber,l.endColumn+u))}const d=new t0().parse(e.insertText.snippet);d.children.length===1&&d.children[0]instanceof Do?(r=d.children[0].value,a=void 0):(r=d.toString(),a={snippet:e.insertText.snippet,range:l})}else ix(e.insertText);return new QI(r,e.command,l,r,a,e.additionalTextEdits||MBe(),e,t)}constructor(e,t,i,s,o,r,a,l){this.filterText=e,this.command=t,this.range=i,this.insertText=s,this.snippetInfo=o,this.additionalTextEdits=r,this.sourceInlineCompletion=a,this.source=l,e=e.replace(/\r\n|\r/g,"\n"),s=e.replace(/\r\n|\r/g,"\n")}withRange(e){return new QI(this.filterText,this.command,e,this.insertText,this.snippetInfo,this.additionalTextEdits,this.sourceInlineCompletion,this.source)}hash(){return JSON.stringify({insertText:this.insertText,range:this.range.toString()})}}function jBe(n,e){const t=e.getWordAtPosition(n),i=e.getLineMaxColumn(n.lineNumber);return t?new I(n.lineNumber,t.startColumn,n.lineNumber,i):I.fromPositions(n,n.with(void 0,i))}function Xj(n,e,t,i){const o=t.getLineContent(e.lineNumber).substring(0,e.column-1)+n,r=t.tokenization.tokenizeLineWithEdit(e,o.length-(e.column-1),n),a=r==null?void 0:r.sliceAndInflate(e.column-1,o.length,0);return a?VBe(a,i):n}class i0{constructor(e,t){this.range=e,this.text=t}removeCommonPrefix(e,t){const i=t?this.range.intersectRanges(t):this.range;if(!i)return this;const s=e.getValueInRange(i,1),o=om(s,this.text),r=t5(this.range.getStartPosition(),i5(s.substring(0,o))),a=this.text.substring(o),l=I.fromPositions(r,this.range.getEndPosition());return new i0(l,a)}augments(e){return this.text.startsWith(e.text)&&KBe(this.range,e.range)}computeGhostText(e,t,i,s=0){let o=this.removeCommonPrefix(e);if(o.range.endLineNumber!==o.range.startLineNumber)return;const r=e.getLineContent(o.range.startLineNumber),a=ki(r).length;if(o.range.startColumn-1<=a){const g=ki(o.text).length,p=r.substring(o.range.startColumn-1,a),[_,v]=[o.range.getStartPosition(),o.range.getEndPosition()],b=_.column+p.length<=v.column?_.delta(0,p.length):v,C=I.fromPositions(b,v),w=o.text.startsWith(p)?o.text.substring(p.length):o.text.substring(g);o=new i0(C,w)}const c=e.getValueInRange(o.range),d=qBe(c,o.text);if(!d)return;const u=o.range.startLineNumber,h=new Array;if(t==="prefix"){const g=d.filter(p=>p.originalLength===0);if(g.length>1||g.length===1&&g[0].originalStart!==c.length)return}const f=o.text.length-s;for(const g of d){const p=o.range.startColumn+g.originalStart+g.originalLength;if(t==="subwordSmart"&&i&&i.lineNumber===o.range.startLineNumber&&p0)return;if(g.modifiedLength===0)continue;const _=g.modifiedStart+g.modifiedLength,v=Math.max(g.modifiedStart,Math.min(_,f)),b=o.text.substring(g.modifiedStart,v),C=o.text.substring(v,Math.max(g.modifiedStart,_));if(b.length>0){const w=Sd(b);h.push(new n5(p,w,!1))}if(C.length>0){const w=Sd(C);h.push(new n5(p,w,!0))}}return new XI(u,h)}}function KBe(n,e){return e.getStartPosition().equals(n.getStartPosition())&&e.getEndPosition().isBeforeOrEqual(n.getEndPosition())}let xc;function qBe(n,e){if((xc==null?void 0:xc.originalValue)===n&&(xc==null?void 0:xc.newValue)===e)return xc==null?void 0:xc.changes;{let t=Jj(n,e,!0);if(t){const i=Qj(t);if(i>0){const s=Jj(n,e,!1);s&&Qj(s)5e3||e.length>5e3)return;function i(c){let d=0;for(let u=0,h=c.length;ud&&(d=f)}return d}const s=Math.max(i(n),i(e));function o(c){if(c<0)throw new Error("unexpected");return s+c+1}function r(c){let d=0,u=0;const h=new Int32Array(c.length);for(let f=0,g=c.length;fa},{getElements:()=>l}).ComputeDiff(!1).changes}var GBe=globalThis&&globalThis.__decorate||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=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},YBe=globalThis&&globalThis.__awaiter||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 r5=class extends te{constructor(e,t,i,s,o){super(),this.textModel=e,this.versionId=t,this._debounceValue=i,this.languageFeaturesService=s,this.languageConfigurationService=o,this._updateOperation=this._register(new Ts),this.inlineCompletions=DI("inlineCompletions",void 0),this.suggestWidgetInlineCompletions=DI("suggestWidgetInlineCompletions",void 0),this._register(this.textModel.onDidChangeContent(()=>{this._updateOperation.clear()}))}fetch(e,t,i){var s,o;const r=new XBe(e,t,this.textModel.getVersionId()),a=t.selectedSuggestionInfo?this.suggestWidgetInlineCompletions:this.inlineCompletions;if(!((s=this._updateOperation.value)===null||s===void 0)&&s.request.satisfies(r))return this._updateOperation.value.promise;if(!((o=a.get())===null||o===void 0)&&o.request.satisfies(r))return Promise.resolve(!0);const l=!!this._updateOperation.value;this._updateOperation.clear();const c=new Tn,d=(()=>YBe(this,void 0,void 0,function*(){if((l||t.triggerKind===Ru.Automatic)&&(yield ZBe(this._debounceValue.get(this.textModel))),c.token.isCancellationRequested||this.textModel.getVersionId()!==r.versionId)return!1;const f=new Date,g=yield $Be(this.languageFeaturesService.inlineCompletionsProvider,e,this.textModel,t,c.token,this.languageConfigurationService);if(c.token.isCancellationRequested||this.textModel.getVersionId()!==r.versionId)return!1;const p=new Date;this._debounceValue.update(this.textModel,p.getTime()-f.getTime());const _=new e8e(g,r,this.textModel,this.versionId);if(i){const v=i.toInlineCompletion(void 0);i.canBeReused(this.textModel,e)&&!g.has(v)&&_.prepend(i.inlineCompletion,v.range,!0)}return this._updateOperation.clear(),Gi(v=>{a.set(_,v)}),!0}))(),u=new JBe(r,c,d);return this._updateOperation.value=u,d}clear(e){this._updateOperation.clear(),this.inlineCompletions.set(void 0,e),this.suggestWidgetInlineCompletions.set(void 0,e)}clearSuggestWidgetInlineCompletions(e){var t;!((t=this._updateOperation.value)===null||t===void 0)&&t.request.context.selectedSuggestionInfo&&this._updateOperation.clear(),this.suggestWidgetInlineCompletions.set(void 0,e)}cancelUpdate(){this._updateOperation.clear()}};r5=GBe([eK(3,Ze),eK(4,Ni)],r5);function ZBe(n,e){return new Promise(t=>{let i;const s=setTimeout(()=>{i&&i.dispose(),t()},n);e&&(i=e.onCancellationRequested(()=>{clearTimeout(s),i&&i.dispose(),t()}))})}class XBe{constructor(e,t,i){this.position=e,this.context=t,this.versionId=i}satisfies(e){return this.position.equals(e.position)&&QBe(this.context.selectedSuggestionInfo,e.context.selectedSuggestionInfo,(t,i)=>t.equals(i))&&(e.context.triggerKind===Ru.Automatic||this.context.triggerKind===Ru.Explicit)&&this.versionId===e.versionId}}function QBe(n,e,t){return!n||!e?n===e:t(n,e)}class JBe{constructor(e,t,i){this.request=e,this.cancellationTokenSource=t,this.promise=i}dispose(){this.cancellationTokenSource.cancel()}}class e8e{get inlineCompletions(){return this._inlineCompletions}constructor(e,t,i,s){this.inlineCompletionProviderResult=e,this.request=t,this.textModel=i,this.versionId=s,this._refCount=1,this._prependedInlineCompletionItems=[],this._rangeVersionIdValue=0,this._rangeVersionId=Ut(this,r=>{this.versionId.read(r);let a=!1;for(const l of this._inlineCompletions)a=a||l._updateRange(this.textModel);return a&&this._rangeVersionIdValue++,this._rangeVersionIdValue});const o=i.deltaDecorations([],e.completions.map(r=>({range:r.range,options:{description:"inline-completion-tracking-range"}})));this._inlineCompletions=e.completions.map((r,a)=>new tK(r,o[a],this._rangeVersionId))}clone(){return this._refCount++,this}dispose(){if(this._refCount--,this._refCount===0){setTimeout(()=>{this.textModel.isDisposed()||this.textModel.deltaDecorations(this._inlineCompletions.map(e=>e.decorationId),[])},0),this.inlineCompletionProviderResult.dispose();for(const e of this._prependedInlineCompletionItems)e.source.removeRef()}}prepend(e,t,i){i&&e.source.addRef();const s=this.textModel.deltaDecorations([],[{range:t,options:{description:"inline-completion-tracking-range"}}])[0];this._inlineCompletions.unshift(new tK(e,s,this._rangeVersionId,t)),this._prependedInlineCompletionItems.push(e)}}class tK{get forwardStable(){var e;return(e=this.inlineCompletion.source.inlineCompletions.enableForwardStability)!==null&&e!==void 0?e:!1}constructor(e,t,i,s){this.inlineCompletion=e,this.decorationId=t,this.rangeVersion=i,this.semanticId=JSON.stringify([this.inlineCompletion.filterText,this.inlineCompletion.insertText,this.inlineCompletion.range.getStartPosition().toString()]),this._isValid=!0,this._updatedRange=s!=null?s:e.range}toInlineCompletion(e){return this.inlineCompletion.withRange(this._getUpdatedRange(e))}toSingleTextEdit(e){return new i0(this._getUpdatedRange(e),this.inlineCompletion.insertText)}isVisible(e,t,i){const s=this._toFilterTextReplacement(i).removeCommonPrefix(e);if(!this._isValid||!this.inlineCompletion.range.getStartPosition().equals(this._getUpdatedRange(i).getStartPosition())||t.lineNumber!==s.range.startLineNumber)return!1;const o=e.getValueInRange(s.range,1).toLowerCase(),r=s.text.toLowerCase(),a=Math.max(0,t.column-s.range.startColumn);let l=r.substring(0,a),c=r.substring(a),d=o.substring(0,a),u=o.substring(a);const h=e.getLineIndentColumn(s.range.startLineNumber);return s.range.startColumn<=h&&(d=d.trimStart(),d.length===0&&(u=u.trimStart()),l=l.trimStart(),l.length===0&&(c=c.trimStart())),l.startsWith(d)&&!!pee(u,c)}canBeReused(e,t){return this._isValid&&this._getUpdatedRange(void 0).containsPosition(t)&&this.isVisible(e,t,void 0)&&!this._isSmallerThanOriginal(void 0)}_toFilterTextReplacement(e){return new i0(this._getUpdatedRange(e),this.inlineCompletion.filterText)}_isSmallerThanOriginal(e){return iK(this._getUpdatedRange(e)).isBefore(iK(this.inlineCompletion.range))}_getUpdatedRange(e){return this.rangeVersion.read(e),this._updatedRange}_updateRange(e){const t=e.getDecorationRange(this.decorationId);return t?this._updatedRange.equalsRange(t)?!1:(this._updatedRange=t,!0):(this._isValid=!1,!0)}}function iK(n){return n.startLineNumber===n.endLineNumber?new Y(1,1+n.endColumn-n.startColumn):new Y(1+n.endLineNumber-n.startLineNumber,n.endColumn)}var HC=globalThis&&globalThis.__awaiter||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 Tt={Visible:e6,HasFocusedSuggestion:new Ve("suggestWidgetHasFocusedSuggestion",!1,m("suggestWidgetHasSelection","Whether any suggestion is focused")),DetailsVisible:new Ve("suggestWidgetDetailsVisible",!1,m("suggestWidgetDetailsVisible","Whether suggestion details are visible")),MultipleSuggestions:new Ve("suggestWidgetMultipleSuggestions",!1,m("suggestWidgetMultipleSuggestions","Whether there are multiple suggestions to pick from")),MakesTextEdit:new Ve("suggestionMakesTextEdit",!0,m("suggestionMakesTextEdit","Whether inserting the current suggestion yields in a change or has everything already been typed")),AcceptSuggestionsOnEnter:new Ve("acceptSuggestionOnEnter",!0,m("acceptSuggestionOnEnter","Whether suggestions are inserted when pressing Enter")),HasInsertAndReplaceRange:new Ve("suggestionHasInsertAndReplaceRange",!1,m("suggestionHasInsertAndReplaceRange","Whether the current suggestion has insert and replace behaviour")),InsertMode:new Ve("suggestionInsertMode",void 0,{type:"string",description:m("suggestionInsertMode","Whether the default behaviour is to insert or replace")}),CanResolve:new Ve("suggestionCanResolve",!1,m("suggestionCanResolve","Whether the current suggestion supports to resolve further details"))},Af=new M("suggestWidgetStatusBar");class t8e{constructor(e,t,i,s){var o;this.position=e,this.completion=t,this.container=i,this.provider=s,this.isInvalid=!1,this.score=lc.Default,this.distance=0,this.textLabel=typeof t.label=="string"?t.label:(o=t.label)===null||o===void 0?void 0:o.label,this.labelLow=this.textLabel.toLowerCase(),this.isInvalid=!this.textLabel,this.sortTextLow=t.sortText&&t.sortText.toLowerCase(),this.filterTextLow=t.filterText&&t.filterText.toLowerCase(),this.extensionId=t.extensionId,I.isIRange(t.range)?(this.editStart=new Y(t.range.startLineNumber,t.range.startColumn),this.editInsertEnd=new Y(t.range.endLineNumber,t.range.endColumn),this.editReplaceEnd=new Y(t.range.endLineNumber,t.range.endColumn),this.isInvalid=this.isInvalid||I.spansMultipleLines(t.range)||t.range.startLineNumber!==e.lineNumber):(this.editStart=new Y(t.range.insert.startLineNumber,t.range.insert.startColumn),this.editInsertEnd=new Y(t.range.insert.endLineNumber,t.range.insert.endColumn),this.editReplaceEnd=new Y(t.range.replace.endLineNumber,t.range.replace.endColumn),this.isInvalid=this.isInvalid||I.spansMultipleLines(t.range.insert)||I.spansMultipleLines(t.range.replace)||t.range.insert.startLineNumber!==e.lineNumber||t.range.replace.startLineNumber!==e.lineNumber||t.range.insert.startColumn!==t.range.replace.startColumn),typeof s.resolveCompletionItem!="function"&&(this._resolveCache=Promise.resolve(),this._resolveDuration=0)}get isResolved(){return this._resolveDuration!==void 0}get resolveDuration(){return this._resolveDuration!==void 0?this._resolveDuration:-1}resolve(e){return HC(this,void 0,void 0,function*(){if(!this._resolveCache){const t=e.onCancellationRequested(()=>{this._resolveCache=void 0,this._resolveDuration=void 0}),i=new so(!0);this._resolveCache=Promise.resolve(this.provider.resolveCompletionItem(this.completion,e)).then(s=>{Object.assign(this.completion,s),this._resolveDuration=i.elapsed()},s=>{bc(s)&&(this._resolveCache=void 0,this._resolveDuration=void 0)}).finally(()=>{t.dispose()})}return this._resolveCache})}}class Dy{constructor(e=2,t=new Set,i=new Set,s=new Map,o=!0){this.snippetSortOrder=e,this.kindFilter=t,this.providerFilter=i,this.providerItemsToReuse=s,this.showDeprecated=o}}Dy.default=new Dy;let i8e;function n8e(){return i8e}class s8e{constructor(e,t,i,s){this.items=e,this.needsClipboard=t,this.durations=i,this.disposable=s}}function c6(n,e,t,i=Dy.default,s={triggerKind:0},o=Ft.None){return HC(this,void 0,void 0,function*(){const r=new so;t=t.clone();const a=e.getWordAtPosition(t),l=a?new I(t.lineNumber,a.startColumn,t.lineNumber,a.endColumn):I.fromPositions(t),c={replace:l,insert:l.setEndPosition(t.lineNumber,t.column)},d=[],u=new be,h=[];let f=!1;const g=(_,v,b)=>{var C,w,y;let L=!1;if(!v)return L;for(const S of v.suggestions)if(!i.kindFilter.has(S.kind)){if(!i.showDeprecated&&(!((C=S==null?void 0:S.tags)===null||C===void 0)&&C.includes(1)))continue;S.range||(S.range=c),S.sortText||(S.sortText=typeof S.label=="string"?S.label:S.label.label),!f&&S.insertTextRules&&S.insertTextRules&4&&(f=t0.guessNeedsClipboard(S.insertText)),d.push(new t8e(t,S,v,_)),L=!0}return _8(v)&&u.add(v),h.push({providerName:(w=_._debugDisplayName)!==null&&w!==void 0?w:"unknown_provider",elapsedProvider:(y=v.duration)!==null&&y!==void 0?y:-1,elapsedOverall:b.elapsed()}),L},p=(()=>HC(this,void 0,void 0,function*(){}))();for(const _ of n.orderedGroups(e)){let v=!1;if(yield Promise.all(_.map(b=>HC(this,void 0,void 0,function*(){if(i.providerItemsToReuse.has(b)){const C=i.providerItemsToReuse.get(b);C.forEach(w=>d.push(w)),v=v||C.length>0;return}if(!(i.providerFilter.size>0&&!i.providerFilter.has(b)))try{const C=new so,w=yield b.provideCompletionItems(e,t,s,o);v=g(b,w,C)||v}catch(C){Bn(C)}}))),v||o.isCancellationRequested)break}return yield p,o.isCancellationRequested?(u.dispose(),Promise.reject(new Sg)):new s8e(d.sort(a8e(i.snippetSortOrder)),f,{entries:h,elapsed:r.elapsed()},u)})}function d6(n,e){if(n.sortTextLow&&e.sortTextLow){if(n.sortTextLowe.sortTextLow)return 1}return n.textLabele.textLabel?1:n.completion.kind-e.completion.kind}function o8e(n,e){if(n.completion.kind!==e.completion.kind){if(n.completion.kind===27)return-1;if(e.completion.kind===27)return 1}return d6(n,e)}function r8e(n,e){if(n.completion.kind!==e.completion.kind){if(n.completion.kind===27)return 1;if(e.completion.kind===27)return-1}return d6(n,e)}const AN=new Map;AN.set(0,o8e);AN.set(2,r8e);AN.set(1,d6);function a8e(n){return AN.get(n)}qt.registerCommand("_executeCompletionItemProvider",(n,...e)=>HC(void 0,void 0,void 0,function*(){const[t,i,s,o]=e;bi(ct.isUri(t)),bi(Y.isIPosition(i)),bi(typeof s=="string"||!s),bi(typeof o=="number"||!o);const{completionProvider:r}=n.get(Ze),a=yield n.get(sr).createModelReference(t);try{const l={incomplete:!1,suggestions:[]},c=[],d=a.object.textEditorModel.validatePosition(i),u=yield c6(r,a.object.textEditorModel,d,void 0,{triggerCharacter:s!=null?s:void 0,triggerKind:s?1:0});for(const h of u.items)c.length<(o!=null?o:0)&&c.push(h.resolve(Ft.None)),l.incomplete=l.incomplete||h.container.incomplete,l.suggestions.push(h.completion);try{return yield Promise.all(c),l}finally{setTimeout(()=>u.disposable.dispose(),100)}}finally{a.dispose()}}));function l8e(n,e){var t;(t=n.getContribution("editor.contrib.suggestController"))===null||t===void 0||t.triggerSuggest(new Set().add(e),void 0,!0)}class Lv{static isAllOff(e){return e.other==="off"&&e.comments==="off"&&e.strings==="off"}static isAllOn(e){return e.other==="on"&&e.comments==="on"&&e.strings==="on"}static valueFor(e,t){switch(t){case 1:return e.comments;case 2:return e.strings;default:return e.other}}}function nK(n,e=zs){return Yke(n,e)?n.charAt(0).toUpperCase()+n.slice(1):n}var c8e=globalThis&&globalThis.__decorate||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},d8e=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};class sK{constructor(e){this._delegates=e}resolve(e){for(const t of this._delegates){const i=t.resolve(e);if(i!==void 0)return i}}}class oK{constructor(e,t,i,s){this._model=e,this._selection=t,this._selectionIdx=i,this._overtypingCapturer=s}resolve(e){const{name:t}=e;if(t==="SELECTION"||t==="TM_SELECTED_TEXT"){let i=this._model.getValueInRange(this._selection)||void 0,s=this._selection.startLineNumber!==this._selection.endLineNumber;if(!i&&this._overtypingCapturer){const o=this._overtypingCapturer.getLastOvertypedInfo(this._selectionIdx);o&&(i=o.value,s=o.multiline)}if(i&&s&&e.snippet){const o=this._model.getLineContent(this._selection.startLineNumber),r=ki(o,0,this._selection.startColumn-1);let a=r;e.snippet.walk(c=>c===e?!1:(c instanceof Do&&(a=ki(Sd(c.value).pop())),!0));const l=om(a,r);i=i.replace(/(\r\n|\r|\n)(.*)/g,(c,d,u)=>"".concat(d).concat(a.substr(l)).concat(u))}return i}else{if(t==="TM_CURRENT_LINE")return this._model.getLineContent(this._selection.positionLineNumber);if(t==="TM_CURRENT_WORD"){const i=this._model.getWordAtPosition({lineNumber:this._selection.positionLineNumber,column:this._selection.positionColumn});return i&&i.word||void 0}else{if(t==="TM_LINE_INDEX")return String(this._selection.positionLineNumber-1);if(t==="TM_LINE_NUMBER")return String(this._selection.positionLineNumber);if(t==="CURSOR_INDEX")return String(this._selectionIdx);if(t==="CURSOR_NUMBER")return String(this._selectionIdx+1)}}}}class rK{constructor(e,t){this._labelService=e,this._model=t}resolve(e){const{name:t}=e;if(t==="TM_FILENAME")return bf(this._model.uri.fsPath);if(t==="TM_FILENAME_BASE"){const i=bf(this._model.uri.fsPath),s=i.lastIndexOf(".");return s<=0?i:i.slice(0,s)}else{if(t==="TM_DIRECTORY")return mX(this._model.uri.fsPath)==="."?"":this._labelService.getUriLabel(Ix(this._model.uri));if(t==="TM_FILEPATH")return this._labelService.getUriLabel(this._model.uri);if(t==="RELATIVE_FILEPATH")return this._labelService.getUriLabel(this._model.uri,{relative:!0,noPrefix:!0})}}}class aK{constructor(e,t,i,s){this._readClipboardText=e,this._selectionIdx=t,this._selectionCount=i,this._spread=s}resolve(e){if(e.name!=="CLIPBOARD")return;const t=this._readClipboardText();if(t){if(this._spread){const i=t.split(/\r\n|\n|\r/).filter(s=>!SX(s));if(i.length===this._selectionCount)return i[this._selectionIdx]}return t}}}let JI=class{constructor(e,t,i){this._model=e,this._selection=t,this._languageConfigurationService=i}resolve(e){const{name:t}=e,i=this._model.getLanguageIdAtPosition(this._selection.selectionStartLineNumber,this._selection.selectionStartColumn),s=this._languageConfigurationService.getLanguageConfiguration(i).comments;if(s){if(t==="LINE_COMMENT")return s.lineCommentToken||void 0;if(t==="BLOCK_COMMENT_START")return s.blockCommentStartToken||void 0;if(t==="BLOCK_COMMENT_END")return s.blockCommentEndToken||void 0}}};JI=c8e([d8e(2,Ni)],JI);class ec{constructor(){this._date=new Date}resolve(e){const{name:t}=e;if(t==="CURRENT_YEAR")return String(this._date.getFullYear());if(t==="CURRENT_YEAR_SHORT")return String(this._date.getFullYear()).slice(-2);if(t==="CURRENT_MONTH")return String(this._date.getMonth().valueOf()+1).padStart(2,"0");if(t==="CURRENT_DATE")return String(this._date.getDate().valueOf()).padStart(2,"0");if(t==="CURRENT_HOUR")return String(this._date.getHours().valueOf()).padStart(2,"0");if(t==="CURRENT_MINUTE")return String(this._date.getMinutes().valueOf()).padStart(2,"0");if(t==="CURRENT_SECOND")return String(this._date.getSeconds().valueOf()).padStart(2,"0");if(t==="CURRENT_DAY_NAME")return ec.dayNames[this._date.getDay()];if(t==="CURRENT_DAY_NAME_SHORT")return ec.dayNamesShort[this._date.getDay()];if(t==="CURRENT_MONTH_NAME")return ec.monthNames[this._date.getMonth()];if(t==="CURRENT_MONTH_NAME_SHORT")return ec.monthNamesShort[this._date.getMonth()];if(t==="CURRENT_SECONDS_UNIX")return String(Math.floor(this._date.getTime()/1e3));if(t==="CURRENT_TIMEZONE_OFFSET"){const i=this._date.getTimezoneOffset(),s=i>0?"-":"+",o=Math.trunc(Math.abs(i/60)),r=o<10?"0"+o:o,a=Math.abs(i)-o*60,l=a<10?"0"+a:a;return s+r+":"+l}}}ec.dayNames=[m("Sunday","Sunday"),m("Monday","Monday"),m("Tuesday","Tuesday"),m("Wednesday","Wednesday"),m("Thursday","Thursday"),m("Friday","Friday"),m("Saturday","Saturday")];ec.dayNamesShort=[m("SundayShort","Sun"),m("MondayShort","Mon"),m("TuesdayShort","Tue"),m("WednesdayShort","Wed"),m("ThursdayShort","Thu"),m("FridayShort","Fri"),m("SaturdayShort","Sat")];ec.monthNames=[m("January","January"),m("February","February"),m("March","March"),m("April","April"),m("May","May"),m("June","June"),m("July","July"),m("August","August"),m("September","September"),m("October","October"),m("November","November"),m("December","December")];ec.monthNamesShort=[m("JanuaryShort","Jan"),m("FebruaryShort","Feb"),m("MarchShort","Mar"),m("AprilShort","Apr"),m("MayShort","May"),m("JuneShort","Jun"),m("JulyShort","Jul"),m("AugustShort","Aug"),m("SeptemberShort","Sep"),m("OctoberShort","Oct"),m("NovemberShort","Nov"),m("DecemberShort","Dec")];class lK{constructor(e){this._workspaceService=e}resolve(e){if(!this._workspaceService)return;const t=dTe(this._workspaceService.getWorkspace());if(!aTe(t)){if(e.name==="WORKSPACE_NAME")return this._resolveWorkspaceName(t);if(e.name==="WORKSPACE_FOLDER")return this._resoveWorkspacePath(t)}}_resolveWorkspaceName(e){if($O(e))return bf(e.uri.path);let t=bf(e.configPath.path);return t.endsWith(zO)&&(t=t.substr(0,t.length-zO.length-1)),t}_resoveWorkspacePath(e){if($O(e))return nK(e.uri.fsPath);const t=bf(e.configPath.path);let i=e.configPath.fsPath;return i.endsWith(t)&&(i=i.substr(0,i.length-t.length-1)),i?nK(i):"/"}}class cK{resolve(e){const{name:t}=e;if(t==="RANDOM")return Math.random().toString().slice(-6);if(t==="RANDOM_HEX")return Math.random().toString(16).slice(-6);if(t==="UUID")return SN()}}var u8e=globalThis&&globalThis.__decorate||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},h8e=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},Ml;class ga{constructor(e,t,i){this._editor=e,this._snippet=t,this._snippetLineLeadingWhitespace=i,this._offset=-1,this._nestingLevel=1,this._placeholderGroups=TV(t.placeholders,pa.compareByIndex),this._placeholderGroupsIdx=-1}initialize(e){this._offset=e.newPosition}dispose(){this._placeholderDecorations&&this._editor.removeDecorations([...this._placeholderDecorations.values()]),this._placeholderGroups.length=0}_initDecorations(){if(this._offset===-1)throw new Error("Snippet not initialized!");if(this._placeholderDecorations)return;this._placeholderDecorations=new Map;const e=this._editor.getModel();this._editor.changeDecorations(t=>{for(const i of this._snippet.placeholders){const s=this._snippet.offset(i),o=this._snippet.fullLen(i),r=I.fromPositions(e.getPositionAt(this._offset+s),e.getPositionAt(this._offset+s+o)),a=i.isFinalTabstop?ga._decor.inactiveFinal:ga._decor.inactive,l=t.addDecoration(r,a);this._placeholderDecorations.set(i,l)}})}move(e){if(!this._editor.hasModel())return[];if(this._initDecorations(),this._placeholderGroupsIdx>=0){const s=[];for(const o of this._placeholderGroups[this._placeholderGroupsIdx])if(o.transform){const r=this._placeholderDecorations.get(o),a=this._editor.getModel().getDecorationRange(r),l=this._editor.getModel().getValueInRange(a),c=o.transform.resolve(l).split(/\r\n|\r|\n/);for(let d=1;d0&&this._editor.executeEdits("snippet.placeholderTransform",s)}let t=!1;e===!0&&this._placeholderGroupsIdx0&&(this._placeholderGroupsIdx-=1,t=!0);const i=this._editor.getModel().changeDecorations(s=>{const o=new Set,r=[];for(const a of this._placeholderGroups[this._placeholderGroupsIdx]){const l=this._placeholderDecorations.get(a),c=this._editor.getModel().getDecorationRange(l);r.push(new Je(c.startLineNumber,c.startColumn,c.endLineNumber,c.endColumn)),t=t&&this._hasPlaceholderBeenCollapsed(a),s.changeDecorationOptions(l,a.isFinalTabstop?ga._decor.activeFinal:ga._decor.active),o.add(a);for(const d of this._snippet.enclosingPlaceholders(a)){const u=this._placeholderDecorations.get(d);s.changeDecorationOptions(u,d.isFinalTabstop?ga._decor.activeFinal:ga._decor.active),o.add(d)}}for(const[a,l]of this._placeholderDecorations)o.has(a)||s.changeDecorationOptions(l,a.isFinalTabstop?ga._decor.inactiveFinal:ga._decor.inactive);return r});return t?this.move(e):i!=null?i:[]}_hasPlaceholderBeenCollapsed(e){let t=e;for(;t;){if(t instanceof pa){const i=this._placeholderDecorations.get(t);if(this._editor.getModel().getDecorationRange(i).isEmpty()&&t.toString().length>0)return!0}t=t.parent}return!1}get isAtFirstPlaceholder(){return this._placeholderGroupsIdx<=0||this._placeholderGroups.length===0}get isAtLastPlaceholder(){return this._placeholderGroupsIdx===this._placeholderGroups.length-1}get hasPlaceholder(){return this._snippet.placeholders.length>0}get isTrivialSnippet(){if(this._snippet.placeholders.length===0)return!0;if(this._snippet.placeholders.length===1){const[e]=this._snippet.placeholders;if(e.isFinalTabstop&&this._snippet.rightMostDescendant===e)return!0}return!1}computePossibleSelections(){const e=new Map;for(const t of this._placeholderGroups){let i;for(const s of t){if(s.isFinalTabstop)break;i||(i=[],e.set(s.index,i));const o=this._placeholderDecorations.get(s),r=this._editor.getModel().getDecorationRange(o);if(!r){e.delete(s.index);break}i.push(r)}}return e}get activeChoice(){if(!this._placeholderDecorations)return;const e=this._placeholderGroups[this._placeholderGroupsIdx][0];if(!(e!=null&&e.choice))return;const t=this._placeholderDecorations.get(e);if(!t)return;const i=this._editor.getModel().getDecorationRange(t);if(i)return{range:i,choice:e.choice}}get hasChoice(){let e=!1;return this._snippet.walk(t=>(e=t instanceof W0,!e)),e}merge(e){const t=this._editor.getModel();this._nestingLevel*=10,this._editor.changeDecorations(i=>{for(const s of this._placeholderGroups[this._placeholderGroupsIdx]){const o=e.shift();console.assert(o._offset!==-1),console.assert(!o._placeholderDecorations);const r=o._snippet.placeholderInfo.last.index;for(const l of o._snippet.placeholderInfo.all)l.isFinalTabstop?l.index=s.index+(r+1)/this._nestingLevel:l.index=s.index+l.index/this._nestingLevel;this._snippet.replace(s,o._snippet.children);const a=this._placeholderDecorations.get(s);i.removeDecoration(a),this._placeholderDecorations.delete(s);for(const l of o._snippet.placeholders){const c=o._snippet.offset(l),d=o._snippet.fullLen(l),u=I.fromPositions(t.getPositionAt(o._offset+c),t.getPositionAt(o._offset+c+d)),h=i.addDecoration(u,ga._decor.inactive);this._placeholderDecorations.set(l,h)}}this._placeholderGroups=TV(this._snippet.placeholders,pa.compareByIndex)})}}ga._decor={active:kt.register({description:"snippet-placeholder-1",stickiness:0,className:"snippet-placeholder"}),inactive:kt.register({description:"snippet-placeholder-2",stickiness:1,className:"snippet-placeholder"}),activeFinal:kt.register({description:"snippet-placeholder-3",stickiness:1,className:"finish-snippet-placeholder"}),inactiveFinal:kt.register({description:"snippet-placeholder-4",stickiness:1,className:"finish-snippet-placeholder"})};const dK={overwriteBefore:0,overwriteAfter:0,adjustWhitespace:!0,clipboardText:void 0,overtypingCapturer:void 0};let eT=Ml=class{static adjustWhitespace(e,t,i,s,o){const r=e.getLineContent(t.lineNumber),a=ki(r,0,t.column-1);let l;return s.walk(c=>{if(!(c instanceof Do)||c.parent instanceof W0||o&&!o.has(c))return!0;const d=c.value.split(/\r\n|\r|\n/);if(i){const h=s.offset(c);if(h===0)d[0]=e.normalizeIndentation(d[0]);else{l=l!=null?l:s.toString();const f=l.charCodeAt(h-1);(f===10||f===13)&&(d[0]=e.normalizeIndentation(a+d[0]))}for(let f=1;fw.get(hm)),g=e.invokeWithinContext(w=>new rK(w.get(Fb),h)),p=()=>a,_=h.getValueInRange(Ml.adjustSelection(h,e.getSelection(),i,0)),v=h.getValueInRange(Ml.adjustSelection(h,e.getSelection(),0,s)),b=h.getLineFirstNonWhitespaceColumn(e.getSelection().positionLineNumber),C=e.getSelections().map((w,y)=>({selection:w,idx:y})).sort((w,y)=>I.compareRangesUsingStarts(w.selection,y.selection));for(const{selection:w,idx:y}of C){let L=Ml.adjustSelection(h,w,i,0),S=Ml.adjustSelection(h,w,0,s);_!==h.getValueInRange(L)&&(L=w),v!==h.getValueInRange(S)&&(S=w);const k=w.setStartPosition(L.startLineNumber,L.startColumn).setEndPosition(S.endLineNumber,S.endColumn),D=new t0().parse(t,!0,o),x=k.getStartPosition(),A=Ml.adjustWhitespace(h,x,r||y>0&&b!==h.getLineFirstNonWhitespaceColumn(w.positionLineNumber),D);D.resolveVariables(new sK([g,new aK(p,y,C.length,e.getOption(78)==="spread"),new oK(h,w,y,l),new JI(h,w,c),new ec,new lK(f),new cK])),d[y]=Yi.replace(k,D.toString()),d[y].identifier={major:y,minor:0},d[y]._isTracked=!0,u[y]=new ga(e,D,A)}return{edits:d,snippets:u}}static createEditsAndSnippetsFromEdits(e,t,i,s,o,r,a){if(!e.hasModel()||t.length===0)return{edits:[],snippets:[]};const l=[],c=e.getModel(),d=new t0,u=new jS,h=new sK([e.invokeWithinContext(g=>new rK(g.get(Fb),c)),new aK(()=>o,0,e.getSelections().length,e.getOption(78)==="spread"),new oK(c,e.getSelection(),0,r),new JI(c,e.getSelection(),a),new ec,new lK(e.invokeWithinContext(g=>g.get(hm))),new cK]);t=t.sort((g,p)=>I.compareRangesUsingStarts(g.range,p.range));let f=0;for(let g=0;g0){const y=t[g-1].range,L=I.fromPositions(y.getEndPosition(),p.getStartPosition()),S=new Do(c.getValueInRange(L));u.appendChild(S),f+=S.value.length}const v=d.parseFragment(_,u);Ml.adjustWhitespace(c,p.getStartPosition(),!0,u,new Set(v)),u.resolveVariables(h);const b=u.toString(),C=b.slice(f);f=b.length;const w=Yi.replace(p,C);w.identifier={major:g,minor:0},w._isTracked=!0,l.push(w)}return d.ensureFinalTabstop(u,i,!0),{edits:l,snippets:[new ga(e,u,"")]}}constructor(e,t,i=dK,s){this._editor=e,this._template=t,this._options=i,this._languageConfigurationService=s,this._templateMerges=[],this._snippets=[]}dispose(){fi(this._snippets)}_logInfo(){return'template="'.concat(this._template,'", merged_templates="').concat(this._templateMerges.join(" -> "),'"')}insert(){if(!this._editor.hasModel())return;const{edits:e,snippets:t}=typeof this._template=="string"?Ml.createEditsAndSnippetsFromSelections(this._editor,this._template,this._options.overwriteBefore,this._options.overwriteAfter,!1,this._options.adjustWhitespace,this._options.clipboardText,this._options.overtypingCapturer,this._languageConfigurationService):Ml.createEditsAndSnippetsFromEdits(this._editor,this._template,!1,this._options.adjustWhitespace,this._options.clipboardText,this._options.overtypingCapturer,this._languageConfigurationService);this._snippets=t,this._editor.executeEdits("snippet",e,i=>{const s=i.filter(o=>!!o.identifier);for(let o=0;oJe.fromPositions(o.range.getEndPosition()))}),this._editor.revealRange(this._editor.getSelections()[0])}merge(e,t=dK){if(!this._editor.hasModel())return;this._templateMerges.push([this._snippets[0]._nestingLevel,this._snippets[0]._placeholderGroupsIdx,e]);const{edits:i,snippets:s}=Ml.createEditsAndSnippetsFromSelections(this._editor,e,t.overwriteBefore,t.overwriteAfter,!0,t.adjustWhitespace,t.clipboardText,t.overtypingCapturer,this._languageConfigurationService);this._editor.executeEdits("snippet",i,o=>{const r=o.filter(l=>!!l.identifier);for(let l=0;lJe.fromPositions(l.range.getEndPosition()))})}next(){const e=this._move(!0);this._editor.setSelections(e),this._editor.revealPositionInCenterIfOutsideViewport(e[0].getPosition())}prev(){const e=this._move(!1);this._editor.setSelections(e),this._editor.revealPositionInCenterIfOutsideViewport(e[0].getPosition())}_move(e){const t=[];for(const i of this._snippets){const s=i.move(e);t.push(...s)}return t}get isAtFirstPlaceholder(){return this._snippets[0].isAtFirstPlaceholder}get isAtLastPlaceholder(){return this._snippets[0].isAtLastPlaceholder}get hasPlaceholder(){return this._snippets[0].hasPlaceholder}get hasChoice(){return this._snippets[0].hasChoice}get activeChoice(){return this._snippets[0].activeChoice}isSelectionWithinPlaceholders(){if(!this.hasPlaceholder)return!1;const e=this._editor.getSelections();if(e.length{o.push(...s.get(r))})}e.sort(I.compareRangesUsingStarts);for(const[i,s]of t){if(s.length!==e.length){t.delete(i);continue}s.sort(I.compareRangesUsingStarts);for(let o=0;o0}};eT=Ml=u8e([h8e(3,Ni)],eT);var f8e=globalThis&&globalThis.__decorate||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},Sk=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},Z_;const uK={overwriteBefore:0,overwriteAfter:0,undoStopBefore:!0,undoStopAfter:!0,adjustWhitespace:!0,clipboardText:void 0,overtypingCapturer:void 0};let xs=Z_=class{static get(e){return e.getContribution(Z_.ID)}constructor(e,t,i,s,o){this._editor=e,this._logService=t,this._languageFeaturesService=i,this._languageConfigurationService=o,this._snippetListener=new be,this._modelVersionId=-1,this._inSnippet=Z_.InSnippetMode.bindTo(s),this._hasNextTabstop=Z_.HasNextTabstop.bindTo(s),this._hasPrevTabstop=Z_.HasPrevTabstop.bindTo(s)}dispose(){var e;this._inSnippet.reset(),this._hasPrevTabstop.reset(),this._hasNextTabstop.reset(),(e=this._session)===null||e===void 0||e.dispose(),this._snippetListener.dispose()}insert(e,t){try{this._doInsert(e,typeof t>"u"?uK:Object.assign(Object.assign({},uK),t))}catch(i){this.cancel(),this._logService.error(i),this._logService.error("snippet_error"),this._logService.error("insert_template=",e),this._logService.error("existing_template=",this._session?this._session._logInfo():"")}}_doInsert(e,t){var i;if(this._editor.hasModel()){if(this._snippetListener.clear(),t.undoStopBefore&&this._editor.getModel().pushStackElement(),this._session&&typeof e!="string"&&this.cancel(),this._session?(bi(typeof e=="string"),this._session.merge(e,t)):(this._modelVersionId=this._editor.getModel().getAlternativeVersionId(),this._session=new eT(this._editor,e,t,this._languageConfigurationService),this._session.insert()),t.undoStopAfter&&this._editor.getModel().pushStackElement(),!((i=this._session)===null||i===void 0)&&i.hasChoice){const s={_debugDisplayName:"snippetChoiceCompletions",provideCompletionItems:(d,u)=>{if(!this._session||d!==this._editor.getModel()||!Y.equals(this._editor.getPosition(),u))return;const{activeChoice:h}=this._session;if(!h||h.choice.options.length===0)return;const f=d.getValueInRange(h.range),g=!!h.choice.options.find(_=>_.value===f),p=[];for(let _=0;_{r==null||r.dispose(),a=!1},c=()=>{a||(r=this._languageFeaturesService.completionProvider.register({language:o.getLanguageId(),pattern:o.uri.fsPath,scheme:o.uri.scheme,exclusive:!0},s),this._snippetListener.add(r),a=!0)};this._choiceCompletions={provider:s,enable:c,disable:l}}this._updateState(),this._snippetListener.add(this._editor.onDidChangeModelContent(s=>s.isFlush&&this.cancel())),this._snippetListener.add(this._editor.onDidChangeModel(()=>this.cancel())),this._snippetListener.add(this._editor.onDidChangeCursorSelection(()=>this._updateState()))}}_updateState(){if(!(!this._session||!this._editor.hasModel())){if(this._modelVersionId===this._editor.getModel().getAlternativeVersionId())return this.cancel();if(!this._session.hasPlaceholder)return this.cancel();if(this._session.isAtLastPlaceholder||!this._session.isSelectionWithinPlaceholders())return this._editor.getModel().pushStackElement(),this.cancel();this._inSnippet.set(!0),this._hasPrevTabstop.set(!this._session.isAtFirstPlaceholder),this._hasNextTabstop.set(!this._session.isAtLastPlaceholder),this._handleChoice()}}_handleChoice(){var e;if(!this._session||!this._editor.hasModel()){this._currentChoice=void 0;return}const{activeChoice:t}=this._session;if(!t||!this._choiceCompletions){(e=this._choiceCompletions)===null||e===void 0||e.disable(),this._currentChoice=void 0;return}this._currentChoice!==t.choice&&(this._currentChoice=t.choice,this._choiceCompletions.enable(),queueMicrotask(()=>{l8e(this._editor,this._choiceCompletions.provider)}))}finish(){for(;this._inSnippet.get();)this.next()}cancel(e=!1){var t;this._inSnippet.reset(),this._hasPrevTabstop.reset(),this._hasNextTabstop.reset(),this._snippetListener.clear(),this._currentChoice=void 0,(t=this._session)===null||t===void 0||t.dispose(),this._session=void 0,this._modelVersionId=-1,e&&this._editor.setSelections([this._editor.getSelection()])}prev(){var e;(e=this._session)===null||e===void 0||e.prev(),this._updateState()}next(){var e;(e=this._session)===null||e===void 0||e.next(),this._updateState()}isInSnippet(){return!!this._inSnippet.get()}};xs.ID="snippetController2";xs.InSnippetMode=new Ve("inSnippetMode",!1,m("inSnippetMode","Whether the editor in current in snippet mode"));xs.HasNextTabstop=new Ve("hasNextTabstop",!1,m("hasNextTabstop","Whether there is a next tab stop when in snippet mode"));xs.HasPrevTabstop=new Ve("hasPrevTabstop",!1,m("hasPrevTabstop","Whether there is a previous tab stop when in snippet mode"));xs=Z_=f8e([Sk(1,aa),Sk(2,Ze),Sk(3,bt),Sk(4,Ni)],xs);ti(xs.ID,xs,4);const MN=fs.bindToContribution(xs.get);Re(new MN({id:"jumpToNextSnippetPlaceholder",precondition:fe.and(xs.InSnippetMode,xs.HasNextTabstop),handler:n=>n.next(),kbOpts:{weight:100+30,kbExpr:O.editorTextFocus,primary:2}}));Re(new MN({id:"jumpToPrevSnippetPlaceholder",precondition:fe.and(xs.InSnippetMode,xs.HasPrevTabstop),handler:n=>n.prev(),kbOpts:{weight:100+30,kbExpr:O.editorTextFocus,primary:1026}}));Re(new MN({id:"leaveSnippet",precondition:xs.InSnippetMode,handler:n=>n.cancel(!0),kbOpts:{weight:100+30,kbExpr:O.editorTextFocus,primary:9,secondary:[1033]}}));Re(new MN({id:"acceptSnippet",precondition:xs.InSnippetMode,handler:n=>n.finish()}));var g8e=globalThis&&globalThis.__decorate||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},RR=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},eu=globalThis&&globalThis.__awaiter||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())})},Rr;(function(n){n[n.Undo=0]="Undo",n[n.Redo=1]="Redo",n[n.AcceptWord=2]="AcceptWord",n[n.Other=3]="Other"})(Rr||(Rr={}));let a5=class extends te{get isAcceptingPartially(){return this._isAcceptingPartially}constructor(e,t,i,s,o,r,a,l,c,d,u,h){super(),this.textModel=e,this.selectedSuggestItem=t,this.cursorPosition=i,this.textModelVersionId=s,this._debounceValue=o,this._suggestPreviewEnabled=r,this._suggestPreviewMode=a,this._inlineSuggestMode=l,this._enabled=c,this._instantiationService=d,this._commandService=u,this._languageConfigurationService=h,this._source=this._register(this._instantiationService.createInstance(r5,this.textModel,this.textModelVersionId,this._debounceValue)),this._isActive=Pi(this,!1),this._forceUpdate=Lte("forceUpdate"),this._selectedInlineCompletionId=Pi(this,void 0),this._isAcceptingPartially=!1,this._preserveCurrentCompletionReasons=new Set([Rr.Redo,Rr.Undo,Rr.AcceptWord]),this._fetchInlineCompletions=YMe({owner:this,createEmptyChangeSummary:()=>({preserveCurrentCompletion:!1,inlineCompletionTriggerKind:Ru.Automatic}),handleChange:(g,p)=>(g.didChange(this.textModelVersionId)&&this._preserveCurrentCompletionReasons.has(g.change)?p.preserveCurrentCompletion=!0:g.didChange(this._forceUpdate)&&(p.inlineCompletionTriggerKind=g.change),!0)},(g,p)=>{if(this._forceUpdate.read(g),!(this._enabled.read(g)&&this.selectedSuggestItem.read(g)||this._isActive.read(g))){this._source.cancelUpdate();return}this.textModelVersionId.read(g);const v=this.selectedInlineCompletion.get(),b=p.preserveCurrentCompletion||v!=null&&v.forwardStable?v:void 0,C=this._source.suggestWidgetInlineCompletions.get(),w=this.selectedSuggestItem.read(g);if(C&&!w){const S=this._source.inlineCompletions.get();Gi(k=>{S&&C.request.versionId>S.request.versionId&&this._source.inlineCompletions.set(C.clone(),k),this._source.clearSuggestWidgetInlineCompletions(k)})}const y=this.cursorPosition.read(g),L={triggerKind:p.inlineCompletionTriggerKind,selectedSuggestionInfo:w==null?void 0:w.toSelectedSuggestionInfo()};return this._source.fetch(y,L,b)}),this._filteredInlineCompletionItems=Ut(this,g=>{const p=this._source.inlineCompletions.read(g);if(!p)return[];const _=this.cursorPosition.read(g);return p.inlineCompletions.filter(b=>b.isVisible(this.textModel,_,g))}),this.selectedInlineCompletionIndex=Ut(this,g=>{const p=this._selectedInlineCompletionId.read(g),_=this._filteredInlineCompletionItems.read(g),v=this._selectedInlineCompletionId===void 0?-1:_.findIndex(b=>b.semanticId===p);return v===-1?(this._selectedInlineCompletionId.set(void 0,void 0),0):v}),this.selectedInlineCompletion=Ut(this,g=>{const p=this._filteredInlineCompletionItems.read(g),_=this.selectedInlineCompletionIndex.read(g);return p[_]}),this.lastTriggerKind=this._source.inlineCompletions.map(g=>g==null?void 0:g.request.context.triggerKind),this.inlineCompletionsCount=Ut(this,g=>{if(this.lastTriggerKind.read(g)===Ru.Explicit)return this._filteredInlineCompletionItems.read(g).length}),this.state=wU({owner:this,equalityComparer:(g,p)=>!g||!p?g===p:qj(g.ghostText,p.ghostText)&&g.inlineCompletion===p.inlineCompletion&&g.suggestItem===p.suggestItem},g=>{var p;const _=this.textModel,v=this.selectedSuggestItem.read(g);if(v){const b=v.toSingleTextEdit().removeCommonPrefix(_),C=this._computeAugmentedCompletion(b,g);if(!this._suggestPreviewEnabled.read(g)&&!C)return;const y=(p=C==null?void 0:C.edit)!==null&&p!==void 0?p:b,L=C?C.edit.text.length-b.text.length:0,S=this._suggestPreviewMode.read(g),k=this.cursorPosition.read(g),D=y.computeGhostText(_,S,k,L);return{ghostText:D!=null?D:new XI(y.range.endLineNumber,[]),inlineCompletion:C==null?void 0:C.completion,suggestItem:v}}else{if(!this._isActive.read(g))return;const b=this.selectedInlineCompletion.read(g);if(!b)return;const C=b.toSingleTextEdit(g),w=this._inlineSuggestMode.read(g),y=this.cursorPosition.read(g),L=C.computeGhostText(_,w,y);return L?{ghostText:L,inlineCompletion:b,suggestItem:void 0}:void 0}}),this.ghostText=wU({owner:this,equalityComparer:qj},g=>{const p=this.state.read(g);if(p)return p.ghostText}),this._register(gy(this._fetchInlineCompletions));let f;this._register(xi(g=>{var p,_;const v=this.state.read(g),b=v==null?void 0:v.inlineCompletion;if((b==null?void 0:b.semanticId)!==(f==null?void 0:f.semanticId)&&(f=b,b)){const C=b.inlineCompletion,w=C.source;(_=(p=w.provider).handleItemDidShow)===null||_===void 0||_.call(p,w.inlineCompletions,C.sourceInlineCompletion,C.insertText)}}))}trigger(e){return eu(this,void 0,void 0,function*(){this._isActive.set(!0,e),yield this._fetchInlineCompletions.get()})}triggerExplicitly(e){return eu(this,void 0,void 0,function*(){K4(e,t=>{this._isActive.set(!0,t),this._forceUpdate.trigger(t,Ru.Explicit)}),yield this._fetchInlineCompletions.get()})}stop(e){K4(e,t=>{this._isActive.set(!1,t),this._source.clear(t)})}_computeAugmentedCompletion(e,t){const i=this.textModel,s=this._source.suggestWidgetInlineCompletions.read(t),o=s?s.inlineCompletions:[this.selectedInlineCompletion.read(t)].filter(uw);return H1e(o,a=>{let l=a.toSingleTextEdit(t);return l=l.removeCommonPrefix(i,I.fromPositions(l.range.getStartPosition(),e.range.getEndPosition())),l.augments(e)?{edit:l,completion:a}:void 0})}_deltaSelectedInlineCompletionIndex(e){return eu(this,void 0,void 0,function*(){yield this.triggerExplicitly();const t=this._filteredInlineCompletionItems.get()||[];if(t.length>0){const i=(this.selectedInlineCompletionIndex.get()+e+t.length)%t.length;this._selectedInlineCompletionId.set(t[i].semanticId,void 0)}else this._selectedInlineCompletionId.set(void 0,void 0)})}next(){return eu(this,void 0,void 0,function*(){yield this._deltaSelectedInlineCompletionIndex(1)})}previous(){return eu(this,void 0,void 0,function*(){yield this._deltaSelectedInlineCompletionIndex(-1)})}accept(e){var t;return eu(this,void 0,void 0,function*(){if(e.getModel()!==this.textModel)throw new Rn;const i=this.state.get();if(!i||i.ghostText.isEmpty()||!i.inlineCompletion)return;const s=i.inlineCompletion.toInlineCompletion(void 0);e.pushUndoStop(),s.snippetInfo?(e.executeEdits("inlineSuggestion.accept",[Yi.replaceMove(s.range,""),...s.additionalTextEdits]),e.setPosition(s.snippetInfo.range.getStartPosition()),(t=xs.get(e))===null||t===void 0||t.insert(s.snippetInfo.snippet,{undoStopBefore:!1})):e.executeEdits("inlineSuggestion.accept",[Yi.replaceMove(s.range,s.insertText),...s.additionalTextEdits]),s.command&&s.source.addRef(),Gi(o=>{this._source.clear(o),this._isActive.set(!1,o)}),s.command&&(yield this._commandService.executeCommand(s.command.id,...s.command.arguments||[]).then(void 0,Bn),s.source.removeRef())})}acceptNextWord(e){return eu(this,void 0,void 0,function*(){yield this._acceptNext(e,(t,i)=>{const s=this.textModel.getLanguageIdAtPosition(t.lineNumber,t.column),o=this._languageConfigurationService.getLanguageConfiguration(s),r=new RegExp(o.wordDefinition.source,o.wordDefinition.flags.replace("g","")),a=i.match(r);let l=0;a&&a.index!==void 0?a.index===0?l=a[0].length:l=a.index:l=i.length;const d=/\s+/g.exec(i);return d&&d.index!==void 0&&d.index+d[0].length{const s=i.match(/\n/);return s&&s.index!==void 0?s.index+1:i.length})})}_acceptNext(e,t){return eu(this,void 0,void 0,function*(){if(e.getModel()!==this.textModel)throw new Rn;const i=this.state.get();if(!i||i.ghostText.isEmpty()||!i.inlineCompletion)return;const s=i.ghostText,o=i.inlineCompletion.toInlineCompletion(void 0);if(o.snippetInfo||o.filterText!==o.insertText){yield this.accept(e);return}const r=s.parts[0],a=new Y(s.lineNumber,r.column),l=r.lines.join("\n"),c=t(a,l);if(c===l.length&&s.parts.length===1){this.accept(e);return}const d=l.substring(0,c);this._isAcceptingPartially=!0;try{e.pushUndoStop(),e.executeEdits("inlineSuggestion.accept",[Yi.replace(I.fromPositions(a),d)]);const u=i5(d);e.setPosition(t5(a,u))}finally{this._isAcceptingPartially=!1}if(o.source.provider.handlePartialAccept){const u=I.fromPositions(o.range.getStartPosition(),t5(a,i5(d))),h=e.getModel().getValueInRange(u,1);o.source.provider.handlePartialAccept(o.source.inlineCompletions,o.sourceInlineCompletion,h.length)}})}handleSuggestAccepted(e){var t,i;const s=e.toSingleTextEdit().removeCommonPrefix(this.textModel),o=this._computeAugmentedCompletion(s,void 0);if(!o)return;const r=o.completion.inlineCompletion;(i=(t=r.source.provider).handlePartialAccept)===null||i===void 0||i.call(t,r.source.inlineCompletions,r.sourceInlineCompletion,s.text.length)}};a5=g8e([RR(9,_t),RR(10,gn),RR(11,Ni)],a5);var p8e=globalThis&&globalThis.__decorate||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},hK=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},iC;class u6{constructor(e){this.name=e}select(e,t,i){if(i.length===0)return 0;const s=i[0].score[0];for(let o=0;ol&&u.type===i[c].completion.kind&&u.insertText===i[c].completion.insertText&&(l=u.touch,a=c),i[c].completion.preselect&&r===-1)return r=c}return a!==-1?a:r!==-1?r:0}toJSON(){return this._cache.toJSON()}fromJSON(e){this._cache.clear();const t=0;for(const[i,s]of e)s.touch=t,s.type=typeof s.type=="number"?s.type:pw.fromString(s.type),this._cache.set(i,s);this._seq=this._cache.size}}class _8e extends u6{constructor(){super("recentlyUsedByPrefix"),this._trie=eb.forStrings(),this._seq=0}memorize(e,t,i){const{word:s}=e.getWordUntilPosition(t),o="".concat(e.getLanguageId(),"/").concat(s);this._trie.set(o,{type:i.completion.kind,insertText:i.completion.insertText,touch:this._seq++})}select(e,t,i){const{word:s}=e.getWordUntilPosition(t);if(!s)return super.select(e,t,i);const o="".concat(e.getLanguageId(),"/").concat(s);let r=this._trie.get(o);if(r||(r=this._trie.findSubstr(o)),r)for(let a=0;ae.push([i,t])),e.sort((t,i)=>-(t[1].touch-i[1].touch)).forEach((t,i)=>t[1].touch=i),e.slice(0,200)}fromJSON(e){if(this._trie.clear(),e.length>0){this._seq=e[0][1].touch+1;for(const[t,i]of e)i.type=typeof i.type=="number"?i.type:pw.fromString(i.type),this._trie.set(t,i)}}}let Ey=iC=class{constructor(e,t){this._storageService=e,this._configService=t,this._disposables=new be,this._persistSoon=new Si(()=>this._saveState(),500),this._disposables.add(e.onWillSaveState(i=>{i.reason===lI.SHUTDOWN&&this._saveState()}))}dispose(){this._disposables.dispose(),this._persistSoon.dispose()}memorize(e,t,i){this._withStrategy(e,t).memorize(e,t,i),this._persistSoon.schedule()}select(e,t,i){return this._withStrategy(e,t).select(e,t,i)}_withStrategy(e,t){var i;const s=this._configService.getValue("editor.suggestSelection",{overrideIdentifier:e.getLanguageIdAtPosition(t.lineNumber,t.column),resource:e.uri});if(((i=this._strategy)===null||i===void 0?void 0:i.name)!==s){this._saveState();const o=iC._strategyCtors.get(s)||Xne;this._strategy=new o;try{const a=this._configService.getValue("editor.suggest.shareSuggestSelections")?0:1,l=this._storageService.get("".concat(iC._storagePrefix,"/").concat(s),a);l&&this._strategy.fromJSON(JSON.parse(l))}catch{}}return this._strategy}_saveState(){if(this._strategy){const t=this._configService.getValue("editor.suggest.shareSuggestSelections")?0:1,i=JSON.stringify(this._strategy);this._storageService.store("".concat(iC._storagePrefix,"/").concat(this._strategy.name),i,t,1)}}};Ey._strategyCtors=new Map([["recentlyUsedByPrefix",_8e],["recentlyUsed",m8e],["first",Xne]]);Ey._storagePrefix="suggest/memories";Ey=iC=p8e([hK(0,yl),hK(1,zt)],Ey);const RN=Wt("ISuggestMemories");Gt(RN,Ey,1);var v8e=globalThis&&globalThis.__decorate||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},b8e=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},l5;let Iy=l5=class{constructor(e,t){this._editor=e,this._enabled=!1,this._ckAtEnd=l5.AtEnd.bindTo(t),this._configListener=this._editor.onDidChangeConfiguration(i=>i.hasChanged(122)&&this._update()),this._update()}dispose(){var e;this._configListener.dispose(),(e=this._selectionListener)===null||e===void 0||e.dispose(),this._ckAtEnd.reset()}_update(){const e=this._editor.getOption(122)==="on";if(this._enabled!==e)if(this._enabled=e,this._enabled){const t=()=>{if(!this._editor.hasModel()){this._ckAtEnd.set(!1);return}const i=this._editor.getModel(),s=this._editor.getSelection(),o=i.getWordAtPosition(s.getStartPosition());if(!o){this._ckAtEnd.set(!1);return}this._ckAtEnd.set(o.endColumn===s.getStartPosition().column)};this._selectionListener=this._editor.onDidChangeCursorSelection(t),t()}else this._selectionListener&&(this._ckAtEnd.reset(),this._selectionListener.dispose(),this._selectionListener=void 0)}};Iy.AtEnd=new Ve("atEndOfWord",!1);Iy=l5=v8e([b8e(1,bt)],Iy);var C8e=globalThis&&globalThis.__decorate||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},w8e=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},nC;let Tm=nC=class{constructor(e,t){this._editor=e,this._index=0,this._ckOtherSuggestions=nC.OtherSuggestions.bindTo(t)}dispose(){this.reset()}reset(){var e;this._ckOtherSuggestions.reset(),(e=this._listener)===null||e===void 0||e.dispose(),this._model=void 0,this._acceptNext=void 0,this._ignore=!1}set({model:e,index:t},i){if(e.items.length===0){this.reset();return}if(nC._moveIndex(!0,e,t)===t){this.reset();return}this._acceptNext=i,this._model=e,this._index=t,this._listener=this._editor.onDidChangeCursorPosition(()=>{this._ignore||this.reset()}),this._ckOtherSuggestions.set(!0)}static _moveIndex(e,t,i){let s=i;for(let o=t.items.length;o>0&&(s=(s+t.items.length+(e?1:-1))%t.items.length,!(s===i||!t.items[s].completion.additionalTextEdits));o--);return s}next(){this._move(!0)}prev(){this._move(!1)}_move(e){if(this._model)try{this._ignore=!0,this._index=nC._moveIndex(e,this._model,this._index),this._acceptNext({index:this._index,item:this._model.items[this._index],model:this._model})}finally{this._ignore=!1}}};Tm.OtherSuggestions=new Ve("hasOtherSuggestions",!1);Tm=nC=C8e([w8e(1,bt)],Tm);class y8e{constructor(e,t,i,s){this._disposables=new be,this._disposables.add(i.onDidSuggest(o=>{o.completionModel.items.length===0&&this.reset()})),this._disposables.add(i.onDidCancel(o=>{this.reset()})),this._disposables.add(t.onDidShow(()=>this._onItem(t.getFocusedItem()))),this._disposables.add(t.onDidFocus(this._onItem,this)),this._disposables.add(t.onDidHide(this.reset,this)),this._disposables.add(e.onWillType(o=>{if(this._active&&!t.isFrozen()&&i.state!==0){const r=o.charCodeAt(o.length-1);this._active.acceptCharacters.has(r)&&e.getOption(0)&&s(this._active.item)}}))}_onItem(e){if(!e||!io(e.item.completion.commitCharacters)){this.reset();return}if(this._active&&this._active.item.item===e.item)return;const t=new kE;for(const i of e.item.completion.commitCharacters)i.length>0&&t.add(i.charCodeAt(0));this._active={acceptCharacters:t,item:e}}reset(){this._active=void 0}dispose(){this._disposables.dispose()}}var S8e=globalThis&&globalThis.__awaiter||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 Pr{provideSelectionRanges(e,t){return S8e(this,void 0,void 0,function*(){const i=[];for(const s of t){const o=[];i.push(o);const r=new Map;yield new Promise(a=>Pr._bracketsRightYield(a,0,e,s,r)),yield new Promise(a=>Pr._bracketsLeftYield(a,0,e,s,r,o))}return i})}static _bracketsRightYield(e,t,i,s,o){const r=new Map,a=Date.now();for(;;){if(t>=Pr._maxRounds){e();break}if(!s){e();break}const l=i.bracketPairs.findNextBracket(s);if(!l){e();break}if(Date.now()-a>Pr._maxDuration){setTimeout(()=>Pr._bracketsRightYield(e,t+1,i,s,o));break}if(l.bracketInfo.isOpeningBracket){const d=l.bracketInfo.bracketText,u=r.has(d)?r.get(d):0;r.set(d,u+1)}else{const d=l.bracketInfo.getOpeningBrackets()[0].bracketText;let u=r.has(d)?r.get(d):0;if(u-=1,r.set(d,Math.max(0,u)),u<0){let h=o.get(d);h||(h=new To,o.set(d,h)),h.push(l.range)}}s=l.range.getEndPosition()}}static _bracketsLeftYield(e,t,i,s,o,r){const a=new Map,l=Date.now();for(;;){if(t>=Pr._maxRounds&&o.size===0){e();break}if(!s){e();break}const c=i.bracketPairs.findPrevBracket(s);if(!c){e();break}if(Date.now()-l>Pr._maxDuration){setTimeout(()=>Pr._bracketsLeftYield(e,t+1,i,s,o,r));break}if(c.bracketInfo.isOpeningBracket){const u=c.bracketInfo.bracketText;let h=a.has(u)?a.get(u):0;if(h-=1,a.set(u,Math.max(0,h)),h<0){const f=o.get(u);if(f){const g=f.shift();f.size===0&&o.delete(u);const p=I.fromPositions(c.range.getEndPosition(),g.getStartPosition()),_=I.fromPositions(c.range.getStartPosition(),g.getEndPosition());r.push({range:p}),r.push({range:_}),Pr._addBracketLeading(i,_,r)}}}else{const u=c.bracketInfo.getOpeningBrackets()[0].bracketText,h=a.has(u)?a.get(u):0;a.set(u,h+1)}s=c.range.getStartPosition()}}static _addBracketLeading(e,t,i){if(t.startLineNumber===t.endLineNumber)return;const s=t.startLineNumber,o=e.getLineFirstNonWhitespaceColumn(s);o!==0&&o!==t.startColumn&&(i.push({range:I.fromPositions(new Y(s,o),t.getEndPosition())}),i.push({range:I.fromPositions(new Y(s,1),t.getEndPosition())}));const r=s-1;if(r>0){const a=e.getLineFirstNonWhitespaceColumn(r);a===t.startColumn&&a!==e.getLineLastNonWhitespaceColumn(r)&&(i.push({range:I.fromPositions(new Y(r,a),t.getEndPosition())}),i.push({range:I.fromPositions(new Y(r,1),t.getEndPosition())}))}}}Pr._maxDuration=30;Pr._maxRounds=2;var L8e=globalThis&&globalThis.__awaiter||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 Kl{static create(e,t){return L8e(this,void 0,void 0,function*(){if(!t.getOption(117).localityBonus||!t.hasModel())return Kl.None;const i=t.getModel(),s=t.getPosition();if(!e.canComputeWordRanges(i.uri))return Kl.None;const[o]=yield new Pr().provideSelectionRanges(i,[s]);if(o.length===0)return Kl.None;const r=yield e.computeWordRanges(i.uri,o[0].range);if(!r)return Kl.None;const a=i.getWordUntilPosition(s);return delete r[a.word],new class extends Kl{distance(l,c){if(!s.equals(t.getPosition()))return 0;if(c.kind===17)return 2<<20;const d=typeof c.label=="string"?c.label:c.label.label,u=r[d];if(UZ(u))return 2<<20;const h=cw(u,I.fromPositions(l),I.compareRangesUsingStarts),f=h>=0?u[h]:u[Math.max(0,~h-1)];let g=o.length;for(const p of o){if(!I.containsRange(p.range,f))break;g-=1}return g}}})}}Kl.None=new class extends Kl{distance(){return 0}};let fK=class{constructor(e,t){this.leadingLineContent=e,this.characterCountDelta=t}};class Kh{constructor(e,t,i,s,o,r,a=Fx.default,l=void 0){this.clipboardText=l,this._snippetCompareFn=Kh._compareCompletionItems,this._items=e,this._column=t,this._wordDistance=s,this._options=o,this._refilterKind=1,this._lineContext=i,this._fuzzyScoreOptions=a,r==="top"?this._snippetCompareFn=Kh._compareCompletionItemsSnippetsUp:r==="bottom"&&(this._snippetCompareFn=Kh._compareCompletionItemsSnippetsDown)}get lineContext(){return this._lineContext}set lineContext(e){(this._lineContext.leadingLineContent!==e.leadingLineContent||this._lineContext.characterCountDelta!==e.characterCountDelta)&&(this._refilterKind=this._lineContext.characterCountDelta0&&i[0].container.incomplete&&e.add(t);return e}get stats(){return this._ensureCachedState(),this._stats}_ensureCachedState(){this._refilterKind!==0&&this._createCachedState()}_createCachedState(){this._itemsByProvider=new Map;const e=[],{leadingLineContent:t,characterCountDelta:i}=this._lineContext;let s="",o="";const r=this._refilterKind===1?this._items:this._filteredItems,a=[],l=!this._options.filterGraceful||r.length>2e3?fm:BTe;for(let c=0;c=f)d.score=lc.Default;else if(typeof d.completion.filterText=="string"){const p=l(s,o,g,d.completion.filterText,d.filterTextLow,0,this._fuzzyScoreOptions);if(!p)continue;PP(d.completion.filterText,d.textLabel)===0?d.score=p:(d.score=RTe(s,o,g,d.textLabel,d.labelLow,0),d.score[0]=p[0])}else{const p=l(s,o,g,d.textLabel,d.labelLow,0,this._fuzzyScoreOptions);if(!p)continue;d.score=p}}d.idx=c,d.distance=this._wordDistance.distance(d.position,d.completion),a.push(d),e.push(d.textLabel.length)}this._filteredItems=a.sort(this._snippetCompareFn),this._refilterKind=0,this._stats={pLabelLen:e.length?W2(e.length-.85,e,(c,d)=>c-d):0}}static _compareCompletionItems(e,t){return e.score[0]>t.score[0]?-1:e.score[0]t.distance?1:e.idxt.idx?1:0}static _compareCompletionItemsSnippetsDown(e,t){if(e.completion.kind!==t.completion.kind){if(e.completion.kind===27)return 1;if(t.completion.kind===27)return-1}return Kh._compareCompletionItems(e,t)}static _compareCompletionItemsSnippetsUp(e,t){if(e.completion.kind!==t.completion.kind){if(e.completion.kind===27)return-1;if(t.completion.kind===27)return 1}return Kh._compareCompletionItems(e,t)}}var k8e=globalThis&&globalThis.__decorate||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},Ch=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},D8e=globalThis&&globalThis.__awaiter||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())})},c5;class Qg{static shouldAutoTrigger(e){if(!e.hasModel())return!1;const t=e.getModel(),i=e.getPosition();t.tokenization.tokenizeIfCheap(i.lineNumber);const s=t.getWordAtPosition(i);return!(!s||s.endColumn!==i.column&&s.startColumn+1!==i.column||!isNaN(Number(s.word)))}constructor(e,t,i){this.leadingLineContent=e.getLineContent(t.lineNumber).substr(0,t.column-1),this.leadingWord=e.getWordUntilPosition(t),this.lineNumber=t.lineNumber,this.column=t.column,this.triggerOptions=i}}function E8e(n,e,t){if(!e.getContextKeyValue(us.inlineSuggestionVisible.key))return!0;const i=e.getContextKeyValue(us.suppressSuggestions.key);return i!==void 0?!i:!n.getOption(62).suppressSuggestions}function I8e(n,e,t){if(!e.getContextKeyValue("inlineSuggestionVisible"))return!0;const i=e.getContextKeyValue(us.suppressSuggestions.key);return i!==void 0?!i:!n.getOption(62).suppressSuggestions}let d5=c5=class{constructor(e,t,i,s,o,r,a,l,c){this._editor=e,this._editorWorkerService=t,this._clipboardService=i,this._telemetryService=s,this._logService=o,this._contextKeyService=r,this._configurationService=a,this._languageFeaturesService=l,this._envService=c,this._toDispose=new be,this._triggerCharacterListener=new be,this._triggerQuickSuggest=new _l,this._triggerState=void 0,this._completionDisposables=new be,this._onDidCancel=new j,this._onDidTrigger=new j,this._onDidSuggest=new j,this.onDidCancel=this._onDidCancel.event,this.onDidTrigger=this._onDidTrigger.event,this.onDidSuggest=this._onDidSuggest.event,this._telemetryGate=0,this._currentSelection=this._editor.getSelection()||new Je(1,1,1,1),this._toDispose.add(this._editor.onDidChangeModel(()=>{this._updateTriggerCharacters(),this.cancel()})),this._toDispose.add(this._editor.onDidChangeModelLanguage(()=>{this._updateTriggerCharacters(),this.cancel()})),this._toDispose.add(this._editor.onDidChangeConfiguration(()=>{this._updateTriggerCharacters()})),this._toDispose.add(this._languageFeaturesService.completionProvider.onDidChange(()=>{this._updateTriggerCharacters(),this._updateActiveSuggestSession()}));let d=!1;this._toDispose.add(this._editor.onDidCompositionStart(()=>{d=!0})),this._toDispose.add(this._editor.onDidCompositionEnd(()=>{d=!1,this._onCompositionEnd()})),this._toDispose.add(this._editor.onDidChangeCursorSelection(u=>{d||this._onCursorChange(u)})),this._toDispose.add(this._editor.onDidChangeModelContent(()=>{!d&&this._triggerState!==void 0&&this._refilterCompletionItems()})),this._updateTriggerCharacters()}dispose(){fi(this._triggerCharacterListener),fi([this._onDidCancel,this._onDidSuggest,this._onDidTrigger,this._triggerQuickSuggest]),this._toDispose.dispose(),this._completionDisposables.dispose(),this.cancel()}_updateTriggerCharacters(){if(this._triggerCharacterListener.clear(),this._editor.getOption(90)||!this._editor.hasModel()||!this._editor.getOption(120))return;const e=new Map;for(const i of this._languageFeaturesService.completionProvider.all(this._editor.getModel()))for(const s of i.triggerCharacters||[]){let o=e.get(s);o||(o=new Set,o.add(n8e()),e.set(s,o)),o.add(i)}const t=i=>{var s;if(!I8e(this._editor,this._contextKeyService,this._configurationService)||Qg.shouldAutoTrigger(this._editor))return;if(!i){const a=this._editor.getPosition();i=this._editor.getModel().getLineContent(a.lineNumber).substr(0,a.column-1)}let o="";rm(i.charCodeAt(i.length-1))?es(i.charCodeAt(i.length-2))&&(o=i.substr(i.length-2)):o=i.charAt(i.length-1);const r=e.get(o);if(r){const a=new Map;if(this._completionModel)for(const[l,c]of this._completionModel.getItemsByProvider())r.has(l)||a.set(l,c);this.trigger({auto:!0,triggerKind:1,triggerCharacter:o,retrigger:!!this._completionModel,clipboardText:(s=this._completionModel)===null||s===void 0?void 0:s.clipboardText,completionOptions:{providerFilter:r,providerItemsToReuse:a}})}};this._triggerCharacterListener.add(this._editor.onDidType(t)),this._triggerCharacterListener.add(this._editor.onDidCompositionEnd(()=>t()))}get state(){return this._triggerState?this._triggerState.auto?2:1:0}cancel(e=!1){var t;this._triggerState!==void 0&&(this._triggerQuickSuggest.cancel(),(t=this._requestToken)===null||t===void 0||t.cancel(),this._requestToken=void 0,this._triggerState=void 0,this._completionModel=void 0,this._context=void 0,this._onDidCancel.fire({retrigger:e}))}clear(){this._completionDisposables.clear()}_updateActiveSuggestSession(){this._triggerState!==void 0&&(!this._editor.hasModel()||!this._languageFeaturesService.completionProvider.has(this._editor.getModel())?this.cancel():this.trigger({auto:this._triggerState.auto,retrigger:!0}))}_onCursorChange(e){if(!this._editor.hasModel())return;const t=this._currentSelection;if(this._currentSelection=this._editor.getSelection(),!e.selection.isEmpty()||e.reason!==0&&e.reason!==3||e.source!=="keyboard"&&e.source!=="deleteLeft"){this.cancel();return}this._triggerState===void 0&&e.reason===0?(t.containsRange(this._currentSelection)||t.getEndPosition().isBeforeOrEqual(this._currentSelection.getPosition()))&&this._doTriggerQuickSuggest():this._triggerState!==void 0&&e.reason===3&&this._refilterCompletionItems()}_onCompositionEnd(){this._triggerState===void 0?this._doTriggerQuickSuggest():this._refilterCompletionItems()}_doTriggerQuickSuggest(){var e;Lv.isAllOff(this._editor.getOption(88))||this._editor.getOption(117).snippetsPreventQuickSuggestions&&(!((e=xs.get(this._editor))===null||e===void 0)&&e.isInSnippet())||(this.cancel(),this._triggerQuickSuggest.cancelAndSet(()=>{if(this._triggerState!==void 0||!Qg.shouldAutoTrigger(this._editor)||!this._editor.hasModel()||!this._editor.hasWidgetFocus())return;const t=this._editor.getModel(),i=this._editor.getPosition(),s=this._editor.getOption(88);if(!Lv.isAllOff(s)){if(!Lv.isAllOn(s)){t.tokenization.tokenizeIfCheap(i.lineNumber);const o=t.tokenization.getLineTokens(i.lineNumber),r=o.getStandardTokenType(o.findTokenIndexAtOffset(Math.max(i.column-1-1,0)));if(Lv.valueFor(s,r)!=="on")return}E8e(this._editor,this._contextKeyService,this._configurationService)&&this._languageFeaturesService.completionProvider.has(t)&&this.trigger({auto:!0})}},this._editor.getOption(89)))}_refilterCompletionItems(){bi(this._editor.hasModel()),bi(this._triggerState!==void 0);const e=this._editor.getModel(),t=this._editor.getPosition(),i=new Qg(e,t,Object.assign(Object.assign({},this._triggerState),{refilter:!0}));this._onNewContext(i)}trigger(e){var t,i,s,o,r,a;if(!this._editor.hasModel())return;const l=this._editor.getModel(),c=new Qg(l,this._editor.getPosition(),e);this.cancel(e.retrigger),this._triggerState=e,this._onDidTrigger.fire({auto:e.auto,shy:(t=e.shy)!==null&&t!==void 0?t:!1,position:this._editor.getPosition()}),this._context=c;let d={triggerKind:(i=e.triggerKind)!==null&&i!==void 0?i:0};e.triggerCharacter&&(d={triggerKind:1,triggerCharacter:e.triggerCharacter}),this._requestToken=new Tn;const u=this._editor.getOption(111);let h=1;switch(u){case"top":h=0;break;case"bottom":h=2;break}const{itemKind:f,showDeprecated:g}=c5._createSuggestFilter(this._editor),p=new Dy(h,(o=(s=e.completionOptions)===null||s===void 0?void 0:s.kindFilter)!==null&&o!==void 0?o:f,(r=e.completionOptions)===null||r===void 0?void 0:r.providerFilter,(a=e.completionOptions)===null||a===void 0?void 0:a.providerItemsToReuse,g),_=Kl.create(this._editorWorkerService,this._editor),v=c6(this._languageFeaturesService.completionProvider,l,this._editor.getPosition(),p,d,this._requestToken.token);Promise.all([v,_]).then(([b,C])=>D8e(this,void 0,void 0,function*(){var w;if((w=this._requestToken)===null||w===void 0||w.dispose(),!this._editor.hasModel())return;let y=e==null?void 0:e.clipboardText;if(!y&&b.needsClipboard&&(y=yield this._clipboardService.readText()),this._triggerState===void 0)return;const L=this._editor.getModel(),S=new Qg(L,this._editor.getPosition(),e),k=Object.assign(Object.assign({},Fx.default),{firstMatchCanBeWeak:!this._editor.getOption(117).matchOnWordStartOnly});if(this._completionModel=new Kh(b.items,this._context.column,{leadingLineContent:S.leadingLineContent,characterCountDelta:S.column-this._context.column},C,this._editor.getOption(117),this._editor.getOption(111),k,y),this._completionDisposables.add(b.disposable),this._onNewContext(S),this._reportDurationsTelemetry(b.durations),!this._envService.isBuilt||this._envService.isExtensionDevelopment)for(const D of b.items)D.isInvalid&&this._logService.warn("[suggest] did IGNORE invalid completion item from ".concat(D.provider._debugDisplayName),D.completion)})).catch(Dt)}_reportDurationsTelemetry(e){this._telemetryGate++%230===0&&setTimeout(()=>{this._telemetryService.publicLog2("suggest.durations.json",{data:JSON.stringify(e)}),this._logService.debug("suggest.durations.json",e)})}static _createSuggestFilter(e){const t=new Set;e.getOption(111)==="none"&&t.add(27);const s=e.getOption(117);return s.showMethods||t.add(0),s.showFunctions||t.add(1),s.showConstructors||t.add(2),s.showFields||t.add(3),s.showVariables||t.add(4),s.showClasses||t.add(5),s.showStructs||t.add(6),s.showInterfaces||t.add(7),s.showModules||t.add(8),s.showProperties||t.add(9),s.showEvents||t.add(10),s.showOperators||t.add(11),s.showUnits||t.add(12),s.showValues||t.add(13),s.showConstants||t.add(14),s.showEnums||t.add(15),s.showEnumMembers||t.add(16),s.showKeywords||t.add(17),s.showWords||t.add(18),s.showColors||t.add(19),s.showFiles||t.add(20),s.showReferences||t.add(21),s.showColors||t.add(22),s.showFolders||t.add(23),s.showTypeParameters||t.add(24),s.showSnippets||t.add(27),s.showUsers||t.add(25),s.showIssues||t.add(26),{itemKind:t,showDeprecated:s.showDeprecated}}_onNewContext(e){if(this._context){if(e.lineNumber!==this._context.lineNumber){this.cancel();return}if(ki(e.leadingLineContent)!==ki(this._context.leadingLineContent)){this.cancel();return}if(e.columnthis._context.leadingWord.startColumn){if(Qg.shouldAutoTrigger(this._editor)&&this._context){const i=this._completionModel.getItemsByProvider();this.trigger({auto:this._context.triggerOptions.auto,retrigger:!0,clipboardText:this._completionModel.clipboardText,completionOptions:{providerItemsToReuse:i}})}return}if(e.column>this._context.column&&this._completionModel.getIncompleteProvider().size>0&&e.leadingWord.word.length!==0){const t=new Map,i=new Set;for(const[s,o]of this._completionModel.getItemsByProvider())o.length>0&&o[0].container.incomplete?i.add(s):t.set(s,o);this.trigger({auto:this._context.triggerOptions.auto,triggerKind:2,retrigger:!0,clipboardText:this._completionModel.clipboardText,completionOptions:{providerFilter:i,providerItemsToReuse:t}})}else{const t=this._completionModel.lineContext;let i=!1;if(this._completionModel.lineContext={leadingLineContent:e.leadingLineContent,characterCountDelta:e.column-this._context.column},this._completionModel.items.length===0){const s=Qg.shouldAutoTrigger(this._editor);if(!this._context){this.cancel();return}if(s&&this._context.leadingWord.endColumn0,i&&e.leadingWord.word.length===0){this.cancel();return}}this._onDidSuggest.fire({completionModel:this._completionModel,triggerOptions:e.triggerOptions,isFrozen:i})}}}}};d5=c5=k8e([Ch(1,Sl),Ch(2,ch),Ch(3,ra),Ch(4,aa),Ch(5,bt),Ch(6,zt),Ch(7,Ze),Ch(8,A9)],d5);class PN{constructor(e,t){this._disposables=new be,this._lastOvertyped=[],this._locked=!1,this._disposables.add(e.onWillType(()=>{if(this._locked||!e.hasModel())return;const i=e.getSelections(),s=i.length;let o=!1;for(let a=0;aPN._maxSelectionLength)return;this._lastOvertyped[a]={value:r.getValueInRange(l),multiline:l.startLineNumber!==l.endLineNumber}}})),this._disposables.add(t.onDidTrigger(i=>{this._locked=!0})),this._disposables.add(t.onDidCancel(i=>{this._locked=!1}))}getLastOvertypedInfo(e){if(e>=0&&e=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},PR=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};class h6 extends gm{updateLabel(){const e=this._keybindingService.lookupKeybinding(this._action.id,this._contextKeyService);if(!e)return super.updateLabel();this.label&&(this.label.textContent=m({key:"content",comment:["A label","A keybinding"]},"{0} ({1})",this._action.label,h6.symbolPrintEnter(e)))}static symbolPrintEnter(e){var t;return(t=e.getLabel())===null||t===void 0?void 0:t.replace(/\benter\b/gi,"⏎")}}let u5=class{constructor(e,t,i,s,o){this._menuId=t,this._menuService=s,this._contextKeyService=o,this._menuDisposables=new be,this.element=ge(e,ye(".suggest-status-bar"));const r=a=>a instanceof fl?i.createInstance(h6,a,void 0):void 0;this._leftActions=new Pa(this.element,{actionViewItemProvider:r}),this._rightActions=new Pa(this.element,{actionViewItemProvider:r}),this._leftActions.domNode.classList.add("left"),this._rightActions.domNode.classList.add("right")}dispose(){this._menuDisposables.dispose(),this._leftActions.dispose(),this._rightActions.dispose(),this.element.remove()}show(){const e=this._menuService.createMenu(this._menuId,this._contextKeyService),t=()=>{const i=[],s=[];for(const[o,r]of e.getActions())o==="left"?i.push(...r):s.push(...r);this._leftActions.clear(),this._leftActions.push(i),this._rightActions.clear(),this._rightActions.push(s)};this._menuDisposables.add(e.onDidChange(()=>t())),this._menuDisposables.add(e)}hide(){this._menuDisposables.clear()}};u5=T8e([PR(2,_t),PR(3,Vd),PR(4,bt)],u5);var x8e=globalThis&&globalThis.__decorate||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},N8e=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};function f6(n){return!!n&&!!(n.completion.documentation||n.completion.detail&&n.completion.detail!==n.completion.label)}let h5=class{constructor(e,t){this._editor=e,this._onDidClose=new j,this.onDidClose=this._onDidClose.event,this._onDidChangeContents=new j,this.onDidChangeContents=this._onDidChangeContents.event,this._disposables=new be,this._renderDisposeable=new be,this._borderWidth=1,this._size=new ii(330,0),this.domNode=ye(".suggest-details"),this.domNode.classList.add("no-docs"),this._markdownRenderer=t.createInstance(Zu,{editor:e}),this._body=ye(".body"),this._scrollbar=new bS(this._body,{alwaysConsumeMouseWheel:!0}),ge(this.domNode,this._scrollbar.getDomNode()),this._disposables.add(this._scrollbar),this._header=ge(this._body,ye(".header")),this._close=ge(this._header,ye("span"+dt.asCSSSelector(Me.close))),this._close.title=m("details.close","Close"),this._type=ge(this._header,ye("p.type")),this._docs=ge(this._body,ye("p.docs")),this._configureFont(),this._disposables.add(this._editor.onDidChangeConfiguration(i=>{i.hasChanged(50)&&this._configureFont()}))}dispose(){this._disposables.dispose(),this._renderDisposeable.dispose()}_configureFont(){const e=this._editor.getOptions(),t=e.get(50),i=t.getMassagedFontFamily(),s=e.get(118)||t.fontSize,o=e.get(119)||t.lineHeight,r=t.fontWeight,a="".concat(s,"px"),l="".concat(o,"px");this.domNode.style.fontSize=a,this.domNode.style.lineHeight="".concat(o/s),this.domNode.style.fontWeight=r,this.domNode.style.fontFeatureSettings=t.fontFeatureSettings,this._type.style.fontFamily=i,this._close.style.height=l,this._close.style.width=l}getLayoutInfo(){const e=this._editor.getOption(119)||this._editor.getOption(50).lineHeight,t=this._borderWidth,i=t*2;return{lineHeight:e,borderWidth:t,borderHeight:i,verticalPadding:22,horizontalPadding:14}}renderLoading(){this._type.textContent=m("loading","Loading..."),this._docs.textContent="",this.domNode.classList.remove("no-docs","no-type"),this.layout(this.size.width,this.getLayoutInfo().lineHeight*2),this._onDidChangeContents.fire(this)}renderItem(e,t){var i,s;this._renderDisposeable.clear();let{detail:o,documentation:r}=e.completion;if(t){let a="";a+="score: ".concat(e.score[0],"\n"),a+="prefix: ".concat((i=e.word)!==null&&i!==void 0?i:"(no prefix)","\n"),a+="word: ".concat(e.completion.filterText?e.completion.filterText+" (filterText)":e.textLabel,"\n"),a+="distance: ".concat(e.distance," (localityBonus-setting)\n"),a+="index: ".concat(e.idx,", based on ").concat(e.completion.sortText&&'sortText: "'.concat(e.completion.sortText,'"')||"label","\n"),a+="commit_chars: ".concat((s=e.completion.commitCharacters)===null||s===void 0?void 0:s.join(""),"\n"),r=new Bs().appendCodeblock("empty",a),o="Provider: ".concat(e.provider._debugDisplayName)}if(!t&&!f6(e)){this.clearContents();return}if(this.domNode.classList.remove("no-docs","no-type"),o){const a=o.length>1e5?"".concat(o.substr(0,1e5),"…"):o;this._type.textContent=a,this._type.title=a,mr(this._type),this._type.classList.toggle("auto-wrap",!/\r?\n^\s+/gmi.test(a))}else Ds(this._type),this._type.title="",Lo(this._type),this.domNode.classList.add("no-type");if(Ds(this._docs),typeof r=="string")this._docs.classList.remove("markdown-docs"),this._docs.textContent=r;else if(r){this._docs.classList.add("markdown-docs"),Ds(this._docs);const a=this._markdownRenderer.render(r);this._docs.appendChild(a.element),this._renderDisposeable.add(a),this._renderDisposeable.add(this._markdownRenderer.onDidRenderAsync(()=>{this.layout(this._size.width,this._type.clientHeight+this._docs.clientHeight),this._onDidChangeContents.fire(this)}))}this.domNode.style.userSelect="text",this.domNode.tabIndex=-1,this._close.onmousedown=a=>{a.preventDefault(),a.stopPropagation()},this._close.onclick=a=>{a.preventDefault(),a.stopPropagation(),this._onDidClose.fire()},this._body.scrollTop=0,this.layout(this._size.width,this._type.clientHeight+this._docs.clientHeight),this._onDidChangeContents.fire(this)}clearContents(){this.domNode.classList.add("no-docs"),this._type.textContent="",this._docs.textContent=""}get size(){return this._size}layout(e,t){const i=new ii(e,t);ii.equals(i,this._size)||(this._size=i,Zbe(this.domNode,e,t)),this._scrollbar.scanDomNode()}scrollDown(e=8){this._body.scrollTop+=e}scrollUp(e=8){this._body.scrollTop-=e}scrollTop(){this._body.scrollTop=0}scrollBottom(){this._body.scrollTop=this._body.scrollHeight}pageDown(){this.scrollDown(80)}pageUp(){this.scrollUp(80)}set borderWidth(e){this._borderWidth=e}get borderWidth(){return this._borderWidth}};h5=x8e([N8e(1,_t)],h5);class A8e{constructor(e,t){this.widget=e,this._editor=t,this._disposables=new be,this._added=!1,this._preferAlignAtTop=!0,this._resizable=new U7,this._resizable.domNode.classList.add("suggest-details-container"),this._resizable.domNode.appendChild(e.domNode),this._resizable.enableSashes(!1,!0,!0,!1);let i,s,o=0,r=0;this._disposables.add(this._resizable.onDidWillResize(()=>{i=this._topLeft,s=this._resizable.size})),this._disposables.add(this._resizable.onDidResize(a=>{if(i&&s){this.widget.layout(a.dimension.width,a.dimension.height);let l=!1;a.west&&(r=s.width-a.dimension.width,l=!0),a.north&&(o=s.height-a.dimension.height,l=!0),l&&this._applyTopLeft({top:i.top+o,left:i.left+r})}a.done&&(i=void 0,s=void 0,o=0,r=0,this._userSize=a.dimension)})),this._disposables.add(this.widget.onDidChangeContents(()=>{var a;this._anchorBox&&this._placeAtAnchor(this._anchorBox,(a=this._userSize)!==null&&a!==void 0?a:this.widget.size,this._preferAlignAtTop)}))}dispose(){this._resizable.dispose(),this._disposables.dispose(),this.hide()}getId(){return"suggest.details"}getDomNode(){return this._resizable.domNode}getPosition(){return null}show(){this._added||(this._editor.addOverlayWidget(this),this.getDomNode().style.position="fixed",this._added=!0)}hide(e=!1){this._resizable.clearSashHoverState(),this._added&&(this._editor.removeOverlayWidget(this),this._added=!1,this._anchorBox=void 0,this._topLeft=void 0),e&&(this._userSize=void 0,this.widget.clearContents())}placeAtAnchor(e,t){var i;const s=e.getBoundingClientRect();this._anchorBox=s,this._preferAlignAtTop=t,this._placeAtAnchor(this._anchorBox,(i=this._userSize)!==null&&i!==void 0?i:this.widget.size,t)}_placeAtAnchor(e,t,i){var s;const o=L0(this.getDomNode().ownerDocument.body),r=this.widget.getLayoutInfo(),a=new ii(220,2*r.lineHeight),l=e.top,c=function(){const C=o.width-(e.left+e.width+r.borderWidth+r.horizontalPadding),w=-r.borderWidth+e.left+e.width,y=new ii(C,o.height-e.top-r.borderHeight-r.verticalPadding),L=y.with(void 0,e.top+e.height-r.borderHeight-r.verticalPadding);return{top:l,left:w,fit:C-t.width,maxSizeTop:y,maxSizeBottom:L,minSize:a.with(Math.min(C,a.width))}}(),d=function(){const C=e.left-r.borderWidth-r.horizontalPadding,w=Math.max(r.horizontalPadding,e.left-t.width-r.borderWidth),y=new ii(C,o.height-e.top-r.borderHeight-r.verticalPadding),L=y.with(void 0,e.top+e.height-r.borderHeight-r.verticalPadding);return{top:l,left:w,fit:C-t.width,maxSizeTop:y,maxSizeBottom:L,minSize:a.with(Math.min(C,a.width))}}(),u=function(){const C=e.left,w=-r.borderWidth+e.top+e.height,y=new ii(e.width-r.borderHeight,o.height-e.top-e.height-r.verticalPadding);return{top:w,left:C,fit:y.height-t.height,maxSizeBottom:y,maxSizeTop:y,minSize:a.with(y.width)}}(),h=[c,d,u],f=(s=h.find(C=>C.fit>=0))!==null&&s!==void 0?s:h.sort((C,w)=>w.fit-C.fit)[0],g=e.top+e.height-r.borderHeight;let p,_=t.height;const v=Math.max(f.maxSizeTop.height,f.maxSizeBottom.height);_>v&&(_=v);let b;i?_<=f.maxSizeTop.height?(p=!0,b=f.maxSizeTop):(p=!1,b=f.maxSizeBottom):_<=f.maxSizeBottom.height?(p=!1,b=f.maxSizeBottom):(p=!0,b=f.maxSizeTop),this._applyTopLeft({left:f.left,top:p?f.top:g-_}),this.getDomNode().style.position="fixed",this._resizable.enableSashes(!p,f===c,p,f!==c),this._resizable.minSize=f.minSize,this._resizable.maxSize=b,this._resizable.layout(_,Math.min(b.width,t.width)),this.widget.layout(this._resizable.size.width,this._resizable.size.height)}_applyTopLeft(e){this._topLeft=e,this.getDomNode().style.left="".concat(this._topLeft.left,"px"),this.getDomNode().style.top="".concat(this._topLeft.top,"px")}}var xu;(function(n){n[n.FILE=0]="FILE",n[n.FOLDER=1]="FOLDER",n[n.ROOT_FOLDER=2]="ROOT_FOLDER"})(xu||(xu={}));const M8e=/(?:\/|^)(?:([^\/]+)\/)?([^\/]+)$/;function Lk(n,e,t,i){const s=i===xu.ROOT_FOLDER?["rootfolder-icon"]:i===xu.FOLDER?["folder-icon"]:["file-icon"];if(t){let o;if(t.scheme===Nt.data)o=Qf.parseMetaData(t).get(Qf.META_DATA_LABEL);else{const r=t.path.match(M8e);r?(o=kk(r[2].toLowerCase()),r[1]&&s.push("".concat(kk(r[1].toLowerCase()),"-name-dir-icon"))):o=kk(t.authority.toLowerCase())}if(i===xu.FOLDER)s.push("".concat(o,"-name-folder-icon"));else{if(o){if(s.push("".concat(o,"-name-file-icon")),s.push("name-file-icon"),o.length<=255){const a=o.split(".");for(let l=1;l=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},OR=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},wh;function Qne(n){return"suggest-aria-id:".concat(n)}const O8e=Sn("suggest-more-info",Me.chevronRight,m("suggestMoreInfoIcon","Icon for more information in the suggest widget.")),F8e=new(wh=class{extract(e,t){if(e.textLabel.match(wh._regexStrict))return t[0]=e.textLabel,!0;if(e.completion.detail&&e.completion.detail.match(wh._regexStrict))return t[0]=e.completion.detail,!0;if(typeof e.completion.documentation=="string"){const i=wh._regexRelaxed.exec(e.completion.documentation);if(i&&(i.index===0||i.index+i[0].length===e.completion.documentation.length))return t[0]=i[0],!0}return!1}},wh._regexRelaxed=/(#([\da-fA-F]{3}){1,2}|(rgb|hsl)a\(\s*(\d{1,3}%?\s*,\s*){3}(1|0?\.\d+)\)|(rgb|hsl)\(\s*\d{1,3}%?(\s*,\s*\d{1,3}%?){2}\s*\))/,wh._regexStrict=new RegExp("^".concat(wh._regexRelaxed.source,"$"),"i"),wh);let f5=class{constructor(e,t,i,s){this._editor=e,this._modelService=t,this._languageService=i,this._themeService=s,this._onDidToggleDetails=new j,this.onDidToggleDetails=this._onDidToggleDetails.event,this.templateId="suggestion"}dispose(){this._onDidToggleDetails.dispose()}renderTemplate(e){const t=new be,i=e;i.classList.add("show-file-icons");const s=ge(e,ye(".icon")),o=ge(s,ye("span.colorspan")),r=ge(e,ye(".contents")),a=ge(r,ye(".main")),l=ge(a,ye(".icon-label.codicon")),c=ge(a,ye("span.left")),d=ge(a,ye("span.right")),u=new yI(c,{supportHighlights:!0,supportIcons:!0});t.add(u);const h=ge(c,ye("span.signature-label")),f=ge(c,ye("span.qualifier-label")),g=ge(d,ye("span.details-label")),p=ge(d,ye("span.readMore"+dt.asCSSSelector(O8e)));p.title=m("readMore","Read More");const _=()=>{const v=this._editor.getOptions(),b=v.get(50),C=b.getMassagedFontFamily(),w=b.fontFeatureSettings,y=v.get(118)||b.fontSize,L=v.get(119)||b.lineHeight,S=b.fontWeight,k=b.letterSpacing,D="".concat(y,"px"),x="".concat(L,"px"),A="".concat(k,"px");i.style.fontSize=D,i.style.fontWeight=S,i.style.letterSpacing=A,a.style.fontFamily=C,a.style.fontFeatureSettings=w,a.style.lineHeight=x,s.style.height=x,s.style.width=x,p.style.height=x,p.style.width=x};return _(),t.add(this._editor.onDidChangeConfiguration(v=>{(v.hasChanged(50)||v.hasChanged(118)||v.hasChanged(119))&&_()})),{root:i,left:c,right:d,icon:s,colorspan:o,iconLabel:u,iconContainer:l,parametersLabel:h,qualifierLabel:f,detailsLabel:g,readMore:p,disposables:t}}renderElement(e,t,i){const{completion:s}=e;i.root.id=Qne(t),i.colorspan.style.backgroundColor="";const o={labelEscapeNewLines:!0,matches:DS(e.score)},r=[];if(s.kind===19&&F8e.extract(e,r))i.icon.className="icon customcolor",i.iconContainer.className="icon hide",i.colorspan.style.backgroundColor=r[0];else if(s.kind===20&&this._themeService.getFileIconTheme().hasFileIcons){i.icon.className="icon hide",i.iconContainer.className="icon hide";const a=Lk(this._modelService,this._languageService,ct.from({scheme:"fake",path:e.textLabel}),xu.FILE),l=Lk(this._modelService,this._languageService,ct.from({scheme:"fake",path:s.detail}),xu.FILE);o.extraClasses=a.length>l.length?a:l}else s.kind===23&&this._themeService.getFileIconTheme().hasFolderIcons?(i.icon.className="icon hide",i.iconContainer.className="icon hide",o.extraClasses=[Lk(this._modelService,this._languageService,ct.from({scheme:"fake",path:e.textLabel}),xu.FOLDER),Lk(this._modelService,this._languageService,ct.from({scheme:"fake",path:s.detail}),xu.FOLDER)].flat()):(i.icon.className="icon hide",i.iconContainer.className="",i.iconContainer.classList.add("suggest-icon",...dt.asClassNameArray(pw.toIcon(s.kind))));s.tags&&s.tags.indexOf(1)>=0&&(o.extraClasses=(o.extraClasses||[]).concat(["deprecated"]),o.matches=[]),i.iconLabel.setLabel(e.textLabel,void 0,o),typeof s.label=="string"?(i.parametersLabel.textContent="",i.detailsLabel.textContent=FR(s.detail||""),i.root.classList.add("string-label")):(i.parametersLabel.textContent=FR(s.label.detail||""),i.detailsLabel.textContent=FR(s.label.description||""),i.root.classList.remove("string-label")),this._editor.getOption(117).showInlineDetails?mr(i.detailsLabel):Lo(i.detailsLabel),f6(e)?(i.right.classList.add("can-expand-details"),mr(i.readMore),i.readMore.onmousedown=a=>{a.stopPropagation(),a.preventDefault()},i.readMore.onclick=a=>{a.stopPropagation(),a.preventDefault(),this._onDidToggleDetails.fire()}):(i.right.classList.remove("can-expand-details"),Lo(i.readMore),i.readMore.onmousedown=null,i.readMore.onclick=null)}disposeTemplate(e){e.disposables.dispose()}};f5=P8e([OR(1,Zi),OR(2,qi),OR(3,os)],f5);function FR(n){return n.replace(/\r\n|\r|\n/g,"")}var B8e=globalThis&&globalThis.__decorate||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=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},W8e=globalThis&&globalThis.__awaiter||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())})},X_;F("editorSuggestWidget.background",{dark:un,light:un,hcDark:un,hcLight:un},m("editorSuggestWidgetBackground","Background color of the suggest widget."));F("editorSuggestWidget.border",{dark:ad,light:ad,hcDark:ad,hcLight:ad},m("editorSuggestWidgetBorder","Border color of the suggest widget."));const Ek=F("editorSuggestWidget.foreground",{dark:Ja,light:Ja,hcDark:Ja,hcLight:Ja},m("editorSuggestWidgetForeground","Foreground color of the suggest widget."));F("editorSuggestWidget.selectedForeground",{dark:Tp,light:Tp,hcDark:Tp,hcLight:Tp},m("editorSuggestWidgetSelectedForeground","Foreground color of the selected entry in the suggest widget."));F("editorSuggestWidget.selectedIconForeground",{dark:av,light:av,hcDark:av,hcLight:av},m("editorSuggestWidgetSelectedIconForeground","Icon foreground color of the selected entry in the suggest widget."));const V8e=F("editorSuggestWidget.selectedBackground",{dark:xp,light:xp,hcDark:xp,hcLight:xp},m("editorSuggestWidgetSelectedBackground","Background color of the selected entry in the suggest widget."));F("editorSuggestWidget.highlightForeground",{dark:el,light:el,hcDark:el,hcLight:el},m("editorSuggestWidgetHighlightForeground","Color of the match highlights in the suggest widget."));F("editorSuggestWidget.focusHighlightForeground",{dark:LL,light:LL,hcDark:LL,hcLight:LL},m("editorSuggestWidgetFocusHighlightForeground","Color of the match highlights in the suggest widget when an item is focused."));F("editorSuggestWidgetStatus.foreground",{dark:nt(Ek,.5),light:nt(Ek,.5),hcDark:nt(Ek,.5),hcLight:nt(Ek,.5)},m("editorSuggestWidgetStatusForeground","Foreground color of the suggest widget status."));class H8e{constructor(e,t){this._service=e,this._key="suggestWidget.size/".concat(t.getEditorType(),"/").concat(t instanceof sg)}restore(){var e;const t=(e=this._service.get(this._key,0))!==null&&e!==void 0?e:"";try{const i=JSON.parse(t);if(ii.is(i))return ii.lift(i)}catch{}}store(e){this._service.store(this._key,JSON.stringify(e),0,1)}reset(){this._service.remove(this._key,0)}}let Ty=X_=class{constructor(e,t,i,s,o){this.editor=e,this._storageService=t,this._state=0,this._isAuto=!1,this._pendingLayout=new Ts,this._pendingShowDetails=new Ts,this._ignoreFocusEvents=!1,this._forceRenderingAbove=!1,this._explainMode=!1,this._showTimeout=new _l,this._disposables=new be,this._onDidSelect=new nm,this._onDidFocus=new nm,this._onDidHide=new j,this._onDidShow=new j,this.onDidSelect=this._onDidSelect.event,this.onDidFocus=this._onDidFocus.event,this.onDidHide=this._onDidHide.event,this.onDidShow=this._onDidShow.event,this._onDetailsKeydown=new j,this.onDetailsKeyDown=this._onDetailsKeydown.event,this.element=new U7,this.element.domNode.classList.add("editor-widget","suggest-widget"),this._contentWidget=new $8e(this,e),this._persistedSize=new H8e(t,e);class r{constructor(f,g,p=!1,_=!1){this.persistedSize=f,this.currentSize=g,this.persistHeight=p,this.persistWidth=_}}let a;this._disposables.add(this.element.onDidWillResize(()=>{this._contentWidget.lockPreference(),a=new r(this._persistedSize.restore(),this.element.size)})),this._disposables.add(this.element.onDidResize(h=>{var f,g,p,_;if(this._resize(h.dimension.width,h.dimension.height),a&&(a.persistHeight=a.persistHeight||!!h.north||!!h.south,a.persistWidth=a.persistWidth||!!h.east||!!h.west),!!h.done){if(a){const{itemHeight:v,defaultSize:b}=this.getLayoutInfo(),C=Math.round(v/2);let{width:w,height:y}=this.element.size;(!a.persistHeight||Math.abs(a.currentSize.height-y)<=C)&&(y=(g=(f=a.persistedSize)===null||f===void 0?void 0:f.height)!==null&&g!==void 0?g:b.height),(!a.persistWidth||Math.abs(a.currentSize.width-w)<=C)&&(w=(_=(p=a.persistedSize)===null||p===void 0?void 0:p.width)!==null&&_!==void 0?_:b.width),this._persistedSize.store(new ii(w,y))}this._contentWidget.unlockPreference(),a=void 0}})),this._messageElement=ge(this.element.domNode,ye(".message")),this._listElement=ge(this.element.domNode,ye(".tree"));const l=this._disposables.add(o.createInstance(h5,this.editor));l.onDidClose(this.toggleDetails,this,this._disposables),this._details=new A8e(l,this.editor);const c=()=>this.element.domNode.classList.toggle("no-icons",!this.editor.getOption(117).showIcons);c();const d=o.createInstance(f5,this.editor);this._disposables.add(d),this._disposables.add(d.onDidToggleDetails(()=>this.toggleDetails())),this._list=new wl("SuggestWidget",this._listElement,{getHeight:h=>this.getLayoutInfo().itemHeight,getTemplateId:h=>"suggestion"},[d],{alwaysConsumeMouseWheel:!0,useShadows:!1,mouseSupport:!1,multipleSelectionSupport:!1,accessibilityProvider:{getRole:()=>"option",getWidgetAriaLabel:()=>m("suggest","Suggest"),getWidgetRole:()=>"listbox",getAriaLabel:h=>{let f=h.textLabel;if(typeof h.completion.label!="string"){const{detail:v,description:b}=h.completion.label;v&&b?f=m("label.full","{0} {1}, {2}",f,v,b):v?f=m("label.detail","{0} {1}",f,v):b&&(f=m("label.desc","{0}, {1}",f,b))}if(!h.isResolved||!this._isDetailsVisible())return f;const{documentation:g,detail:p}=h.completion,_=sm("{0}{1}",p||"",g?typeof g=="string"?g:g.value:"");return m("ariaCurrenttSuggestionReadDetails","{0}, docs: {1}",f,_)}}}),this._list.style(N0({listInactiveFocusBackground:V8e,listInactiveFocusOutline:$i})),this._status=o.createInstance(u5,this.element.domNode,Af);const u=()=>this.element.domNode.classList.toggle("with-status-bar",this.editor.getOption(117).showStatusBar);u(),this._disposables.add(s.onDidColorThemeChange(h=>this._onThemeChange(h))),this._onThemeChange(s.getColorTheme()),this._disposables.add(this._list.onMouseDown(h=>this._onListMouseDownOrTap(h))),this._disposables.add(this._list.onTap(h=>this._onListMouseDownOrTap(h))),this._disposables.add(this._list.onDidChangeSelection(h=>this._onListSelection(h))),this._disposables.add(this._list.onDidChangeFocus(h=>this._onListFocus(h))),this._disposables.add(this.editor.onDidChangeCursorSelection(()=>this._onCursorSelectionChanged())),this._disposables.add(this.editor.onDidChangeConfiguration(h=>{h.hasChanged(117)&&(u(),c())})),this._ctxSuggestWidgetVisible=Tt.Visible.bindTo(i),this._ctxSuggestWidgetDetailsVisible=Tt.DetailsVisible.bindTo(i),this._ctxSuggestWidgetMultipleSuggestions=Tt.MultipleSuggestions.bindTo(i),this._ctxSuggestWidgetHasFocusedSuggestion=Tt.HasFocusedSuggestion.bindTo(i),this._disposables.add(In(this._details.widget.domNode,"keydown",h=>{this._onDetailsKeydown.fire(h)})),this._disposables.add(this.editor.onMouseDown(h=>this._onEditorMouseDown(h)))}dispose(){var e;this._details.widget.dispose(),this._details.dispose(),this._list.dispose(),this._status.dispose(),this._disposables.dispose(),(e=this._loadingTimeout)===null||e===void 0||e.dispose(),this._pendingLayout.dispose(),this._pendingShowDetails.dispose(),this._showTimeout.dispose(),this._contentWidget.dispose(),this.element.dispose()}_onEditorMouseDown(e){this._details.widget.domNode.contains(e.target.element)?this._details.widget.domNode.focus():this.element.domNode.contains(e.target.element)&&this.editor.focus()}_onCursorSelectionChanged(){this._state!==0&&this._contentWidget.layout()}_onListMouseDownOrTap(e){typeof e.element>"u"||typeof e.index>"u"||(e.browserEvent.preventDefault(),e.browserEvent.stopPropagation(),this._select(e.element,e.index))}_onListSelection(e){e.elements.length&&this._select(e.elements[0],e.indexes[0])}_select(e,t){const i=this._completionModel;i&&(this._onDidSelect.fire({item:e,index:t,model:i}),this.editor.focus())}_onThemeChange(e){this._details.widget.borderWidth=ac(e.type)?2:1}_onListFocus(e){var t;if(this._ignoreFocusEvents)return;if(!e.elements.length){this._currentSuggestionDetails&&(this._currentSuggestionDetails.cancel(),this._currentSuggestionDetails=void 0,this._focusedItem=void 0),this.editor.setAriaOptions({activeDescendant:void 0}),this._ctxSuggestWidgetHasFocusedSuggestion.set(!1);return}if(!this._completionModel)return;this._ctxSuggestWidgetHasFocusedSuggestion.set(!0);const i=e.elements[0],s=e.indexes[0];i!==this._focusedItem&&((t=this._currentSuggestionDetails)===null||t===void 0||t.cancel(),this._currentSuggestionDetails=void 0,this._focusedItem=i,this._list.reveal(s),this._currentSuggestionDetails=Xn(o=>W8e(this,void 0,void 0,function*(){const r=Kf(()=>{this._isDetailsVisible()&&this.showDetails(!0)},250),a=o.onCancellationRequested(()=>r.dispose());try{return yield i.resolve(o)}finally{r.dispose(),a.dispose()}})),this._currentSuggestionDetails.then(()=>{s>=this._list.length||i!==this._list.element(s)||(this._ignoreFocusEvents=!0,this._list.splice(s,1,[i]),this._list.setFocus([s]),this._ignoreFocusEvents=!1,this._isDetailsVisible()?this.showDetails(!1):this.element.domNode.classList.remove("docs-side"),this.editor.setAriaOptions({activeDescendant:Qne(s)}))}).catch(Dt)),this._onDidFocus.fire({item:i,index:s,model:this._completionModel})}_setState(e){if(this._state!==e)switch(this._state=e,this.element.domNode.classList.toggle("frozen",e===4),this.element.domNode.classList.remove("message"),e){case 0:Lo(this._messageElement,this._listElement,this._status.element),this._details.hide(!0),this._status.hide(),this._contentWidget.hide(),this._ctxSuggestWidgetVisible.reset(),this._ctxSuggestWidgetMultipleSuggestions.reset(),this._ctxSuggestWidgetHasFocusedSuggestion.reset(),this._showTimeout.cancel(),this.element.domNode.classList.remove("visible"),this._list.splice(0,this._list.length),this._focusedItem=void 0,this._cappedHeight=void 0,this._explainMode=!1;break;case 1:this.element.domNode.classList.add("message"),this._messageElement.textContent=X_.LOADING_MESSAGE,Lo(this._listElement,this._status.element),mr(this._messageElement),this._details.hide(),this._show(),this._focusedItem=void 0,Yf(X_.LOADING_MESSAGE);break;case 2:this.element.domNode.classList.add("message"),this._messageElement.textContent=X_.NO_SUGGESTIONS_MESSAGE,Lo(this._listElement,this._status.element),mr(this._messageElement),this._details.hide(),this._show(),this._focusedItem=void 0,Yf(X_.NO_SUGGESTIONS_MESSAGE);break;case 3:Lo(this._messageElement),mr(this._listElement,this._status.element),this._show();break;case 4:Lo(this._messageElement),mr(this._listElement,this._status.element),this._show();break;case 5:Lo(this._messageElement),mr(this._listElement,this._status.element),this._details.show(),this._show();break}}_show(){this._status.show(),this._contentWidget.show(),this._layout(this._persistedSize.restore()),this._ctxSuggestWidgetVisible.set(!0),this._showTimeout.cancelAndSet(()=>{this.element.domNode.classList.add("visible"),this._onDidShow.fire(this)},100)}showTriggered(e,t){this._state===0&&(this._contentWidget.setPosition(this.editor.getPosition()),this._isAuto=!!e,this._isAuto||(this._loadingTimeout=Kf(()=>this._setState(1),t)))}showSuggestions(e,t,i,s,o){var r,a;if(this._contentWidget.setPosition(this.editor.getPosition()),(r=this._loadingTimeout)===null||r===void 0||r.dispose(),(a=this._currentSuggestionDetails)===null||a===void 0||a.cancel(),this._currentSuggestionDetails=void 0,this._completionModel!==e&&(this._completionModel=e),i&&this._state!==2&&this._state!==0){this._setState(4);return}const l=this._completionModel.items.length,c=l===0;if(this._ctxSuggestWidgetMultipleSuggestions.set(l>1),c){this._setState(s?0:2),this._completionModel=void 0;return}this._focusedItem=void 0,this._onDidFocus.pause(),this._onDidSelect.pause();try{this._list.splice(0,this._list.length,this._completionModel.items),this._setState(i?4:3),this._list.reveal(t,0),this._list.setFocus(o?[]:[t])}finally{this._onDidFocus.resume(),this._onDidSelect.resume()}this._pendingLayout.value=bE(()=>{this._pendingLayout.clear(),this._layout(this.element.size),this._details.widget.domNode.classList.remove("focused")})}focusSelected(){this._list.length>0&&this._list.setFocus([0])}selectNextPage(){switch(this._state){case 0:return!1;case 5:return this._details.widget.pageDown(),!0;case 1:return!this._isAuto;default:return this._list.focusNextPage(),!0}}selectNext(){switch(this._state){case 0:return!1;case 1:return!this._isAuto;default:return this._list.focusNext(1,!0),!0}}selectLast(){switch(this._state){case 0:return!1;case 5:return this._details.widget.scrollBottom(),!0;case 1:return!this._isAuto;default:return this._list.focusLast(),!0}}selectPreviousPage(){switch(this._state){case 0:return!1;case 5:return this._details.widget.pageUp(),!0;case 1:return!this._isAuto;default:return this._list.focusPreviousPage(),!0}}selectPrevious(){switch(this._state){case 0:return!1;case 1:return!this._isAuto;default:return this._list.focusPrevious(1,!0),!1}}selectFirst(){switch(this._state){case 0:return!1;case 5:return this._details.widget.scrollTop(),!0;case 1:return!this._isAuto;default:return this._list.focusFirst(),!0}}getFocusedItem(){if(this._state!==0&&this._state!==2&&this._state!==1&&this._completionModel&&this._list.getFocus().length>0)return{item:this._list.getFocusedElements()[0],index:this._list.getFocus()[0],model:this._completionModel}}toggleDetailsFocus(){this._state===5?(this._setState(3),this._details.widget.domNode.classList.remove("focused")):this._state===3&&this._isDetailsVisible()&&(this._setState(5),this._details.widget.domNode.classList.add("focused"))}toggleDetails(){this._isDetailsVisible()?(this._pendingShowDetails.clear(),this._ctxSuggestWidgetDetailsVisible.set(!1),this._setDetailsVisible(!1),this._details.hide(),this.element.domNode.classList.remove("shows-details")):(f6(this._list.getFocusedElements()[0])||this._explainMode)&&(this._state===3||this._state===5||this._state===4)&&(this._ctxSuggestWidgetDetailsVisible.set(!0),this._setDetailsVisible(!0),this.showDetails(!1))}showDetails(e){this._pendingShowDetails.value=bE(()=>{this._pendingShowDetails.clear(),this._details.show(),e?this._details.widget.renderLoading():this._details.widget.renderItem(this._list.getFocusedElements()[0],this._explainMode),this._positionDetails(),this.editor.focus(),this.element.domNode.classList.add("shows-details")})}toggleExplainMode(){this._list.getFocusedElements()[0]&&(this._explainMode=!this._explainMode,this._isDetailsVisible()?this.showDetails(!1):this.toggleDetails())}resetPersistedSize(){this._persistedSize.reset()}hideWidget(){var e;this._pendingLayout.clear(),this._pendingShowDetails.clear(),(e=this._loadingTimeout)===null||e===void 0||e.dispose(),this._setState(0),this._onDidHide.fire(this),this.element.clearSashHoverState();const t=this._persistedSize.restore(),i=Math.ceil(this.getLayoutInfo().itemHeight*4.3);t&&t.heightc&&(l=c);const d=this._completionModel?this._completionModel.stats.pLabelLen*r.typicalHalfwidthCharacterWidth:l,u=r.statusBarHeight+this._list.contentHeight+r.borderHeight,h=r.itemHeight+r.statusBarHeight,f=Un(this.editor.getDomNode()),g=this.editor.getScrolledVisiblePosition(this.editor.getPosition()),p=f.top+g.top+g.height,_=Math.min(o.height-p-r.verticalPadding,u),v=f.top+g.top-r.verticalPadding,b=Math.min(v,u);let C=Math.min(Math.max(b,_)+r.borderHeight,u);a===((t=this._cappedHeight)===null||t===void 0?void 0:t.capped)&&(a=this._cappedHeight.wanted),aC&&(a=C);const w=150;a>_||this._forceRenderingAbove&&v>w?(this._contentWidget.setPreference(1),this.element.enableSashes(!0,!0,!1,!1),C=b):(this._contentWidget.setPreference(2),this.element.enableSashes(!1,!0,!0,!1),C=_),this.element.preferredSize=new ii(d,r.defaultSize.height),this.element.maxSize=new ii(c,C),this.element.minSize=new ii(220,h),this._cappedHeight=a===u?{wanted:(s=(i=this._cappedHeight)===null||i===void 0?void 0:i.wanted)!==null&&s!==void 0?s:e.height,capped:a}:void 0}this._resize(l,a)}_resize(e,t){const{width:i,height:s}=this.element.maxSize;e=Math.min(i,e),t=Math.min(s,t);const{statusBarHeight:o}=this.getLayoutInfo();this._list.layout(t-o,e),this._listElement.style.height="".concat(t-o,"px"),this.element.layout(t,e),this._contentWidget.layout(),this._positionDetails()}_positionDetails(){var e;this._isDetailsVisible()&&this._details.placeAtAnchor(this.element.domNode,((e=this._contentWidget.getPosition())===null||e===void 0?void 0:e.preference[0])===2)}getLayoutInfo(){const e=this.editor.getOption(50),t=fr(this.editor.getOption(119)||e.lineHeight,8,1e3),i=!this.editor.getOption(117).showStatusBar||this._state===2||this._state===1?0:t,s=this._details.widget.borderWidth,o=2*s;return{itemHeight:t,statusBarHeight:i,borderWidth:s,borderHeight:o,typicalHalfwidthCharacterWidth:e.typicalHalfwidthCharacterWidth,verticalPadding:22,horizontalPadding:14,defaultSize:new ii(430,i+12*t+o)}}_isDetailsVisible(){return this._storageService.getBoolean("expandSuggestionDocs",0,!1)}_setDetailsVisible(e){this._storageService.store("expandSuggestionDocs",e,0,0)}forceRenderingAbove(){this._forceRenderingAbove||(this._forceRenderingAbove=!0,this._layout(this._persistedSize.restore()))}stopForceRenderingAbove(){this._forceRenderingAbove=!1}};Ty.LOADING_MESSAGE=m("suggestWidget.loading","Loading...");Ty.NO_SUGGESTIONS_MESSAGE=m("suggestWidget.noSuggestions","No suggestions.");Ty=X_=B8e([Dk(1,yl),Dk(2,bt),Dk(3,os),Dk(4,_t)],Ty);class $8e{constructor(e,t){this._widget=e,this._editor=t,this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this._preferenceLocked=!1,this._added=!1,this._hidden=!1}dispose(){this._added&&(this._added=!1,this._editor.removeContentWidget(this))}getId(){return"editor.widget.suggestWidget"}getDomNode(){return this._widget.element.domNode}show(){this._hidden=!1,this._added||(this._added=!0,this._editor.addContentWidget(this))}hide(){this._hidden||(this._hidden=!0,this.layout())}layout(){this._editor.layoutContentWidget(this)}getPosition(){return this._hidden||!this._position||!this._preference?null:{position:this._position,preference:[this._preference]}}beforeRender(){const{height:e,width:t}=this._widget.element.size,{borderWidth:i,horizontalPadding:s}=this._widget.getLayoutInfo();return new ii(t+2*i+s,e+2*i)}afterRender(e){this._widget._afterRender(e)}setPreference(e){this._preferenceLocked||(this._preference=e)}lockPreference(){this._preferenceLocked=!0}unlockPreference(){this._preferenceLocked=!1}setPosition(e){this._position=e}}var z8e=globalThis&&globalThis.__decorate||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},O_=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},g5;class U8e{constructor(e,t){if(this._model=e,this._position=t,e.getLineMaxColumn(t.lineNumber)!==t.column){const s=e.getOffsetAt(t),o=e.getPositionAt(s+1);this._marker=e.deltaDecorations([],[{range:I.fromPositions(t,o),options:{description:"suggest-line-suffix",stickiness:1}}])}}dispose(){this._marker&&!this._model.isDisposed()&&this._model.deltaDecorations(this._marker,[])}delta(e){if(this._model.isDisposed()||this._position.lineNumber!==e.lineNumber)return 0;if(this._marker){const t=this._model.getDecorationRange(this._marker[0]);return this._model.getOffsetAt(t.getStartPosition())-this._model.getOffsetAt(e)}else return this._model.getLineMaxColumn(e.lineNumber)-e.column}}let il=g5=class{static get(e){return e.getContribution(g5.ID)}constructor(e,t,i,s,o,r,a){this._memoryService=t,this._commandService=i,this._contextKeyService=s,this._instantiationService=o,this._logService=r,this._telemetryService=a,this._lineSuffix=new Ts,this._toDispose=new be,this._selectors=new j8e(u=>u.priority),this._onWillInsertSuggestItem=new j,this.onWillInsertSuggestItem=this._onWillInsertSuggestItem.event,this.editor=e,this.model=o.createInstance(d5,this.editor),this._selectors.register({priority:0,select:(u,h,f)=>this._memoryService.select(u,h,f)});const l=Tt.InsertMode.bindTo(s);l.set(e.getOption(117).insertMode),this._toDispose.add(this.model.onDidTrigger(()=>l.set(e.getOption(117).insertMode))),this.widget=this._toDispose.add(new aD(()=>{const u=this._instantiationService.createInstance(Ty,this.editor);this._toDispose.add(u),this._toDispose.add(u.onDidSelect(_=>this._insertSuggestion(_,0),this));const h=new y8e(this.editor,u,this.model,_=>this._insertSuggestion(_,2));this._toDispose.add(h);const f=Tt.MakesTextEdit.bindTo(this._contextKeyService),g=Tt.HasInsertAndReplaceRange.bindTo(this._contextKeyService),p=Tt.CanResolve.bindTo(this._contextKeyService);return this._toDispose.add(vt(()=>{f.reset(),g.reset(),p.reset()})),this._toDispose.add(u.onDidFocus(({item:_})=>{const v=this.editor.getPosition(),b=_.editStart.column,C=v.column;let w=!0;this.editor.getOption(1)==="smart"&&this.model.state===2&&!_.completion.additionalTextEdits&&!(_.completion.insertTextRules&4)&&C-b===_.completion.insertText.length&&(w=this.editor.getModel().getValueInRange({startLineNumber:v.lineNumber,startColumn:b,endLineNumber:v.lineNumber,endColumn:C})!==_.completion.insertText),f.set(w),g.set(!Y.equals(_.editInsertEnd,_.editReplaceEnd)),p.set(!!_.provider.resolveCompletionItem||!!_.completion.documentation||_.completion.detail!==_.completion.label)})),this._toDispose.add(u.onDetailsKeyDown(_=>{if(_.toKeyCodeChord().equals(new Gu(!0,!1,!1,!1,33))||Kt&&_.toKeyCodeChord().equals(new Gu(!1,!1,!1,!0,33))){_.stopPropagation();return}_.toKeyCodeChord().isModifierKey()||this.editor.focus()})),u})),this._overtypingCapturer=this._toDispose.add(new aD(()=>this._toDispose.add(new PN(this.editor,this.model)))),this._alternatives=this._toDispose.add(new aD(()=>this._toDispose.add(new Tm(this.editor,this._contextKeyService)))),this._toDispose.add(o.createInstance(Iy,e)),this._toDispose.add(this.model.onDidTrigger(u=>{this.widget.value.showTriggered(u.auto,u.shy?250:50),this._lineSuffix.value=new U8e(this.editor.getModel(),u.position)})),this._toDispose.add(this.model.onDidSuggest(u=>{if(u.triggerOptions.shy)return;let h=-1;for(const g of this._selectors.itemsOrderedByPriorityDesc)if(h=g.select(this.editor.getModel(),this.editor.getPosition(),u.completionModel.items),h!==-1)break;h===-1&&(h=0);let f=!1;if(u.triggerOptions.auto){const g=this.editor.getOption(117);g.selectionMode==="never"||g.selectionMode==="always"?f=g.selectionMode==="never":g.selectionMode==="whenTriggerCharacter"?f=u.triggerOptions.triggerKind!==1:g.selectionMode==="whenQuickSuggestion"&&(f=u.triggerOptions.triggerKind===1&&!u.triggerOptions.refilter)}this.widget.value.showSuggestions(u.completionModel,h,u.isFrozen,u.triggerOptions.auto,f)})),this._toDispose.add(this.model.onDidCancel(u=>{u.retrigger||this.widget.value.hideWidget()})),this._toDispose.add(this.editor.onDidBlurEditorWidget(()=>{this.model.cancel(),this.model.clear()}));const c=Tt.AcceptSuggestionsOnEnter.bindTo(s),d=()=>{const u=this.editor.getOption(1);c.set(u==="on"||u==="smart")};this._toDispose.add(this.editor.onDidChangeConfiguration(()=>d())),d()}dispose(){this._alternatives.dispose(),this._toDispose.dispose(),this.widget.dispose(),this.model.dispose(),this._lineSuffix.dispose(),this._onWillInsertSuggestItem.dispose()}_insertSuggestion(e,t){if(!e||!e.item){this._alternatives.value.reset(),this.model.cancel(),this.model.clear();return}if(!this.editor.hasModel())return;const i=xs.get(this.editor);if(!i)return;this._onWillInsertSuggestItem.fire({item:e.item});const s=this.editor.getModel(),o=s.getAlternativeVersionId(),{item:r}=e,a=[],l=new Tn;t&1||this.editor.pushUndoStop();const c=this.getOverwriteInfo(r,!!(t&8));this._memoryService.memorize(s,this.editor.getPosition(),r);const d=r.isResolved;let u=-1,h=-1;if(Array.isArray(r.completion.additionalTextEdits)){this.model.cancel();const g=mc.capture(this.editor);this.editor.executeEdits("suggestController.additionalTextEdits.sync",r.completion.additionalTextEdits.map(p=>Yi.replaceMove(I.lift(p.range),p.text))),g.restoreRelativeVerticalPositionOfCursor(this.editor)}else if(!d){const g=new so;let p;const _=s.onDidChangeContent(w=>{if(w.isFlush){l.cancel(),_.dispose();return}for(const y of w.changes){const L=I.getEndPosition(y.range);(!p||Y.isBefore(L,p))&&(p=L)}}),v=t;t|=2;let b=!1;const C=this.editor.onWillType(()=>{C.dispose(),b=!0,v&2||this.editor.pushUndoStop()});a.push(r.resolve(l.token).then(()=>{if(!r.completion.additionalTextEdits||l.token.isCancellationRequested)return;if(p&&r.completion.additionalTextEdits.some(y=>Y.isBefore(p,I.getStartPosition(y.range))))return!1;b&&this.editor.pushUndoStop();const w=mc.capture(this.editor);return this.editor.executeEdits("suggestController.additionalTextEdits.async",r.completion.additionalTextEdits.map(y=>Yi.replaceMove(I.lift(y.range),y.text))),w.restoreRelativeVerticalPositionOfCursor(this.editor),(b||!(v&2))&&this.editor.pushUndoStop(),!0}).then(w=>{this._logService.trace("[suggest] async resolving of edits DONE (ms, applied?)",g.elapsed(),w),h=w===!0?1:w===!1?0:-2}).finally(()=>{_.dispose(),C.dispose()}))}let{insertText:f}=r.completion;if(r.completion.insertTextRules&4||(f=t0.escape(f)),this.model.cancel(),i.insert(f,{overwriteBefore:c.overwriteBefore,overwriteAfter:c.overwriteAfter,undoStopBefore:!1,undoStopAfter:!1,adjustWhitespace:!(r.completion.insertTextRules&1),clipboardText:e.model.clipboardText,overtypingCapturer:this._overtypingCapturer.value}),t&2||this.editor.pushUndoStop(),r.completion.command)if(r.completion.command.id===KS.id)this.model.trigger({auto:!0,retrigger:!0});else{const g=new so;a.push(this._commandService.executeCommand(r.completion.command.id,...r.completion.command.arguments?[...r.completion.command.arguments]:[]).catch(p=>{r.completion.extensionId?Bn(p):Dt(p)}).finally(()=>{u=g.elapsed()}))}t&4&&this._alternatives.value.set(e,g=>{for(l.cancel();s.canUndo();){o!==s.getAlternativeVersionId()&&s.undo(),this._insertSuggestion(g,3|(t&8?8:0));break}}),this._alertCompletionItem(r),Promise.all(a).finally(()=>{this._reportSuggestionAcceptedTelemetry(r,s,d,u,h),this.model.clear(),l.dispose()})}_reportSuggestionAcceptedTelemetry(e,t,i,s,o){var r,a,l;Math.floor(Math.random()*100)!==0&&this._telemetryService.publicLog2("suggest.acceptedSuggestion",{extensionId:(a=(r=e.extensionId)===null||r===void 0?void 0:r.value)!==null&&a!==void 0?a:"unknown",providerId:(l=e.provider._debugDisplayName)!==null&&l!==void 0?l:"unknown",kind:e.completion.kind,basenameHash:SQ(Ra(t.uri)).toString(16),languageId:t.getLanguageId(),fileExtension:Qke(t.uri),resolveInfo:e.provider.resolveCompletionItem?i?1:0:-1,resolveDuration:e.resolveDuration,commandDuration:s,additionalEditsAsync:o})}getOverwriteInfo(e,t){bi(this.editor.hasModel());let i=this.editor.getOption(117).insertMode==="replace";t&&(i=!i);const s=e.position.column-e.editStart.column,o=(i?e.editReplaceEnd.column:e.editInsertEnd.column)-e.position.column,r=this.editor.getPosition().column-e.position.column,a=this._lineSuffix.value?this._lineSuffix.value.delta(this.editor.getPosition()):0;return{overwriteBefore:s+r,overwriteAfter:o+a}}_alertCompletionItem(e){if(io(e.completion.additionalTextEdits)){const t=m("aria.alert.snippet","Accepting '{0}' made {1} additional edits",e.textLabel,e.completion.additionalTextEdits.length);to(t)}}triggerSuggest(e,t,i){this.editor.hasModel()&&(this.model.trigger({auto:t!=null?t:!1,completionOptions:{providerFilter:e,kindFilter:i?new Set:void 0}}),this.editor.revealPosition(this.editor.getPosition(),0),this.editor.focus())}triggerSuggestAndAcceptBest(e){if(!this.editor.hasModel())return;const t=this.editor.getPosition(),i=()=>{t.equals(this.editor.getPosition())&&this._commandService.executeCommand(e.fallback)},s=o=>{if(o.completion.insertTextRules&4||o.completion.additionalTextEdits)return!0;const r=this.editor.getPosition(),a=o.editStart.column,l=r.column;return l-a!==o.completion.insertText.length?!0:this.editor.getModel().getValueInRange({startLineNumber:r.lineNumber,startColumn:a,endLineNumber:r.lineNumber,endColumn:l})!==o.completion.insertText};We.once(this.model.onDidTrigger)(o=>{const r=[];We.any(this.model.onDidTrigger,this.model.onDidCancel)(()=>{fi(r),i()},void 0,r),this.model.onDidSuggest(({completionModel:a})=>{if(fi(r),a.items.length===0){i();return}const l=this._memoryService.select(this.editor.getModel(),this.editor.getPosition(),a.items),c=a.items[l];if(!s(c)){i();return}this.editor.pushUndoStop(),this._insertSuggestion({index:l,item:c,model:a},7)},void 0,r)}),this.model.trigger({auto:!1,shy:!0}),this.editor.revealPosition(t,0),this.editor.focus()}acceptSelectedSuggestion(e,t){const i=this.widget.value.getFocusedItem();let s=0;e&&(s|=4),t&&(s|=8),this._insertSuggestion(i,s)}acceptNextSuggestion(){this._alternatives.value.next()}acceptPrevSuggestion(){this._alternatives.value.prev()}cancelSuggestWidget(){this.model.cancel(),this.model.clear(),this.widget.value.hideWidget()}focusSuggestion(){this.widget.value.focusSelected()}selectNextSuggestion(){this.widget.value.selectNext()}selectNextPageSuggestion(){this.widget.value.selectNextPage()}selectLastSuggestion(){this.widget.value.selectLast()}selectPrevSuggestion(){this.widget.value.selectPrevious()}selectPrevPageSuggestion(){this.widget.value.selectPreviousPage()}selectFirstSuggestion(){this.widget.value.selectFirst()}toggleSuggestionDetails(){this.widget.value.toggleDetails()}toggleExplainMode(){this.widget.value.toggleExplainMode()}toggleSuggestionFocus(){this.widget.value.toggleDetailsFocus()}resetWidgetSize(){this.widget.value.resetPersistedSize()}forceRenderingAbove(){this.widget.value.forceRenderingAbove()}stopForceRenderingAbove(){this.widget.isInitialized&&this.widget.value.stopForceRenderingAbove()}registerSelector(e){return this._selectors.register(e)}};il.ID="editor.contrib.suggestController";il=g5=z8e([O_(1,RN),O_(2,gn),O_(3,bt),O_(4,_t),O_(5,aa),O_(6,ra)],il);class j8e{constructor(e){this.prioritySelector=e,this._items=new Array}register(e){if(this._items.indexOf(e)!==-1)throw new Error("Value is already registered");return this._items.push(e),this._items.sort((t,i)=>this.prioritySelector(i)-this.prioritySelector(t)),{dispose:()=>{const t=this._items.indexOf(e);t>=0&&this._items.splice(t,1)}}}get itemsOrderedByPriorityDesc(){return this._items}}class KS extends Ue{constructor(){super({id:KS.id,label:m("suggest.trigger.label","Trigger Suggest"),alias:"Trigger Suggest",precondition:fe.and(O.writable,O.hasCompletionItemProvider,Tt.Visible.toNegated()),kbOpts:{kbExpr:O.textInputFocus,primary:2058,secondary:[2087],mac:{primary:266,secondary:[521,2087]},weight:100}})}run(e,t,i){const s=il.get(t);if(!s)return;let o;i&&typeof i=="object"&&i.auto===!0&&(o=!0),s.triggerSuggest(void 0,o,void 0)}}KS.id="editor.action.triggerSuggest";ti(il.ID,il,2);De(KS);const ea=100+90,Wo=fs.bindToContribution(il.get);Re(new Wo({id:"acceptSelectedSuggestion",precondition:fe.and(Tt.Visible,Tt.HasFocusedSuggestion),handler(n){n.acceptSelectedSuggestion(!0,!1)},kbOpts:[{primary:2,kbExpr:fe.and(Tt.Visible,O.textInputFocus),weight:ea},{primary:3,kbExpr:fe.and(Tt.Visible,O.textInputFocus,Tt.AcceptSuggestionsOnEnter,Tt.MakesTextEdit),weight:ea}],menuOpts:[{menuId:Af,title:m("accept.insert","Insert"),group:"left",order:1,when:Tt.HasInsertAndReplaceRange.toNegated()},{menuId:Af,title:m("accept.insert","Insert"),group:"left",order:1,when:fe.and(Tt.HasInsertAndReplaceRange,Tt.InsertMode.isEqualTo("insert"))},{menuId:Af,title:m("accept.replace","Replace"),group:"left",order:1,when:fe.and(Tt.HasInsertAndReplaceRange,Tt.InsertMode.isEqualTo("replace"))}]}));Re(new Wo({id:"acceptAlternativeSelectedSuggestion",precondition:fe.and(Tt.Visible,O.textInputFocus,Tt.HasFocusedSuggestion),kbOpts:{weight:ea,kbExpr:O.textInputFocus,primary:1027,secondary:[1026]},handler(n){n.acceptSelectedSuggestion(!1,!0)},menuOpts:[{menuId:Af,group:"left",order:2,when:fe.and(Tt.HasInsertAndReplaceRange,Tt.InsertMode.isEqualTo("insert")),title:m("accept.replace","Replace")},{menuId:Af,group:"left",order:2,when:fe.and(Tt.HasInsertAndReplaceRange,Tt.InsertMode.isEqualTo("replace")),title:m("accept.insert","Insert")}]}));qt.registerCommandAlias("acceptSelectedSuggestionOnEnter","acceptSelectedSuggestion");Re(new Wo({id:"hideSuggestWidget",precondition:Tt.Visible,handler:n=>n.cancelSuggestWidget(),kbOpts:{weight:ea,kbExpr:O.textInputFocus,primary:9,secondary:[1033]}}));Re(new Wo({id:"selectNextSuggestion",precondition:fe.and(Tt.Visible,fe.or(Tt.MultipleSuggestions,Tt.HasFocusedSuggestion.negate())),handler:n=>n.selectNextSuggestion(),kbOpts:{weight:ea,kbExpr:O.textInputFocus,primary:18,secondary:[2066],mac:{primary:18,secondary:[2066,300]}}}));Re(new Wo({id:"selectNextPageSuggestion",precondition:fe.and(Tt.Visible,fe.or(Tt.MultipleSuggestions,Tt.HasFocusedSuggestion.negate())),handler:n=>n.selectNextPageSuggestion(),kbOpts:{weight:ea,kbExpr:O.textInputFocus,primary:12,secondary:[2060]}}));Re(new Wo({id:"selectLastSuggestion",precondition:fe.and(Tt.Visible,fe.or(Tt.MultipleSuggestions,Tt.HasFocusedSuggestion.negate())),handler:n=>n.selectLastSuggestion()}));Re(new Wo({id:"selectPrevSuggestion",precondition:fe.and(Tt.Visible,fe.or(Tt.MultipleSuggestions,Tt.HasFocusedSuggestion.negate())),handler:n=>n.selectPrevSuggestion(),kbOpts:{weight:ea,kbExpr:O.textInputFocus,primary:16,secondary:[2064],mac:{primary:16,secondary:[2064,302]}}}));Re(new Wo({id:"selectPrevPageSuggestion",precondition:fe.and(Tt.Visible,fe.or(Tt.MultipleSuggestions,Tt.HasFocusedSuggestion.negate())),handler:n=>n.selectPrevPageSuggestion(),kbOpts:{weight:ea,kbExpr:O.textInputFocus,primary:11,secondary:[2059]}}));Re(new Wo({id:"selectFirstSuggestion",precondition:fe.and(Tt.Visible,fe.or(Tt.MultipleSuggestions,Tt.HasFocusedSuggestion.negate())),handler:n=>n.selectFirstSuggestion()}));Re(new Wo({id:"focusSuggestion",precondition:fe.and(Tt.Visible,Tt.HasFocusedSuggestion.negate()),handler:n=>n.focusSuggestion(),kbOpts:{weight:ea,kbExpr:O.textInputFocus,primary:2058,secondary:[2087],mac:{primary:266,secondary:[2087]}}}));Re(new Wo({id:"focusAndAcceptSuggestion",precondition:fe.and(Tt.Visible,Tt.HasFocusedSuggestion.negate()),handler:n=>{n.focusSuggestion(),n.acceptSelectedSuggestion(!0,!1)}}));Re(new Wo({id:"toggleSuggestionDetails",precondition:fe.and(Tt.Visible,Tt.HasFocusedSuggestion),handler:n=>n.toggleSuggestionDetails(),kbOpts:{weight:ea,kbExpr:O.textInputFocus,primary:2058,secondary:[2087],mac:{primary:266,secondary:[2087]}},menuOpts:[{menuId:Af,group:"right",order:1,when:fe.and(Tt.DetailsVisible,Tt.CanResolve),title:m("detail.more","show less")},{menuId:Af,group:"right",order:1,when:fe.and(Tt.DetailsVisible.toNegated(),Tt.CanResolve),title:m("detail.less","show more")}]}));Re(new Wo({id:"toggleExplainMode",precondition:Tt.Visible,handler:n=>n.toggleExplainMode(),kbOpts:{weight:100,primary:2138}}));Re(new Wo({id:"toggleSuggestionFocus",precondition:Tt.Visible,handler:n=>n.toggleSuggestionFocus(),kbOpts:{weight:ea,kbExpr:O.textInputFocus,primary:2570,mac:{primary:778}}}));Re(new Wo({id:"insertBestCompletion",precondition:fe.and(O.textInputFocus,fe.equals("config.editor.tabCompletion","on"),Iy.AtEnd,Tt.Visible.toNegated(),Tm.OtherSuggestions.toNegated(),xs.InSnippetMode.toNegated()),handler:(n,e)=>{n.triggerSuggestAndAcceptBest(Io(e)?Object.assign({fallback:"tab"},e):{fallback:"tab"})},kbOpts:{weight:ea,primary:2}}));Re(new Wo({id:"insertNextSuggestion",precondition:fe.and(O.textInputFocus,fe.equals("config.editor.tabCompletion","on"),Tm.OtherSuggestions,Tt.Visible.toNegated(),xs.InSnippetMode.toNegated()),handler:n=>n.acceptNextSuggestion(),kbOpts:{weight:ea,kbExpr:O.textInputFocus,primary:2}}));Re(new Wo({id:"insertPrevSuggestion",precondition:fe.and(O.textInputFocus,fe.equals("config.editor.tabCompletion","on"),Tm.OtherSuggestions,Tt.Visible.toNegated(),xs.InSnippetMode.toNegated()),handler:n=>n.acceptPrevSuggestion(),kbOpts:{weight:ea,kbExpr:O.textInputFocus,primary:1026}}));De(class extends Ue{constructor(){super({id:"editor.action.resetSuggestSize",label:m("suggest.reset.label","Reset Suggest Widget Size"),alias:"Reset Suggest Widget Size",precondition:void 0})}run(n,e){var t;(t=il.get(e))===null||t===void 0||t.resetWidgetSize()}});class K8e extends te{get selectedItem(){return this._selectedItem}constructor(e,t,i,s){super(),this.editor=e,this.suggestControllerPreselector=t,this.checkModelVersion=i,this.onWillAccept=s,this.isSuggestWidgetVisible=!1,this.isShiftKeyPressed=!1,this._isActive=!1,this._currentSuggestItemInfo=void 0,this._selectedItem=Pi(this,void 0),this._register(e.onKeyDown(r=>{r.shiftKey&&!this.isShiftKeyPressed&&(this.isShiftKeyPressed=!0,this.update(this._isActive))})),this._register(e.onKeyUp(r=>{r.shiftKey&&this.isShiftKeyPressed&&(this.isShiftKeyPressed=!1,this.update(this._isActive))}));const o=il.get(this.editor);if(o){this._register(o.registerSelector({priority:100,select:(l,c,d)=>{var u;Gi(v=>this.checkModelVersion(v));const h=this.editor.getModel();if(!h)return-1;const f=(u=this.suggestControllerPreselector())===null||u===void 0?void 0:u.removeCommonPrefix(h);if(!f)return-1;const g=Y.lift(c),p=d.map((v,b)=>{const w=$C.fromSuggestion(o,h,g,v,this.isShiftKeyPressed).toSingleTextEdit().removeCommonPrefix(h),y=f.augments(w);return{index:b,valid:y,prefixLength:w.text.length,suggestItem:v}}).filter(v=>v&&v.valid&&v.prefixLength>0),_=DQ(p,Sa(v=>v.prefixLength,Mu));return _?_.index:-1}}));let r=!1;const a=()=>{r||(r=!0,this._register(o.widget.value.onDidShow(()=>{this.isSuggestWidgetVisible=!0,this.update(!0)})),this._register(o.widget.value.onDidHide(()=>{this.isSuggestWidgetVisible=!1,this.update(!1)})),this._register(o.widget.value.onDidFocus(()=>{this.isSuggestWidgetVisible=!0,this.update(!0)})))};this._register(We.once(o.model.onDidTrigger)(l=>{a()})),this._register(o.onWillInsertSuggestItem(l=>{const c=this.editor.getPosition(),d=this.editor.getModel();if(!c||!d)return;const u=$C.fromSuggestion(o,d,c,l.item,this.isShiftKeyPressed);this.onWillAccept(u)}))}this.update(this._isActive)}update(e){const t=this.getSuggestItemInfo();(this._isActive!==e||!q8e(this._currentSuggestItemInfo,t))&&(this._isActive=e,this._currentSuggestItemInfo=t,Gi(i=>{this.checkModelVersion(i),this._selectedItem.set(this._isActive?this._currentSuggestItemInfo:void 0,i)}))}getSuggestItemInfo(){const e=il.get(this.editor);if(!e||!this.isSuggestWidgetVisible)return;const t=e.widget.value.getFocusedItem(),i=this.editor.getPosition(),s=this.editor.getModel();if(!(!t||!i||!s))return $C.fromSuggestion(e,s,i,t.item,this.isShiftKeyPressed)}stopForceRenderingAbove(){const e=il.get(this.editor);e==null||e.stopForceRenderingAbove()}forceRenderingAbove(){const e=il.get(this.editor);e==null||e.forceRenderingAbove()}}class $C{static fromSuggestion(e,t,i,s,o){let{insertText:r}=s.completion,a=!1;if(s.completion.insertTextRules&4){const c=new t0().parse(r);c.children.length<100&&eT.adjustWhitespace(t,i,!0,c),r=c.toString(),a=!0}const l=e.getOverwriteInfo(s,o);return new $C(I.fromPositions(i.delta(0,-l.overwriteBefore),i.delta(0,Math.max(l.overwriteAfter,0))),r,s.completion.kind,a)}constructor(e,t,i,s){this.range=e,this.insertText=t,this.completionItemKind=i,this.isSnippetText=s}equals(e){return this.range.equalsRange(e.range)&&this.insertText===e.insertText&&this.completionItemKind===e.completionItemKind&&this.isSnippetText===e.isSnippetText}toSelectedSuggestionInfo(){return new wX(this.range,this.insertText,this.completionItemKind,this.isSnippetText)}toSingleTextEdit(){return new i0(this.range,this.insertText)}}function q8e(n,e){return n===e?!0:!n||!e?!1:n.equals(e)}var G8e=globalThis&&globalThis.__decorate||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},yh=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},p5;let ta=p5=class extends te{static get(e){return e.getContribution(p5.ID)}constructor(e,t,i,s,o,r,a,l,c){super(),this.editor=e,this.instantiationService=t,this.contextKeyService=i,this.configurationService=s,this.commandService=o,this.debounceService=r,this.languageFeaturesService=a,this.audioCueService=l,this._keybindingService=c,this.model=DI("inlineCompletionModel",void 0),this.textModelVersionId=Pi(this,-1),this.cursorPosition=Pi(this,new Y(1,1)),this.suggestWidgetAdaptor=this._register(new K8e(this.editor,()=>{var h,f;return(f=(h=this.model.get())===null||h===void 0?void 0:h.selectedInlineCompletion.get())===null||f===void 0?void 0:f.toSingleTextEdit(void 0)},h=>this.updateObservables(h,Rr.Other),h=>{Gi(f=>{var g;this.updateObservables(f,Rr.Other),(g=this.model.get())===null||g===void 0||g.handleSuggestAccepted(h)})})),this._enabled=ks(this.editor.onDidChangeConfiguration,()=>this.editor.getOption(62).enabled),this.ghostTextWidget=this._register(this.instantiationService.createInstance(o5,this.editor,{ghostText:this.model.map((h,f)=>h==null?void 0:h.ghostText.read(f)),minReservedLineCount:EI(0),targetTextModel:this.model.map(h=>h==null?void 0:h.textModel)})),this._debounceValue=this.debounceService.for(this.languageFeaturesService.inlineCompletionsProvider,"InlineCompletionsDebounce",{min:50,max:50}),this._register(new us(this.contextKeyService,this.model)),this._register(We.runAndSubscribe(e.onDidChangeModel,()=>Gi(h=>{this.model.set(void 0,h),this.updateObservables(h,Rr.Other);const f=e.getModel();if(f){const g=t.createInstance(a5,f,this.suggestWidgetAdaptor.selectedItem,this.cursorPosition,this.textModelVersionId,this._debounceValue,ks(e.onDidChangeConfiguration,()=>e.getOption(117).preview),ks(e.onDidChangeConfiguration,()=>e.getOption(117).previewMode),ks(e.onDidChangeConfiguration,()=>e.getOption(62).mode),this._enabled);this.model.set(g,h)}})));const d=h=>{var f;return h.isUndoing?Rr.Undo:h.isRedoing?Rr.Redo:!((f=this.model.get())===null||f===void 0)&&f.isAcceptingPartially?Rr.AcceptWord:Rr.Other};this._register(e.onDidChangeModelContent(h=>Gi(f=>this.updateObservables(f,d(h))))),this._register(e.onDidChangeCursorPosition(h=>Gi(f=>{var g;this.updateObservables(f,Rr.Other),(h.reason===3||h.source==="api")&&((g=this.model.get())===null||g===void 0||g.stop(f))}))),this._register(e.onDidType(()=>Gi(h=>{var f;this.updateObservables(h,Rr.Other),this._enabled.get()&&((f=this.model.get())===null||f===void 0||f.trigger(h))}))),this._register(this.commandService.onDidExecuteCommand(h=>{new Set([Gv.Tab.id,Gv.DeleteLeft.id,Gv.DeleteRight.id,une,"acceptSelectedSuggestion"]).has(h.commandId)&&e.hasTextFocus()&&this._enabled.get()&&Gi(g=>{var p;(p=this.model.get())===null||p===void 0||p.trigger(g)})})),this._register(this.editor.onDidBlurEditorWidget(()=>{this.contextKeyService.getContextKeyValue("accessibleViewIsShown")||this.configurationService.getValue("editor.inlineSuggest.keepOnBlur")||e.getOption(62).keepOnBlur||lg.dropDownVisible||Gi(h=>{var f;(f=this.model.get())===null||f===void 0||f.stop(h)})})),this._register(xi(h=>{var f;const g=(f=this.model.read(h))===null||f===void 0?void 0:f.state.read(h);g!=null&&g.suggestItem?g.ghostText.lineCount>=2&&this.suggestWidgetAdaptor.forceRenderingAbove():this.suggestWidgetAdaptor.stopForceRenderingAbove()})),this._register(vt(()=>{this.suggestWidgetAdaptor.stopForceRenderingAbove()}));let u;this._register(xi(h=>{const f=this.model.read(h),g=f==null?void 0:f.state.read(h);if(!f||!g||!g.inlineCompletion){u=void 0;return}if(g.inlineCompletion.semanticId!==u){u=g.inlineCompletion.semanticId;const p=f.textModel.getLineContent(g.ghostText.lineNumber);this.audioCueService.playAudioCue(Jt.inlineSuggestion).then(()=>{this.editor.getOption(8)&&this.provideScreenReaderUpdate(g.ghostText.renderForScreenReader(p))})}})),this._register(new OF(this.editor,this.model,this.instantiationService)),this._register(this.configurationService.onDidChangeConfiguration(h=>{h.affectsConfiguration("accessibility.verbosity.inlineCompletions")&&this.editor.updateOptions({inlineCompletionsAccessibilityVerbose:this.configurationService.getValue("accessibility.verbosity.inlineCompletions")})})),this.editor.updateOptions({inlineCompletionsAccessibilityVerbose:this.configurationService.getValue("accessibility.verbosity.inlineCompletions")})}provideScreenReaderUpdate(e){const t=this.contextKeyService.getContextKeyValue("accessibleViewIsShown"),i=this._keybindingService.lookupKeybinding("editor.action.accessibleView");let s;!t&&i&&this.editor.getOption(147)&&(s=m("showAccessibleViewHint","Inspect this in the accessible view ({0})",i.getAriaLabel())),to(s?e+", "+s:e)}updateObservables(e,t){var i,s;const o=this.editor.getModel();this.textModelVersionId.set((i=o==null?void 0:o.getVersionId())!==null&&i!==void 0?i:-1,e,t),this.cursorPosition.set((s=this.editor.getPosition())!==null&&s!==void 0?s:new Y(1,1),e)}shouldShowHoverAt(e){var t;const i=(t=this.model.get())===null||t===void 0?void 0:t.ghostText.get();return i?i.parts.some(s=>e.containsPosition(new Y(i.lineNumber,s.column))):!1}shouldShowHoverAtViewZone(e){return this.ghostTextWidget.ownsViewZone(e)}};ta.ID="editor.contrib.inlineCompletionsController";ta=p5=G8e([yh(1,_t),yh(2,bt),yh(3,zt),yh(4,gn),yh(5,Va),yh(6,Ze),yh(7,MS),yh(8,Di)],ta);var Ng=globalThis&&globalThis.__awaiter||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 ON extends Ue{constructor(){super({id:ON.ID,label:m("action.inlineSuggest.showNext","Show Next Inline Suggestion"),alias:"Show Next Inline Suggestion",precondition:fe.and(O.writable,us.inlineSuggestionVisible),kbOpts:{weight:100,primary:606}})}run(e,t){var i;return Ng(this,void 0,void 0,function*(){const s=ta.get(t);(i=s==null?void 0:s.model.get())===null||i===void 0||i.next()})}}ON.ID=fne;class FN extends Ue{constructor(){super({id:FN.ID,label:m("action.inlineSuggest.showPrevious","Show Previous Inline Suggestion"),alias:"Show Previous Inline Suggestion",precondition:fe.and(O.writable,us.inlineSuggestionVisible),kbOpts:{weight:100,primary:604}})}run(e,t){var i;return Ng(this,void 0,void 0,function*(){const s=ta.get(t);(i=s==null?void 0:s.model.get())===null||i===void 0||i.previous()})}}FN.ID=hne;class Y8e extends Ue{constructor(){super({id:"editor.action.inlineSuggest.trigger",label:m("action.inlineSuggest.trigger","Trigger Inline Suggestion"),alias:"Trigger Inline Suggestion",precondition:O.writable})}run(e,t){var i;return Ng(this,void 0,void 0,function*(){const s=ta.get(t);(i=s==null?void 0:s.model.get())===null||i===void 0||i.triggerExplicitly()})}}class Z8e extends Ue{constructor(){super({id:"editor.action.inlineSuggest.acceptNextWord",label:m("action.inlineSuggest.acceptNextWord","Accept Next Word Of Inline Suggestion"),alias:"Accept Next Word Of Inline Suggestion",precondition:fe.and(O.writable,us.inlineSuggestionVisible),kbOpts:{weight:100+1,primary:2065,kbExpr:fe.and(O.writable,us.inlineSuggestionVisible)},menuOpts:[{menuId:M.InlineSuggestionToolbar,title:m("acceptWord","Accept Word"),group:"primary",order:2}]})}run(e,t){var i;return Ng(this,void 0,void 0,function*(){const s=ta.get(t);yield(i=s==null?void 0:s.model.get())===null||i===void 0?void 0:i.acceptNextWord(s.editor)})}}class X8e extends Ue{constructor(){super({id:"editor.action.inlineSuggest.acceptNextLine",label:m("action.inlineSuggest.acceptNextLine","Accept Next Line Of Inline Suggestion"),alias:"Accept Next Line Of Inline Suggestion",precondition:fe.and(O.writable,us.inlineSuggestionVisible),kbOpts:{weight:100+1},menuOpts:[{menuId:M.InlineSuggestionToolbar,title:m("acceptLine","Accept Line"),group:"secondary",order:2}]})}run(e,t){var i;return Ng(this,void 0,void 0,function*(){const s=ta.get(t);yield(i=s==null?void 0:s.model.get())===null||i===void 0?void 0:i.acceptNextLine(s.editor)})}}class Q8e extends Ue{constructor(){super({id:une,label:m("action.inlineSuggest.accept","Accept Inline Suggestion"),alias:"Accept Inline Suggestion",precondition:us.inlineSuggestionVisible,menuOpts:[{menuId:M.InlineSuggestionToolbar,title:m("accept","Accept"),group:"primary",order:1}],kbOpts:{primary:2,weight:200,kbExpr:fe.and(us.inlineSuggestionVisible,O.tabMovesFocus.toNegated(),us.inlineSuggestionHasIndentationLessThanTabSize,Tt.Visible.toNegated(),O.hoverFocused.toNegated())}})}run(e,t){var i;return Ng(this,void 0,void 0,function*(){const s=ta.get(t);s&&((i=s.model.get())===null||i===void 0||i.accept(s.editor),s.editor.focus())})}}class BN extends Ue{constructor(){super({id:BN.ID,label:m("action.inlineSuggest.hide","Hide Inline Suggestion"),alias:"Hide Inline Suggestion",precondition:us.inlineSuggestionVisible,kbOpts:{weight:100,primary:9}})}run(e,t){return Ng(this,void 0,void 0,function*(){const i=ta.get(t);Gi(s=>{var o;(o=i==null?void 0:i.model.get())===null||o===void 0||o.stop(s)})})}}BN.ID="editor.action.inlineSuggest.hide";class WN extends oa{constructor(){super({id:WN.ID,title:m("action.inlineSuggest.alwaysShowToolbar","Always Show Toolbar"),f1:!1,precondition:void 0,menu:[{id:M.InlineSuggestionToolbar,group:"secondary",order:10}],toggled:fe.equals("config.editor.inlineSuggest.showToolbar","always")})}run(e,t){return Ng(this,void 0,void 0,function*(){const i=e.get(zt),o=i.getValue("editor.inlineSuggest.showToolbar")==="always"?"onHover":"always";i.updateValue("editor.inlineSuggest.showToolbar",o)})}}WN.ID="editor.action.inlineSuggest.toggleAlwaysShowToolbar";var J8e=globalThis&&globalThis.__decorate||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},E1=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};class e9e{constructor(e,t,i){this.owner=e,this.range=t,this.controller=i}isValidForHoverAnchor(e){return e.type===1&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}}let m5=class{constructor(e,t,i,s,o,r){this._editor=e,this._languageService=t,this._openerService=i,this.accessibilityService=s,this._instantiationService=o,this._telemetryService=r,this.hoverOrdinal=4}suggestHoverAnchor(e){const t=ta.get(this._editor);if(!t)return null;const i=e.target;if(i.type===8){const s=i.detail;if(t.shouldShowHoverAtViewZone(s.viewZoneId))return new MD(1e3,this,I.fromPositions(this._editor.getModel().validatePosition(s.positionBefore||s.position)),e.event.posx,e.event.posy,!1)}return i.type===7&&t.shouldShowHoverAt(i.range)?new MD(1e3,this,i.range,e.event.posx,e.event.posy,!1):i.type===6&&i.detail.mightBeForeignElement&&t.shouldShowHoverAt(i.range)?new MD(1e3,this,i.range,e.event.posx,e.event.posy,!1):null}computeSync(e,t){if(this._editor.getOption(62).showToolbar==="always")return[];const i=ta.get(this._editor);return i&&i.shouldShowHoverAt(e.range)?[new e9e(this,e.range,i)]:[]}renderHoverParts(e,t){const i=new be,s=t[0];this._telemetryService.publicLog2("inlineCompletionHover.shown"),this.accessibilityService.isScreenReaderOptimized()&&!this._editor.getOption(8)&&this.renderScreenReaderText(e,s,i);const o=s.controller.model.get(),r=this._instantiationService.createInstance(lg,this._editor,!1,EI(null),o.selectedInlineCompletionIndex,o.inlineCompletionsCount,o.selectedInlineCompletion.map(a=>{var l;return(l=a==null?void 0:a.inlineCompletion.source.inlineCompletions.commands)!==null&&l!==void 0?l:[]}));return e.fragment.appendChild(r.getDomNode()),o.triggerExplicitly(),i.add(r),i}renderScreenReaderText(e,t,i){const s=ye,o=s("div.hover-row.markdown-hover"),r=ge(o,s("div.hover-contents",{"aria-live":"assertive"})),a=i.add(new Zu({editor:this._editor},this._languageService,this._openerService)),l=c=>{i.add(a.onDidRenderAsync(()=>{r.className="hover-contents code-hover-contents",e.onContentsChanged()}));const d=m("inlineSuggestionFollows","Suggestion:"),u=i.add(a.render(new Bs().appendText(d).appendCodeblock("text",c)));r.replaceChildren(u.element)};i.add(xi(c=>{var d;const u=(d=t.controller.model.read(c))===null||d===void 0?void 0:d.ghostText.read(c);if(u){const h=this._editor.getModel().getLineContent(u.lineNumber);l(u.renderForScreenReader(h))}else Es(r)})),e.fragment.appendChild(o)}};m5=J8e([E1(1,qi),E1(2,Ir),E1(3,oh),E1(4,_t),E1(5,ra)],m5);ti(ta.ID,ta,3);De(Y8e);De(ON);De(FN);De(Z8e);De(X8e);De(Q8e);De(BN);Ui(WN);c_.register(m5);function ur(n,e){let t=0;for(let i=0;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},i9e=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};function Jne(n,e,t,i,s){if(n.getLineCount()===1&&n.getLineMaxColumn(1)===1)return[];const o=e.getLanguageConfiguration(n.getLanguageId()).indentationRules;if(!o)return[];for(i=Math.min(i,n.getLineCount());t<=i&&o.unIndentedLinePattern;){const _=n.getLineContent(t);if(!o.unIndentedLinePattern.test(_))break;t++}if(t>i-1)return[];const{tabSize:r,indentSize:a,insertSpaces:l}=n.getOptions(),c=(_,v)=>(v=v||1,va.shiftIndent(_,_.length+v,r,a,l)),d=(_,v)=>(v=v||1,va.unshiftIndent(_,_.length+v,r,a,l)),u=[];let h;const f=n.getLineContent(t);let g=f;if(s!=null){h=s;const _=ki(f);g=h+f.substring(_.length),o.decreaseIndentPattern&&o.decreaseIndentPattern.test(g)&&(h=d(h),g=h+f.substring(_.length)),f!==g&&u.push(Yi.replaceMove(new Je(t,1,t,_.length+1),FE(h,a,l)))}else h=ki(f);let p=h;o.increaseIndentPattern&&o.increaseIndentPattern.test(g)?(p=c(p),h=c(h)):o.indentNextLinePattern&&o.indentNextLinePattern.test(g)&&(p=c(p)),t++;for(let _=t;_<=i;_++){const v=n.getLineContent(_),b=ki(v),C=p+v.substring(b.length);o.decreaseIndentPattern&&o.decreaseIndentPattern.test(C)&&(p=d(p),h=d(h)),b!==p&&u.push(Yi.replaceMove(new Je(_,1,_,b.length+1),FE(p,a,l))),!(o.unIndentedLinePattern&&o.unIndentedLinePattern.test(v))&&(o.increaseIndentPattern&&o.increaseIndentPattern.test(C)?(h=c(h),p=h):o.indentNextLinePattern&&o.indentNextLinePattern.test(C)?p=c(p):p=h)}return u}class VN extends Ue{constructor(){super({id:VN.ID,label:m("indentationToSpaces","Convert Indentation to Spaces"),alias:"Convert Indentation to Spaces",precondition:O.writable})}run(e,t){const i=t.getModel();if(!i)return;const s=i.getOptions(),o=t.getSelection();if(!o)return;const r=new r9e(o,s.tabSize);t.pushUndoStop(),t.executeCommands(this.id,[r]),t.pushUndoStop(),i.updateOptions({insertSpaces:!0})}}VN.ID="editor.action.indentationToSpaces";class HN extends Ue{constructor(){super({id:HN.ID,label:m("indentationToTabs","Convert Indentation to Tabs"),alias:"Convert Indentation to Tabs",precondition:O.writable})}run(e,t){const i=t.getModel();if(!i)return;const s=i.getOptions(),o=t.getSelection();if(!o)return;const r=new a9e(o,s.tabSize);t.pushUndoStop(),t.executeCommands(this.id,[r]),t.pushUndoStop(),i.updateOptions({insertSpaces:!1})}}HN.ID="editor.action.indentationToTabs";class g6 extends Ue{constructor(e,t,i){super(i),this.insertSpaces=e,this.displaySizeOnly=t}run(e,t){const i=e.get(yc),s=e.get(Zi),o=t.getModel();if(!o)return;const r=s.getCreationOptions(o.getLanguageId(),o.uri,o.isForSimpleWidget),a=o.getOptions(),l=[1,2,3,4,5,6,7,8].map(d=>({id:d.toString(),label:d.toString(),description:d===r.tabSize&&d===a.tabSize?m("configuredTabSize","Configured Tab Size"):d===r.tabSize?m("defaultTabSize","Default Tab Size"):d===a.tabSize?m("currentTabSize","Current Tab Size"):void 0})),c=Math.min(o.getOptions().tabSize-1,7);setTimeout(()=>{i.pick(l,{placeHolder:m({key:"selectTabWidth",comment:["Tab corresponds to the tab key"]},"Select Tab Size for Current File"),activeItem:l[c]}).then(d=>{if(d&&o&&!o.isDisposed()){const u=parseInt(d.label,10);this.displaySizeOnly?o.updateOptions({tabSize:u}):o.updateOptions({tabSize:u,indentSize:u,insertSpaces:this.insertSpaces})}})},50)}}class $N extends g6{constructor(){super(!1,!1,{id:$N.ID,label:m("indentUsingTabs","Indent Using Tabs"),alias:"Indent Using Tabs",precondition:void 0})}}$N.ID="editor.action.indentUsingTabs";class zN extends g6{constructor(){super(!0,!1,{id:zN.ID,label:m("indentUsingSpaces","Indent Using Spaces"),alias:"Indent Using Spaces",precondition:void 0})}}zN.ID="editor.action.indentUsingSpaces";class UN extends g6{constructor(){super(!0,!0,{id:UN.ID,label:m("changeTabDisplaySize","Change Tab Display Size"),alias:"Change Tab Display Size",precondition:void 0})}}UN.ID="editor.action.changeTabDisplaySize";class jN extends Ue{constructor(){super({id:jN.ID,label:m("detectIndentation","Detect Indentation from Content"),alias:"Detect Indentation from Content",precondition:void 0})}run(e,t){const i=e.get(Zi),s=t.getModel();if(!s)return;const o=i.getCreationOptions(s.getLanguageId(),s.uri,s.isForSimpleWidget);s.detectIndentation(o.insertSpaces,o.tabSize)}}jN.ID="editor.action.detectIndentation";class n9e extends Ue{constructor(){super({id:"editor.action.reindentlines",label:m("editor.reindentlines","Reindent Lines"),alias:"Reindent Lines",precondition:O.writable})}run(e,t){const i=e.get(Ni),s=t.getModel();if(!s)return;const o=Jne(s,i,1,s.getLineCount());o.length>0&&(t.pushUndoStop(),t.executeEdits(this.id,o),t.pushUndoStop())}}class s9e extends Ue{constructor(){super({id:"editor.action.reindentselectedlines",label:m("editor.reindentselectedlines","Reindent Selected Lines"),alias:"Reindent Selected Lines",precondition:O.writable})}run(e,t){const i=e.get(Ni),s=t.getModel();if(!s)return;const o=t.getSelections();if(o===null)return;const r=[];for(const a of o){let l=a.startLineNumber,c=a.endLineNumber;if(l!==c&&a.endColumn===1&&c--,l===1){if(l===c)continue}else l--;const d=Jne(s,i,l,c);r.push(...d)}r.length>0&&(t.pushUndoStop(),t.executeEdits(this.id,r),t.pushUndoStop())}}class o9e{constructor(e,t){this._initialSelection=t,this._edits=[],this._selectionId=null;for(const i of e)i.range&&typeof i.text=="string"&&this._edits.push(i)}getEditOperations(e,t){for(const s of this._edits)t.addEditOperation(I.lift(s.range),s.text);let i=!1;Array.isArray(this._edits)&&this._edits.length===1&&this._initialSelection.isEmpty()&&(this._edits[0].range.startColumn===this._initialSelection.endColumn&&this._edits[0].range.startLineNumber===this._initialSelection.endLineNumber?(i=!0,this._selectionId=t.trackSelection(this._initialSelection,!0)):this._edits[0].range.endColumn===this._initialSelection.startColumn&&this._edits[0].range.endLineNumber===this._initialSelection.startLineNumber&&(i=!0,this._selectionId=t.trackSelection(this._initialSelection,!1))),i||(this._selectionId=t.trackSelection(this._initialSelection))}computeCursorState(e,t){return t.getTrackedSelection(this._selectionId)}}let xy=class{constructor(e,t){this.editor=e,this._languageConfigurationService=t,this.callOnDispose=new be,this.callOnModel=new be,this.callOnDispose.add(e.onDidChangeConfiguration(()=>this.update())),this.callOnDispose.add(e.onDidChangeModel(()=>this.update())),this.callOnDispose.add(e.onDidChangeModelLanguage(()=>this.update()))}update(){this.callOnModel.clear(),!(this.editor.getOption(12)<4||this.editor.getOption(55))&&this.editor.hasModel()&&this.callOnModel.add(this.editor.onDidPaste(({range:e})=>{this.trigger(e)}))}trigger(e){const t=this.editor.getSelections();if(t===null||t.length>1)return;const i=this.editor.getModel();if(!i||!i.tokenization.isCheapToTokenize(e.getStartPosition().lineNumber))return;const s=this.editor.getOption(12),{tabSize:o,indentSize:r,insertSpaces:a}=i.getOptions(),l=[],c={shiftIndent:f=>va.shiftIndent(f,f.length+1,o,r,a),unshiftIndent:f=>va.unshiftIndent(f,f.length+1,o,r,a)};let d=e.startLineNumber;for(;d<=e.endLineNumber;){if(this.shouldIgnoreLine(i,d)){d++;continue}break}if(d>e.endLineNumber)return;let u=i.getLineContent(d);if(!/\S/.test(u.substring(0,e.startColumn-1))){const f=wC(s,i,i.getLanguageId(),d,c,this._languageConfigurationService);if(f!==null){const g=ki(u),p=ur(f,o),_=ur(g,o);if(p!==_){const v=zC(p,o,a);l.push({range:new I(d,1,d,g.length+1),text:v}),u=v+u.substr(g.length)}else{const v=gJ(i,d,this._languageConfigurationService);if(v===0||v===8)return}}}const h=d;for(;di.tokenization.getLineTokens(p),getLanguageId:()=>i.getLanguageId(),getLanguageIdAtPosition:(p,_)=>i.getLanguageIdAtPosition(p,_)},getLineContent:p=>p===h?u:i.getLineContent(p)},i.getLanguageId(),d+1,c,this._languageConfigurationService);if(g!==null){const p=ur(g,o),_=ur(ki(i.getLineContent(d+1)),o);if(p!==_){const v=p-_;for(let b=d+1;b<=e.endLineNumber;b++){const C=i.getLineContent(b),w=ki(C),L=ur(w,o)+v,S=zC(L,o,a);S!==w&&l.push({range:new I(b,1,b,w.length+1),text:S})}}}}if(l.length>0){this.editor.pushUndoStop();const f=new o9e(l,this.editor.getSelection());this.editor.executeCommand("autoIndentOnPaste",f),this.editor.pushUndoStop()}}shouldIgnoreLine(e,t){e.tokenization.forceTokenization(t);const i=e.getLineFirstNonWhitespaceColumn(t);if(i===0)return!0;const s=e.tokenization.getLineTokens(t);if(s.getCount()>0){const o=s.findTokenIndexAtOffset(i);if(o>=0&&s.getStandardTokenType(o)===1)return!0}return!1}dispose(){this.callOnDispose.dispose(),this.callOnModel.dispose()}};xy.ID="editor.contrib.autoIndentOnPaste";xy=t9e([i9e(1,Ni)],xy);function ese(n,e,t,i){if(n.getLineCount()===1&&n.getLineMaxColumn(1)===1)return;let s="";for(let r=0;rthis._currentResolve=void 0)),yield this._currentResolve}})}_doResolve(e){var t,i;return tT(this,void 0,void 0,function*(){try{const s=yield Promise.resolve(this.provider.resolveInlayHint(this.hint,e));this.hint.tooltip=(t=s==null?void 0:s.tooltip)!==null&&t!==void 0?t:this.hint.tooltip,this.hint.label=(i=s==null?void 0:s.label)!==null&&i!==void 0?i:this.hint.label,this._isResolved=!0}catch(s){Bn(s),this._isResolved=!1}})}}class Ny{static create(e,t,i,s){return tT(this,void 0,void 0,function*(){const o=[],r=e.ordered(t).reverse().map(a=>i.map(l=>tT(this,void 0,void 0,function*(){try{const c=yield a.provideInlayHints(t,l,s);c!=null&&c.hints.length&&o.push([c,a])}catch(c){Bn(c)}})));if(yield Promise.all(r.flat()),s.isCancellationRequested||t.isDisposed())throw new Sg;return new Ny(i,o,t)})}constructor(e,t,i){this._disposables=new be,this.ranges=e,this.provider=new Set;const s=[];for(const[o,r]of t){this._disposables.add(o),this.provider.add(r);for(const a of o.hints){const l=i.validatePosition(a.position);let c="before";const d=Ny._getRangeAtPosition(i,l);let u;d.getStartPosition().isBefore(l)?(u=I.fromPositions(d.getStartPosition(),l),c="after"):(u=I.fromPositions(l,d.getEndPosition()),c="before"),s.push(new p6(a,new tse(u,c),r))}}this.items=s.sort((o,r)=>Y.compare(o.hint.position,r.hint.position))}dispose(){this._disposables.dispose()}static _getRangeAtPosition(e,t){const i=t.lineNumber,s=e.getWordAtPosition(t);if(s)return new I(i,s.startColumn,i,s.endColumn);e.tokenization.tokenizeIfCheap(i);const o=e.tokenization.getLineTokens(i),r=t.column-1,a=o.findTokenIndexAtOffset(r);let l=o.getStartOffset(a),c=o.getEndOffset(a);return c-l===1&&(l===r&&a>1?(l=o.getStartOffset(a-1),c=o.getEndOffset(a-1)):c===r&&aiv(g)?g.command.id:SN()));for(const g of mo.all())h.has(g.desc.id)&&u.push(new Ro(g.desc.id,fl.label(g.desc,{renderShortTitle:!0}),void 0,!0,()=>UC(this,void 0,void 0,function*(){const p=yield o.createModelReference(d.uri);try{const _=new Yb(p.object.textEditorModel,I.getStartPosition(d.range)),v=i.item.anchor.range;yield l.invokeFunction(g.runEditorCommand.bind(g),e,_,v)}finally{p.dispose()}})));if(i.part.command){const{command:g}=i.part;u.push(new hs),u.push(new Ro(g.id,g.title,void 0,!0,()=>UC(this,void 0,void 0,function*(){var p;try{yield a.executeCommand(g.id,...(p=g.arguments)!==null&&p!==void 0?p:[])}catch(_){c.notify({severity:Nx.Error,source:i.item.provider.displayName,message:_})}})))}const f=e.getOption(126);r.showContextMenu({domForShadowRoot:f&&(s=e.getDomNode())!==null&&s!==void 0?s:void 0,getAnchor:()=>{const g=Un(t);return{x:g.left,y:g.top+g.height+8}},getActions:()=>u,onHide:()=>{e.focus()},autoSelectFirstItem:!0})})}function ise(n,e,t,i){return UC(this,void 0,void 0,function*(){const o=yield n.get(sr).createModelReference(i.uri);yield t.invokeWithinContext(r=>UC(this,void 0,void 0,function*(){const a=e.hasSideBySideModifier,l=r.get(bt),c=tr.inPeekEditor.getValue(l),d=!a&&t.getOption(87)&&!c;return new US({openToSide:a,openInPeek:d,muteMessage:!0},{title:{value:"",original:""},id:"",precondition:void 0}).run(r,new Yb(o.object.textEditorModel,I.getStartPosition(i.range)),I.lift(i.range))})),o.dispose()})}var d9e=globalThis&&globalThis.__decorate||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},F_=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},Q_=globalThis&&globalThis.__awaiter||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())})},FD;class iT{constructor(){this._entries=new Dg(50)}get(e){const t=iT._key(e);return this._entries.get(t)}set(e,t){const i=iT._key(e);this._entries.set(i,t)}static _key(e){return"".concat(e.uri.toString(),"/").concat(e.getVersionId())}}const nse=Wt("IInlayHintsCache");Gt(nse,iT,1);class _5{constructor(e,t){this.item=e,this.index=t}get part(){const e=this.item.hint.label;return typeof e=="string"?{label:e}:e[this.index]}}class u9e{constructor(e,t){this.part=e,this.hasTriggerModifier=t}}let xm=FD=class{static get(e){var t;return(t=e.getContribution(FD.ID))!==null&&t!==void 0?t:void 0}constructor(e,t,i,s,o,r,a){this._editor=e,this._languageFeaturesService=t,this._inlayHintsCache=s,this._commandService=o,this._notificationService=r,this._instaService=a,this._disposables=new be,this._sessionDisposables=new be,this._decorationsMetadata=new Map,this._ruleFactory=new mS(this._editor),this._activeRenderMode=0,this._debounceInfo=i.for(t.inlayHintsProvider,"InlayHint",{min:25}),this._disposables.add(t.inlayHintsProvider.onDidChange(()=>this._update())),this._disposables.add(e.onDidChangeModel(()=>this._update())),this._disposables.add(e.onDidChangeModelLanguage(()=>this._update())),this._disposables.add(e.onDidChangeConfiguration(l=>{l.hasChanged(139)&&this._update()})),this._update()}dispose(){this._sessionDisposables.dispose(),this._removeAllDecorations(),this._disposables.dispose()}_update(){this._sessionDisposables.clear(),this._removeAllDecorations();const e=this._editor.getOption(139);if(e.enabled==="off")return;const t=this._editor.getModel();if(!t||!this._languageFeaturesService.inlayHintsProvider.has(t))return;const i=this._inlayHintsCache.get(t);i&&this._updateHintsDecorators([t.getFullModelRange()],i),this._sessionDisposables.add(vt(()=>{t.isDisposed()||this._cacheHintsForFastRestore(t)}));let s;const o=new Set,r=new Si(()=>Q_(this,void 0,void 0,function*(){const a=Date.now();s==null||s.dispose(!0),s=new Tn;const l=t.onWillDispose(()=>s==null?void 0:s.cancel());try{const c=s.token,d=yield Ny.create(this._languageFeaturesService.inlayHintsProvider,t,this._getHintsRanges(),c);if(r.delay=this._debounceInfo.update(t,Date.now()-a),c.isCancellationRequested){d.dispose();return}for(const u of d.provider)typeof u.onDidChangeInlayHints=="function"&&!o.has(u)&&(o.add(u),this._sessionDisposables.add(u.onDidChangeInlayHints(()=>{r.isScheduled()||r.schedule()})));this._sessionDisposables.add(d),this._updateHintsDecorators(d.ranges,d.items),this._cacheHintsForFastRestore(t)}catch(c){Dt(c)}finally{s.dispose(),l.dispose()}}),this._debounceInfo.get(t));if(this._sessionDisposables.add(r),this._sessionDisposables.add(vt(()=>s==null?void 0:s.dispose(!0))),r.schedule(0),this._sessionDisposables.add(this._editor.onDidScrollChange(a=>{(a.scrollTopChanged||!r.isScheduled())&&r.schedule()})),this._sessionDisposables.add(this._editor.onDidChangeModelContent(a=>{const l=Math.max(r.delay,1250);r.schedule(l)})),e.enabled==="on")this._activeRenderMode=0;else{let a,l;e.enabled==="onUnlessPressed"?(a=0,l=1):(a=1,l=0),this._activeRenderMode=a,this._sessionDisposables.add(wu.getInstance().event(c=>{if(!this._editor.hasModel())return;const d=c.altKey&&c.ctrlKey&&!(c.shiftKey||c.metaKey)?l:a;if(d!==this._activeRenderMode){this._activeRenderMode=d;const u=this._editor.getModel(),h=this._copyInlayHintsWithCurrentAnchor(u);this._updateHintsDecorators([u.getFullModelRange()],h),r.schedule(0)}}))}this._sessionDisposables.add(this._installDblClickGesture(()=>r.schedule(0))),this._sessionDisposables.add(this._installLinkGesture()),this._sessionDisposables.add(this._installContextMenu())}_installLinkGesture(){const e=new be,t=e.add(new gN(this._editor)),i=new be;return e.add(i),e.add(t.onMouseMoveOrRelevantKeyDown(s=>{const[o]=s,r=this._getInlayHintLabelPart(o),a=this._editor.getModel();if(!r||!a){i.clear();return}const l=new Tn;i.add(vt(()=>l.dispose(!0))),r.item.resolve(l.token),this._activeInlayHintPart=r.part.command||r.part.location?new u9e(r,o.hasTriggerModifier):void 0;const c=a.validatePosition(r.item.hint.position).lineNumber,d=new I(c,1,c,a.getLineMaxColumn(c)),u=this._getInlineHintsForRange(d);this._updateHintsDecorators([d],u),i.add(vt(()=>{this._activeInlayHintPart=void 0,this._updateHintsDecorators([d],u)}))})),e.add(t.onCancel(()=>i.clear())),e.add(t.onExecute(s=>Q_(this,void 0,void 0,function*(){const o=this._getInlayHintLabelPart(s);if(o){const r=o.part;r.location?this._instaService.invokeFunction(ise,s,this._editor,r.location):Y2.is(r.command)&&(yield this._invokeCommand(r.command,o.item))}}))),e}_getInlineHintsForRange(e){const t=new Set;for(const i of this._decorationsMetadata.values())e.containsRange(i.item.anchor.range)&&t.add(i.item);return Array.from(t)}_installDblClickGesture(e){return this._editor.onMouseUp(t=>Q_(this,void 0,void 0,function*(){if(t.event.detail!==2)return;const i=this._getInlayHintLabelPart(t);if(i&&(t.event.preventDefault(),yield i.item.resolve(Ft.None),io(i.item.hint.textEdits))){const s=i.item.hint.textEdits.map(o=>Yi.replace(I.lift(o.range),o.text));this._editor.executeEdits("inlayHint.default",s),e()}}))}_installContextMenu(){return this._editor.onContextMenu(e=>Q_(this,void 0,void 0,function*(){if(!(e.event.target instanceof HTMLElement))return;const t=this._getInlayHintLabelPart(e);t&&(yield this._instaService.invokeFunction(c9e,this._editor,e.event.target,t))}))}_getInlayHintLabelPart(e){var t;if(e.target.type!==6)return;const i=(t=e.target.detail.injectedText)===null||t===void 0?void 0:t.options;if(i instanceof eg&&(i==null?void 0:i.attachedData)instanceof _5)return i.attachedData}_invokeCommand(e,t){var i;return Q_(this,void 0,void 0,function*(){try{yield this._commandService.executeCommand(e.id,...(i=e.arguments)!==null&&i!==void 0?i:[])}catch(s){this._notificationService.notify({severity:Nx.Error,source:t.provider.displayName,message:s})}})}_cacheHintsForFastRestore(e){const t=this._copyInlayHintsWithCurrentAnchor(e);this._inlayHintsCache.set(e,t)}_copyInlayHintsWithCurrentAnchor(e){const t=new Map;for(const[i,s]of this._decorationsMetadata){if(t.has(s.item))continue;const o=e.getDecorationRange(i);if(o){const r=new tse(o,s.item.anchor.direction),a=s.item.with({anchor:r});t.set(s.item,a)}}return Array.from(t.values())}_getHintsRanges(){const t=this._editor.getModel(),i=this._editor.getVisibleRangesPlusViewportAboveBelow(),s=[];for(const o of i.sort(I.compareRangesUsingStarts)){const r=t.validateRange(new I(o.startLineNumber-30,o.startColumn,o.endLineNumber+30,o.endColumn));s.length===0||!I.areIntersectingOrTouching(s[s.length-1],r)?s.push(r):s[s.length-1]=I.plusRange(s[s.length-1],r)}return s}_updateHintsDecorators(e,t){var i,s;const o=[],r=(p,_,v,b,C)=>{const w={content:v,inlineClassNameAffectsLetterSpacing:!0,inlineClassName:_.className,cursorStops:b,attachedData:C};o.push({item:p,classNameRef:_,decoration:{range:p.anchor.range,options:{description:"InlayHint",showIfCollapsed:p.anchor.range.isEmpty(),collapseOnReplaceEdit:!p.anchor.range.isEmpty(),stickiness:0,[p.anchor.direction]:this._activeRenderMode===0?w:void 0}}})},a=(p,_)=>{const v=this._ruleFactory.createClassNameRef({width:"".concat(l/3|0,"px"),display:"inline-block"});r(p,v," ",_?Jl.Right:Jl.None)},{fontSize:l,fontFamily:c,padding:d,isUniform:u}=this._getLayoutInfo(),h="--code-editorInlayHintsFontFamily";this._editor.getContainerDomNode().style.setProperty(h,c);for(const p of t){p.hint.paddingLeft&&a(p,!1);const _=typeof p.hint.label=="string"?[{label:p.hint.label}]:p.hint.label;for(let v=0;v<_.length;v++){const b=_[v],C=v===0,w=v===_.length-1,y={fontSize:"".concat(l,"px"),fontFamily:"var(".concat(h,"), ").concat(wr.fontFamily),verticalAlign:u?"baseline":"middle",unicodeBidi:"isolate"};io(p.hint.textEdits)&&(y.cursor="default"),this._fillInColors(y,p.hint),(b.command||b.location)&&((i=this._activeInlayHintPart)===null||i===void 0?void 0:i.part.item)===p&&this._activeInlayHintPart.part.index===v&&(y.textDecoration="underline",this._activeInlayHintPart.hasTriggerModifier&&(y.color=sn(qwe),y.cursor="pointer")),d&&(C&&w?(y.padding="1px ".concat(Math.max(1,l/4)|0,"px"),y.borderRadius="".concat(l/4|0,"px")):C?(y.padding="1px 0 1px ".concat(Math.max(1,l/4)|0,"px"),y.borderRadius="".concat(l/4|0,"px 0 0 ").concat(l/4|0,"px")):w?(y.padding="1px ".concat(Math.max(1,l/4)|0,"px 1px 0"),y.borderRadius="0 ".concat(l/4|0,"px ").concat(l/4|0,"px 0")):y.padding="1px 0 1px 0"),r(p,this._ruleFactory.createClassNameRef(y),h9e(b.label),w&&!p.hint.paddingRight?Jl.Right:Jl.None,new _5(p,v))}if(p.hint.paddingRight&&a(p,!0),o.length>FD._MAX_DECORATORS)break}const f=[];for(const p of e)for(const{id:_}of(s=this._editor.getDecorationsInRange(p))!==null&&s!==void 0?s:[]){const v=this._decorationsMetadata.get(_);v&&(f.push(_),v.classNameRef.dispose(),this._decorationsMetadata.delete(_))}const g=mc.capture(this._editor);this._editor.changeDecorations(p=>{const _=p.deltaDecorations(f,o.map(v=>v.decoration));for(let v=0;v<_.length;v++){const b=o[v];this._decorationsMetadata.set(_[v],b)}}),g.restore(this._editor)}_fillInColors(e,t){t.kind===gE.Parameter?(e.backgroundColor=sn(Xwe),e.color=sn(Zwe)):t.kind===gE.Type?(e.backgroundColor=sn(Ywe),e.color=sn(Gwe)):(e.backgroundColor=sn(Du),e.color=sn(ku))}_getLayoutInfo(){const e=this._editor.getOption(139),t=e.padding,i=this._editor.getOption(52),s=this._editor.getOption(49);let o=e.fontSize;(!o||o<5||o>i)&&(o=i);const r=e.fontFamily||s;return{fontSize:o,fontFamily:r,padding:t,isUniform:!t&&r===s&&o===i}}_removeAllDecorations(){this._editor.removeDecorations(Array.from(this._decorationsMetadata.keys()));for(const e of this._decorationsMetadata.values())e.classNameRef.dispose();this._decorationsMetadata.clear()}};xm.ID="editor.contrib.InlayHints";xm._MAX_DECORATORS=1500;xm=FD=d9e([F_(1,Ze),F_(2,Va),F_(3,nse),F_(4,gn),F_(5,Nn),F_(6,_t)],xm);function h9e(n){const e=" ";return n.replace(/[ \t]/g,e)}qt.registerCommand("_executeInlayHintProvider",(n,...e)=>Q_(void 0,void 0,void 0,function*(){const[t,i]=e;bi(ct.isUri(t)),bi(I.isIRange(i));const{inlayHintsProvider:s}=n.get(Ze),o=yield n.get(sr).createModelReference(t);try{const r=yield Ny.create(s,o.object.textEditorModel,[I.lift(i)],Ft.None),a=r.items.map(l=>l.hint);return setTimeout(()=>r.dispose(),0),a}finally{o.dispose()}}));var f9e=globalThis&&globalThis.__decorate||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},I1=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},gK=globalThis&&globalThis.__awaiter||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())})},g9e=globalThis&&globalThis.__asyncValues||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)}};class pK extends MD{constructor(e,t,i,s){super(10,t,e.item.anchor.range,i,s,!0),this.part=e}}let v5=class extends $I{constructor(e,t,i,s,o,r){super(e,t,i,s,r),this._resolverService=o,this.hoverOrdinal=6}suggestHoverAnchor(e){var t;if(!xm.get(this._editor)||e.target.type!==6)return null;const s=(t=e.target.detail.injectedText)===null||t===void 0?void 0:t.options;return s instanceof eg&&s.attachedData instanceof _5?new pK(s.attachedData,this,e.event.posx,e.event.posy):null}computeSync(){return[]}computeAsync(e,t,i){return e instanceof pK?new Mn(s=>gK(this,void 0,void 0,function*(){var o,r,a,l;const{part:c}=e;if(yield c.item.resolve(i),i.isCancellationRequested)return;let d;typeof c.item.hint.tooltip=="string"?d=new Bs().appendText(c.item.hint.tooltip):c.item.hint.tooltip&&(d=c.item.hint.tooltip),d&&s.emitOne(new Yl(this,e.range,[d],!1,0)),io(c.item.hint.textEdits)&&s.emitOne(new Yl(this,e.range,[new Bs().appendText(m("hint.dbl","Double-click to insert"))],!1,10001));let u;if(typeof c.part.tooltip=="string"?u=new Bs().appendText(c.part.tooltip):c.part.tooltip&&(u=c.part.tooltip),u&&s.emitOne(new Yl(this,e.range,[u],!1,1)),c.part.location||c.part.command){let _;const b=this._editor.getOption(77)==="altKey"?Kt?m("links.navigate.kb.meta.mac","cmd + click"):m("links.navigate.kb.meta","ctrl + click"):Kt?m("links.navigate.kb.alt.mac","option + click"):m("links.navigate.kb.alt","alt + click");c.part.location&&c.part.command?_=new Bs().appendText(m("hint.defAndCommand","Go to Definition ({0}), right click for more",b)):c.part.location?_=new Bs().appendText(m("hint.def","Go to Definition ({0})",b)):c.part.command&&(_=new Bs("[".concat(m("hint.cmd","Execute Command"),"](").concat(l9e(c.part.command),' "').concat(c.part.command.title,'") (').concat(b,")"),{isTrusted:!0})),_&&s.emitOne(new Yl(this,e.range,[_],!1,1e4))}const h=yield this._resolveInlayHintLabelPartHover(c,i);try{for(var f=!0,g=g9e(h),p;p=yield g.next(),o=p.done,!o;f=!0){l=p.value,f=!1;const _=l;s.emitOne(_)}}catch(_){r={error:_}}finally{try{!f&&!o&&(a=g.return)&&(yield a.call(g))}finally{if(r)throw r.error}}})):Mn.EMPTY}_resolveInlayHintLabelPartHover(e,t){return gK(this,void 0,void 0,function*(){if(!e.part.location)return Mn.EMPTY;const{uri:i,range:s}=e.part.location,o=yield this._resolverService.createModelReference(i);try{const r=o.object.textEditorModel;return this._languageFeaturesService.hoverProvider.has(r)?K7(this._languageFeaturesService.hoverProvider,r,new Y(s.startLineNumber,s.startColumn),t).filter(a=>!Vb(a.hover.contents)).map(a=>new Yl(this,e.item.anchor.range,a.hover.contents,!1,2+a.ordinal)):Mn.EMPTY}finally{o.dispose()}})}};v5=f9e([I1(1,qi),I1(2,Ir),I1(3,zt),I1(4,sr),I1(5,Ze)],v5);ti(xm.ID,xm,1);c_.register(v5);class p9e{constructor(e,t,i){this._editRange=e,this._originalSelection=t,this._text=i}getEditOperations(e,t){t.addTrackedEditOperation(this._editRange,this._text)}computeCursorState(e,t){const s=t.getInverseEditOperations()[0].range;return this._originalSelection.isEmpty()?new Je(s.endLineNumber,Math.min(this._originalSelection.positionColumn,s.endColumn),s.endLineNumber,Math.min(this._originalSelection.positionColumn,s.endColumn)):new Je(s.endLineNumber,s.endColumn-this._text.length,s.endLineNumber,s.endColumn)}}var m9e=globalThis&&globalThis.__decorate||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},_9e=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},BD;let dg=BD=class{static get(e){return e.getContribution(BD.ID)}constructor(e,t){this.editor=e,this.editorWorkerService=t,this.decorations=this.editor.createDecorationsCollection()}dispose(){}run(e,t){var i;(i=this.currentRequest)===null||i===void 0||i.cancel();const s=this.editor.getSelection(),o=this.editor.getModel();if(!o||!s)return;let r=s;if(r.startLineNumber!==r.endLineNumber)return;const a=new Wte(this.editor,5),l=o.uri;return this.editorWorkerService.canNavigateValueSet(l)?(this.currentRequest=Xn(c=>this.editorWorkerService.navigateValueSet(l,r,t)),this.currentRequest.then(c=>{var d;if(!c||!c.range||!c.value||!a.validate(this.editor))return;const u=I.lift(c.range);let h=c.range;const f=c.value.length-(r.endColumn-r.startColumn);h={startLineNumber:h.startLineNumber,startColumn:h.startColumn,endLineNumber:h.endLineNumber,endColumn:h.startColumn+c.value.length},f>1&&(r=new Je(r.startLineNumber,r.startColumn,r.endLineNumber,r.endColumn+f-1));const g=new p9e(u,r,c.value);this.editor.pushUndoStop(),this.editor.executeCommand(e,g),this.editor.pushUndoStop(),this.decorations.set([{range:h,options:BD.DECORATION}]),(d=this.decorationRemover)===null||d===void 0||d.cancel(),this.decorationRemover=jf(350),this.decorationRemover.then(()=>this.decorations.clear()).catch(Dt)}).catch(Dt)):Promise.resolve(void 0)}};dg.ID="editor.contrib.inPlaceReplaceController";dg.DECORATION=kt.register({description:"in-place-replace",className:"valueSetReplacement"});dg=BD=m9e([_9e(1,Sl)],dg);class v9e extends Ue{constructor(){super({id:"editor.action.inPlaceReplace.up",label:m("InPlaceReplaceAction.previous.label","Replace with Previous Value"),alias:"Replace with Previous Value",precondition:O.writable,kbOpts:{kbExpr:O.editorTextFocus,primary:3159,weight:100}})}run(e,t){const i=dg.get(t);return i?i.run(this.id,!1):Promise.resolve(void 0)}}class b9e extends Ue{constructor(){super({id:"editor.action.inPlaceReplace.down",label:m("InPlaceReplaceAction.next.label","Replace with Next Value"),alias:"Replace with Next Value",precondition:O.writable,kbOpts:{kbExpr:O.editorTextFocus,primary:3161,weight:100}})}run(e,t){const i=dg.get(t);return i?i.run(this.id,!0):Promise.resolve(void 0)}}ti(dg.ID,dg,4);De(v9e);De(b9e);class C9e extends Ue{constructor(){super({id:"expandLineSelection",label:m("expandLineSelection","Expand Line Selection"),alias:"Expand Line Selection",precondition:void 0,kbOpts:{weight:0,kbExpr:O.textInputFocus,primary:2090}})}run(e,t,i){if(i=i||{},!t.hasModel())return;const s=t._getViewModel();s.model.pushStackElement(),s.setCursorStates(i.source,3,ms.expandLineSelection(s,s.getCursorStates())),s.revealPrimaryCursor(i.source,!0)}}De(C9e);class w9e{constructor(e,t){this._selection=e,this._cursors=t,this._selectionId=null}getEditOperations(e,t){const i=y9e(e,this._cursors);for(let s=0,o=i.length;sr.lineNumber===a.lineNumber?r.column-a.column:r.lineNumber-a.lineNumber);for(let r=e.length-2;r>=0;r--)e[r].lineNumber===e[r+1].lineNumber&&e.splice(r,1);const t=[];let i=0,s=0;const o=e.length;for(let r=1,a=n.getLineCount();r<=a;r++){const l=n.getLineContent(r),c=l.length+1;let d=0;if(s=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},L9e=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let b5=class{constructor(e,t,i,s){this._languageConfigurationService=s,this._selection=e,this._isMovingDown=t,this._autoIndent=i,this._selectionId=null,this._moveEndLineSelectionShrink=!1}getEditOperations(e,t){const i=e.getLineCount();if(this._isMovingDown&&this._selection.endLineNumber===i){this._selectionId=t.trackSelection(this._selection);return}if(!this._isMovingDown&&this._selection.startLineNumber===1){this._selectionId=t.trackSelection(this._selection);return}this._moveEndPositionDown=!1;let s=this._selection;s.startLineNumbere.tokenization.getLineTokens(d),getLanguageId:()=>e.getLanguageId(),getLanguageIdAtPosition:(d,u)=>e.getLanguageIdAtPosition(d,u)},getLineContent:null};if(s.startLineNumber===s.endLineNumber&&e.getLineMaxColumn(s.startLineNumber)===1){const d=s.startLineNumber,u=this._isMovingDown?d+1:d-1;e.getLineMaxColumn(u)===1?t.addEditOperation(new I(1,1,1,1),null):(t.addEditOperation(new I(d,1,d,1),e.getLineContent(u)),t.addEditOperation(new I(u,1,u,e.getLineMaxColumn(u)),null)),s=new Je(u,1,u,1)}else{let d,u;if(this._isMovingDown){d=s.endLineNumber+1,u=e.getLineContent(d),t.addEditOperation(new I(d-1,e.getLineMaxColumn(d-1),d,e.getLineMaxColumn(d)),null);let h=u;if(this.shouldAutoIndent(e,s)){const f=this.matchEnterRule(e,l,o,d,s.startLineNumber-1);if(f!==null){const p=ki(e.getLineContent(d)),_=f+ur(p,o);h=zC(_,o,a)+this.trimStart(u)}else{c.getLineContent=_=>_===s.startLineNumber?e.getLineContent(d):e.getLineContent(_);const p=wC(this._autoIndent,c,e.getLanguageIdAtPosition(d,1),s.startLineNumber,l,this._languageConfigurationService);if(p!==null){const _=ki(e.getLineContent(d)),v=ur(p,o),b=ur(_,o);v!==b&&(h=zC(v,o,a)+this.trimStart(u))}}t.addEditOperation(new I(s.startLineNumber,1,s.startLineNumber,1),h+"\n");const g=this.matchEnterRuleMovingDown(e,l,o,s.startLineNumber,d,h);if(g!==null)g!==0&&this.getIndentEditsOfMovingBlock(e,t,s,o,a,g);else{c.getLineContent=_=>_===s.startLineNumber?h:_>=s.startLineNumber+1&&_<=s.endLineNumber+1?e.getLineContent(_-1):e.getLineContent(_);const p=wC(this._autoIndent,c,e.getLanguageIdAtPosition(d,1),s.startLineNumber+1,l,this._languageConfigurationService);if(p!==null){const _=ki(e.getLineContent(s.startLineNumber)),v=ur(p,o),b=ur(_,o);if(v!==b){const C=v-b;this.getIndentEditsOfMovingBlock(e,t,s,o,a,C)}}}}else t.addEditOperation(new I(s.startLineNumber,1,s.startLineNumber,1),h+"\n")}else if(d=s.startLineNumber-1,u=e.getLineContent(d),t.addEditOperation(new I(d,1,d+1,1),null),t.addEditOperation(new I(s.endLineNumber,e.getLineMaxColumn(s.endLineNumber),s.endLineNumber,e.getLineMaxColumn(s.endLineNumber)),"\n"+u),this.shouldAutoIndent(e,s)){c.getLineContent=f=>f===d?e.getLineContent(s.startLineNumber):e.getLineContent(f);const h=this.matchEnterRule(e,l,o,s.startLineNumber,s.startLineNumber-2);if(h!==null)h!==0&&this.getIndentEditsOfMovingBlock(e,t,s,o,a,h);else{const f=wC(this._autoIndent,c,e.getLanguageIdAtPosition(s.startLineNumber,1),d,l,this._languageConfigurationService);if(f!==null){const g=ki(e.getLineContent(s.startLineNumber)),p=ur(f,o),_=ur(g,o);if(p!==_){const v=p-_;this.getIndentEditsOfMovingBlock(e,t,s,o,a,v)}}}}}this._selectionId=t.trackSelection(s)}buildIndentConverter(e,t,i){return{shiftIndent:s=>va.shiftIndent(s,s.length+1,e,t,i),unshiftIndent:s=>va.unshiftIndent(s,s.length+1,e,t,i)}}parseEnterResult(e,t,i,s,o){if(o){let r=o.indentation;o.indentAction===Pn.None||o.indentAction===Pn.Indent?r=o.indentation+o.appendText:o.indentAction===Pn.IndentOutdent?r=o.indentation:o.indentAction===Pn.Outdent&&(r=t.unshiftIndent(o.indentation)+o.appendText);const a=e.getLineContent(s);if(this.trimStart(a).indexOf(this.trimStart(r))>=0){const l=ki(e.getLineContent(s));let c=ki(r);const d=gJ(e,s,this._languageConfigurationService);d!==null&&d&2&&(c=t.unshiftIndent(c));const u=ur(c,i),h=ur(l,i);return u-h}}return null}matchEnterRuleMovingDown(e,t,i,s,o,r){if(oc(r)>=0){const a=e.getLineMaxColumn(o),l=qv(this._autoIndent,e,new I(o,a,o,a),this._languageConfigurationService);return this.parseEnterResult(e,t,i,s,l)}else{let a=s-1;for(;a>=1;){const d=e.getLineContent(a);if(oc(d)>=0)break;a--}if(a<1||s>e.getLineCount())return null;const l=e.getLineMaxColumn(a),c=qv(this._autoIndent,e,new I(a,l,a,l),this._languageConfigurationService);return this.parseEnterResult(e,t,i,s,c)}}matchEnterRule(e,t,i,s,o,r){let a=o;for(;a>=1;){let d;if(a===o&&r!==void 0?d=r:d=e.getLineContent(a),oc(d)>=0)break;a--}if(a<1||s>e.getLineCount())return null;const l=e.getLineMaxColumn(a),c=qv(this._autoIndent,e,new I(a,l,a,l),this._languageConfigurationService);return this.parseEnterResult(e,t,i,s,c)}trimStart(e){return e.replace(/^\s+/,"")}shouldAutoIndent(e,t){if(this._autoIndent<4||!e.tokenization.isCheapToTokenize(t.startLineNumber))return!1;const i=e.getLanguageIdAtPosition(t.startLineNumber,1),s=e.getLanguageIdAtPosition(t.endLineNumber,1);return!(i!==s||this._languageConfigurationService.getLanguageConfiguration(i).indentRulesSupport===null)}getIndentEditsOfMovingBlock(e,t,i,s,o,r){for(let a=i.startLineNumber;a<=i.endLineNumber;a++){const l=e.getLineContent(a),c=ki(l),u=ur(c,s)+r,h=zC(u,s,o);h!==c&&(t.addEditOperation(new I(a,1,a,c.length+1),h),a===i.endLineNumber&&i.endColumn<=c.length+1&&h===""&&(this._moveEndLineSelectionShrink=!0))}}computeCursorState(e,t){let i=t.getTrackedSelection(this._selectionId);return this._moveEndPositionDown&&(i=i.setEndPosition(i.endLineNumber+1,1)),this._moveEndLineSelectionShrink&&i.startLineNumber=s)return null;const o=[];for(let a=i;a<=s;a++)o.push(n.getLineContent(a));let r=o.slice(0);return r.sort(Mf.getCollator().compare),t===!0&&(r=r.reverse()),{startLineNumber:i,endLineNumber:s,before:o,after:r}}function k9e(n,e,t){const i=ose(n,e,t);return i?Yi.replace(new I(i.startLineNumber,1,i.endLineNumber,n.getLineMaxColumn(i.endLineNumber)),i.after.join("\n")):null}class rse extends Ue{constructor(e,t){super(t),this.down=e}run(e,t){if(!t.hasModel())return;const i=t.getSelections().map((r,a)=>({selection:r,index:a,ignore:!1}));i.sort((r,a)=>I.compareRangesUsingStarts(r.selection,a.selection));let s=i[0];for(let r=1;rnew Y(a.positionLineNumber,a.positionColumn)));const o=t.getSelection();if(o===null)return;const r=new w9e(o,s);t.pushUndoStop(),t.executeCommands(this.id,[r]),t.pushUndoStop()}}KN.ID="editor.action.trimTrailingWhitespace";class R9e extends Ue{constructor(){super({id:"editor.action.deleteLines",label:m("lines.delete","Delete Line"),alias:"Delete Line",precondition:O.writable,kbOpts:{kbExpr:O.textInputFocus,primary:3113,weight:100}})}run(e,t){if(!t.hasModel())return;const i=this._getLinesToRemove(t),s=t.getModel();if(s.getLineCount()===1&&s.getLineMaxColumn(1)===1)return;let o=0;const r=[],a=[];for(let l=0,c=i.length;l1&&(u-=1,f=s.getLineMaxColumn(u)),r.push(Yi.replace(new Je(u,f,h,g),"")),a.push(new Je(u-o,d.positionColumn,u-o,d.positionColumn)),o+=d.endLineNumber-d.startLineNumber+1}t.pushUndoStop(),t.executeEdits(this.id,r,a),t.pushUndoStop()}_getLinesToRemove(e){const t=e.getSelections().map(o=>{let r=o.endLineNumber;return o.startLineNumbero.startLineNumber===r.startLineNumber?o.endLineNumber-r.endLineNumber:o.startLineNumber-r.startLineNumber);const i=[];let s=t[0];for(let o=1;o=t[o].startLineNumber?s.endLineNumber=t[o].endLineNumber:(i.push(s),s=t[o]);return i.push(s),i}}class P9e extends Ue{constructor(){super({id:"editor.action.indentLines",label:m("lines.indent","Indent Line"),alias:"Indent Line",precondition:O.writable,kbOpts:{kbExpr:O.editorTextFocus,primary:2142,weight:100}})}run(e,t){const i=t._getViewModel();i&&(t.pushUndoStop(),t.executeCommands(this.id,Qi.indent(i.cursorConfig,t.getModel(),t.getSelections())),t.pushUndoStop())}}class O9e extends Ue{constructor(){super({id:"editor.action.outdentLines",label:m("lines.outdent","Outdent Line"),alias:"Outdent Line",precondition:O.writable,kbOpts:{kbExpr:O.editorTextFocus,primary:2140,weight:100}})}run(e,t){Gv.Outdent.runEditorCommand(e,t,null)}}class F9e extends Ue{constructor(){super({id:"editor.action.insertLineBefore",label:m("lines.insertBefore","Insert Line Above"),alias:"Insert Line Above",precondition:O.writable,kbOpts:{kbExpr:O.editorTextFocus,primary:3075,weight:100}})}run(e,t){const i=t._getViewModel();i&&(t.pushUndoStop(),t.executeCommands(this.id,Qi.lineInsertBefore(i.cursorConfig,t.getModel(),t.getSelections())))}}class B9e extends Ue{constructor(){super({id:"editor.action.insertLineAfter",label:m("lines.insertAfter","Insert Line Below"),alias:"Insert Line Below",precondition:O.writable,kbOpts:{kbExpr:O.editorTextFocus,primary:2051,weight:100}})}run(e,t){const i=t._getViewModel();i&&(t.pushUndoStop(),t.executeCommands(this.id,Qi.lineInsertAfter(i.cursorConfig,t.getModel(),t.getSelections())))}}class cse extends Ue{run(e,t){if(!t.hasModel())return;const i=t.getSelection(),s=this._getRangesToDelete(t),o=[];for(let l=0,c=s.length-1;lYi.replace(l,""));t.pushUndoStop(),t.executeEdits(this.id,a,r),t.pushUndoStop()}}class W9e extends cse{constructor(){super({id:"deleteAllLeft",label:m("lines.deleteAllLeft","Delete All Left"),alias:"Delete All Left",precondition:O.writable,kbOpts:{kbExpr:O.textInputFocus,primary:0,mac:{primary:2049},weight:100}})}_getEndCursorState(e,t){let i=null;const s=[];let o=0;return t.forEach(r=>{let a;if(r.endColumn===1&&o>0){const l=r.startLineNumber-o;a=new Je(l,r.startColumn,l,r.startColumn)}else a=new Je(r.startLineNumber,r.startColumn,r.startLineNumber,r.startColumn);o+=r.endLineNumber-r.startLineNumber,r.intersectRanges(e)?i=a:s.push(a)}),i&&s.unshift(i),s}_getRangesToDelete(e){const t=e.getSelections();if(t===null)return[];let i=t;const s=e.getModel();return s===null?[]:(i.sort(I.compareRangesUsingStarts),i=i.map(o=>{if(o.isEmpty())if(o.startColumn===1){const r=Math.max(1,o.startLineNumber-1),a=o.startLineNumber===1?1:s.getLineLength(r)+1;return new I(r,a,o.startLineNumber,1)}else return new I(o.startLineNumber,1,o.startLineNumber,o.startColumn);else return new I(o.startLineNumber,1,o.endLineNumber,o.endColumn)}),i)}}class V9e extends cse{constructor(){super({id:"deleteAllRight",label:m("lines.deleteAllRight","Delete All Right"),alias:"Delete All Right",precondition:O.writable,kbOpts:{kbExpr:O.textInputFocus,primary:0,mac:{primary:297,secondary:[2068]},weight:100}})}_getEndCursorState(e,t){let i=null;const s=[];for(let o=0,r=t.length,a=0;o{if(o.isEmpty()){const r=t.getLineMaxColumn(o.startLineNumber);return o.startColumn===r?new I(o.startLineNumber,o.startColumn,o.startLineNumber+1,1):new I(o.startLineNumber,o.startColumn,o.startLineNumber,r)}return o});return s.sort(I.compareRangesUsingStarts),s}}class H9e extends Ue{constructor(){super({id:"editor.action.joinLines",label:m("lines.joinLines","Join Lines"),alias:"Join Lines",precondition:O.writable,kbOpts:{kbExpr:O.editorTextFocus,primary:0,mac:{primary:296},weight:100}})}run(e,t){const i=t.getSelections();if(i===null)return;let s=t.getSelection();if(s===null)return;i.sort(I.compareRangesUsingStarts);const o=[],r=i.reduce((h,f)=>h.isEmpty()?h.endLineNumber===f.startLineNumber?(s.equalsSelection(h)&&(s=f),f):f.startLineNumber>h.endLineNumber+1?(o.push(h),f):new Je(h.startLineNumber,h.startColumn,f.endLineNumber,f.endColumn):f.startLineNumber>h.endLineNumber?(o.push(h),f):new Je(h.startLineNumber,h.startColumn,f.endLineNumber,f.endColumn));o.push(r);const a=t.getModel();if(a===null)return;const l=[],c=[];let d=s,u=0;for(let h=0,f=o.length;h=1){let x=!0;y===""&&(x=!1),x&&(y.charAt(y.length-1)===" "||y.charAt(y.length-1)===" ")&&(x=!1,y=y.replace(/[\s\uFEFF\xA0]+$/g," "));const A=k.substr(D-1);y+=(x?" ":"")+A,x?v=A.length+1:v=A.length}else v=0}const L=new I(p,_,b,C);if(!L.isEmpty()){let S;g.isEmpty()?(l.push(Yi.replace(L,y)),S=new Je(L.startLineNumber-u,y.length-v+1,p-u,y.length-v+1)):g.startLineNumber===g.endLineNumber?(l.push(Yi.replace(L,y)),S=new Je(g.startLineNumber-u,g.startColumn,g.endLineNumber-u,g.endColumn)):(l.push(Yi.replace(L,y)),S=new Je(g.startLineNumber-u,g.startColumn,g.startLineNumber-u,y.length-w)),I.intersectRanges(L,s)!==null?d=S:c.push(S)}u+=L.endLineNumber-L.startLineNumber}c.unshift(d),t.pushUndoStop(),t.executeEdits(this.id,l,c),t.pushUndoStop()}}class $9e extends Ue{constructor(){super({id:"editor.action.transpose",label:m("editor.transpose","Transpose Characters around the Cursor"),alias:"Transpose Characters around the Cursor",precondition:O.writable})}run(e,t){const i=t.getSelections();if(i===null)return;const s=t.getModel();if(s===null)return;const o=[];for(let r=0,a=i.length;r=d){if(c.lineNumber===s.getLineCount())continue;const u=new I(c.lineNumber,Math.max(1,c.column-1),c.lineNumber+1,1),h=s.getValueInRange(u).split("").reverse().join("");o.push(new Rs(new Je(c.lineNumber,Math.max(1,c.column-1),c.lineNumber+1,1),h))}else{const u=new I(c.lineNumber,Math.max(1,c.column-1),c.lineNumber,c.column+1),h=s.getValueInRange(u).split("").reverse().join("");o.push(new u9(u,h,new Je(c.lineNumber,c.column+1,c.lineNumber,c.column+1)))}}t.pushUndoStop(),t.executeCommands(this.id,o),t.pushUndoStop()}}class V0 extends Ue{run(e,t){const i=t.getSelections();if(i===null)return;const s=t.getModel();if(s===null)return;const o=t.getOption(129),r=[];for(const a of i)if(a.isEmpty()){const l=a.getStartPosition(),c=t.getConfiguredWordAtPosition(l);if(!c)continue;const d=new I(l.lineNumber,c.startColumn,l.lineNumber,c.endColumn),u=s.getValueInRange(d);r.push(Yi.replace(d,this._modifyText(u,o)))}else{const l=s.getValueInRange(a);r.push(Yi.replace(a,this._modifyText(l,o)))}t.pushUndoStop(),t.executeEdits(this.id,r),t.pushUndoStop()}}class z9e extends V0{constructor(){super({id:"editor.action.transformToUppercase",label:m("editor.transformToUppercase","Transform to Uppercase"),alias:"Transform to Uppercase",precondition:O.writable})}_modifyText(e,t){return e.toLocaleUpperCase()}}class U9e extends V0{constructor(){super({id:"editor.action.transformToLowercase",label:m("editor.transformToLowercase","Transform to Lowercase"),alias:"Transform to Lowercase",precondition:O.writable})}_modifyText(e,t){return e.toLocaleLowerCase()}}class d_{constructor(e,t){this._pattern=e,this._flags=t,this._actual=null,this._evaluated=!1}get(){if(!this._evaluated){this._evaluated=!0;try{this._actual=new RegExp(this._pattern,this._flags)}catch{}}return this._actual}isSupported(){return this.get()!==null}}class Ay extends V0{constructor(){super({id:"editor.action.transformToTitlecase",label:m("editor.transformToTitlecase","Transform to Title Case"),alias:"Transform to Title Case",precondition:O.writable})}_modifyText(e,t){const i=Ay.titleBoundary.get();return i?e.toLocaleLowerCase().replace(i,s=>s.toLocaleUpperCase()):e}}Ay.titleBoundary=new d_("(^|[^\\p{L}\\p{N}']|((^|\\P{L})'))\\p{L}","gmu");class Rf extends V0{constructor(){super({id:"editor.action.transformToSnakecase",label:m("editor.transformToSnakecase","Transform to Snake Case"),alias:"Transform to Snake Case",precondition:O.writable})}_modifyText(e,t){const i=Rf.caseBoundary.get(),s=Rf.singleLetters.get();return!i||!s?e:e.replace(i,"$1_$2").replace(s,"$1_$2$3").toLocaleLowerCase()}}Rf.caseBoundary=new d_("(\\p{Ll})(\\p{Lu})","gmu");Rf.singleLetters=new d_("(\\p{Lu}|\\p{N})(\\p{Lu})(\\p{Ll})","gmu");class My extends V0{constructor(){super({id:"editor.action.transformToCamelcase",label:m("editor.transformToCamelcase","Transform to Camel Case"),alias:"Transform to Camel Case",precondition:O.writable})}_modifyText(e,t){const i=My.wordBoundary.get();if(!i)return e;const s=e.split(i);return s.shift()+s.map(r=>r.substring(0,1).toLocaleUpperCase()+r.substring(1)).join("")}}My.wordBoundary=new d_("[_\\s-]","gm");class $u extends V0{static isSupported(){return[this.caseBoundary,this.singleLetters,this.underscoreBoundary].every(t=>t.isSupported())}constructor(){super({id:"editor.action.transformToKebabcase",label:m("editor.transformToKebabcase","Transform to Kebab Case"),alias:"Transform to Kebab Case",precondition:O.writable})}_modifyText(e,t){const i=$u.caseBoundary.get(),s=$u.singleLetters.get(),o=$u.underscoreBoundary.get();return!i||!s||!o?e:e.replace(o,"$1-$3").replace(i,"$1-$2").replace(s,"$1-$2").toLocaleLowerCase()}}$u.caseBoundary=new d_("(\\p{Ll})(\\p{Lu})","gmu");$u.singleLetters=new d_("(\\p{Lu}|\\p{N})(\\p{Lu}\\p{Ll})","gmu");$u.underscoreBoundary=new d_("(\\S)(_)(\\S)","gm");De(D9e);De(E9e);De(I9e);De(T9e);De(x9e);De(N9e);De(A9e);De(M9e);De(KN);De(R9e);De(P9e);De(O9e);De(F9e);De(B9e);De(W9e);De(V9e);De(H9e);De($9e);De(z9e);De(U9e);Rf.caseBoundary.isSupported()&&Rf.singleLetters.isSupported()&&De(Rf);My.wordBoundary.isSupported()&&De(My);Ay.titleBoundary.isSupported()&&De(Ay);$u.isSupported()&&De($u);var j9e=globalThis&&globalThis.__decorate||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},Ik=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},C5=globalThis&&globalThis.__awaiter||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())})},WD;const dse=new Ve("LinkedEditingInputVisible",!1),K9e="linked-editing-decoration";let ug=WD=class extends te{static get(e){return e.getContribution(WD.ID)}constructor(e,t,i,s,o){super(),this.languageConfigurationService=s,this._syncRangesToken=0,this._localToDispose=this._register(new be),this._editor=e,this._providers=i.linkedEditingRangeProvider,this._enabled=!1,this._visibleContextKey=dse.bindTo(t),this._debounceInformation=o.for(this._providers,"Linked Editing",{max:200}),this._currentDecorations=this._editor.createDecorationsCollection(),this._languageWordPattern=null,this._currentWordPattern=null,this._ignoreChangeEvent=!1,this._localToDispose=this._register(new be),this._rangeUpdateTriggerPromise=null,this._rangeSyncTriggerPromise=null,this._currentRequest=null,this._currentRequestPosition=null,this._currentRequestModelVersion=null,this._register(this._editor.onDidChangeModel(()=>this.reinitialize(!0))),this._register(this._editor.onDidChangeConfiguration(r=>{(r.hasChanged(69)||r.hasChanged(92))&&this.reinitialize(!1)})),this._register(this._providers.onDidChange(()=>this.reinitialize(!1))),this._register(this._editor.onDidChangeModelLanguage(()=>this.reinitialize(!0))),this.reinitialize(!0)}reinitialize(e){const t=this._editor.getModel(),i=t!==null&&(this._editor.getOption(69)||this._editor.getOption(92))&&this._providers.has(t);if(i===this._enabled&&!e||(this._enabled=i,this.clearRanges(),this._localToDispose.clear(),!i||t===null))return;this._localToDispose.add(We.runAndSubscribe(t.onDidChangeLanguageConfiguration,()=>{this._languageWordPattern=this.languageConfigurationService.getLanguageConfiguration(t.getLanguageId()).getWordDefinition()}));const s=new pl(this._debounceInformation.get(t)),o=()=>{var l;this._rangeUpdateTriggerPromise=s.trigger(()=>this.updateRanges(),(l=this._debounceDuration)!==null&&l!==void 0?l:this._debounceInformation.get(t))},r=new pl(0),a=l=>{this._rangeSyncTriggerPromise=r.trigger(()=>this._syncRanges(l))};this._localToDispose.add(this._editor.onDidChangeCursorPosition(()=>{o()})),this._localToDispose.add(this._editor.onDidChangeModelContent(l=>{if(!this._ignoreChangeEvent&&this._currentDecorations.length>0){const c=this._currentDecorations.getRange(0);if(c&&l.changes.every(d=>c.intersectRanges(d.range))){a(this._syncRangesToken);return}}o()})),this._localToDispose.add({dispose:()=>{s.dispose(),r.dispose()}}),this.updateRanges()}_syncRanges(e){if(!this._editor.hasModel()||e!==this._syncRangesToken||this._currentDecorations.length===0)return;const t=this._editor.getModel(),i=this._currentDecorations.getRange(0);if(!i||i.startLineNumber!==i.endLineNumber)return this.clearRanges();const s=t.getValueInRange(i);if(this._currentWordPattern){const r=s.match(this._currentWordPattern);if((r?r[0].length:0)!==s.length)return this.clearRanges()}const o=[];for(let r=1,a=this._currentDecorations.length;r1){this.clearRanges();return}const i=this._editor.getModel(),s=i.getVersionId();if(this._currentRequestPosition&&this._currentRequestModelVersion===s){if(t.equals(this._currentRequestPosition))return;if(this._currentDecorations.length>0){const r=this._currentDecorations.getRange(0);if(r&&r.containsPosition(t))return}}this.clearRanges(),this._currentRequestPosition=t,this._currentRequestModelVersion=s;const o=Xn(r=>C5(this,void 0,void 0,function*(){try{const a=new so(!1),l=yield use(this._providers,i,t,r);if(this._debounceInformation.update(i,a.elapsed()),o!==this._currentRequest||(this._currentRequest=null,s!==i.getVersionId()))return;let c=[];l!=null&&l.ranges&&(c=l.ranges),this._currentWordPattern=(l==null?void 0:l.wordPattern)||this._languageWordPattern;let d=!1;for(let h=0,f=c.length;h({range:h,options:WD.DECORATION}));this._visibleContextKey.set(!0),this._currentDecorations.set(u),this._syncRangesToken++}catch(a){bc(a)||Dt(a),(this._currentRequest===o||!this._currentRequest)&&this.clearRanges()}}));return this._currentRequest=o,o})}};ug.ID="editor.contrib.linkedEditing";ug.DECORATION=kt.register({description:"linked-editing",stickiness:0,className:K9e});ug=WD=j9e([Ik(1,bt),Ik(2,Ze),Ik(3,Ni),Ik(4,Va)],ug);class q9e extends Ue{constructor(){super({id:"editor.action.linkedEditing",label:m("linkedEditing.label","Start Linked Editing"),alias:"Start Linked Editing",precondition:fe.and(O.writable,O.hasRenameProvider),kbOpts:{kbExpr:O.editorTextFocus,primary:3132,weight:100}})}runCommand(e,t){const i=e.get(ai),[s,o]=Array.isArray(t)&&t||[void 0,void 0];return ct.isUri(s)&&Y.isIPosition(o)?i.openCodeEditor({resource:s},i.getActiveCodeEditor()).then(r=>{r&&(r.setPosition(o),r.invokeWithinContext(a=>(this.reportTelemetry(a,r),this.run(a,r))))},Dt):super.runCommand(e,t)}run(e,t){const i=ug.get(t);return i?Promise.resolve(i.updateRanges(!0)):Promise.resolve()}}const G9e=fs.bindToContribution(ug.get);Re(new G9e({id:"cancelLinkedEditingInput",precondition:dse,handler:n=>n.clearRanges(),kbOpts:{kbExpr:O.editorTextFocus,weight:100+99,primary:9,secondary:[1033]}}));function use(n,e,t,i){const s=n.ordered(e);return cQ(s.map(o=>()=>C5(this,void 0,void 0,function*(){try{return yield o.provideLinkedEditingRanges(e,t,i)}catch(r){Bn(r);return}})),o=>!!o&&io(o==null?void 0:o.ranges))}F("editor.linkedEditingBackground",{dark:ee.fromHex("#f00").transparent(.3),light:ee.fromHex("#f00").transparent(.3),hcDark:ee.fromHex("#f00").transparent(.3),hcLight:ee.white},m("editorLinkedEditingBackground","Background color when the editor auto renames on type."));$d("_executeLinkedEditingProvider",(n,e,t)=>{const{linkedEditingRangeProvider:i}=n.get(Ze);return use(i,e,t,Ft.None)});ti(ug.ID,ug,1);De(q9e);var hse=globalThis&&globalThis.__awaiter||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 Y9e=class{constructor(e,t){this._link=e,this._provider=t}toJSON(){return{range:this.range,url:this.url,tooltip:this.tooltip}}get range(){return this._link.range}get url(){return this._link.url}get tooltip(){return this._link.tooltip}resolve(e){return hse(this,void 0,void 0,function*(){return this._link.url?this._link.url:typeof this._provider.resolveLink=="function"?Promise.resolve(this._provider.resolveLink(this._link,e)).then(t=>(this._link=t||this._link,this._link.url?this.resolve(e):Promise.reject(new Error("missing")))):Promise.reject(new Error("missing"))})}};class nT{constructor(e){this._disposables=new be;let t=[];for(const[i,s]of e){const o=i.links.map(r=>new Y9e(r,s));t=nT._union(t,o),_8(i)&&this._disposables.add(i)}this.links=t}dispose(){this._disposables.dispose(),this.links.length=0}static _union(e,t){const i=[];let s,o,r,a;for(s=0,r=0,o=e.length,a=t.length;sPromise.resolve(o.provideLinks(e,t)).then(a=>{a&&(i[r]=[a,o])},Bn));return Promise.all(s).then(()=>{const o=new nT(wd(i));return t.isCancellationRequested?(o.dispose(),new nT([])):o})}qt.registerCommand("_executeLinkProvider",(n,...e)=>hse(void 0,void 0,void 0,function*(){let[t,i]=e;bi(t instanceof ct),typeof i!="number"&&(i=0);const{linkProvider:s}=n.get(Ze),o=n.get(Zi).getModel(t);if(!o)return[];const r=yield fse(s,o,Ft.None);if(!r)return[];for(let l=0;l=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},Tk=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},X9e=globalThis&&globalThis.__awaiter||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())})},w5;let n0=w5=class extends te{static get(e){return e.getContribution(w5.ID)}constructor(e,t,i,s,o){super(),this.editor=e,this.openerService=t,this.notificationService=i,this.languageFeaturesService=s,this.providers=this.languageFeaturesService.linkProvider,this.debounceInformation=o.for(this.providers,"Links",{min:1e3,max:4e3}),this.computeLinks=this._register(new Si(()=>this.computeLinksNow(),1e3)),this.computePromise=null,this.activeLinksList=null,this.currentOccurrences={},this.activeLinkDecorationId=null;const r=this._register(new gN(e));this._register(r.onMouseMoveOrRelevantKeyDown(([a,l])=>{this._onEditorMouseMove(a,l)})),this._register(r.onExecute(a=>{this.onEditorMouseUp(a)})),this._register(r.onCancel(a=>{this.cleanUpActiveLinkDecoration()})),this._register(e.onDidChangeConfiguration(a=>{a.hasChanged(70)&&(this.updateDecorations([]),this.stop(),this.computeLinks.schedule(0))})),this._register(e.onDidChangeModelContent(a=>{this.editor.hasModel()&&this.computeLinks.schedule(this.debounceInformation.get(this.editor.getModel()))})),this._register(e.onDidChangeModel(a=>{this.currentOccurrences={},this.activeLinkDecorationId=null,this.stop(),this.computeLinks.schedule(0)})),this._register(e.onDidChangeModelLanguage(a=>{this.stop(),this.computeLinks.schedule(0)})),this._register(this.providers.onDidChange(a=>{this.stop(),this.computeLinks.schedule(0)})),this.computeLinks.schedule(0)}computeLinksNow(){return X9e(this,void 0,void 0,function*(){if(!this.editor.hasModel()||!this.editor.getOption(70))return;const e=this.editor.getModel();if(!e.isTooLargeForSyncing()&&this.providers.has(e)){this.activeLinksList&&(this.activeLinksList.dispose(),this.activeLinksList=null),this.computePromise=Xn(t=>fse(this.providers,e,t));try{const t=new so(!1);if(this.activeLinksList=yield this.computePromise,this.debounceInformation.update(e,t.elapsed()),e.isDisposed())return;this.updateDecorations(this.activeLinksList.links)}catch(t){Dt(t)}finally{this.computePromise=null}}})}updateDecorations(e){const t=this.editor.getOption(77)==="altKey",i=[],s=Object.keys(this.currentOccurrences);for(const r of s){const a=this.currentOccurrences[r];i.push(a.decorationId)}const o=[];if(e)for(const r of e)o.push(ab.decoration(r,t));this.editor.changeDecorations(r=>{const a=r.deltaDecorations(i,o);this.currentOccurrences={},this.activeLinkDecorationId=null;for(let l=0,c=a.length;l{s.activate(o,i),this.activeLinkDecorationId=s.decorationId})}else this.cleanUpActiveLinkDecoration()}cleanUpActiveLinkDecoration(){const e=this.editor.getOption(77)==="altKey";if(this.activeLinkDecorationId){const t=this.currentOccurrences[this.activeLinkDecorationId];t&&this.editor.changeDecorations(i=>{t.deactivate(i,e)}),this.activeLinkDecorationId=null}}onEditorMouseUp(e){if(!this.isEnabled(e))return;const t=this.getLinkOccurrence(e.target.position);t&&this.openLinkOccurrence(t,e.hasSideBySideModifier,!0)}openLinkOccurrence(e,t,i=!1){if(!this.openerService)return;const{link:s}=e;s.resolve(Ft.None).then(o=>{if(typeof o=="string"&&this.editor.hasModel()){const r=this.editor.getModel().uri;if(r.scheme===Nt.file&&o.startsWith("".concat(Nt.file,":"))){const a=ct.parse(o);if(a.scheme===Nt.file){const l=Ac(a);let c=null;l.startsWith("/./")?c=".".concat(l.substr(1)):l.startsWith("//./")&&(c=".".concat(l.substr(2))),c&&(o=Jke(r,c))}}}return this.openerService.open(o,{openToSide:t,fromUserGesture:i,allowContributedOpeners:!0,allowCommands:!0,fromWorkspace:!0})},o=>{const r=o instanceof Error?o.message:o;r==="invalid"?this.notificationService.warn(m("invalid.url","Failed to open this link because it is not well-formed: {0}",s.url.toString())):r==="missing"?this.notificationService.warn(m("missing.url","Failed to open this link because its target is missing.")):Dt(o)})}getLinkOccurrence(e){if(!this.editor.hasModel()||!e)return null;const t=this.editor.getModel().getDecorationsInRange({startLineNumber:e.lineNumber,startColumn:e.column,endLineNumber:e.lineNumber,endColumn:e.column},0,!0);for(const i of t){const s=this.currentOccurrences[i.id];if(s)return s}return null}isEnabled(e,t){return!!(e.target.type===6&&(e.hasTriggerModifier||t&&t.keyCodeIsTriggerKey))}stop(){var e;this.computeLinks.cancel(),this.activeLinksList&&((e=this.activeLinksList)===null||e===void 0||e.dispose(),this.activeLinksList=null),this.computePromise&&(this.computePromise.cancel(),this.computePromise=null)}dispose(){super.dispose(),this.stop()}};n0.ID="editor.linkDetector";n0=w5=Z9e([Tk(1,Ir),Tk(2,Nn),Tk(3,Ze),Tk(4,Va)],n0);const mK={general:kt.register({description:"detected-link",stickiness:1,collapseOnReplaceEdit:!0,inlineClassName:"detected-link"}),active:kt.register({description:"detected-link-active",stickiness:1,collapseOnReplaceEdit:!0,inlineClassName:"detected-link-active"})};class ab{static decoration(e,t){return{range:e.range,options:ab._getOptions(e,t,!1)}}static _getOptions(e,t,i){const s=Object.assign({},i?mK.active:mK.general);return s.hoverMessage=Q9e(e,t),s}constructor(e,t){this.link=e,this.decorationId=t}activate(e,t){e.changeDecorationOptions(this.decorationId,ab._getOptions(this.link,t,!0))}deactivate(e,t){e.changeDecorationOptions(this.decorationId,ab._getOptions(this.link,t,!1))}}function Q9e(n,e){const t=n.url&&/^command:/i.test(n.url.toString()),i=n.tooltip?n.tooltip:t?m("links.navigate.executeCmd","Execute command"):m("links.navigate.follow","Follow link"),s=e?Kt?m("links.navigate.kb.meta.mac","cmd + click"):m("links.navigate.kb.meta","ctrl + click"):Kt?m("links.navigate.kb.alt.mac","option + click"):m("links.navigate.kb.alt","alt + click");if(n.url){let o="";if(/^command:/i.test(n.url.toString())){const a=n.url.toString().match(/^command:([^?#]+)/);if(a){const l=a[1];o=m("tooltip.explanation","Execute command {0}",l)}}return new Bs("",!0).appendLink(n.url.toString(!0).replace(/ /g,"%20"),i,o).appendMarkdown(" (".concat(s,")"))}else return new Bs().appendText("".concat(i," (").concat(s,")"))}class J9e extends Ue{constructor(){super({id:"editor.action.openLink",label:m("label","Open Link"),alias:"Open Link",precondition:void 0})}run(e,t){const i=n0.get(t);if(!i||!t.hasModel())return;const s=t.getSelections();for(const o of s){const r=i.getLinkOccurrence(o.getEndPosition());r&&i.openLinkOccurrence(r,!1)}}}ti(n0.ID,n0,1);De(J9e);class y5 extends te{constructor(e){super(),this._editor=e,this._register(this._editor.onMouseDown(t=>{const i=this._editor.getOption(116);i>=0&&t.target.type===6&&t.target.position.column>=i&&this._editor.updateOptions({stopRenderingLineAfter:-1})}))}}y5.ID="editor.contrib.longLinesHelper";ti(y5.ID,y5,2);const xk=F("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);F("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);F("editor.wordHighlightTextBackground",{light:xk,dark:xk,hcDark:xk,hcLight:xk},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 Nk=F("editor.wordHighlightBorder",{light:null,dark:null,hcDark:$i,hcLight:$i},m("wordHighlightBorder","Border color of a symbol during read-access, like reading a variable."));F("editor.wordHighlightStrongBorder",{light:null,dark:null,hcDark:$i,hcLight:$i},m("wordHighlightStrongBorder","Border color of a symbol during write-access, like writing to a variable."));F("editor.wordHighlightTextBorder",{light:Nk,dark:Nk,hcDark:Nk,hcLight:Nk},m("wordHighlightTextBorder","Border color of a textual occurrence for a symbol."));const e7e=F("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),t7e=F("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),i7e=F("editorOverviewRuler.wordHighlightTextForeground",{dark:j1,light:j1,hcDark:j1,hcLight:j1},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),n7e=kt.register({description:"word-highlight-strong",stickiness:1,className:"wordHighlightStrong",overviewRuler:{color:sn(t7e),position:Qr.Center},minimap:{color:sn(bx),position:yr.Inline}}),s7e=kt.register({description:"word-highlight-text",stickiness:1,className:"wordHighlightText",overviewRuler:{color:sn(i7e),position:Qr.Center},minimap:{color:sn(bx),position:yr.Inline}}),o7e=kt.register({description:"selection-highlight-overview",stickiness:1,className:"selectionHighlight",overviewRuler:{color:sn(j1),position:Qr.Center},minimap:{color:sn(bx),position:yr.Inline}}),r7e=kt.register({description:"selection-highlight",stickiness:1,className:"selectionHighlight"}),a7e=kt.register({description:"word-highlight",stickiness:1,className:"wordHighlight",overviewRuler:{color:sn(e7e),position:Qr.Center},minimap:{color:sn(bx),position:yr.Inline}});function l7e(n){return n===mw.Write?n7e:n===mw.Text?s7e:a7e}function c7e(n){return n?r7e:o7e}bl((n,e)=>{const t=n.getColor(i9);t&&e.addRule(".monaco-editor .selectionHighlight { background-color: ".concat(t.transparent(.5),"; }"))});var d7e=globalThis&&globalThis.__decorate||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},u7e=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},S5;function Ag(n,e){const t=e.filter(i=>!n.find(s=>s.equals(i)));if(t.length>=1){const i=t.map(o=>"line ".concat(o.viewState.position.lineNumber," column ").concat(o.viewState.position.column)).join(", "),s=t.length===1?m("cursorAdded","Cursor added: {0}",i):m("cursorsAdded","Cursors added: {0}",i);Yf(s)}}class h7e extends Ue{constructor(){super({id:"editor.action.insertCursorAbove",label:m("mutlicursor.insertAbove","Add Cursor Above"),alias:"Add Cursor Above",precondition:void 0,kbOpts:{kbExpr:O.editorTextFocus,primary:2576,linux:{primary:1552,secondary:[3088]},weight:100},menuOpts:{menuId:M.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,ms.addCursorUp(o,r,s)),o.revealTopMostCursor(i.source),Ag(r,o.getCursorStates())}}class f7e extends Ue{constructor(){super({id:"editor.action.insertCursorBelow",label:m("mutlicursor.insertBelow","Add Cursor Below"),alias:"Add Cursor Below",precondition:void 0,kbOpts:{kbExpr:O.editorTextFocus,primary:2578,linux:{primary:1554,secondary:[3090]},weight:100},menuOpts:{menuId:M.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,ms.addCursorDown(o,r,s)),o.revealBottomMostCursor(i.source),Ag(r,o.getCursorStates())}}class g7e extends Ue{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:O.editorTextFocus,primary:1575,weight:100},menuOpts:{menuId:M.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 Je(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),Ag(r,o.getCursorStates())}}class p7e extends Ue{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 Je(l,i[0].startColumn,l,i[0].endColumn));const r=t._getViewModel(),a=r.getCursorStates();o.length>0&&t.setSelections(o),Ag(a,r.getCursorStates())}}class m7e extends Ue{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 Je(a,i[0].startColumn,a,i[0].endColumn));const o=t._getViewModel(),r=o.getCursorStates();s.length>0&&t.setSelections(s),Ag(r,o.getCursorStates())}}class Ak{constructor(e,t,i){this.selections=e,this.revealRange=t,this.revealScrollType=i}}class Ry{static create(e,t){if(!e.hasModel())return null;const i=t.getState();if(!e.hasTextFocus()&&i.isRevealed&&i.searchString.length>0)return new Ry(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 Je(l.startLineNumber,u.startColumn,l.startLineNumber,u.endColumn)}else c=e.getModel().getValueInRange(l).replace(/\r\n/g,"\n");return new Ry(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 Ak(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 Ak(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 Je(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 Ak(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 Ak(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 Je(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 Nm extends te{static get(e){return e.getContribution(Nm.ID)}constructor(e){super(),this._sessionDispose=this._register(new be),this._editor=e,this._ignoreSelectionChange=!1,this._session=null}dispose(){this._endSession(),super.dispose()}_beginSessionIfNeeded(e){if(!this._session){const t=Ry.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 Je(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(!gse(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 Je(o.range.startLineNumber,o.range.startColumn,o.range.endLineNumber,o.range.endColumn)))}}}Nm.ID="editor.contrib.multiCursorController";class H0 extends Ue{run(e,t){const i=Nm.get(t);if(!i)return;const s=t._getViewModel();if(s){const o=s.getCursorStates(),r=Oo.get(t);if(r)this._run(i,r);else{const a=e.get(_t).createInstance(Oo,t);this._run(i,a),a.dispose()}Ag(o,s.getCursorStates())}}}class _7e extends H0{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:O.focus,primary:2082,weight:100},menuOpts:{menuId:M.MenubarSelectionMenu,group:"3_multi",title:m({key:"miAddSelectionToNextFindMatch",comment:["&& denotes a mnemonic"]},"Add &&Next Occurrence"),order:5}})}_run(e,t){e.addSelectionToNextFindMatch(t)}}class v7e extends H0{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:M.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 b7e extends H0{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:O.focus,primary:qn(2089,2082),weight:100}})}_run(e,t){e.moveSelectionToNextFindMatch(t)}}class C7e extends H0{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 w7e extends H0{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:O.focus,primary:3114,weight:100},menuOpts:{menuId:M.MenubarSelectionMenu,group:"3_multi",title:m({key:"miSelectHighlights",comment:["&& denotes a mnemonic"]},"Select All &&Occurrences"),order:7}})}_run(e,t){e.selectAll(t)}}class y7e extends H0{constructor(){super({id:"editor.action.changeAll",label:m("changeAll.label","Change All Occurrences"),alias:"Change All Occurrences",precondition:fe.and(O.writable,O.editorTextFocus),kbOpts:{kbExpr:O.editorTextFocus,primary:2108,weight:100},contextMenuOpts:{group:"1_modification",order:1.2}})}_run(e,t){e.selectAll(t)}}class S7e{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(I.compareRangesUsingStarts)),this._cachedFindMatches}}let Py=S5=class extends te{constructor(e,t){super(),this._languageFeaturesService=t,this.editor=e,this._isEnabled=e.getOption(107),this._decorations=e.createDecorationsCollection(),this.updateSoon=this._register(new Si(()=>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=Oo.get(e);i&&this._register(i.getState().onFindReplaceStateChange(s=>{this._update()})),this.updateSoon.schedule()}_update(){this._setState(S5._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=Nm.get(i);if(!o)return null;const r=Oo.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(!gse(i.getModel(),d,h))return null}a=Ry.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 S7e(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(I.compareRangesUsingStarts);const o=[];for(let l=0,c=0,d=i.length,u=s.length;l=u)o.push(h),l++;else{const f=I.compareRangesUsingStarts(h,s[c]);f<0?((s[c].isEmpty()||!I.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:c7e(r)}));this._decorations.set(a)}dispose(){this._setState(null),super.dispose()}};Py.ID="editor.contrib.selectionHighlighter";Py=S5=d7e([u7e(1,Ze)],Py);function gse(n,e,t){const i=_K(n,e[0],!t);for(let s=1,o=e.length;spse(void 0,void 0,void 0,function*(){const[t,i,s]=e;bi(ct.isUri(t)),bi(Y.isIPosition(i)),bi(typeof s=="string"||!s);const o=n.get(Ze),r=yield n.get(sr).createModelReference(t);try{const a=yield mse(o.signatureHelpProvider,r.object.textEditorModel,Y.lift(i),{triggerKind:gd.Invoke,isRetrigger:!1,triggerCharacter:s},Ft.None);return a?(setTimeout(()=>a.dispose(),0),a.value):void 0}finally{r.dispose()}}));var D7e=globalThis&&globalThis.__awaiter||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())})},Bh;(function(n){n.Default={type:0};class e{constructor(s,o){this.request=s,this.previouslyActiveHints=o,this.type=2}}n.Pending=e;class t{constructor(s){this.hints=s,this.type=1}}n.Active=t})(Bh||(Bh={}));class qN extends te{constructor(e,t,i=qN.DEFAULT_DELAY){super(),this._onChangedHints=this._register(new j),this.onChangedHints=this._onChangedHints.event,this.triggerOnType=!1,this._state=Bh.Default,this._pendingTriggers=[],this._lastSignatureHelpResult=this._register(new Ts),this.triggerChars=new kE,this.retriggerChars=new kE,this.triggerId=0,this.editor=e,this.providers=t,this.throttledDelayer=new pl(i),this._register(this.editor.onDidBlurEditorWidget(()=>this.cancel())),this._register(this.editor.onDidChangeConfiguration(()=>this.onEditorConfigurationChange())),this._register(this.editor.onDidChangeModel(s=>this.onModelChanged())),this._register(this.editor.onDidChangeModelLanguage(s=>this.onModelChanged())),this._register(this.editor.onDidChangeCursorSelection(s=>this.onCursorChange(s))),this._register(this.editor.onDidChangeModelContent(s=>this.onModelContentChange())),this._register(this.providers.onDidChange(this.onModelChanged,this)),this._register(this.editor.onDidType(s=>this.onDidType(s))),this.onEditorConfigurationChange(),this.onModelChanged()}get state(){return this._state}set state(e){this._state.type===2&&this._state.request.cancel(),this._state=e}cancel(e=!1){this.state=Bh.Default,this.throttledDelayer.cancel(),e||this._onChangedHints.fire(void 0)}trigger(e,t){const i=this.editor.getModel();if(!i||!this.providers.has(i))return;const s=++this.triggerId;this._pendingTriggers.push(e),this.throttledDelayer.trigger(()=>this.doTrigger(s),t).catch(Dt)}next(){if(this.state.type!==1)return;const e=this.state.hints.signatures.length,t=this.state.hints.activeSignature,i=t%e===e-1,s=this.editor.getOption(85).cycle;if((e<2||i)&&!s){this.cancel();return}this.updateActiveSignature(i&&s?0:t+1)}previous(){if(this.state.type!==1)return;const e=this.state.hints.signatures.length,t=this.state.hints.activeSignature,i=t===0,s=this.editor.getOption(85).cycle;if((e<2||i)&&!s){this.cancel();return}this.updateActiveSignature(i&&s?e-1:t-1)}updateActiveSignature(e){this.state.type===1&&(this.state=new Bh.Active(Object.assign(Object.assign({},this.state.hints),{activeSignature:e})),this._onChangedHints.fire(this.state.hints))}doTrigger(e){return D7e(this,void 0,void 0,function*(){const t=this.state.type===1||this.state.type===2,i=this.getLastActiveHints();if(this.cancel(!0),this._pendingTriggers.length===0)return!1;const s=this._pendingTriggers.reduce(E7e);this._pendingTriggers=[];const o={triggerKind:s.triggerKind,triggerCharacter:s.triggerCharacter,isRetrigger:t,activeSignatureHelp:i};if(!this.editor.hasModel())return!1;const r=this.editor.getModel(),a=this.editor.getPosition();this.state=new Bh.Pending(Xn(l=>mse(this.providers,r,a,o,l)),i);try{const l=yield this.state.request;return e!==this.triggerId?(l==null||l.dispose(),!1):!l||!l.value.signatures||l.value.signatures.length===0?(l==null||l.dispose(),this._lastSignatureHelpResult.clear(),this.cancel(),!1):(this.state=new Bh.Active(l.value),this._lastSignatureHelpResult.value=l,this._onChangedHints.fire(this.state.hints),!0)}catch(l){return e===this.triggerId&&(this.state=Bh.Default),Dt(l),!1}})}getLastActiveHints(){switch(this.state.type){case 1:return this.state.hints;case 2:return this.state.previouslyActiveHints;default:return}}get isTriggered(){return this.state.type===1||this.state.type===2||this.throttledDelayer.isTriggered()}onModelChanged(){this.cancel(),this.triggerChars.clear(),this.retriggerChars.clear();const e=this.editor.getModel();if(e)for(const t of this.providers.ordered(e)){for(const i of t.signatureHelpTriggerCharacters||[])if(i.length){const s=i.charCodeAt(0);this.triggerChars.add(s),this.retriggerChars.add(s)}for(const i of t.signatureHelpRetriggerCharacters||[])i.length&&this.retriggerChars.add(i.charCodeAt(0))}}onDidType(e){if(!this.triggerOnType)return;const t=e.length-1,i=e.charCodeAt(t);(this.triggerChars.has(i)||this.isTriggered&&this.retriggerChars.has(i))&&this.trigger({triggerKind:gd.TriggerCharacter,triggerCharacter:e.charAt(t)})}onCursorChange(e){e.source==="mouse"?this.cancel():this.isTriggered&&this.trigger({triggerKind:gd.ContentChange})}onModelContentChange(){this.isTriggered&&this.trigger({triggerKind:gd.ContentChange})}onEditorConfigurationChange(){this.triggerOnType=this.editor.getOption(85).enabled,this.triggerOnType||this.cancel()}dispose(){this.cancel(!0),super.dispose()}}qN.DEFAULT_DELAY=120;function E7e(n,e){switch(e.triggerKind){case gd.Invoke:return e;case gd.ContentChange:return n;case gd.TriggerCharacter:default:return e}}var I7e=globalThis&&globalThis.__decorate||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=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},L5;const xr=ye,T7e=Sn("parameter-hints-next",Me.chevronDown,m("parameterHintsNextIcon","Icon for show next parameter hint.")),x7e=Sn("parameter-hints-previous",Me.chevronUp,m("parameterHintsPreviousIcon","Icon for show previous parameter hint."));let sT=L5=class extends te{constructor(e,t,i,s,o){super(),this.editor=e,this.model=t,this.renderDisposeables=this._register(new be),this.visible=!1,this.announcedLabel=null,this.allowEditorOverflow=!0,this.markdownRenderer=this._register(new Zu({editor:e},o,s)),this.keyVisible=Am.Visible.bindTo(i),this.keyMultipleSignatures=Am.MultipleSignatures.bindTo(i)}createParameterHintDOMNodes(){const e=xr(".editor-widget.parameter-hints-widget"),t=ge(e,xr(".phwrapper"));t.tabIndex=-1;const i=ge(t,xr(".controls")),s=ge(i,xr(".button"+dt.asCSSSelector(x7e))),o=ge(i,xr(".overloads")),r=ge(i,xr(".button"+dt.asCSSSelector(T7e)));this._register(ce(s,"click",h=>{xt.stop(h),this.previous()})),this._register(ce(r,"click",h=>{xt.stop(h),this.next()}));const a=xr(".body"),l=new bS(a,{alwaysConsumeMouseWheel:!0});this._register(l),t.appendChild(l.getDomNode());const c=ge(a,xr(".signature")),d=ge(a,xr(".docs"));e.style.userSelect="text",this.domNodes={element:e,signature:c,overloads:o,docs:d,scrollbar:l},this.editor.addContentWidget(this),this.hide(),this._register(this.editor.onDidChangeCursorSelection(h=>{this.visible&&this.editor.layoutContentWidget(this)}));const u=()=>{if(!this.domNodes)return;const h=this.editor.getOption(50);this.domNodes.element.style.fontSize="".concat(h.fontSize,"px"),this.domNodes.element.style.lineHeight="".concat(h.lineHeight/h.fontSize)};u(),this._register(We.chain(this.editor.onDidChangeConfiguration.bind(this.editor),h=>h.filter(f=>f.hasChanged(50)))(u)),this._register(this.editor.onDidLayoutChange(h=>this.updateMaxHeight())),this.updateMaxHeight()}show(){this.visible||(this.domNodes||this.createParameterHintDOMNodes(),this.keyVisible.set(!0),this.visible=!0,setTimeout(()=>{var e;(e=this.domNodes)===null||e===void 0||e.element.classList.add("visible")},100),this.editor.layoutContentWidget(this))}hide(){var e;this.renderDisposeables.clear(),this.visible&&(this.keyVisible.reset(),this.visible=!1,this.announcedLabel=null,(e=this.domNodes)===null||e===void 0||e.element.classList.remove("visible"),this.editor.layoutContentWidget(this))}getPosition(){return this.visible?{position:this.editor.getPosition(),preference:[1,2]}:null}render(e){var t;if(this.renderDisposeables.clear(),!this.domNodes)return;const i=e.signatures.length>1;this.domNodes.element.classList.toggle("multiple",i),this.keyMultipleSignatures.set(i),this.domNodes.signature.innerText="",this.domNodes.docs.innerText="";const s=e.signatures[e.activeSignature];if(!s)return;const o=ge(this.domNodes.signature,xr(".code")),r=this.editor.getOption(50);o.style.fontSize="".concat(r.fontSize,"px"),o.style.fontFamily=r.fontFamily;const a=s.parameters.length>0,l=(t=s.activeParameter)!==null&&t!==void 0?t:e.activeParameter;if(a)this.renderParameters(o,s,l);else{const u=ge(o,xr("span"));u.textContent=s.label}const c=s.parameters[l];if(c!=null&&c.documentation){const u=xr("span.documentation");if(typeof c.documentation=="string")u.textContent=c.documentation;else{const h=this.renderMarkdownDocs(c.documentation);u.appendChild(h.element)}ge(this.domNodes.docs,xr("p",{},u))}if(s.documentation!==void 0)if(typeof s.documentation=="string")ge(this.domNodes.docs,xr("p",{},s.documentation));else{const u=this.renderMarkdownDocs(s.documentation);ge(this.domNodes.docs,u.element)}const d=this.hasDocs(s,c);if(this.domNodes.signature.classList.toggle("has-docs",d),this.domNodes.docs.classList.toggle("empty",!d),this.domNodes.overloads.textContent=String(e.activeSignature+1).padStart(e.signatures.length.toString().length,"0")+"/"+e.signatures.length,c){let u="";const h=s.parameters[l];Array.isArray(h.label)?u=s.label.substring(h.label[0],h.label[1]):u=h.label,h.documentation&&(u+=typeof h.documentation=="string"?", ".concat(h.documentation):", ".concat(h.documentation.value)),s.documentation&&(u+=typeof s.documentation=="string"?", ".concat(s.documentation):", ".concat(s.documentation.value)),this.announcedLabel!==u&&(to(m("hint","{0}, hint",u)),this.announcedLabel=u)}this.editor.layoutContentWidget(this),this.domNodes.scrollbar.scanDomNode()}renderMarkdownDocs(e){const t=this.renderDisposeables.add(this.markdownRenderer.render(e,{asyncRenderCallback:()=>{var i;(i=this.domNodes)===null||i===void 0||i.scrollbar.scanDomNode()}}));return t.element.classList.add("markdown-docs"),t}hasDocs(e,t){return!!(t&&typeof t.documentation=="string"&&kp(t.documentation).length>0||t&&typeof t.documentation=="object"&&kp(t.documentation).value.length>0||e.documentation&&typeof e.documentation=="string"&&kp(e.documentation).length>0||e.documentation&&typeof e.documentation=="object"&&kp(e.documentation.value).length>0)}renderParameters(e,t,i){const[s,o]=this.getParameterLabelOffsets(t,i),r=document.createElement("span");r.textContent=t.label.substring(0,s);const a=document.createElement("span");a.textContent=t.label.substring(s,o),a.className="parameter active";const l=document.createElement("span");l.textContent=t.label.substring(o),ge(e,r,a,l)}getParameterLabelOffsets(e,t){const i=e.parameters[t];if(i){if(Array.isArray(i.label))return i.label;if(i.label.length){const s=new RegExp("(\\W|^)".concat(Xr(i.label),"(?=\\W|$)"),"g");s.test(e.label);const o=s.lastIndex-i.label.length;return o>=0?[o,s.lastIndex]:[0,0]}else return[0,0]}else return[0,0]}next(){this.editor.focus(),this.model.next()}previous(){this.editor.focus(),this.model.previous()}getDomNode(){return this.domNodes||this.createParameterHintDOMNodes(),this.domNodes.element}getId(){return L5.ID}updateMaxHeight(){if(!this.domNodes)return;const e=Math.max(this.editor.getLayoutInfo().height/4,250),t="".concat(e,"px");this.domNodes.element.style.maxHeight=t;const i=this.domNodes.element.getElementsByClassName("phwrapper");i.length&&(i[0].style.maxHeight=t)}};sT.ID="editor.widget.parameterHintsWidget";sT=L5=I7e([BR(2,bt),BR(3,Ir),BR(4,qi)],sT);F("editorHoverWidget.highlightForeground",{dark:el,light:el,hcDark:el,hcLight:el},m("editorHoverWidgetHighlightForeground","Foreground color of the active item in the parameter hint."));var N7e=globalThis&&globalThis.__decorate||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},vK=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},k5;let Mm=k5=class extends te{static get(e){return e.getContribution(k5.ID)}constructor(e,t,i){super(),this.editor=e,this.model=this._register(new qN(e,i.signatureHelpProvider)),this._register(this.model.onChangedHints(s=>{var o;s?(this.widget.value.show(),this.widget.value.render(s)):(o=this.widget.rawValue)===null||o===void 0||o.hide()})),this.widget=new kg(()=>this._register(t.createInstance(sT,this.editor,this.model)))}cancel(){this.model.cancel()}previous(){var e;(e=this.widget.rawValue)===null||e===void 0||e.previous()}next(){var e;(e=this.widget.rawValue)===null||e===void 0||e.next()}trigger(e){this.model.trigger(e,0)}};Mm.ID="editor.controller.parameterHints";Mm=k5=N7e([vK(1,_t),vK(2,Ze)],Mm);class A7e extends Ue{constructor(){super({id:"editor.action.triggerParameterHints",label:m("parameterHints.trigger.label","Trigger Parameter Hints"),alias:"Trigger Parameter Hints",precondition:O.hasSignatureHelpProvider,kbOpts:{kbExpr:O.editorTextFocus,primary:3082,weight:100}})}run(e,t){const i=Mm.get(t);i==null||i.trigger({triggerKind:gd.Invoke})}}ti(Mm.ID,Mm,2);De(A7e);const m6=100+75,_6=fs.bindToContribution(Mm.get);Re(new _6({id:"closeParameterHints",precondition:Am.Visible,handler:n=>n.cancel(),kbOpts:{weight:m6,kbExpr:O.focus,primary:9,secondary:[1033]}}));Re(new _6({id:"showPrevParameterHint",precondition:fe.and(Am.Visible,Am.MultipleSignatures),handler:n=>n.previous(),kbOpts:{weight:m6,kbExpr:O.focus,primary:16,secondary:[528],mac:{primary:16,secondary:[528,302]}}}));Re(new _6({id:"showNextParameterHint",precondition:fe.and(Am.Visible,Am.MultipleSignatures),handler:n=>n.next(),kbOpts:{weight:m6,kbExpr:O.focus,primary:18,secondary:[530],mac:{primary:18,secondary:[530,300]}}}));var M7e=globalThis&&globalThis.__decorate||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},WR=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};const GN=new Ve("renameInputVisible",!1,m("renameInputVisible","Whether the rename input widget is visible"));let D5=class{constructor(e,t,i,s,o){this._editor=e,this._acceptKeybindings=t,this._themeService=i,this._keybindingService=s,this._disposables=new be,this.allowEditorOverflow=!0,this._visibleContextKey=GN.bindTo(o),this._editor.addContentWidget(this),this._disposables.add(this._editor.onDidChangeConfiguration(r=>{r.hasChanged(50)&&this._updateFont()})),this._disposables.add(i.onDidColorThemeChange(this._updateStyles,this))}dispose(){this._disposables.dispose(),this._editor.removeContentWidget(this)}getId(){return"__renameInputWidget"}getDomNode(){return this._domNode||(this._domNode=document.createElement("div"),this._domNode.className="monaco-editor rename-box",this._input=document.createElement("input"),this._input.className="rename-input",this._input.type="text",this._input.setAttribute("aria-label",m("renameAriaLabel","Rename input. Type new name and press Enter to commit.")),this._domNode.appendChild(this._input),this._label=document.createElement("div"),this._label.className="rename-label",this._domNode.appendChild(this._label),this._updateFont(),this._updateStyles(this._themeService.getColorTheme())),this._domNode}_updateStyles(e){var t,i,s,o;if(!this._input||!this._domNode)return;const r=e.getColor(nd),a=e.getColor(J8);this._domNode.style.backgroundColor=String((t=e.getColor(un))!==null&&t!==void 0?t:""),this._domNode.style.boxShadow=r?" 0 0 8px 2px ".concat(r):"",this._domNode.style.border=a?"1px solid ".concat(a):"",this._domNode.style.color=String((i=e.getColor(HQ))!==null&&i!==void 0?i:""),this._input.style.backgroundColor=String((s=e.getColor(VQ))!==null&&s!==void 0?s:"");const l=e.getColor($Q);this._input.style.borderWidth=l?"1px":"0px",this._input.style.borderStyle=l?"solid":"none",this._input.style.borderColor=(o=l==null?void 0:l.toString())!==null&&o!==void 0?o:"none"}_updateFont(){if(!this._input||!this._label)return;const e=this._editor.getOption(50);this._input.style.fontFamily=e.fontFamily,this._input.style.fontWeight=e.fontWeight,this._input.style.fontSize="".concat(e.fontSize,"px"),this._label.style.fontSize="".concat(e.fontSize*.8,"px")}getPosition(){return this._visible?{position:this._position,preference:[2,1]}:null}beforeRender(){var e,t;const[i,s]=this._acceptKeybindings;return this._label.innerText=m({key:"label",comment:['placeholders are keybindings, e.g "F2 to Rename, Shift+F2 to Preview"']},"{0} to Rename, {1} to Preview",(e=this._keybindingService.lookupKeybinding(i))===null||e===void 0?void 0:e.getLabel(),(t=this._keybindingService.lookupKeybinding(s))===null||t===void 0?void 0:t.getLabel()),null}afterRender(e){e||this.cancelInput(!0)}acceptInput(e){var t;(t=this._currentAcceptInput)===null||t===void 0||t.call(this,e)}cancelInput(e){var t;(t=this._currentCancelInput)===null||t===void 0||t.call(this,e)}getInput(e,t,i,s,o,r){this._domNode.classList.toggle("preview",o),this._position=new Y(e.startLineNumber,e.startColumn),this._input.value=t,this._input.setAttribute("selectionStart",i.toString()),this._input.setAttribute("selectionEnd",s.toString()),this._input.size=Math.max((e.endColumn-e.startColumn)*1.1,20);const a=new be;return new Promise(l=>{this._currentCancelInput=c=>(this._currentAcceptInput=void 0,this._currentCancelInput=void 0,l(c),!0),this._currentAcceptInput=c=>{if(this._input.value.trim().length===0||this._input.value===t){this.cancelInput(!0);return}this._currentAcceptInput=void 0,this._currentCancelInput=void 0,l({newName:this._input.value,wantsPreview:o&&c})},a.add(r.onCancellationRequested(()=>this.cancelInput(!0))),a.add(this._editor.onDidBlurEditorWidget(()=>{var c;return this.cancelInput(!(!((c=this._domNode)===null||c===void 0)&&c.ownerDocument.hasFocus()))})),this._show()}).finally(()=>{a.dispose(),this._hide()})}_show(){this._editor.revealLineInCenterIfOutsideViewport(this._position.lineNumber,0),this._visible=!0,this._visibleContextKey.set(!0),this._editor.layoutContentWidget(this),setTimeout(()=>{this._input.focus(),this._input.setSelectionRange(parseInt(this._input.getAttribute("selectionStart")),parseInt(this._input.getAttribute("selectionEnd")))},100)}_hide(){this._visible=!1,this._visibleContextKey.reset(),this._editor.layoutContentWidget(this)}};D5=M7e([WR(2,os),WR(3,Di),WR(4,bt)],D5);var R7e=globalThis&&globalThis.__decorate||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},Jg=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},Qp=globalThis&&globalThis.__awaiter||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())})},E5;class v6{constructor(e,t,i){this.model=e,this.position=t,this._providerRenameIdx=0,this._providers=i.ordered(e)}hasProvider(){return this._providers.length>0}resolveRenameLocation(e){return Qp(this,void 0,void 0,function*(){const t=[];for(this._providerRenameIdx=0;this._providerRenameIdx0?t.join("\n"):void 0}:{range:I.fromPositions(this.position),text:"",rejectReason:t.length>0?t.join("\n"):void 0}})}provideRenameEdits(e,t){return Qp(this,void 0,void 0,function*(){return this._provideRenameEdits(e,this._providerRenameIdx,[],t)})}_provideRenameEdits(e,t,i,s){return Qp(this,void 0,void 0,function*(){const o=this._providers[t];if(!o)return{edits:[],rejectReason:i.join("\n")};const r=yield o.provideRenameEdits(this.model,this.position,e,s);if(r){if(r.rejectReason)return this._provideRenameEdits(e,t+1,i.concat(r.rejectReason),s)}else return this._provideRenameEdits(e,t+1,i.concat(m("no result","No result.")),s);return r})}}function P7e(n,e,t,i){return Qp(this,void 0,void 0,function*(){const s=new v6(e,t,n),o=yield s.resolveRenameLocation(Ft.None);return o!=null&&o.rejectReason?{edits:[],rejectReason:o.rejectReason}:s.provideRenameEdits(i,Ft.None)})}let Rm=E5=class{static get(e){return e.getContribution(E5.ID)}constructor(e,t,i,s,o,r,a,l){this.editor=e,this._instaService=t,this._notificationService=i,this._bulkEditService=s,this._progressService=o,this._logService=r,this._configService=a,this._languageFeaturesService=l,this._disposableStore=new be,this._cts=new Tn,this._renameInputField=this._disposableStore.add(this._instaService.createInstance(D5,this.editor,["acceptRenameInput","acceptRenameInputWithPreview"]))}dispose(){this._disposableStore.dispose(),this._cts.dispose(!0)}run(){var e,t;return Qp(this,void 0,void 0,function*(){if(this._cts.dispose(!0),this._cts=new Tn,!this.editor.hasModel())return;const i=this.editor.getPosition(),s=new v6(this.editor.getModel(),i,this._languageFeaturesService.renameProvider);if(!s.hasProvider())return;const o=new tg(this.editor,5,void 0,this._cts.token);let r;try{const g=s.resolveRenameLocation(o.token);this._progressService.showWhile(g,250),r=yield g}catch(g){(e=Sr.get(this.editor))===null||e===void 0||e.showMessage(g||m("resolveRenameLocationFailed","An unknown error occurred while resolving rename location"),i);return}finally{o.dispose()}if(!r)return;if(r.rejectReason){(t=Sr.get(this.editor))===null||t===void 0||t.showMessage(r.rejectReason,i);return}if(o.token.isCancellationRequested)return;const a=new tg(this.editor,5,r.range,this._cts.token),l=this.editor.getSelection();let c=0,d=r.text.length;!I.isEmpty(l)&&!I.spansMultipleLines(l)&&I.containsRange(r.range,l)&&(c=Math.max(0,l.startColumn-r.range.startColumn),d=Math.min(r.range.endColumn,l.endColumn)-r.range.startColumn);const u=this._bulkEditService.hasPreviewHandler()&&this._configService.getValue(this.editor.getModel().uri,"editor.rename.enablePreview"),h=yield this._renameInputField.getInput(r.range,r.text,c,d,u,a.token);if(typeof h=="boolean"){h&&this.editor.focus(),a.dispose();return}this.editor.focus();const f=rx(s.provideRenameEdits(h.newName,a.token),a.token).then(g=>Qp(this,void 0,void 0,function*(){if(!(!g||!this.editor.hasModel())){if(g.rejectReason){this._notificationService.info(g.rejectReason);return}this.editor.setSelection(I.fromPositions(this.editor.getSelection().getPosition())),this._bulkEditService.apply(g,{editor:this.editor,showPreview:h.wantsPreview,label:m("label","Renaming '{0}' to '{1}'",r==null?void 0:r.text,h.newName),code:"undoredo.rename",quotableLabel:m("quotableLabel","Renaming {0} to {1}",r==null?void 0:r.text,h.newName),respectAutoSaveConfig:!0}).then(p=>{p.ariaSummary&&to(m("aria","Successfully renamed '{0}' to '{1}'. Summary: {2}",r.text,h.newName,p.ariaSummary))}).catch(p=>{this._notificationService.error(m("rename.failedApply","Rename failed to apply edits")),this._logService.error(p)})}}),g=>{this._notificationService.error(m("rename.failed","Rename failed to compute edits")),this._logService.error(g)}).finally(()=>{a.dispose()});return this._progressService.showWhile(f,250),f})}acceptRenameInput(e){this._renameInputField.acceptInput(e)}cancelRenameInput(){this._renameInputField.cancelInput(!0)}};Rm.ID="editor.contrib.renameController";Rm=E5=R7e([Jg(1,_t),Jg(2,Nn),Jg(3,kS),Jg(4,Tg),Jg(5,aa),Jg(6,j8),Jg(7,Ze)],Rm);class O7e extends Ue{constructor(){super({id:"editor.action.rename",label:m("rename.label","Rename Symbol"),alias:"Rename Symbol",precondition:fe.and(O.writable,O.hasRenameProvider),kbOpts:{kbExpr:O.editorTextFocus,primary:60,weight:100},contextMenuOpts:{group:"1_modification",order:1.1}})}runCommand(e,t){const i=e.get(ai),[s,o]=Array.isArray(t)&&t||[void 0,void 0];return ct.isUri(s)&&Y.isIPosition(o)?i.openCodeEditor({resource:s},i.getActiveCodeEditor()).then(r=>{r&&(r.setPosition(o),r.invokeWithinContext(a=>(this.reportTelemetry(a,r),this.run(a,r))))},Dt):super.runCommand(e,t)}run(e,t){const i=Rm.get(t);return i?i.run():Promise.resolve()}}ti(Rm.ID,Rm,4);De(O7e);const b6=fs.bindToContribution(Rm.get);Re(new b6({id:"acceptRenameInput",precondition:GN,handler:n=>n.acceptRenameInput(!1),kbOpts:{weight:100+99,kbExpr:fe.and(O.focus,fe.not("isComposing")),primary:3}}));Re(new b6({id:"acceptRenameInputWithPreview",precondition:fe.and(GN,fe.has("config.editor.rename.enablePreview")),handler:n=>n.acceptRenameInput(!0),kbOpts:{weight:100+99,kbExpr:fe.and(O.focus,fe.not("isComposing")),primary:1024+3}}));Re(new b6({id:"cancelRenameInput",precondition:GN,handler:n=>n.cancelRenameInput(),kbOpts:{weight:100+99,kbExpr:O.focus,primary:9,secondary:[1033]}}));$d("_executeDocumentRenameProvider",function(n,e,t,...i){const[s]=i;bi(typeof s=="string");const{renameProvider:o}=n.get(Ze);return P7e(o,e,t,s)});$d("_executePrepareRename",function(n,e,t){return Qp(this,void 0,void 0,function*(){const{renameProvider:i}=n.get(Ze),o=yield new v6(e,t,i).resolveRenameLocation(Ft.None);if(o!=null&&o.rejectReason)throw new Error(o.rejectReason);return o})});en.as(wc.Configuration).registerConfiguration({id:"editor",properties:{"editor.rename.enablePreview":{scope:5,description:m("enablePreview","Enable/disable the ability to preview changes before renaming"),default:!0,type:"boolean"}}});function F7e(n){for(let e=0,t=n.length;e0?t[0]:[]}function Cse(n,e,t,i,s){return hg(this,void 0,void 0,function*(){const o=H7e(n,e),r=yield Promise.all(o.map(a=>hg(this,void 0,void 0,function*(){let l,c=null;try{l=yield a.provideDocumentSemanticTokens(e,a===t?i:null,s)}catch(d){c=d,l=null}return(!l||!YN(l)&&!vse(l))&&(l=null),new V7e(a,l,c)})));for(const a of r){if(a.error)throw a.error;if(a.tokens)return a}return r.length>0?r[0]:null})}function $7e(n,e){const t=n.orderedGroups(e);return t.length>0?t[0]:null}class z7e{constructor(e,t){this.provider=e,this.tokens=t}}function U7e(n,e){return n.has(e)}function wse(n,e){const t=n.orderedGroups(e);return t.length>0?t[0]:[]}function C6(n,e,t,i){return hg(this,void 0,void 0,function*(){const s=wse(n,e),o=yield Promise.all(s.map(r=>hg(this,void 0,void 0,function*(){let a;try{a=yield r.provideDocumentRangeSemanticTokens(e,t,i)}catch(l){Bn(l),a=null}return(!a||!YN(a))&&(a=null),new z7e(r,a)})));for(const r of o)if(r.tokens)return r;return o.length>0?o[0]:null})}qt.registerCommand("_provideDocumentSemanticTokensLegend",(n,...e)=>hg(void 0,void 0,void 0,function*(){const[t]=e;bi(t instanceof ct);const i=n.get(Zi).getModel(t);if(!i)return;const{documentSemanticTokensProvider:s}=n.get(Ze),o=$7e(s,i);return o?o[0].getLegend():n.get(gn).executeCommand("_provideDocumentRangeSemanticTokensLegend",t)}));qt.registerCommand("_provideDocumentSemanticTokens",(n,...e)=>hg(void 0,void 0,void 0,function*(){const[t]=e;bi(t instanceof ct);const i=n.get(Zi).getModel(t);if(!i)return;const{documentSemanticTokensProvider:s}=n.get(Ze);if(!bse(s,i))return n.get(gn).executeCommand("_provideDocumentRangeSemanticTokens",t,i.getFullModelRange());const o=yield Cse(s,i,null,null,Ft.None);if(!o)return;const{provider:r,tokens:a}=o;if(!a||!YN(a))return;const l=_se({id:0,type:"full",data:a.data});return a.resultId&&r.releaseDocumentSemanticTokens(a.resultId),l}));qt.registerCommand("_provideDocumentRangeSemanticTokensLegend",(n,...e)=>hg(void 0,void 0,void 0,function*(){const[t,i]=e;bi(t instanceof ct);const s=n.get(Zi).getModel(t);if(!s)return;const{documentRangeSemanticTokensProvider:o}=n.get(Ze),r=wse(o,s);if(r.length===0)return;if(r.length===1)return r[0].getLegend();if(!i||!I.isIRange(i))return console.warn("provideDocumentRangeSemanticTokensLegend might be out-of-sync with provideDocumentRangeSemanticTokens unless a range argument is passed in"),r[0].getLegend();const a=yield C6(o,s,I.lift(i),Ft.None);if(a)return a.provider.getLegend()}));qt.registerCommand("_provideDocumentRangeSemanticTokens",(n,...e)=>hg(void 0,void 0,void 0,function*(){const[t,i]=e;bi(t instanceof ct),bi(I.isIRange(i));const s=n.get(Zi).getModel(t);if(!s)return;const{documentRangeSemanticTokensProvider:o}=n.get(Ze),r=yield C6(o,s,I.lift(i),Ft.None);if(!(!r||!r.tokens))return _se({id:0,type:"full",data:r.tokens.data})}));const w6="editor.semanticHighlighting";function I5(n,e,t){var i;const s=(i=t.getValue(w6,{overrideIdentifier:n.getLanguageId(),resource:n.uri}))===null||i===void 0?void 0:i.enabled;return typeof s=="boolean"?s:e.getColorTheme().semanticHighlighting}var yse=globalThis&&globalThis.__decorate||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},zc=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},Mh;let T5=class extends te{constructor(e,t,i,s,o,r){super(),this._watchers=Object.create(null);const a=d=>{this._watchers[d.uri.toString()]=new Oy(d,e,i,o,r)},l=(d,u)=>{u.dispose(),delete this._watchers[d.uri.toString()]},c=()=>{for(const d of t.getModels()){const u=this._watchers[d.uri.toString()];I5(d,i,s)?u||a(d):u&&l(d,u)}};this._register(t.onModelAdded(d=>{I5(d,i,s)&&a(d)})),this._register(t.onModelRemoved(d=>{const u=this._watchers[d.uri.toString()];u&&l(d,u)})),this._register(s.onDidChangeConfiguration(d=>{d.affectsConfiguration(w6)&&c()})),this._register(i.onDidColorThemeChange(c))}dispose(){for(const e of Object.values(this._watchers))e.dispose();super.dispose()}};T5=yse([zc(0,Ax),zc(1,Zi),zc(2,os),zc(3,zt),zc(4,Va),zc(5,Ze)],T5);let Oy=Mh=class extends te{constructor(e,t,i,s,o){super(),this._semanticTokensStylingService=t,this._isDisposed=!1,this._model=e,this._provider=o.documentSemanticTokensProvider,this._debounceInformation=s.for(this._provider,"DocumentSemanticTokens",{min:Mh.REQUEST_MIN_DELAY,max:Mh.REQUEST_MAX_DELAY}),this._fetchDocumentSemanticTokens=this._register(new Si(()=>this._fetchDocumentSemanticTokensNow(),Mh.REQUEST_MIN_DELAY)),this._currentDocumentResponse=null,this._currentDocumentRequestCancellationTokenSource=null,this._documentProvidersChangeListeners=[],this._providersChangedDuringRequest=!1,this._register(this._model.onDidChangeContent(()=>{this._fetchDocumentSemanticTokens.isScheduled()||this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model))})),this._register(this._model.onDidChangeAttached(()=>{this._fetchDocumentSemanticTokens.isScheduled()||this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model))})),this._register(this._model.onDidChangeLanguage(()=>{this._currentDocumentResponse&&(this._currentDocumentResponse.dispose(),this._currentDocumentResponse=null),this._currentDocumentRequestCancellationTokenSource&&(this._currentDocumentRequestCancellationTokenSource.cancel(),this._currentDocumentRequestCancellationTokenSource=null),this._setDocumentSemanticTokens(null,null,null,[]),this._fetchDocumentSemanticTokens.schedule(0)}));const r=()=>{fi(this._documentProvidersChangeListeners),this._documentProvidersChangeListeners=[];for(const a of this._provider.all(e))typeof a.onDidChange=="function"&&this._documentProvidersChangeListeners.push(a.onDidChange(()=>{if(this._currentDocumentRequestCancellationTokenSource){this._providersChangedDuringRequest=!0;return}this._fetchDocumentSemanticTokens.schedule(0)}))};r(),this._register(this._provider.onDidChange(()=>{r(),this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model))})),this._register(i.onDidColorThemeChange(a=>{this._setDocumentSemanticTokens(null,null,null,[]),this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model))})),this._fetchDocumentSemanticTokens.schedule(0)}dispose(){this._currentDocumentResponse&&(this._currentDocumentResponse.dispose(),this._currentDocumentResponse=null),this._currentDocumentRequestCancellationTokenSource&&(this._currentDocumentRequestCancellationTokenSource.cancel(),this._currentDocumentRequestCancellationTokenSource=null),fi(this._documentProvidersChangeListeners),this._documentProvidersChangeListeners=[],this._setDocumentSemanticTokens(null,null,null,[]),this._isDisposed=!0,super.dispose()}_fetchDocumentSemanticTokensNow(){if(this._currentDocumentRequestCancellationTokenSource)return;if(!bse(this._provider,this._model)){this._currentDocumentResponse&&this._model.tokenization.setSemanticTokens(null,!1);return}if(!this._model.isAttachedToEditor())return;const e=new Tn,t=this._currentDocumentResponse?this._currentDocumentResponse.provider:null,i=this._currentDocumentResponse&&this._currentDocumentResponse.resultId||null,s=Cse(this._provider,this._model,t,i,e.token);this._currentDocumentRequestCancellationTokenSource=e,this._providersChangedDuringRequest=!1;const o=[],r=this._model.onDidChangeContent(l=>{o.push(l)}),a=new so(!1);s.then(l=>{if(this._debounceInformation.update(this._model,a.elapsed()),this._currentDocumentRequestCancellationTokenSource=null,r.dispose(),!l)this._setDocumentSemanticTokens(null,null,null,o);else{const{provider:c,tokens:d}=l,u=this._semanticTokensStylingService.getStyling(c);this._setDocumentSemanticTokens(c,d||null,u,o)}},l=>{l&&(bc(l)||typeof l.message=="string"&&l.message.indexOf("busy")!==-1)||Dt(l),this._currentDocumentRequestCancellationTokenSource=null,r.dispose(),(o.length>0||this._providersChangedDuringRequest)&&(this._fetchDocumentSemanticTokens.isScheduled()||this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model)))})}static _copy(e,t,i,s,o){o=Math.min(o,i.length-s,e.length-t);for(let r=0;r{(s.length>0||this._providersChangedDuringRequest)&&!this._fetchDocumentSemanticTokens.isScheduled()&&this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model))};if(this._currentDocumentResponse&&(this._currentDocumentResponse.dispose(),this._currentDocumentResponse=null),this._isDisposed){e&&t&&e.releaseDocumentSemanticTokens(t.resultId);return}if(!e||!i){this._model.tokenization.setSemanticTokens(null,!1);return}if(!t){this._model.tokenization.setSemanticTokens(null,!0),r();return}if(vse(t)){if(!o){this._model.tokenization.setSemanticTokens(null,!0);return}if(t.edits.length===0)t={resultId:t.resultId,data:o.data};else{let a=0;for(const h of t.edits)a+=(h.data?h.data.length:0)-h.deleteCount;const l=o.data,c=new Uint32Array(l.length+a);let d=l.length,u=c.length;for(let h=t.edits.length-1;h>=0;h--){const f=t.edits[h];if(f.start>l.length){i.warnInvalidEditStart(o.resultId,t.resultId,h,f.start,l.length),this._model.tokenization.setSemanticTokens(null,!0);return}const g=d-(f.start+f.deleteCount);g>0&&(Mh._copy(l,d-g,c,u-g,g),u-=g),f.data&&(Mh._copy(f.data,0,c,u-f.data.length,f.data.length),u-=f.data.length),d=f.start}d>0&&Mh._copy(l,0,c,0,d),t={resultId:t.resultId,data:c}}}if(YN(t)){this._currentDocumentResponse=new j7e(e,t.resultId,t.data);const a=iee(t,i,this._model.getLanguageId());if(s.length>0)for(const l of s)for(const c of a)for(const d of l.changes)c.applyEdit(d.range,d.text);this._model.tokenization.setSemanticTokens(a,!0)}else this._model.tokenization.setSemanticTokens(null,!0);r()}};Oy.REQUEST_MIN_DELAY=300;Oy.REQUEST_MAX_DELAY=2e3;Oy=Mh=yse([zc(1,Ax),zc(2,os),zc(3,Va),zc(4,Ze)],Oy);class j7e{constructor(e,t,i){this.provider=e,this.resultId=t,this.data=i}dispose(){this.provider.releaseDocumentSemanticTokens(this.resultId)}}Jx(T5);var K7e=globalThis&&globalThis.__decorate||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},T1=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let Fy=class extends te{constructor(e,t,i,s,o,r){super(),this._semanticTokensStylingService=t,this._themeService=i,this._configurationService=s,this._editor=e,this._provider=r.documentRangeSemanticTokensProvider,this._debounceInformation=o.for(this._provider,"DocumentRangeSemanticTokens",{min:100,max:500}),this._tokenizeViewport=this._register(new Si(()=>this._tokenizeViewportNow(),100)),this._outstandingRequests=[];const a=()=>{this._editor.hasModel()&&this._tokenizeViewport.schedule(this._debounceInformation.get(this._editor.getModel()))};this._register(this._editor.onDidScrollChange(()=>{a()})),this._register(this._editor.onDidChangeModel(()=>{this._cancelAll(),a()})),this._register(this._editor.onDidChangeModelContent(l=>{this._cancelAll(),a()})),this._register(this._provider.onDidChange(()=>{this._cancelAll(),a()})),this._register(this._configurationService.onDidChangeConfiguration(l=>{l.affectsConfiguration(w6)&&(this._cancelAll(),a())})),this._register(this._themeService.onDidColorThemeChange(()=>{this._cancelAll(),a()})),a()}_cancelAll(){for(const e of this._outstandingRequests)e.cancel();this._outstandingRequests=[]}_removeOutstandingRequest(e){for(let t=0,i=this._outstandingRequests.length;tthis._requestRange(e,i)))}_requestRange(e,t){const i=e.getVersionId(),s=Xn(r=>Promise.resolve(C6(this._provider,e,t,r))),o=new so(!1);return s.then(r=>{if(this._debounceInformation.update(e,o.elapsed()),!r||!r.tokens||e.isDisposed()||e.getVersionId()!==i)return;const{provider:a,tokens:l}=r,c=this._semanticTokensStylingService.getStyling(a);e.tokenization.setPartialSemanticTokens(t,iee(l,c,e.getLanguageId()))}).then(()=>this._removeOutstandingRequest(s),()=>this._removeOutstandingRequest(s)),s}};Fy.ID="editor.contrib.viewportSemanticTokens";Fy=K7e([T1(1,Ax),T1(2,os),T1(3,zt),T1(4,Va),T1(5,Ze)],Fy);ti(Fy.ID,Fy,1);class q7e{constructor(e=!0){this.selectSubwords=e}provideSelectionRanges(e,t){const i=[];for(const s of t){const o=[];i.push(o),this.selectSubwords&&this._addInWordRanges(o,e,s),this._addWordRanges(o,e,s),this._addWhitespaceLine(o,e,s),o.push({range:e.getFullModelRange()})}return i}_addInWordRanges(e,t,i){const s=t.getWordAtPosition(i);if(!s)return;const{word:o,startColumn:r}=s,a=i.column-r;let l=a,c=a,d=0;for(;l>=0;l--){const u=o.charCodeAt(l);if(l!==a&&(u===95||u===45))break;if(Xh(u)&&Vc(d))break;d=u}for(l+=1;c0&&t.getLineFirstNonWhitespaceColumn(i.lineNumber)===0&&t.getLineLastNonWhitespaceColumn(i.lineNumber)===0&&e.push({range:new I(i.lineNumber,1,i.lineNumber,t.getLineMaxColumn(i.lineNumber))})}}var G7e=globalThis&&globalThis.__decorate||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},Y7e=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},ZN=globalThis&&globalThis.__awaiter||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())})},x5;class y6{constructor(e,t){this.index=e,this.ranges=t}mov(e){const t=this.index+(e?1:-1);if(t<0||t>=this.ranges.length)return this;const i=new y6(t,this.ranges);return i.ranges[t].equalsRange(this.ranges[this.index])?i.mov(e):i}}let s0=x5=class{static get(e){return e.getContribution(x5.ID)}constructor(e,t){this._editor=e,this._languageFeaturesService=t,this._ignoreSelection=!1}dispose(){var e;(e=this._selectionListener)===null||e===void 0||e.dispose()}run(e){return ZN(this,void 0,void 0,function*(){if(!this._editor.hasModel())return;const t=this._editor.getSelections(),i=this._editor.getModel();if(this._state||(yield Lse(this._languageFeaturesService.selectionRangeProvider,i,t.map(o=>o.getPosition()),this._editor.getOption(112),Ft.None).then(o=>{var r;if(!(!io(o)||o.length!==t.length)&&!(!this._editor.hasModel()||!yn(this._editor.getSelections(),t,(a,l)=>a.equalsSelection(l)))){for(let a=0;al.containsPosition(t[a].getStartPosition())&&l.containsPosition(t[a].getEndPosition())),o[a].unshift(t[a]);this._state=o.map(a=>new y6(0,a)),(r=this._selectionListener)===null||r===void 0||r.dispose(),this._selectionListener=this._editor.onDidChangeCursorPosition(()=>{var a;this._ignoreSelection||((a=this._selectionListener)===null||a===void 0||a.dispose(),this._state=void 0)})}})),!this._state)return;this._state=this._state.map(o=>o.mov(e));const s=this._state.map(o=>Je.fromPositions(o.ranges[o.index].getStartPosition(),o.ranges[o.index].getEndPosition()));this._ignoreSelection=!0;try{this._editor.setSelections(s)}finally{this._ignoreSelection=!1}})}};s0.ID="editor.contrib.smartSelectController";s0=x5=G7e([Y7e(1,Ze)],s0);class Sse extends Ue{constructor(e,t){super(t),this._forward=e}run(e,t){return ZN(this,void 0,void 0,function*(){const i=s0.get(t);i&&(yield i.run(this._forward))})}}class Z7e extends Sse{constructor(){super(!0,{id:"editor.action.smartSelect.expand",label:m("smartSelect.expand","Expand Selection"),alias:"Expand Selection",precondition:void 0,kbOpts:{kbExpr:O.editorTextFocus,primary:1553,mac:{primary:3345,secondary:[1297]},weight:100},menuOpts:{menuId:M.MenubarSelectionMenu,group:"1_basic",title:m({key:"miSmartSelectGrow",comment:["&& denotes a mnemonic"]},"&&Expand Selection"),order:2}})}}qt.registerCommandAlias("editor.action.smartSelect.grow","editor.action.smartSelect.expand");class X7e extends Sse{constructor(){super(!1,{id:"editor.action.smartSelect.shrink",label:m("smartSelect.shrink","Shrink Selection"),alias:"Shrink Selection",precondition:void 0,kbOpts:{kbExpr:O.editorTextFocus,primary:1551,mac:{primary:3343,secondary:[1295]},weight:100},menuOpts:{menuId:M.MenubarSelectionMenu,group:"1_basic",title:m({key:"miSmartSelectShrink",comment:["&& denotes a mnemonic"]},"&&Shrink Selection"),order:3}})}}ti(s0.ID,s0,4);De(Z7e);De(X7e);function Lse(n,e,t,i,s){return ZN(this,void 0,void 0,function*(){const o=n.all(e).concat(new q7e(i.selectSubwords));o.length===1&&o.unshift(new Pr);const r=[],a=[];for(const l of o)r.push(Promise.resolve(l.provideSelectionRanges(e,t,s)).then(c=>{if(io(c)&&c.length===t.length)for(let d=0;d{if(l.length===0)return[];l.sort((h,f)=>Y.isBefore(h.getStartPosition(),f.getStartPosition())?1:Y.isBefore(f.getStartPosition(),h.getStartPosition())||Y.isBefore(h.getEndPosition(),f.getEndPosition())?-1:Y.isBefore(f.getEndPosition(),h.getEndPosition())?1:0);const c=[];let d;for(const h of l)(!d||I.containsRange(h,d)&&!I.equalsRange(h,d))&&(c.push(h),d=h);if(!i.selectLeadingAndTrailingWhitespace)return c;const u=[c[0]];for(let h=1;hn}),VR="data-sticky-line-index",wK="data-sticky-is-line",e6e="data-sticky-is-line-number",yK="data-sticky-is-folding-icon";class t6e extends te{constructor(e){super(),this._editor=e,this._foldingIconStore=new be,this._rootDomNode=document.createElement("div"),this._lineNumbersDomNode=document.createElement("div"),this._linesDomNodeScrollable=document.createElement("div"),this._linesDomNode=document.createElement("div"),this._lineHeight=this._editor.getOption(66),this._stickyLines=[],this._lineNumbers=[],this._lastLineRelativePosition=0,this._minContentWidthInPx=0,this._isOnGlyphMargin=!1,this._lineNumbersDomNode.className="sticky-widget-line-numbers",this._lineNumbersDomNode.setAttribute("role","none"),this._linesDomNode.className="sticky-widget-lines",this._linesDomNode.setAttribute("role","list"),this._linesDomNodeScrollable.className="sticky-widget-lines-scrollable",this._linesDomNodeScrollable.appendChild(this._linesDomNode),this._rootDomNode.className="sticky-widget",this._rootDomNode.classList.toggle("peek",e instanceof sg),this._rootDomNode.appendChild(this._lineNumbersDomNode),this._rootDomNode.appendChild(this._linesDomNodeScrollable);const t=()=>{this._linesDomNode.style.left=this._editor.getOption(114).scrollWithEditor?"-".concat(this._editor.getScrollLeft(),"px"):"0px"};this._register(this._editor.onDidChangeConfiguration(i=>{i.hasChanged(114)&&t(),i.hasChanged(66)&&(this._lineHeight=this._editor.getOption(66))})),this._register(this._editor.onDidScrollChange(i=>{i.scrollLeftChanged&&t(),i.scrollWidthChanged&&this._updateWidgetWidth()})),this._register(this._editor.onDidChangeModel(()=>{t(),this._updateWidgetWidth()})),this._register(this._foldingIconStore),t(),this._register(this._editor.onDidLayoutChange(i=>{this._updateWidgetWidth()})),this._updateWidgetWidth()}get lineNumbers(){return this._lineNumbers}get lineNumberCount(){return this._lineNumbers.length}getStickyLineForLine(e){return this._stickyLines.find(t=>t.lineNumber===e)}getCurrentLines(){return this._lineNumbers}setState(e,t,i=1/0){if((!this._previousState&&!e||this._previousState&&this._previousState.equals(e))&&i===1/0)return;this._previousState=e;const s=this._stickyLines;if(this._clearStickyWidget(),!e||!this._editor._getViewModel())return;if(e.startLineNumbers.length*this._lineHeight+e.lastLineRelativePosition>0){this._lastLineRelativePosition=e.lastLineRelativePosition;const r=[...e.startLineNumbers];e.showEndForLine!==null&&(r[e.showEndForLine]=e.endLineNumbers[e.showEndForLine]),this._lineNumbers=r}else this._lastLineRelativePosition=0,this._lineNumbers=[];this._renderRootNode(s,t,i)}_updateWidgetWidth(){const e=this._editor.getLayoutInfo(),t=e.contentLeft;this._lineNumbersDomNode.style.width="".concat(t,"px"),this._linesDomNodeScrollable.style.setProperty("--vscode-editorStickyScroll-scrollableWidth","".concat(this._editor.getScrollWidth()-e.verticalScrollbarWidth,"px")),this._rootDomNode.style.width="".concat(e.width-e.verticalScrollbarWidth,"px")}_clearStickyWidget(){this._stickyLines=[],this._foldingIconStore.clear(),Ds(this._lineNumbersDomNode),Ds(this._linesDomNode),this._rootDomNode.style.display="none"}_useFoldingOpacityTransition(e){this._lineNumbersDomNode.style.setProperty("--vscode-editorStickyScroll-foldingOpacityTransition","opacity ".concat(e?.5:0,"s"))}_setFoldingIconsVisibility(e){for(const t of this._stickyLines){const i=t.foldingIcon;i&&i.setVisible(e?!0:i.isCollapsed)}}_renderRootNode(e,t,i=1/0){return J7e(this,void 0,void 0,function*(){const s=this._editor.getLayoutInfo();for(const[r,a]of this._lineNumbers.entries()){const l=e[r],c=a>=i||(l==null?void 0:l.lineNumber)!==a?this._renderChildNode(r,a,t,s):this._updateTopAndZIndexOfStickyLine(l);c&&(this._linesDomNode.appendChild(c.lineDomNode),this._lineNumbersDomNode.appendChild(c.lineNumberDomNode),this._stickyLines.push(c))}t&&(this._setFoldingHoverListeners(),this._useFoldingOpacityTransition(!this._isOnGlyphMargin));const o=this._lineNumbers.length*this._lineHeight+this._lastLineRelativePosition;if(o===0){this._clearStickyWidget();return}this._rootDomNode.style.display="block",this._lineNumbersDomNode.style.height="".concat(o,"px"),this._linesDomNodeScrollable.style.height="".concat(o,"px"),this._rootDomNode.style.height="".concat(o,"px"),this._rootDomNode.style.marginLeft="0px",this._updateMinContentWidth(),this._editor.layoutOverlayWidget(this)})}_setFoldingHoverListeners(){this._editor.getOption(109)==="mouseover"&&(this._foldingIconStore.add(ce(this._lineNumbersDomNode,Pe.MOUSE_ENTER,t=>{this._isOnGlyphMargin=!0,this._setFoldingIconsVisibility(!0)})),this._foldingIconStore.add(ce(this._lineNumbersDomNode,Pe.MOUSE_LEAVE,()=>{this._isOnGlyphMargin=!1,this._useFoldingOpacityTransition(!0),this._setFoldingIconsVisibility(!1)})))}_renderChildNode(e,t,i,s){const o=this._editor._getViewModel();if(!o)return;const r=o.coordinatesConverter.convertModelPositionToViewPosition(new Y(t,1)).lineNumber,a=o.getViewLineRenderingData(r),l=this._editor.getOption(67);let c;try{c=br.filter(a.inlineDecorations,r,a.minColumn,a.maxColumn)}catch{c=[]}const d=new Eg(!0,!0,a.content,a.continuesWithWrappedLine,a.isBasicASCII,a.containsRTL,0,a.tokens,c,a.tabSize,a.startVisibleColumn,1,1,1,500,"none",!0,!0,null),u=new D0(2e3),h=gS(d,u);let f;CK?f=CK.createHTML(u.build()):f=u.build();const g=document.createElement("span");g.setAttribute(VR,String(e)),g.setAttribute(wK,""),g.setAttribute("role","listitem"),g.tabIndex=0,g.className="sticky-line-content",g.classList.add("stickyLine".concat(t)),g.style.lineHeight="".concat(this._lineHeight,"px"),g.innerHTML=f;const p=document.createElement("span");p.setAttribute(VR,String(e)),p.setAttribute(e6e,""),p.className="sticky-line-number",p.style.lineHeight="".concat(this._lineHeight,"px");const _=s.contentLeft;p.style.width="".concat(_,"px");const v=document.createElement("span");l.renderType===1||l.renderType===3&&t%10===0?v.innerText=t.toString():l.renderType===2&&(v.innerText=Math.abs(t-this._editor.getPosition().lineNumber).toString()),v.className="sticky-line-number-inner",v.style.lineHeight="".concat(this._lineHeight,"px"),v.style.width="".concat(s.lineNumbersWidth,"px"),v.style.paddingLeft="".concat(s.lineNumbersLeft,"px"),p.appendChild(v);const b=this._renderFoldingIconForLine(i,t);b&&p.appendChild(b.domNode),this._editor.applyFontInfo(g),this._editor.applyFontInfo(v),p.style.lineHeight="".concat(this._lineHeight,"px"),g.style.lineHeight="".concat(this._lineHeight,"px"),p.style.height="".concat(this._lineHeight,"px"),g.style.height="".concat(this._lineHeight,"px");const C=new i6e(e,t,g,p,b,h.characterMapping);return this._updateTopAndZIndexOfStickyLine(C)}_updateTopAndZIndexOfStickyLine(e){var t;const i=e.index,s=e.lineDomNode,o=e.lineNumberDomNode,r=i===this._lineNumbers.length-1,a="0",l="1";s.style.zIndex=r?a:l,o.style.zIndex=r?a:l;const c="".concat(i*this._lineHeight+this._lastLineRelativePosition+(!((t=e.foldingIcon)===null||t===void 0)&&t.isCollapsed?1:0),"px"),d="".concat(i*this._lineHeight,"px");return s.style.top=r?c:d,o.style.top=r?c:d,e}_renderFoldingIconForLine(e,t){const i=this._editor.getOption(109);if(!e||i==="never")return;const s=e.regions,o=s.findRange(t),r=s.getStartLineNumber(o);if(!(t===r))return;const l=s.isCollapsed(o),c=new n6e(l,r,s.getEndLineNumber(o),this._lineHeight);return c.setVisible(this._isOnGlyphMargin?!0:l||i==="always"),c.domNode.setAttribute(yK,""),c}_updateMinContentWidth(){this._minContentWidthInPx=0;for(const e of this._stickyLines)e.lineDomNode.scrollWidth>this._minContentWidthInPx&&(this._minContentWidthInPx=e.lineDomNode.scrollWidth);this._minContentWidthInPx+=this._editor.getLayoutInfo().verticalScrollbarWidth}getId(){return"editor.contrib.stickyScrollWidget"}getDomNode(){return this._rootDomNode}getPosition(){return{preference:null}}getMinContentWidthInPx(){return this._minContentWidthInPx}focusLineWithIndex(e){0<=e&&e0)return null;const t=this._getRenderedStickyLineFromChildDomNode(e);if(!t)return null;const i=r9(t.characterMapping,e,0);return new Y(t.lineNumber,i)}getLineNumberFromChildDomNode(e){var t,i;return(i=(t=this._getRenderedStickyLineFromChildDomNode(e))===null||t===void 0?void 0:t.lineNumber)!==null&&i!==void 0?i:null}_getRenderedStickyLineFromChildDomNode(e){const t=this.getLineIndexFromChildDomNode(e);return t===null||t<0||t>=this._stickyLines.length?null:this._stickyLines[t]}getLineIndexFromChildDomNode(e){const t=this._getAttributeValue(e,VR);return t?parseInt(t,10):null}isInStickyLine(e){return this._getAttributeValue(e,wK)!==void 0}isInFoldingIconDomNode(e){return this._getAttributeValue(e,yK)!==void 0}_getAttributeValue(e,t){for(;e&&e!==this._rootDomNode;){const i=e.getAttribute(t);if(i!==null)return i;e=e.parentElement}}}class i6e{constructor(e,t,i,s,o,r){this.index=e,this.lineNumber=t,this.lineDomNode=i,this.lineNumberDomNode=s,this.foldingIcon=o,this.characterMapping=r}}class n6e{constructor(e,t,i,s){this.isCollapsed=e,this.foldingStartLine=t,this.foldingEndLine=i,this.dimension=s,this.domNode=document.createElement("div"),this.domNode.style.width="".concat(s,"px"),this.domNode.style.height="".concat(s,"px"),this.domNode.className=dt.asClassName(e?xN:TN)}setVisible(e){this.domNode.style.cursor=e?"pointer":"default",this.domNode.style.opacity=e?"1":"0"}}class jC{constructor(e,t){this.startLineNumber=e,this.endLineNumber=t}}class oT{constructor(e,t,i){this.range=e,this.children=t,this.parent=i}}class kse{constructor(e,t,i,s){this.uri=e,this.version=t,this.element=i,this.outlineProviderId=s}}var XN=globalThis&&globalThis.__decorate||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=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},SK=globalThis&&globalThis.__awaiter||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())})},KC;(function(n){n.OUTLINE_MODEL="outlineModel",n.FOLDING_PROVIDER_MODEL="foldingProviderModel",n.INDENTATION_MODEL="indentationModel"})(KC||(KC={}));var uf;(function(n){n[n.VALID=0]="VALID",n[n.INVALID=1]="INVALID",n[n.CANCELED=2]="CANCELED"})(uf||(uf={}));let N5=class extends te{constructor(e,t,i,s){super(),this._editor=e,this._languageConfigurationService=t,this._languageFeaturesService=i,this._modelProviders=[],this._modelPromise=null,this._updateScheduler=this._register(new pl(300)),this._updateOperation=this._register(new be);const o=new A5(i),r=new R5(this._editor,i),a=new M5(this._editor,t);switch(s){case KC.OUTLINE_MODEL:this._modelProviders.push(o),this._modelProviders.push(r),this._modelProviders.push(a);break;case KC.FOLDING_PROVIDER_MODEL:this._modelProviders.push(r),this._modelProviders.push(a);break;case KC.INDENTATION_MODEL:this._modelProviders.push(a);break}}_cancelModelPromise(){this._modelPromise&&(this._modelPromise.cancel(),this._modelPromise=null)}update(e,t,i){return SK(this,void 0,void 0,function*(){return this._updateOperation.clear(),this._updateOperation.add({dispose:()=>{this._cancelModelPromise(),this._updateScheduler.cancel()}}),this._cancelModelPromise(),yield this._updateScheduler.trigger(()=>SK(this,void 0,void 0,function*(){for(const s of this._modelProviders){const{statusPromise:o,modelPromise:r}=s.computeStickyModel(e,t,i);this._modelPromise=r;const a=yield o;if(this._modelPromise!==r)return null;switch(a){case uf.CANCELED:return this._updateOperation.clear(),null;case uf.VALID:return s.stickyModel}}return null})).catch(s=>(Dt(s),null))})}};N5=XN([By(1,Ni),By(2,Ze)],N5);class Dse{constructor(){this._stickyModel=null}get stickyModel(){return this._stickyModel}_invalid(){return this._stickyModel=null,uf.INVALID}computeStickyModel(e,t,i){if(i.isCancellationRequested||!this.isProviderValid(e))return{statusPromise:this._invalid(),modelPromise:null};const s=Xn(o=>this.createModelFromProvider(e,t,o));return{statusPromise:s.then(o=>this.isModelValid(o)?i.isCancellationRequested?uf.CANCELED:(this._stickyModel=this.createStickyModel(e,t,i,o),uf.VALID):this._invalid()).then(void 0,o=>(Dt(o),uf.CANCELED)),modelPromise:s}}isModelValid(e){return!0}isProviderValid(e){return!0}}let A5=class extends Dse{constructor(e){super(),this._languageFeaturesService=e}createModelFromProvider(e,t,i){return gu.create(this._languageFeaturesService.documentSymbolProvider,e,i)}createStickyModel(e,t,i,s){var o;const{stickyOutlineElement:r,providerID:a}=this._stickyModelFromOutlineModel(s,(o=this._stickyModel)===null||o===void 0?void 0:o.outlineProviderId);return new kse(e.uri,t,r,a)}isModelValid(e){return e&&e.children.size>0}_stickyModelFromOutlineModel(e,t){let i;if(Pt.first(e.children.values())instanceof Yne){const a=Pt.find(e.children.values(),l=>l.id===t);if(a)i=a.children;else{let l="",c=-1,d;for(const[u,h]of e.children.entries()){const f=this._findSumOfRangesOfGroup(h);f>c&&(d=h,c=f,l=h.id)}t=l,i=d.children}}else i=e.children;const s=[],o=Array.from(i.values()).sort((a,l)=>{const c=new jC(a.symbol.range.startLineNumber,a.symbol.range.endLineNumber),d=new jC(l.symbol.range.startLineNumber,l.symbol.range.endLineNumber);return this._comparator(c,d)});for(const a of o)s.push(this._stickyModelFromOutlineElement(a,a.symbol.selectionRange.startLineNumber));return{stickyOutlineElement:new oT(void 0,s,void 0),providerID:t}}_stickyModelFromOutlineElement(e,t){const i=[];for(const o of e.children.values())if(o.symbol.selectionRange.startLineNumber!==o.symbol.range.endLineNumber)if(o.symbol.selectionRange.startLineNumber!==t)i.push(this._stickyModelFromOutlineElement(o,o.symbol.selectionRange.startLineNumber));else for(const r of o.children.values())i.push(this._stickyModelFromOutlineElement(r,o.symbol.selectionRange.startLineNumber));i.sort((o,r)=>this._comparator(o.range,r.range));const s=new jC(e.symbol.selectionRange.startLineNumber,e.symbol.range.endLineNumber);return new oT(s,i,void 0)}_comparator(e,t){return e.startLineNumber!==t.startLineNumber?e.startLineNumber-t.startLineNumber:t.endLineNumber-e.endLineNumber}_findSumOfRangesOfGroup(e){let t=0;for(const i of e.children.values())t+=this._findSumOfRangesOfGroup(i);return e instanceof JF?t+e.symbol.range.endLineNumber-e.symbol.selectionRange.startLineNumber:t}};A5=XN([By(0,Ze)],A5);class Ese extends Dse{constructor(e){super(),this._foldingLimitReporter=new Kne(e)}createStickyModel(e,t,i,s){const o=this._fromFoldingRegions(s);return new kse(e.uri,t,o,void 0)}isModelValid(e){return e!==null}_fromFoldingRegions(e){const t=e.length,i=[],s=new oT(void 0,[],void 0);for(let o=0;o0}createModelFromProvider(e,t,i){const s=Md.getFoldingRangeProviders(this._languageFeaturesService,e);return new r6(e,s,()=>this.createModelFromProvider(e,t,i),this._foldingLimitReporter,void 0).compute(i)}};R5=XN([By(1,Ze)],R5);var s6e=globalThis&&globalThis.__decorate||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},LK=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},kK=globalThis&&globalThis.__awaiter||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 o6e{constructor(e,t,i){this.startLineNumber=e,this.endLineNumber=t,this.nestingDepth=i}}let P5=class extends te{constructor(e,t,i){super(),this._languageFeaturesService=t,this._languageConfigurationService=i,this._onDidChangeStickyScroll=this._register(new j),this.onDidChangeStickyScroll=this._onDidChangeStickyScroll.event,this._options=null,this._model=null,this._cts=null,this._stickyModelProvider=null,this._editor=e,this._sessionStore=this._register(new be),this._updateSoon=this._register(new Si(()=>this.update(),50)),this._register(this._editor.onDidChangeConfiguration(s=>{s.hasChanged(114)&&this.readConfiguration()})),this.readConfiguration()}readConfiguration(){this._stickyModelProvider=null,this._sessionStore.clear(),this._options=this._editor.getOption(114),this._options.enabled&&(this._stickyModelProvider=this._sessionStore.add(new N5(this._editor,this._languageConfigurationService,this._languageFeaturesService,this._options.defaultModel)),this._sessionStore.add(this._editor.onDidChangeModel(()=>{this._model=null,this._onDidChangeStickyScroll.fire(),this.update()})),this._sessionStore.add(this._editor.onDidChangeHiddenAreas(()=>this.update())),this._sessionStore.add(this._editor.onDidChangeModelContent(()=>this._updateSoon.schedule())),this._sessionStore.add(this._languageFeaturesService.documentSymbolProvider.onDidChange(()=>this.update())),this.update())}getVersionId(){var e;return(e=this._model)===null||e===void 0?void 0:e.version}update(){var e;return kK(this,void 0,void 0,function*(){(e=this._cts)===null||e===void 0||e.dispose(!0),this._cts=new Tn,yield this.updateStickyModel(this._cts.token),this._onDidChangeStickyScroll.fire()})}updateStickyModel(e){return kK(this,void 0,void 0,function*(){if(!this._editor.hasModel()||!this._stickyModelProvider||this._editor.getModel().isTooLargeForTokenization()){this._model=null;return}const t=this._editor.getModel(),i=t.getVersionId(),s=yield this._stickyModelProvider.update(t,i,e);e.isCancellationRequested||(this._model=s)})}updateIndex(e){return e===-1?e=0:e<0&&(e=-e-2),e}getCandidateStickyLinesIntersectingFromStickyModel(e,t,i,s,o){if(t.children.length===0)return;let r=o;const a=[];for(let d=0;dd-u)),c=this.updateIndex(cw(a,e.startLineNumber+s,(d,u)=>d-u));for(let d=l;d<=c;d++){const u=t.children[d];if(!u)return;if(u.range){const h=u.range.startLineNumber,f=u.range.endLineNumber;e.startLineNumber<=f+1&&h-1<=e.endLineNumber&&h!==r&&(r=h,i.push(new o6e(h,f-1,s+1)),this.getCandidateStickyLinesIntersectingFromStickyModel(e,u,i,s+1,h))}else this.getCandidateStickyLinesIntersectingFromStickyModel(e,u,i,s,o)}}getCandidateStickyLinesIntersecting(e){var t,i;if(!(!((t=this._model)===null||t===void 0)&&t.element))return[];let s=[];this.getCandidateStickyLinesIntersectingFromStickyModel(e,this._model.element,s,0,-1);const o=(i=this._editor._getViewModel())===null||i===void 0?void 0:i.getHiddenAreas();if(o)for(const r of o)s=s.filter(a=>!(a.startLineNumber>=r.startLineNumber&&a.endLineNumber<=r.endLineNumber+1));return s}};P5=s6e([LK(1,Ze),LK(2,Ni)],P5);var r6e=globalThis&&globalThis.__decorate||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},B_=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},HR=globalThis&&globalThis.__awaiter||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())})},O5;let Rd=O5=class extends te{constructor(e,t,i,s,o,r,a){super(),this._editor=e,this._contextMenuService=t,this._languageFeaturesService=i,this._instaService=s,this._contextKeyService=a,this._sessionStore=new be,this._foldingModel=null,this._maxStickyLines=Number.MAX_SAFE_INTEGER,this._candidateDefinitionsLength=-1,this._focusedStickyElementIndex=-1,this._enabled=!1,this._focused=!1,this._positionRevealed=!1,this._onMouseDown=!1,this._endLineNumbers=[],this._showEndForLine=null,this._stickyScrollWidget=new t6e(this._editor),this._stickyLineCandidateProvider=new P5(this._editor,i,o),this._register(this._stickyScrollWidget),this._register(this._stickyLineCandidateProvider),this._widgetState=new bK([],[],0),this._readConfiguration();const l=this._stickyScrollWidget.getDomNode();this._register(this._editor.onDidChangeConfiguration(d=>{(d.hasChanged(114)||d.hasChanged(72)||d.hasChanged(66)||d.hasChanged(109))&&this._readConfiguration()})),this._register(ce(l,Pe.CONTEXT_MENU,d=>HR(this,void 0,void 0,function*(){this._onContextMenu(d)}))),this._stickyScrollFocusedContextKey=O.stickyScrollFocused.bindTo(this._contextKeyService),this._stickyScrollVisibleContextKey=O.stickyScrollVisible.bindTo(this._contextKeyService);const c=this._register(Ld(l));this._register(c.onDidBlur(d=>{this._positionRevealed===!1&&l.clientHeight===0?(this._focusedStickyElementIndex=-1,this.focus()):this._disposeFocusStickyScrollStore()})),this._register(c.onDidFocus(d=>{this.focus()})),this._registerMouseListeners(),this._register(ce(l,Pe.MOUSE_DOWN,d=>{this._onMouseDown=!0}))}static get(e){return e.getContribution(O5.ID)}_disposeFocusStickyScrollStore(){var e;this._stickyScrollFocusedContextKey.set(!1),(e=this._focusDisposableStore)===null||e===void 0||e.dispose(),this._focused=!1,this._positionRevealed=!1,this._onMouseDown=!1}focus(){if(this._onMouseDown){this._onMouseDown=!1,this._editor.focus();return}this._stickyScrollFocusedContextKey.get()!==!0&&(this._focused=!0,this._focusDisposableStore=new be,this._stickyScrollFocusedContextKey.set(!0),this._focusedStickyElementIndex=this._stickyScrollWidget.lineNumbers.length-1,this._stickyScrollWidget.focusLineWithIndex(this._focusedStickyElementIndex))}focusNext(){this._focusedStickyElementIndex0&&this._focusNav(!1)}selectEditor(){this._editor.focus()}_focusNav(e){this._focusedStickyElementIndex=e?this._focusedStickyElementIndex+1:this._focusedStickyElementIndex-1,this._stickyScrollWidget.focusLineWithIndex(this._focusedStickyElementIndex)}goToFocused(){const e=this._stickyScrollWidget.lineNumbers;this._disposeFocusStickyScrollStore(),this._revealPosition({lineNumber:e[this._focusedStickyElementIndex],column:1})}_revealPosition(e){this._reveaInEditor(e,()=>this._editor.revealPosition(e))}_revealLineInCenterIfOutsideViewport(e){this._reveaInEditor(e,()=>this._editor.revealLineInCenterIfOutsideViewport(e.lineNumber,0))}_reveaInEditor(e,t){this._focused&&this._disposeFocusStickyScrollStore(),this._positionRevealed=!0,t(),this._editor.setSelection(I.fromPositions(e)),this._editor.focus()}_registerMouseListeners(){const e=this._register(new be),t=this._register(new gN(this._editor,{extractLineNumberFromMouseEvent:o=>{const r=this._stickyScrollWidget.getEditorPositionFromNode(o.target.element);return r?r.lineNumber:0}})),i=o=>{if(!this._editor.hasModel()||o.target.type!==12||o.target.detail!==this._stickyScrollWidget.getId())return null;const r=o.target.element;if(!r||r.innerText!==r.innerHTML)return null;const a=this._stickyScrollWidget.getEditorPositionFromNode(r);return a?{range:new I(a.lineNumber,a.column,a.lineNumber,a.column+r.innerText.length),textElement:r}:null},s=this._stickyScrollWidget.getDomNode();this._register(In(s,Pe.CLICK,o=>{if(o.ctrlKey||o.altKey||o.metaKey||!o.leftButton)return;if(o.shiftKey){const c=this._stickyScrollWidget.getLineIndexFromChildDomNode(o.target);if(c===null)return;const d=new Y(this._endLineNumbers[c],1);this._revealLineInCenterIfOutsideViewport(d);return}if(this._stickyScrollWidget.isInFoldingIconDomNode(o.target)){const c=this._stickyScrollWidget.getLineNumberFromChildDomNode(o.target);this._toggleFoldingRegionForLine(c);return}if(!this._stickyScrollWidget.isInStickyLine(o.target))return;let l=this._stickyScrollWidget.getEditorPositionFromNode(o.target);if(!l){const c=this._stickyScrollWidget.getLineNumberFromChildDomNode(o.target);if(c===null)return;l=new Y(c,1)}this._revealPosition(l)})),this._register(In(s,Pe.MOUSE_MOVE,o=>{if(o.shiftKey){const r=this._stickyScrollWidget.getLineIndexFromChildDomNode(o.target);if(r===null||this._showEndForLine!==null&&this._showEndForLine===r)return;this._showEndForLine=r,this._renderStickyScroll();return}this._showEndForLine!==null&&(this._showEndForLine=null,this._renderStickyScroll())})),this._register(ce(s,Pe.MOUSE_LEAVE,o=>{this._showEndForLine!==null&&(this._showEndForLine=null,this._renderStickyScroll())})),this._register(t.onMouseMoveOrRelevantKeyDown(([o,r])=>{const a=i(o);if(!a||!o.hasTriggerModifier||!this._editor.hasModel()){e.clear();return}const{range:l,textElement:c}=a;if(!l.equalsRange(this._stickyRangeProjectedOnEditor))this._stickyRangeProjectedOnEditor=l,e.clear();else if(c.style.textDecoration==="underline")return;const d=new Tn;e.add(vt(()=>d.dispose(!0)));let u;CN(this._languageFeaturesService.definitionProvider,this._editor.getModel(),new Y(l.startLineNumber,l.startColumn+1),d.token).then(h=>{if(!d.token.isCancellationRequested)if(h.length!==0){this._candidateDefinitionsLength=h.length;const f=c;u!==f?(e.clear(),u=f,u.style.textDecoration="underline",e.add(vt(()=>{u.style.textDecoration="none"}))):u||(u=f,u.style.textDecoration="underline",e.add(vt(()=>{u.style.textDecoration="none"})))}else e.clear()})})),this._register(t.onCancel(()=>{e.clear()})),this._register(t.onExecute(o=>HR(this,void 0,void 0,function*(){if(o.target.type!==12||o.target.detail!==this._stickyScrollWidget.getId())return;const r=this._stickyScrollWidget.getEditorPositionFromNode(o.target.element);r&&(this._candidateDefinitionsLength>1&&(this._focused&&this._disposeFocusStickyScrollStore(),this._revealPosition({lineNumber:r.lineNumber,column:1})),this._instaService.invokeFunction(ise,o,this._editor,{uri:this._editor.getModel().uri,range:this._stickyRangeProjectedOnEditor}))})))}_onContextMenu(e){const t=new ba(e);this._contextMenuService.showContextMenu({menuId:M.StickyScrollContext,getAnchor:()=>t})}_toggleFoldingRegionForLine(e){if(!this._foldingModel||e===null)return;const t=this._stickyScrollWidget.getStickyLineForLine(e),i=t==null?void 0:t.foldingIcon;if(!i)return;Hne(this._foldingModel,Number.MAX_VALUE,[e]),i.isCollapsed=!i.isCollapsed;const s=(i.isCollapsed?this._editor.getTopForLineNumber(i.foldingEndLine):this._editor.getTopForLineNumber(i.foldingStartLine))-this._editor.getOption(66)*t.index+1;this._editor.setScrollTop(s),this._renderStickyScroll(e)}_readConfiguration(){const e=this._editor.getOption(114);if(e.enabled===!1){this._editor.removeOverlayWidget(this._stickyScrollWidget),this._sessionStore.clear(),this._enabled=!1;return}else e.enabled&&!this._enabled&&(this._editor.addOverlayWidget(this._stickyScrollWidget),this._sessionStore.add(this._editor.onDidScrollChange(i=>{i.scrollTopChanged&&(this._showEndForLine=null,this._renderStickyScroll())})),this._sessionStore.add(this._editor.onDidLayoutChange(()=>this._onDidResize())),this._sessionStore.add(this._editor.onDidChangeModelTokens(i=>this._onTokensChange(i))),this._sessionStore.add(this._stickyLineCandidateProvider.onDidChangeStickyScroll(()=>{this._showEndForLine=null,this._renderStickyScroll()})),this._enabled=!0);this._editor.getOption(67).renderType===2&&this._sessionStore.add(this._editor.onDidChangeCursorPosition(()=>{this._showEndForLine=null,this._renderStickyScroll()}))}_needsUpdate(e){const t=this._stickyScrollWidget.getCurrentLines();for(const i of t)for(const s of e.ranges)if(i>=s.fromLineNumber&&i<=s.toLineNumber)return!0;return!1}_onTokensChange(e){this._needsUpdate(e)&&this._renderStickyScroll(-1)}_onDidResize(){const t=this._editor.getLayoutInfo().height/this._editor.getOption(66);this._maxStickyLines=Math.round(t*.25)}_renderStickyScroll(e=1/0){var t,i;return HR(this,void 0,void 0,function*(){const s=this._editor.getModel();if(!s||s.isTooLargeForTokenization()){this._foldingModel=null,this._stickyScrollWidget.setState(void 0,null,e);return}const o=this._stickyLineCandidateProvider.getVersionId();if(o===void 0||o===s.getVersionId())if(this._foldingModel=(i=yield(t=Md.get(this._editor))===null||t===void 0?void 0:t.getFoldingModel())!==null&&i!==void 0?i:null,this._widgetState=this.findScrollWidgetState(),this._stickyScrollVisibleContextKey.set(this._widgetState.startLineNumbers.length!==0),!this._focused)this._stickyScrollWidget.setState(this._widgetState,this._foldingModel,e);else if(this._focusedStickyElementIndex===-1)this._stickyScrollWidget.setState(this._widgetState,this._foldingModel,e),this._focusedStickyElementIndex=this._stickyScrollWidget.lineNumberCount-1,this._focusedStickyElementIndex!==-1&&this._stickyScrollWidget.focusLineWithIndex(this._focusedStickyElementIndex);else{const r=this._stickyScrollWidget.lineNumbers[this._focusedStickyElementIndex];this._stickyScrollWidget.setState(this._widgetState,this._foldingModel,e),this._stickyScrollWidget.lineNumberCount===0?this._focusedStickyElementIndex=-1:(this._stickyScrollWidget.lineNumbers.includes(r)||(this._focusedStickyElementIndex=this._stickyScrollWidget.lineNumberCount-1),this._stickyScrollWidget.focusLineWithIndex(this._focusedStickyElementIndex))}})}findScrollWidgetState(){const e=this._editor.getOption(66),t=Math.min(this._maxStickyLines,this._editor.getOption(114).maxLineCount),i=this._editor.getScrollTop();let s=0;const o=[],r=[],a=this._editor.getVisibleRanges();if(a.length!==0){const l=new jC(a[0].startLineNumber,a[a.length-1].endLineNumber),c=this._stickyLineCandidateProvider.getCandidateStickyLinesIntersecting(l);for(const d of c){const u=d.startLineNumber,h=d.endLineNumber,f=d.nestingDepth;if(h-u>0){const g=(f-1)*e,p=f*e,_=this._editor.getBottomForLineNumber(u)-i,v=this._editor.getTopForLineNumber(h)-i,b=this._editor.getBottomForLineNumber(h)-i;if(g>v&&g<=b){o.push(u),r.push(h+1),s=b-p;break}else p>_&&p<=b&&(o.push(u),r.push(h+1));if(o.length===t)break}}}return this._endLineNumbers=r,new bK(o,r,s,this._showEndForLine)}dispose(){super.dispose(),this._sessionStore.dispose()}};Rd.ID="store.contrib.stickyScrollController";Rd=O5=r6e([B_(1,Cl),B_(2,Ze),B_(3,_t),B_(4,Ni),B_(5,Va),B_(6,bt)],Rd);var a6e=globalThis&&globalThis.__awaiter||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 l6e extends oa{constructor(){super({id:"editor.action.toggleStickyScroll",title:{value:m("toggleStickyScroll","Toggle Sticky Scroll"),mnemonicTitle:m({key:"mitoggleStickyScroll",comment:["&& denotes a mnemonic"]},"&&Toggle Sticky Scroll"),original:"Toggle Sticky Scroll"},category:Q7e.View,toggled:{condition:fe.equals("config.editor.stickyScroll.enabled",!0),title:m("stickyScroll","Sticky Scroll"),mnemonicTitle:m({key:"miStickyScroll",comment:["&& denotes a mnemonic"]},"&&Sticky Scroll")},menu:[{id:M.CommandPalette},{id:M.MenubarAppearanceMenu,group:"4_editor",order:3},{id:M.StickyScrollContext}]})}run(e){return a6e(this,void 0,void 0,function*(){const t=e.get(zt),i=!t.getValue("editor.stickyScroll.enabled");return t.updateValue("editor.stickyScroll.enabled",i)})}}const QN=100;class c6e extends Cc{constructor(){super({id:"editor.action.focusStickyScroll",title:{value:m("focusStickyScroll","Focus Sticky Scroll"),mnemonicTitle:m({key:"mifocusStickyScroll",comment:["&& denotes a mnemonic"]},"&&Focus Sticky Scroll"),original:"Focus Sticky Scroll"},precondition:fe.and(fe.has("config.editor.stickyScroll.enabled"),O.stickyScrollVisible),menu:[{id:M.CommandPalette}]})}runEditorCommand(e,t){var i;(i=Rd.get(t))===null||i===void 0||i.focus()}}class d6e extends Cc{constructor(){super({id:"editor.action.selectNextStickyScrollLine",title:{value:m("selectNextStickyScrollLine.title","Select next sticky scroll line"),original:"Select next sticky scroll line"},precondition:O.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:QN,primary:18}})}runEditorCommand(e,t){var i;(i=Rd.get(t))===null||i===void 0||i.focusNext()}}class u6e extends Cc{constructor(){super({id:"editor.action.selectPreviousStickyScrollLine",title:{value:m("selectPreviousStickyScrollLine.title","Select previous sticky scroll line"),original:"Select previous sticky scroll line"},precondition:O.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:QN,primary:16}})}runEditorCommand(e,t){var i;(i=Rd.get(t))===null||i===void 0||i.focusPrevious()}}class h6e extends Cc{constructor(){super({id:"editor.action.goToFocusedStickyScrollLine",title:{value:m("goToFocusedStickyScrollLine.title","Go to focused sticky scroll line"),original:"Go to focused sticky scroll line"},precondition:O.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:QN,primary:3}})}runEditorCommand(e,t){var i;(i=Rd.get(t))===null||i===void 0||i.goToFocused()}}class f6e extends Cc{constructor(){super({id:"editor.action.selectEditor",title:{value:m("selectEditor.title","Select Editor"),original:"Select Editor"},precondition:O.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:QN,primary:9}})}runEditorCommand(e,t){var i;(i=Rd.get(t))===null||i===void 0||i.selectEditor()}}ti(Rd.ID,Rd,1);Ui(l6e);Ui(c6e);Ui(u6e);Ui(d6e);Ui(h6e);Ui(f6e);var S6=globalThis&&globalThis.__decorate||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=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},g6e=globalThis&&globalThis.__awaiter||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())})},ap;class p6e{constructor(e,t,i,s,o,r){this.range=e,this.insertText=t,this.filterText=i,this.additionalTextEdits=s,this.command=o,this.completion=r}}let F5=class extends B_e{constructor(e,t,i,s,o,r){super(o.disposable),this.model=e,this.line=t,this.word=i,this.completionModel=s,this._suggestMemoryService=r}canBeReused(e,t,i){return this.model===e&&this.line===t&&this.word.word.length>0&&this.word.startColumn===i.startColumn&&this.word.endColumn=0&&l.resolve(Ft.None)}return t}};F5=S6([Jp(5,RN)],F5);let B5=class{constructor(e,t,i,s){this._getEditorOption=e,this._languageFeatureService=t,this._clipboardService=i,this._suggestMemoryService=s}provideInlineCompletions(e,t,i,s){var o;return g6e(this,void 0,void 0,function*(){if(i.selectedSuggestionInfo)return;const r=this._getEditorOption(88,e);if(Lv.isAllOff(r))return;e.tokenization.tokenizeIfCheap(t.lineNumber);const a=e.tokenization.getLineTokens(t.lineNumber),l=a.getStandardTokenType(a.findTokenIndexAtOffset(Math.max(t.column-1-1,0)));if(Lv.valueFor(r,l)!=="inline")return;let c=e.getWordAtPosition(t),d;if(c!=null&&c.word||(d=this._getTriggerCharacterInfo(e,t)),!(c!=null&&c.word)&&!d||(c||(c=e.getWordUntilPosition(t)),c.endColumn!==t.column))return;let u;const h=e.getValueInRange(new I(t.lineNumber,1,t.lineNumber,t.column));if(!d&&(!((o=this._lastResult)===null||o===void 0)&&o.canBeReused(e,t.lineNumber,c))){const f=new fK(h,t.column-this._lastResult.word.endColumn);this._lastResult.completionModel.lineContext=f,this._lastResult.acquire(),u=this._lastResult}else{const f=yield c6(this._languageFeatureService.completionProvider,e,t,new Dy(void 0,void 0,d==null?void 0:d.providers),d&&{triggerKind:1,triggerCharacter:d.ch},s);let g;f.needsClipboard&&(g=yield this._clipboardService.readText());const p=new Kh(f.items,t.column,new fK(h,0),Kl.None,this._getEditorOption(117,e),this._getEditorOption(111,e),{boostFullMatch:!1,firstMatchCanBeWeak:!1},g);u=new F5(e,t.lineNumber,c,p,f,this._suggestMemoryService)}return this._lastResult=u,u})}handleItemDidShow(e,t){t.completion.resolve(Ft.None)}freeInlineCompletions(e){e.release()}_getTriggerCharacterInfo(e,t){var i;const s=e.getValueInRange(I.fromPositions({lineNumber:t.lineNumber,column:t.column-1},t)),o=new Set;for(const r of this._languageFeatureService.completionProvider.all(e))!((i=r.triggerCharacters)===null||i===void 0)&&i.includes(s)&&o.add(r);if(o.size!==0)return{providers:o,ch:s}}};B5=S6([Jp(1,Ze),Jp(2,ch),Jp(3,RN)],B5);let rT=ap=class{constructor(e,t,i,s){if(++ap._counter===1){const o=s.createInstance(B5,(r,a)=>{var l;return((l=i.listCodeEditors().find(d=>d.getModel()===a))!==null&&l!==void 0?l:e).getOption(r)});ap._disposable=t.inlineCompletionsProvider.register("*",o)}}dispose(){var e;--ap._counter===0&&((e=ap._disposable)===null||e===void 0||e.dispose(),ap._disposable=void 0)}};rT._counter=0;rT=ap=S6([Jp(1,Ze),Jp(2,ai),Jp(3,_t)],rT);ti("suggest.inlineCompletionsProvider",rT,0);class m6e extends Ue{constructor(){super({id:"editor.action.forceRetokenize",label:m("forceRetokenize","Developer: Force Retokenize"),alias:"Developer: Force Retokenize",precondition:void 0})}run(e,t){if(!t.hasModel())return;const i=t.getModel();i.tokenization.resetTokenization();const s=new so;i.tokenization.forceTokenization(i.getLineCount()),s.stop(),console.log("tokenization took ".concat(s.elapsed()))}}De(m6e);class JN extends oa{constructor(){super({id:JN.ID,title:{value:m({key:"toggle.tabMovesFocus",comment:["Turn on/off use of tab key for moving focus around VS Code"]},"Toggle Tab Key Moves Focus"),original:"Toggle Tab Key Moves Focus"},precondition:void 0,keybinding:{primary:2091,mac:{primary:1323},weight:100},f1:!0})}run(){const t=!Ib.getTabFocusMode();Ib.setTabFocusMode(t),to(t?m("toggle.tabMovesFocus.on","Pressing Tab will now move focus to the next focusable element"):m("toggle.tabMovesFocus.off","Pressing Tab will now insert the tab character"))}}JN.ID="editor.action.toggleTabFocusMode";Ui(JN);var _6e=globalThis&&globalThis.__decorate||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},v6e=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let W5=class extends te{get enabled(){return this._enabled}set enabled(e){e?(this.el.setAttribute("aria-disabled","false"),this.el.tabIndex=0,this.el.style.pointerEvents="auto",this.el.style.opacity="1",this.el.style.cursor="pointer",this._enabled=!1):(this.el.setAttribute("aria-disabled","true"),this.el.tabIndex=-1,this.el.style.pointerEvents="none",this.el.style.opacity="0.4",this.el.style.cursor="default",this._enabled=!0),this._enabled=e}constructor(e,t,i={},s){var o;super(),this._link=t,this._enabled=!0,this.el=ge(e,ye("a.monaco-link",{tabIndex:(o=t.tabIndex)!==null&&o!==void 0?o:0,href:t.href,title:t.title},t.label)),this.el.setAttribute("role","button");const r=this._register(new Vt(this.el,"click")),a=this._register(new Vt(this.el,"keypress")),l=We.chain(a.event,u=>u.map(h=>new Oi(h)).filter(h=>h.keyCode===3)),c=this._register(new Vt(this.el,Ti.Tap)).event;this._register(Ii.addTarget(this.el));const d=We.any(r.event,l,c);this._register(d(u=>{this.enabled&&(xt.stop(u,!0),i!=null&&i.opener?i.opener(this._link.href):s.open(this._link.href,{allowCommands:!0}))})),this.enabled=!0}};W5=_6e([v6e(3,Ir)],W5);var Ise=globalThis&&globalThis.__decorate||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},Tse=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};const b6e=26;let V5=class extends te{constructor(e,t){super(),this._editor=e,this.instantiationService=t,this.banner=this._register(this.instantiationService.createInstance(H5))}hide(){this._editor.setBanner(null,0),this.banner.clear()}show(e){this.banner.show(Object.assign(Object.assign({},e),{onClose:()=>{var t;this.hide(),(t=e.onClose)===null||t===void 0||t.call(e)}})),this._editor.setBanner(this.banner.element,b6e)}};V5=Ise([Tse(1,_t)],V5);let H5=class extends te{constructor(e){super(),this.instantiationService=e,this.markdownRenderer=this.instantiationService.createInstance(Zu,{}),this.element=ye("div.editor-banner"),this.element.tabIndex=0}getAriaLabel(e){if(e.ariaLabel)return e.ariaLabel;if(typeof e.message=="string")return e.message}getBannerMessage(e){if(typeof e=="string"){const t=ye("span");return t.innerText=e,t}return this.markdownRenderer.render(e).element}clear(){Ds(this.element)}show(e){Ds(this.element);const t=this.getAriaLabel(e);t&&this.element.setAttribute("aria-label",t);const i=ge(this.element,ye("div.icon-container"));i.setAttribute("aria-hidden","true"),e.icon&&i.appendChild(ye("div".concat(dt.asCSSSelector(e.icon))));const s=ge(this.element,ye("div.message-container"));if(s.setAttribute("aria-hidden","true"),s.appendChild(this.getBannerMessage(e.message)),this.messageActionsContainer=ge(this.element,ye("div.message-actions-container")),e.actions)for(const r of e.actions)this._register(this.instantiationService.createInstance(W5,this.messageActionsContainer,Object.assign(Object.assign({},r),{tabIndex:-1}),{}));const o=ge(this.element,ye("div.action-container"));this.actionBar=this._register(new Pa(o)),this.actionBar.push(this._register(new Ro("banner.close","Close Banner",dt.asClassName(fte),!0,()=>{typeof e.onClose=="function"&&e.onClose()})),{icon:!0,label:!1}),this.actionBar.setFocusable(!1)}};H5=Ise([Tse(0,_t)],H5);var L6=globalThis&&globalThis.__decorate||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},lb=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},Zs=globalThis&&globalThis.__awaiter||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 C6e=Sn("extensions-warning-message",Me.warning,m("warningIcon","Icon shown with a warning message in the extensions editor."));let o0=class extends te{constructor(e,t,i,s){super(),this._editor=e,this._editorWorkerService=t,this._workspaceTrustService=i,this._highlighter=null,this._bannerClosed=!1,this._updateState=o=>{if(o&&o.hasMore){if(this._bannerClosed)return;const r=Math.max(o.ambiguousCharacterCount,o.nonBasicAsciiCharacterCount,o.invisibleCharacterCount);let a;if(o.nonBasicAsciiCharacterCount>=r)a={message:m("unicodeHighlighting.thisDocumentHasManyNonBasicAsciiUnicodeCharacters","This document contains many non-basic ASCII unicode characters"),command:new z0};else if(o.ambiguousCharacterCount>=r)a={message:m("unicodeHighlighting.thisDocumentHasManyAmbiguousUnicodeCharacters","This document contains many ambiguous unicode characters"),command:new Mg};else if(o.invisibleCharacterCount>=r)a={message:m("unicodeHighlighting.thisDocumentHasManyInvisibleUnicodeCharacters","This document contains many invisible unicode characters"),command:new $0};else throw new Error("Unreachable");this._bannerController.show({id:"unicodeHighlightBanner",message:a.message,icon:C6e,actions:[{label:a.command.shortLabel,href:"command:".concat(a.command.id)}],onClose:()=>{this._bannerClosed=!0}})}else this._bannerController.hide()},this._bannerController=this._register(s.createInstance(V5,e)),this._register(this._editor.onDidChangeModel(()=>{this._bannerClosed=!1,this._updateHighlighter()})),this._options=e.getOption(124),this._register(i.onDidChangeTrust(o=>{this._updateHighlighter()})),this._register(e.onDidChangeConfiguration(o=>{o.hasChanged(124)&&(this._options=e.getOption(124),this._updateHighlighter())})),this._updateHighlighter()}dispose(){this._highlighter&&(this._highlighter.dispose(),this._highlighter=null),super.dispose()}_updateHighlighter(){if(this._updateState(null),this._highlighter&&(this._highlighter.dispose(),this._highlighter=null),!this._editor.hasModel())return;const e=w6e(this._workspaceTrustService.isWorkspaceTrusted(),this._options);if([e.nonBasicASCII,e.ambiguousCharacters,e.invisibleCharacters].every(i=>i===!1))return;const t={nonBasicASCII:e.nonBasicASCII,ambiguousCharacters:e.ambiguousCharacters,invisibleCharacters:e.invisibleCharacters,includeComments:e.includeComments,includeStrings:e.includeStrings,allowedCodePoints:Object.keys(e.allowedCharacters).map(i=>i.codePointAt(0)),allowedLocales:Object.keys(e.allowedLocales).map(i=>i==="_os"?new Intl.NumberFormat().resolvedOptions().locale:i==="_vscode"?Vme:i)};this._editorWorkerService.canComputeUnicodeHighlights(this._editor.getModel().uri)?this._highlighter=new $5(this._editor,t,this._updateState,this._editorWorkerService):this._highlighter=new y6e(this._editor,t,this._updateState)}getDecorationInfo(e){return this._highlighter?this._highlighter.getDecorationInfo(e):null}};o0.ID="editor.contrib.unicodeHighlighter";o0=L6([lb(1,Sl),lb(2,uee),lb(3,_t)],o0);function w6e(n,e){return{nonBasicASCII:e.nonBasicASCII===Mr?!n:e.nonBasicASCII,ambiguousCharacters:e.ambiguousCharacters,invisibleCharacters:e.invisibleCharacters,includeComments:e.includeComments===Mr?!n:e.includeComments,includeStrings:e.includeStrings===Mr?!n:e.includeStrings,allowedCharacters:e.allowedCharacters,allowedLocales:e.allowedLocales}}let $5=class extends te{constructor(e,t,i,s){super(),this._editor=e,this._options=t,this._updateState=i,this._editorWorkerService=s,this._model=this._editor.getModel(),this._decorations=this._editor.createDecorationsCollection(),this._updateSoon=this._register(new Si(()=>this._update(),250)),this._register(this._editor.onDidChangeModelContent(()=>{this._updateSoon.schedule()})),this._updateSoon.schedule()}dispose(){this._decorations.clear(),super.dispose()}_update(){if(this._model.isDisposed())return;if(!this._model.mightContainNonBasicASCII()){this._decorations.clear();return}const e=this._model.getVersionId();this._editorWorkerService.computedUnicodeHighlights(this._model.uri,this._options).then(t=>{if(this._model.isDisposed()||this._model.getVersionId()!==e)return;this._updateState(t);const i=[];if(!t.hasMore)for(const s of t.ranges)i.push({range:s,options:aT.instance.getDecorationFromOptions(this._options)});this._decorations.set(i)})}getDecorationInfo(e){if(!this._decorations.has(e))return null;const t=this._editor.getModel();if(!D9(t,e))return null;const i=t.getValueInRange(e.range);return{reason:xse(i,this._options),inComment:E9(t,e),inString:I9(t,e)}}};$5=L6([lb(3,Sl)],$5);class y6e extends te{constructor(e,t,i){super(),this._editor=e,this._options=t,this._updateState=i,this._model=this._editor.getModel(),this._decorations=this._editor.createDecorationsCollection(),this._updateSoon=this._register(new Si(()=>this._update(),250)),this._register(this._editor.onDidLayoutChange(()=>{this._updateSoon.schedule()})),this._register(this._editor.onDidScrollChange(()=>{this._updateSoon.schedule()})),this._register(this._editor.onDidChangeHiddenAreas(()=>{this._updateSoon.schedule()})),this._register(this._editor.onDidChangeModelContent(()=>{this._updateSoon.schedule()})),this._updateSoon.schedule()}dispose(){this._decorations.clear(),super.dispose()}_update(){if(this._model.isDisposed())return;if(!this._model.mightContainNonBasicASCII()){this._decorations.clear();return}const e=this._editor.getVisibleRanges(),t=[],i={ranges:[],ambiguousCharacterCount:0,invisibleCharacterCount:0,nonBasicAsciiCharacterCount:0,hasMore:!1};for(const s of e){const o=H8.computeUnicodeHighlights(this._model,this._options,s);for(const r of o.ranges)i.ranges.push(r);i.ambiguousCharacterCount+=i.ambiguousCharacterCount,i.invisibleCharacterCount+=i.invisibleCharacterCount,i.nonBasicAsciiCharacterCount+=i.nonBasicAsciiCharacterCount,i.hasMore=i.hasMore||o.hasMore}if(!i.hasMore)for(const s of i.ranges)t.push({range:s,options:aT.instance.getDecorationFromOptions(this._options)});this._updateState(i),this._decorations.set(t)}getDecorationInfo(e){if(!this._decorations.has(e))return null;const t=this._editor.getModel(),i=t.getValueInRange(e.range);return D9(t,e)?{reason:xse(i,this._options),inComment:E9(t,e),inString:I9(t,e)}:null}}let z5=class{constructor(e,t,i){this._editor=e,this._languageService=t,this._openerService=i,this.hoverOrdinal=5}computeSync(e,t){if(!this._editor.hasModel()||e.type!==1)return[];const i=this._editor.getModel(),s=this._editor.getContribution(o0.ID);if(!s)return[];const o=[],r=new Set;let a=300;for(const l of t){const c=s.getDecorationInfo(l);if(!c)continue;const u=i.getValueInRange(l.range).codePointAt(0),h=$R(u);let f;switch(c.reason.kind){case 0:{cS(c.reason.confusableWith)?f=m("unicodeHighlight.characterIsAmbiguousASCII","The character {0} could be confused with the ASCII character {1}, which is more common in source code.",h,$R(c.reason.confusableWith.codePointAt(0))):f=m("unicodeHighlight.characterIsAmbiguous","The character {0} could be confused with the character {1}, which is more common in source code.",h,$R(c.reason.confusableWith.codePointAt(0)));break}case 1:f=m("unicodeHighlight.characterIsInvisible","The character {0} is invisible.",h);break;case 2:f=m("unicodeHighlight.characterIsNonBasicAscii","The character {0} is not a basic ASCII character.",h);break}if(r.has(f))continue;r.add(f);const g={codePoint:u,reason:c.reason,inComment:c.inComment,inString:c.inString},p=m("unicodeHighlight.adjustSettings","Adjust settings"),_="command:".concat(qS.ID,"?").concat(encodeURIComponent(JSON.stringify(g))),v=new Bs("",!0).appendMarkdown(f).appendText(" ").appendLink(_,p);o.push(new Yl(this,l.range,[v],!1,a++))}return o}renderHoverParts(e,t){return rne(e,t,this._editor,this._languageService,this._openerService)}};z5=L6([lb(1,qi),lb(2,Ir)],z5);function U5(n){return"U+".concat(n.toString(16).padStart(4,"0"))}function $R(n){let e="`".concat(U5(n),"`");return pd.isInvisibleCharacter(n)||(e+=' "'.concat("".concat(S6e(n)),'"')),e}function S6e(n){return n===96?"`` ` ``":"`"+String.fromCodePoint(n)+"`"}function xse(n,e){return H8.computeUnicodeHighlightReason(n,e)}class aT{constructor(){this.map=new Map}getDecorationFromOptions(e){return this.getDecoration(!e.includeComments,!e.includeStrings)}getDecoration(e,t){const i="".concat(e).concat(t);let s=this.map.get(i);return s||(s=kt.createDynamic({description:"unicode-highlight",stickiness:1,className:"unicode-highlight",showIfCollapsed:!0,overviewRuler:null,minimap:null,hideInCommentTokens:e,hideInStringTokens:t}),this.map.set(i,s)),s}}aT.instance=new aT;class L6e extends Ue{constructor(){super({id:Mg.ID,label:m("action.unicodeHighlight.disableHighlightingInComments","Disable highlighting of characters in comments"),alias:"Disable highlighting of characters in comments",precondition:void 0}),this.shortLabel=m("unicodeHighlight.disableHighlightingInComments.shortLabel","Disable Highlight In Comments")}run(e,t,i){return Zs(this,void 0,void 0,function*(){const s=e==null?void 0:e.get(zt);s&&this.runAction(s)})}runAction(e){return Zs(this,void 0,void 0,function*(){yield e.updateValue(Go.includeComments,!1,2)})}}class k6e extends Ue{constructor(){super({id:Mg.ID,label:m("action.unicodeHighlight.disableHighlightingInStrings","Disable highlighting of characters in strings"),alias:"Disable highlighting of characters in strings",precondition:void 0}),this.shortLabel=m("unicodeHighlight.disableHighlightingInStrings.shortLabel","Disable Highlight In Strings")}run(e,t,i){return Zs(this,void 0,void 0,function*(){const s=e==null?void 0:e.get(zt);s&&this.runAction(s)})}runAction(e){return Zs(this,void 0,void 0,function*(){yield e.updateValue(Go.includeStrings,!1,2)})}}class Mg extends Ue{constructor(){super({id:Mg.ID,label:m("action.unicodeHighlight.disableHighlightingOfAmbiguousCharacters","Disable highlighting of ambiguous characters"),alias:"Disable highlighting of ambiguous characters",precondition:void 0}),this.shortLabel=m("unicodeHighlight.disableHighlightingOfAmbiguousCharacters.shortLabel","Disable Ambiguous Highlight")}run(e,t,i){return Zs(this,void 0,void 0,function*(){const s=e==null?void 0:e.get(zt);s&&this.runAction(s)})}runAction(e){return Zs(this,void 0,void 0,function*(){yield e.updateValue(Go.ambiguousCharacters,!1,2)})}}Mg.ID="editor.action.unicodeHighlight.disableHighlightingOfAmbiguousCharacters";class $0 extends Ue{constructor(){super({id:$0.ID,label:m("action.unicodeHighlight.disableHighlightingOfInvisibleCharacters","Disable highlighting of invisible characters"),alias:"Disable highlighting of invisible characters",precondition:void 0}),this.shortLabel=m("unicodeHighlight.disableHighlightingOfInvisibleCharacters.shortLabel","Disable Invisible Highlight")}run(e,t,i){return Zs(this,void 0,void 0,function*(){const s=e==null?void 0:e.get(zt);s&&this.runAction(s)})}runAction(e){return Zs(this,void 0,void 0,function*(){yield e.updateValue(Go.invisibleCharacters,!1,2)})}}$0.ID="editor.action.unicodeHighlight.disableHighlightingOfInvisibleCharacters";class z0 extends Ue{constructor(){super({id:z0.ID,label:m("action.unicodeHighlight.disableHighlightingOfNonBasicAsciiCharacters","Disable highlighting of non basic ASCII characters"),alias:"Disable highlighting of non basic ASCII characters",precondition:void 0}),this.shortLabel=m("unicodeHighlight.disableHighlightingOfNonBasicAsciiCharacters.shortLabel","Disable Non ASCII Highlight")}run(e,t,i){return Zs(this,void 0,void 0,function*(){const s=e==null?void 0:e.get(zt);s&&this.runAction(s)})}runAction(e){return Zs(this,void 0,void 0,function*(){yield e.updateValue(Go.nonBasicASCII,!1,2)})}}z0.ID="editor.action.unicodeHighlight.disableHighlightingOfNonBasicAsciiCharacters";class qS extends Ue{constructor(){super({id:qS.ID,label:m("action.unicodeHighlight.showExcludeOptions","Show Exclude Options"),alias:"Show Exclude Options",precondition:void 0})}run(e,t,i){return Zs(this,void 0,void 0,function*(){const{codePoint:s,reason:o,inString:r,inComment:a}=i,l=String.fromCodePoint(s),c=e.get(yc),d=e.get(zt);function u(g){return pd.isInvisibleCharacter(g)?m("unicodeHighlight.excludeInvisibleCharFromBeingHighlighted","Exclude {0} (invisible character) from being highlighted",U5(g)):m("unicodeHighlight.excludeCharFromBeingHighlighted","Exclude {0} from being highlighted","".concat(U5(g),' "').concat(l,'"'))}const h=[];if(o.kind===0)for(const g of o.notAmbiguousInLocales)h.push({label:m("unicodeHighlight.allowCommonCharactersInLanguage",'Allow unicode characters that are more common in the language "{0}".',g),run:()=>Zs(this,void 0,void 0,function*(){E6e(d,[g])})});if(h.push({label:u(s),run:()=>D6e(d,[s])}),a){const g=new L6e;h.push({label:g.label,run:()=>Zs(this,void 0,void 0,function*(){return g.runAction(d)})})}else if(r){const g=new k6e;h.push({label:g.label,run:()=>Zs(this,void 0,void 0,function*(){return g.runAction(d)})})}if(o.kind===0){const g=new Mg;h.push({label:g.label,run:()=>Zs(this,void 0,void 0,function*(){return g.runAction(d)})})}else if(o.kind===1){const g=new $0;h.push({label:g.label,run:()=>Zs(this,void 0,void 0,function*(){return g.runAction(d)})})}else if(o.kind===2){const g=new z0;h.push({label:g.label,run:()=>Zs(this,void 0,void 0,function*(){return g.runAction(d)})})}else I6e(o);const f=yield c.pick(h,{title:m("unicodeHighlight.configureUnicodeHighlightOptions","Configure Unicode Highlight Options")});f&&(yield f.run())})}}qS.ID="editor.action.unicodeHighlight.showExcludeOptions";function D6e(n,e){return Zs(this,void 0,void 0,function*(){const t=n.getValue(Go.allowedCharacters);let i;typeof t=="object"&&t?i=t:i={};for(const s of e)i[String.fromCodePoint(s)]=!0;yield n.updateValue(Go.allowedCharacters,i,2)})}function E6e(n,e){var t;return Zs(this,void 0,void 0,function*(){const i=(t=n.inspect(Go.allowedLocales).user)===null||t===void 0?void 0:t.value;let s;typeof i=="object"&&i?s=Object.assign({},i):s={};for(const o of e)s[o]=!0;yield n.updateValue(Go.allowedLocales,s,2)})}function I6e(n){throw new Error("Unexpected value: ".concat(n))}De(Mg);De($0);De(z0);De(qS);ti(o0.ID,o0,1);c_.register(z5);var T6e=globalThis&&globalThis.__decorate||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=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},x6e=globalThis&&globalThis.__awaiter||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 Nse="ignoreUnusualLineTerminators";function N6e(n,e,t){n.setModelProperty(e.uri,Nse,t)}function A6e(n,e){return n.getModelProperty(e.uri,Nse)}let Wy=class extends te{constructor(e,t,i){super(),this._editor=e,this._dialogService=t,this._codeEditorService=i,this._isPresentingDialog=!1,this._config=this._editor.getOption(125),this._register(this._editor.onDidChangeConfiguration(s=>{s.hasChanged(125)&&(this._config=this._editor.getOption(125),this._checkForUnusualLineTerminators())})),this._register(this._editor.onDidChangeModel(()=>{this._checkForUnusualLineTerminators()})),this._register(this._editor.onDidChangeModelContent(s=>{s.isUndoing||this._checkForUnusualLineTerminators()})),this._checkForUnusualLineTerminators()}_checkForUnusualLineTerminators(){return x6e(this,void 0,void 0,function*(){if(this._config==="off"||!this._editor.hasModel())return;const e=this._editor.getModel();if(!e.mightContainUnusualLineTerminators()||A6e(this._codeEditorService,e)===!0||this._editor.getOption(90))return;if(this._config==="auto"){e.removeUnusualLineTerminators(this._editor.getSelections());return}if(this._isPresentingDialog)return;let i;try{this._isPresentingDialog=!0,i=yield this._dialogService.confirm({title:m("unusualLineTerminators.title","Unusual Line Terminators"),message:m("unusualLineTerminators.message","Detected unusual line terminators"),detail:m("unusualLineTerminators.detail","The file '{0}' contains one or more unusual line terminator characters, like Line Separator (LS) or Paragraph Separator (PS).\n\nIt is recommended to remove them from the file. This can be configured via `editor.unusualLineTerminators`.",Ra(e.uri)),primaryButton:m({key:"unusualLineTerminators.fix",comment:["&& denotes a mnemonic"]},"&&Remove Unusual Line Terminators"),cancelButton:m("unusualLineTerminators.ignore","Ignore")})}finally{this._isPresentingDialog=!1}if(!i.confirmed){N6e(this._codeEditorService,e,!0);return}e.removeUnusualLineTerminators(this._editor.getSelections())})}};Wy.ID="editor.contrib.unusualLineTerminatorsDetector";Wy=T6e([DK(1,LS),DK(2,ai)],Wy);ti(Wy.ID,Wy,1);var M6e=globalThis&&globalThis.__decorate||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=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},j5;const eA=new Ve("hasWordHighlights",!1);function Ase(n,e,t,i){const s=n.ordered(e);return cQ(s.map(o=>()=>Promise.resolve(o.provideDocumentHighlights(e,t,i)).then(void 0,Bn)),io)}class Mse{constructor(e,t,i){this._model=e,this._selection=t,this._wordSeparators=i,this._wordRange=this._getCurrentWordRange(e,t),this._result=null}get result(){return this._result||(this._result=Xn(e=>this._compute(this._model,this._selection,this._wordSeparators,e))),this._result}_getCurrentWordRange(e,t){const i=e.getWordAtPosition(t.getPosition());return i?new I(t.startLineNumber,i.startColumn,t.startLineNumber,i.endColumn):null}isValid(e,t,i){const s=t.startLineNumber,o=t.startColumn,r=t.endColumn,a=this._getCurrentWordRange(e,t);let l=!!(this._wordRange&&this._wordRange.equalsRange(a));for(let c=0,d=i.length;!l&&c=r&&(l=!0)}return l}cancel(){this.result.cancel()}}class R6e extends Mse{constructor(e,t,i,s){super(e,t,i),this._providers=s}_compute(e,t,i,s){return Ase(this._providers,e,t.getPosition(),s).then(o=>o||[])}}class P6e extends Mse{constructor(e,t,i){super(e,t,i),this._selectionIsEmpty=t.isEmpty()}_compute(e,t,i,s){return jf(250,s).then(()=>{if(!t.isEmpty())return[];const o=e.getWordAtPosition(t.getPosition());return!o||o.word.length>1e3?[]:e.findMatches(o.word,!0,!1,!0,i,!1).map(a=>({range:a.range,kind:mw.Text}))})}isValid(e,t,i){const s=t.isEmpty();return this._selectionIsEmpty!==s?!1:super.isValid(e,t,i)}}function O6e(n,e,t,i){return n.has(e)?new R6e(e,t,i,n):new P6e(e,t,i)}$d("_executeDocumentHighlights",(n,e,t)=>{const i=n.get(Ze);return Ase(i.documentHighlightProvider,e,t,Ft.None)});class F6e{constructor(e,t,i,s){this.toUnhook=new be,this.workerRequestTokenId=0,this.workerRequestCompleted=!1,this.workerRequestValue=[],this.lastCursorPositionChangeTime=0,this.renderDecorationsTimer=-1,this.editor=e,this.providers=t,this.linkedHighlighters=i,this._hasWordHighlights=eA.bindTo(s),this._ignorePositionChangeEvent=!1,this.occurrencesHighlight=this.editor.getOption(80),this.model=this.editor.getModel(),this.toUnhook.add(e.onDidChangeCursorPosition(o=>{this._ignorePositionChangeEvent||this.occurrencesHighlight&&this._onPositionChanged(o)})),this.toUnhook.add(e.onDidChangeModelContent(o=>{this._stopAll()})),this.toUnhook.add(e.onDidChangeConfiguration(o=>{const r=this.editor.getOption(80);this.occurrencesHighlight!==r&&(this.occurrencesHighlight=r,this._stopAll())})),this.decorations=this.editor.createDecorationsCollection(),this.workerRequestTokenId=0,this.workerRequest=null,this.workerRequestCompleted=!1,this.lastCursorPositionChangeTime=0,this.renderDecorationsTimer=-1}hasDecorations(){return this.decorations.length>0}restore(){this.occurrencesHighlight&&this._run()}_getSortedHighlights(){return this.decorations.getRanges().sort(I.compareRangesUsingStarts)}moveNext(){const e=this._getSortedHighlights(),i=(e.findIndex(o=>o.containsPosition(this.editor.getPosition()))+1)%e.length,s=e[i];try{this._ignorePositionChangeEvent=!0,this.editor.setPosition(s.getStartPosition()),this.editor.revealRangeInCenterIfOutsideViewport(s);const o=this._getWord();if(o){const r=this.editor.getModel().getLineContent(s.startLineNumber);to("".concat(r,", ").concat(i+1," of ").concat(e.length," for '").concat(o.word,"'"))}}finally{this._ignorePositionChangeEvent=!1}}moveBack(){const e=this._getSortedHighlights(),i=(e.findIndex(o=>o.containsPosition(this.editor.getPosition()))-1+e.length)%e.length,s=e[i];try{this._ignorePositionChangeEvent=!0,this.editor.setPosition(s.getStartPosition()),this.editor.revealRangeInCenterIfOutsideViewport(s);const o=this._getWord();if(o){const r=this.editor.getModel().getLineContent(s.startLineNumber);to("".concat(r,", ").concat(i+1," of ").concat(e.length," for '").concat(o.word,"'"))}}finally{this._ignorePositionChangeEvent=!1}}_removeDecorations(){this.decorations.length>0&&(this.decorations.clear(),this._hasWordHighlights.set(!1))}_stopAll(){this._removeDecorations(),this.renderDecorationsTimer!==-1&&(clearTimeout(this.renderDecorationsTimer),this.renderDecorationsTimer=-1),this.workerRequest!==null&&(this.workerRequest.cancel(),this.workerRequest=null),this.workerRequestCompleted||(this.workerRequestTokenId++,this.workerRequestCompleted=!0)}_onPositionChanged(e){if(!this.occurrencesHighlight){this._stopAll();return}if(e.reason!==3){this._stopAll();return}this._run()}_getWord(){const e=this.editor.getSelection(),t=e.startLineNumber,i=e.startColumn;return this.model.getWordAtPosition({lineNumber:t,column:i})}_run(){const e=this.editor.getSelection();if(e.startLineNumber!==e.endLineNumber){this._stopAll();return}const t=e.startColumn,i=e.endColumn,s=this._getWord();if(!s||s.startColumn>t||s.endColumn{r===this.workerRequestTokenId&&(this.workerRequestCompleted=!0,this.workerRequestValue=a||[],this._beginRenderDecorations())},Dt)}}_beginRenderDecorations(){const e=new Date().getTime(),t=this.lastCursorPositionChangeTime+250;e>=t?(this.renderDecorationsTimer=-1,this.renderDecorations()):this.renderDecorationsTimer=setTimeout(()=>{this.renderDecorations()},t-e)}renderDecorations(){this.renderDecorationsTimer=-1;const e=[];for(const t of this.workerRequestValue)t.range&&e.push({range:t.range,options:l7e(t.kind)});this.decorations.set(e),this._hasWordHighlights.set(this.hasDecorations());for(const t of this.linkedHighlighters())(t==null?void 0:t.editor.getModel())===this.editor.getModel()&&(t._stopAll(),t.decorations.set(e),t._hasWordHighlights.set(t.hasDecorations()))}dispose(){this._stopAll(),this.toUnhook.dispose()}}let Pm=j5=class extends te{static get(e){return e.getContribution(j5.ID)}constructor(e,t,i){super(),this.wordHighlighter=null,this.linkedContributions=new Set;const s=()=>{e.hasModel()&&!e.getModel().isTooLargeForTokenization()&&(this.wordHighlighter=new F6e(e,i.documentHighlightProvider,()=>Pt.map(this.linkedContributions,o=>o.wordHighlighter),t))};this._register(e.onDidChangeModel(o=>{this.wordHighlighter&&(this.wordHighlighter.dispose(),this.wordHighlighter=null),s()})),s()}saveViewState(){return!!(this.wordHighlighter&&this.wordHighlighter.hasDecorations())}moveNext(){var e;(e=this.wordHighlighter)===null||e===void 0||e.moveNext()}moveBack(){var e;(e=this.wordHighlighter)===null||e===void 0||e.moveBack()}restoreViewState(e){this.wordHighlighter&&e&&this.wordHighlighter.restore()}dispose(){this.wordHighlighter&&(this.wordHighlighter.dispose(),this.wordHighlighter=null),super.dispose()}};Pm.ID="editor.contrib.wordHighlighter";Pm=j5=M6e([EK(1,bt),EK(2,Ze)],Pm);class Rse extends Ue{constructor(e,t){super(t),this._isNext=e}run(e,t){const i=Pm.get(t);i&&(this._isNext?i.moveNext():i.moveBack())}}class B6e extends Rse{constructor(){super(!0,{id:"editor.action.wordHighlight.next",label:m("wordHighlight.next.label","Go to Next Symbol Highlight"),alias:"Go to Next Symbol Highlight",precondition:eA,kbOpts:{kbExpr:O.editorTextFocus,primary:65,weight:100}})}}class W6e extends Rse{constructor(){super(!1,{id:"editor.action.wordHighlight.prev",label:m("wordHighlight.previous.label","Go to Previous Symbol Highlight"),alias:"Go to Previous Symbol Highlight",precondition:eA,kbOpts:{kbExpr:O.editorTextFocus,primary:1089,weight:100}})}}class V6e extends Ue{constructor(){super({id:"editor.action.wordHighlight.trigger",label:m("wordHighlight.trigger.label","Trigger Symbol Highlight"),alias:"Trigger Symbol Highlight",precondition:eA.toNegated(),kbOpts:{kbExpr:O.editorTextFocus,primary:0,weight:100}})}run(e,t,i){const s=Pm.get(t);s&&s.restoreViewState(!0)}}ti(Pm.ID,Pm,0);De(B6e);De(W6e);De(V6e);class tA extends fs{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode,this._wordNavigationType=e.wordNavigationType}runEditorCommand(e,t,i){if(!t.hasModel())return;const s=Aa(t.getOption(129)),o=t.getModel(),a=t.getSelections().map(l=>{const c=new Y(l.positionLineNumber,l.positionColumn),d=this._move(s,o,c,this._wordNavigationType);return this._moveTo(l,d,this._inSelectionMode)});if(o.pushStackElement(),t._getViewModel().setCursorStates("moveWordCommand",3,a.map(l=>Qt.fromModelSelection(l))),a.length===1){const l=new Y(a[0].positionLineNumber,a[0].positionColumn);t.revealPosition(l,0)}}_moveTo(e,t,i){return i?new Je(e.selectionStartLineNumber,e.selectionStartColumn,t.lineNumber,t.column):new Je(t.lineNumber,t.column,t.lineNumber,t.column)}}class Rg extends tA{_move(e,t,i,s){return oi.moveWordLeft(e,t,i,s)}}class Pg extends tA{_move(e,t,i,s){return oi.moveWordRight(e,t,i,s)}}class H6e extends Rg{constructor(){super({inSelectionMode:!1,wordNavigationType:0,id:"cursorWordStartLeft",precondition:void 0})}}class $6e extends Rg{constructor(){super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordEndLeft",precondition:void 0})}}class z6e extends Rg{constructor(){var e;super({inSelectionMode:!1,wordNavigationType:1,id:"cursorWordLeft",precondition:void 0,kbOpts:{kbExpr:fe.and(O.textInputFocus,(e=fe.and(pS,zx))===null||e===void 0?void 0:e.negate()),primary:2063,mac:{primary:527},weight:100}})}}class U6e extends Rg{constructor(){super({inSelectionMode:!0,wordNavigationType:0,id:"cursorWordStartLeftSelect",precondition:void 0})}}class j6e extends Rg{constructor(){super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordEndLeftSelect",precondition:void 0})}}class K6e extends Rg{constructor(){var e;super({inSelectionMode:!0,wordNavigationType:1,id:"cursorWordLeftSelect",precondition:void 0,kbOpts:{kbExpr:fe.and(O.textInputFocus,(e=fe.and(pS,zx))===null||e===void 0?void 0:e.negate()),primary:3087,mac:{primary:1551},weight:100}})}}class q6e extends Rg{constructor(){super({inSelectionMode:!1,wordNavigationType:3,id:"cursorWordAccessibilityLeft",precondition:void 0})}_move(e,t,i,s){return super._move(Aa(vc.wordSeparators.defaultValue),t,i,s)}}class G6e extends Rg{constructor(){super({inSelectionMode:!0,wordNavigationType:3,id:"cursorWordAccessibilityLeftSelect",precondition:void 0})}_move(e,t,i,s){return super._move(Aa(vc.wordSeparators.defaultValue),t,i,s)}}class Y6e extends Pg{constructor(){super({inSelectionMode:!1,wordNavigationType:0,id:"cursorWordStartRight",precondition:void 0})}}class Z6e extends Pg{constructor(){var e;super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordEndRight",precondition:void 0,kbOpts:{kbExpr:fe.and(O.textInputFocus,(e=fe.and(pS,zx))===null||e===void 0?void 0:e.negate()),primary:2065,mac:{primary:529},weight:100}})}}class X6e extends Pg{constructor(){super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordRight",precondition:void 0})}}class Q6e extends Pg{constructor(){super({inSelectionMode:!0,wordNavigationType:0,id:"cursorWordStartRightSelect",precondition:void 0})}}class J6e extends Pg{constructor(){var e;super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordEndRightSelect",precondition:void 0,kbOpts:{kbExpr:fe.and(O.textInputFocus,(e=fe.and(pS,zx))===null||e===void 0?void 0:e.negate()),primary:3089,mac:{primary:1553},weight:100}})}}class eWe extends Pg{constructor(){super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordRightSelect",precondition:void 0})}}class tWe extends Pg{constructor(){super({inSelectionMode:!1,wordNavigationType:3,id:"cursorWordAccessibilityRight",precondition:void 0})}_move(e,t,i,s){return super._move(Aa(vc.wordSeparators.defaultValue),t,i,s)}}class iWe extends Pg{constructor(){super({inSelectionMode:!0,wordNavigationType:3,id:"cursorWordAccessibilityRightSelect",precondition:void 0})}_move(e,t,i,s){return super._move(Aa(vc.wordSeparators.defaultValue),t,i,s)}}class iA extends fs{constructor(e){super(e),this._whitespaceHeuristics=e.whitespaceHeuristics,this._wordNavigationType=e.wordNavigationType}runEditorCommand(e,t,i){const s=e.get(Ni);if(!t.hasModel())return;const o=Aa(t.getOption(129)),r=t.getModel(),a=t.getSelections(),l=t.getOption(6),c=t.getOption(11),d=s.getLanguageConfiguration(r.getLanguageId()).getAutoClosingPairs(),u=t._getViewModel(),h=a.map(f=>{const g=this._delete({wordSeparators:o,model:r,selection:f,whitespaceHeuristics:this._whitespaceHeuristics,autoClosingDelete:t.getOption(9),autoClosingBrackets:l,autoClosingQuotes:c,autoClosingPairs:d,autoClosedCharacters:u.getCursorAutoClosedCharacters()},this._wordNavigationType);return new Rs(g,"")});t.pushUndoStop(),t.executeCommands(this.id,h),t.pushUndoStop()}}class k6 extends iA{_delete(e,t){const i=oi.deleteWordLeft(e,t);return i||new I(1,1,1,1)}}class D6 extends iA{_delete(e,t){const i=oi.deleteWordRight(e,t);if(i)return i;const s=e.model.getLineCount(),o=e.model.getLineMaxColumn(s);return new I(s,o,s,o)}}class nWe extends k6{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:0,id:"deleteWordStartLeft",precondition:O.writable})}}class sWe extends k6{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:2,id:"deleteWordEndLeft",precondition:O.writable})}}class oWe extends k6{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:0,id:"deleteWordLeft",precondition:O.writable,kbOpts:{kbExpr:O.textInputFocus,primary:2049,mac:{primary:513},weight:100}})}}class rWe extends D6{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:0,id:"deleteWordStartRight",precondition:O.writable})}}class aWe extends D6{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:2,id:"deleteWordEndRight",precondition:O.writable})}}class lWe extends D6{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:2,id:"deleteWordRight",precondition:O.writable,kbOpts:{kbExpr:O.textInputFocus,primary:2068,mac:{primary:532},weight:100}})}}class cWe extends Ue{constructor(){super({id:"deleteInsideWord",precondition:O.writable,label:m("deleteInsideWord","Delete Word"),alias:"Delete Word"})}run(e,t,i){if(!t.hasModel())return;const s=Aa(t.getOption(129)),o=t.getModel(),a=t.getSelections().map(l=>{const c=oi.deleteInsideWord(s,o,l);return new Rs(c,"")});t.pushUndoStop(),t.executeCommands(this.id,a),t.pushUndoStop()}}Re(new H6e);Re(new $6e);Re(new z6e);Re(new U6e);Re(new j6e);Re(new K6e);Re(new Y6e);Re(new Z6e);Re(new X6e);Re(new Q6e);Re(new J6e);Re(new eWe);Re(new q6e);Re(new G6e);Re(new tWe);Re(new iWe);Re(new nWe);Re(new sWe);Re(new oWe);Re(new rWe);Re(new aWe);Re(new lWe);De(cWe);class dWe extends iA{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:0,id:"deleteWordPartLeft",precondition:O.writable,kbOpts:{kbExpr:O.textInputFocus,primary:0,mac:{primary:769},weight:100}})}_delete(e,t){const i=Sx.deleteWordPartLeft(e);return i||new I(1,1,1,1)}}class uWe extends iA{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:2,id:"deleteWordPartRight",precondition:O.writable,kbOpts:{kbExpr:O.textInputFocus,primary:0,mac:{primary:788},weight:100}})}_delete(e,t){const i=Sx.deleteWordPartRight(e);if(i)return i;const s=e.model.getLineCount(),o=e.model.getLineMaxColumn(s);return new I(s,o,s,o)}}class Pse extends tA{_move(e,t,i,s){return Sx.moveWordPartLeft(e,t,i)}}class hWe extends Pse{constructor(){super({inSelectionMode:!1,wordNavigationType:0,id:"cursorWordPartLeft",precondition:void 0,kbOpts:{kbExpr:O.textInputFocus,primary:0,mac:{primary:783},weight:100}})}}qt.registerCommandAlias("cursorWordPartStartLeft","cursorWordPartLeft");class fWe extends Pse{constructor(){super({inSelectionMode:!0,wordNavigationType:0,id:"cursorWordPartLeftSelect",precondition:void 0,kbOpts:{kbExpr:O.textInputFocus,primary:0,mac:{primary:1807},weight:100}})}}qt.registerCommandAlias("cursorWordPartStartLeftSelect","cursorWordPartLeftSelect");class Ose extends tA{_move(e,t,i,s){return Sx.moveWordPartRight(e,t,i)}}class gWe extends Ose{constructor(){super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordPartRight",precondition:void 0,kbOpts:{kbExpr:O.textInputFocus,primary:0,mac:{primary:785},weight:100}})}}class pWe extends Ose{constructor(){super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordPartRightSelect",precondition:void 0,kbOpts:{kbExpr:O.textInputFocus,primary:0,mac:{primary:1809},weight:100}})}}Re(new dWe);Re(new uWe);Re(new hWe);Re(new fWe);Re(new gWe);Re(new pWe);class K5 extends te{constructor(e){super(),this.editor=e,this._register(this.editor.onDidAttemptReadOnlyEdit(()=>this._onDidAttemptReadOnlyEdit()))}_onDidAttemptReadOnlyEdit(){const e=Sr.get(this.editor);if(e&&this.editor.hasModel()){let t=this.editor.getOptions().get(91);t||(this.editor.isSimpleWidget?t=new Bs(m("editor.simple.readonly","Cannot edit in read-only input")):t=new Bs(m("editor.readonly","Cannot edit in read-only editor"))),e.showMessage(t,this.editor.getPosition())}}}K5.ID="editor.contrib.readOnlyMessageController";ti(K5.ID,K5,2);class q5 extends te{constructor(e){super(),this.editor=e,this.widget=null,uc&&(this._register(e.onDidChangeConfiguration(()=>this.update())),this.update())}update(){const e=!this.editor.getOption(90);!this.widget&&e?this.widget=new nA(this.editor):this.widget&&!e&&(this.widget.dispose(),this.widget=null)}dispose(){super.dispose(),this.widget&&(this.widget.dispose(),this.widget=null)}}q5.ID="editor.contrib.iPadShowKeyboard";class nA extends te{constructor(e){super(),this.editor=e,this._domNode=document.createElement("textarea"),this._domNode.className="iPadShowKeyboard",this._register(ce(this._domNode,"touchstart",t=>{this.editor.focus()})),this._register(ce(this._domNode,"focus",t=>{this.editor.focus()})),this.editor.addOverlayWidget(this)}dispose(){this.editor.removeOverlayWidget(this),super.dispose()}getId(){return nA.ID}getDomNode(){return this._domNode}getPosition(){return{preference:1}}}nA.ID="editor.contrib.ShowKeyboardWidget";ti(q5.ID,q5,3);var mWe=globalThis&&globalThis.__decorate||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},IK=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},G5;let r0=G5=class extends te{static get(e){return e.getContribution(G5.ID)}constructor(e,t,i){super(),this._editor=e,this._languageService=i,this._widget=null,this._register(this._editor.onDidChangeModel(s=>this.stop())),this._register(this._editor.onDidChangeModelLanguage(s=>this.stop())),this._register(nn.onDidChange(s=>this.stop())),this._register(this._editor.onKeyUp(s=>s.keyCode===9&&this.stop()))}dispose(){this.stop(),super.dispose()}launch(){this._widget||this._editor.hasModel()&&(this._widget=new sA(this._editor,this._languageService))}stop(){this._widget&&(this._widget.dispose(),this._widget=null)}};r0.ID="editor.contrib.inspectTokens";r0=G5=mWe([IK(1,la),IK(2,qi)],r0);class _We extends Ue{constructor(){super({id:"editor.action.inspectTokens",label:UO.inspectTokensAction,alias:"Developer: Inspect Tokens",precondition:void 0})}run(e,t){const i=r0.get(t);i==null||i.launch()}}function vWe(n){let e="";for(let t=0,i=n.length;tEb,tokenize:(s,o,r)=>q8(e,r),tokenizeEncoded:(s,o,r)=>mx(i,r)}}class sA extends te{constructor(e,t){super(),this.allowEditorOverflow=!0,this._editor=e,this._languageService=t,this._model=this._editor.getModel(),this._domNode=document.createElement("div"),this._domNode.className="tokens-inspect-widget",this._tokenizationSupport=bWe(this._languageService.languageIdCodec,this._model.getLanguageId()),this._compute(this._editor.getPosition()),this._register(this._editor.onDidChangeCursorPosition(i=>this._compute(this._editor.getPosition()))),this._editor.addContentWidget(this)}dispose(){this._editor.removeContentWidget(this),super.dispose()}getId(){return sA._ID}_compute(e){const t=this._getTokensAtLine(e.lineNumber);let i=0;for(let l=t.tokens1.length-1;l>=0;l--){const c=t.tokens1[l];if(e.column-1>=c.offset){i=l;break}}let s=0;for(let l=t.tokens2.length>>>1;l>=0;l--)if(e.column-1>=t.tokens2[l<<1]){s=l;break}const o=this._model.getLineContent(e.lineNumber);let r="";if(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},TK=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},sC;let lT=sC=class{constructor(e,t){this.quickInputService=e,this.keybindingService=t,this.registry=en.as(i_.Quickaccess)}provide(e){const t=new be;return t.add(e.onDidAccept(()=>{const[i]=e.selectedItems;i&&this.quickInputService.quickAccess.show(i.prefix,{preserveValue:!0})})),t.add(e.onDidChangeValue(i=>{const s=this.registry.getQuickAccessProvider(i.substr(sC.PREFIX.length));s&&s.prefix&&s.prefix!==sC.PREFIX&&this.quickInputService.quickAccess.show(s.prefix,{preserveValue:!0})})),e.items=this.getQuickAccessProviders().filter(i=>i.prefix!==sC.PREFIX),t}getQuickAccessProviders(){return this.registry.getQuickAccessProviders().sort((t,i)=>t.prefix.localeCompare(i.prefix)).flatMap(t=>this.createPicks(t))}createPicks(e){return e.helpEntries.map(t=>{const i=t.prefix||e.prefix,s=i||"…";return{prefix:i,label:s,keybinding:t.commandId?this.keybindingService.lookupKeybinding(t.commandId):void 0,ariaLabel:m("helpPickAriaLabel","{0}, {1}",s,t.description),description:t.description}})}};lT.PREFIX="?";lT=sC=CWe([TK(0,yc),TK(1,Di)],lT);en.as(i_.Quickaccess).registerQuickAccessProvider({ctor:lT,prefix:"",helpEntries:[{description:jO.helpQuickAccessActionLabel}]});class Fse{constructor(e){this.options=e,this.rangeHighlightDecorationId=void 0}provide(e,t){var i;const s=new be;e.canAcceptInBackground=!!(!((i=this.options)===null||i===void 0)&&i.canAcceptInBackground),e.matchOnLabel=e.matchOnDescription=e.matchOnDetail=e.sortByLabel=!1;const o=s.add(new Ts);return o.value=this.doProvide(e,t),s.add(this.onDidActiveTextEditorControlChange(()=>{o.value=void 0,o.value=this.doProvide(e,t)})),s}doProvide(e,t){var i;const s=new be,o=this.activeTextEditorControl;if(o&&this.canProvideWithTextEditor(o)){const r={editor:o},a=Hte(o);if(a){let l=(i=o.saveViewState())!==null&&i!==void 0?i:void 0;s.add(a.onDidChangeCursorPosition(()=>{var c;l=(c=o.saveViewState())!==null&&c!==void 0?c:void 0})),r.restoreViewState=()=>{l&&o===this.activeTextEditorControl&&o.restoreViewState(l)},s.add($f(t.onCancellationRequested)(()=>{var c;return(c=r.restoreViewState)===null||c===void 0?void 0:c.call(r)}))}s.add(vt(()=>this.clearDecorations(o))),s.add(this.provideWithTextEditor(r,e,t))}else s.add(this.provideWithoutTextEditor(e,t));return s}canProvideWithTextEditor(e){return!0}gotoLocation({editor:e},t){e.setSelection(t.range),e.revealRangeInCenter(t.range,0),t.preserveFocus||e.focus();const i=e.getModel();i&&"getLineContent"in i&&Yf("".concat(i.getLineContent(t.range.startLineNumber)))}getModel(e){var t;return Vte(e)?(t=e.getModel())===null||t===void 0?void 0:t.modified:e.getModel()}addDecorations(e,t){e.changeDecorations(i=>{const s=[];this.rangeHighlightDecorationId&&(s.push(this.rangeHighlightDecorationId.overviewRulerDecorationId),s.push(this.rangeHighlightDecorationId.rangeHighlightId),this.rangeHighlightDecorationId=void 0);const o=[{range:t,options:{description:"quick-access-range-highlight",className:"rangeHighlight",isWholeLine:!0}},{range:t,options:{description:"quick-access-range-highlight-overview",overviewRuler:{color:sn(rJ),position:Qr.Full}}}],[r,a]=i.deltaDecorations(s,o);this.rangeHighlightDecorationId={rangeHighlightId:r,overviewRulerDecorationId:a}})}clearDecorations(e){const t=this.rangeHighlightDecorationId;t&&(e.changeDecorations(i=>{i.deltaDecorations([t.overviewRulerDecorationId,t.rangeHighlightId],[])}),this.rangeHighlightDecorationId=void 0)}}class oA extends Fse{constructor(){super({canAcceptInBackground:!0})}provideWithoutTextEditor(e){const t=m("cannotRunGotoLine","Open a text editor first to go to a line.");return e.items=[{label:t}],e.ariaLabel=t,te.None}provideWithTextEditor(e,t,i){const s=e.editor,o=new be;o.add(t.onDidAccept(l=>{const[c]=t.selectedItems;if(c){if(!this.isValidLineNumber(s,c.lineNumber))return;this.gotoLocation(e,{range:this.toRange(c.lineNumber,c.column),keyMods:t.keyMods,preserveFocus:l.inBackground}),l.inBackground||t.hide()}}));const r=()=>{const l=this.parsePosition(s,t.value.trim().substr(oA.PREFIX.length)),c=this.getPickLabel(s,l.lineNumber,l.column);if(t.items=[{lineNumber:l.lineNumber,column:l.column,label:c}],t.ariaLabel=c,!this.isValidLineNumber(s,l.lineNumber)){this.clearDecorations(s);return}const d=this.toRange(l.lineNumber,l.column);s.revealRangeInCenter(d,0),this.addDecorations(s,d)};r(),o.add(t.onDidChangeValue(()=>r()));const a=Hte(s);return a&&a.getOptions().get(67).renderType===2&&(a.updateOptions({lineNumbers:"on"}),o.add(vt(()=>a.updateOptions({lineNumbers:"relative"})))),o}toRange(e=1,t=1){return{startLineNumber:e,startColumn:t,endLineNumber:e,endColumn:t}}parsePosition(e,t){const i=t.split(/,|:|#/).map(o=>parseInt(o,10)).filter(o=>!isNaN(o)),s=this.lineCount(e)+1;return{lineNumber:i[0]>0?i[0]:s+i[0],column:i[1]}}getPickLabel(e,t,i){if(this.isValidLineNumber(e,t))return this.isValidColumn(e,t,i)?m("gotoLineColumnLabel","Go to line {0} and character {1}.",t,i):m("gotoLineLabel","Go to line {0}.",t);const s=e.getPosition()||{lineNumber:1,column:1},o=this.lineCount(e);return o>1?m("gotoLineLabelEmptyWithLimit","Current Line: {0}, Character: {1}. Type a line number between 1 and {2} to navigate to.",s.lineNumber,s.column,o):m("gotoLineLabelEmpty","Current Line: {0}, Character: {1}. Type a line number to navigate to.",s.lineNumber,s.column)}isValidLineNumber(e,t){return!t||typeof t!="number"?!1:t>0&&t<=this.lineCount(e)}isValidColumn(e,t,i){if(!i||typeof i!="number")return!1;const s=this.getModel(e);if(!s)return!1;const o={lineNumber:t,column:i};return s.validatePosition(o).equals(o)}lineCount(e){var t,i;return(i=(t=this.getModel(e))===null||t===void 0?void 0:t.getLineCount())!==null&&i!==void 0?i:0}}oA.PREFIX=":";var wWe=globalThis&&globalThis.__decorate||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},yWe=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let Vy=class extends oA{constructor(e){super(),this.editorService=e,this.onDidActiveTextEditorControlChange=We.None}get activeTextEditorControl(){var e;return(e=this.editorService.getFocusedCodeEditor())!==null&&e!==void 0?e:void 0}};Vy=wWe([yWe(0,ai)],Vy);let E6=class Bse extends Ue{constructor(){super({id:Bse.ID,label:iI.gotoLineActionLabel,alias:"Go to Line/Column...",precondition:void 0,kbOpts:{kbExpr:O.focus,primary:2085,mac:{primary:293},weight:100}})}run(e){e.get(yc).quickAccess.show(Vy.PREFIX)}};E6.ID="editor.action.gotoLine";De(E6);en.as(i_.Quickaccess).registerQuickAccessProvider({ctor:Vy,prefix:Vy.PREFIX,helpEntries:[{description:iI.gotoLineActionLabel,commandId:E6.ID}]});const Wse=[void 0,[]];function zR(n,e,t=0,i=0){const s=e;return s.values&&s.values.length>1?SWe(n,s.values,t,i):Vse(n,e,t,i)}function SWe(n,e,t,i){let s=0;const o=[];for(const r of e){const[a,l]=Vse(n,r,t,i);if(typeof a!="number")return Wse;s+=a,o.push(...l)}return[s,LWe(o)]}function Vse(n,e,t,i){const s=fm(e.original,e.originalLowercase,t,n,n.toLowerCase(),i,{firstMatchCanBeWeak:!0,boostFullMatch:!0});return s?[s[0],DS(s)]:Wse}function LWe(n){const e=n.sort((s,o)=>s.start-o.start),t=[];let i;for(const s of e)!i||!kWe(i,s)?(i=s,t.push(s)):(i.start=Math.min(i.start,s.start),i.end=Math.max(i.end,s.end));return t}function kWe(n,e){return!(n.end=0,r=xK(n);let a;const l=n.split(Hse);if(l.length>1)for(const c of l){const d=xK(c),{pathNormalized:u,normalized:h,normalizedLowercase:f}=NK(c);h&&(a||(a=[]),a.push({original:c,originalLowercase:c.toLowerCase(),pathNormalized:u,normalized:h,normalizedLowercase:f,expectContiguousMatch:d}))}return{original:n,originalLowercase:e,pathNormalized:t,normalized:i,normalizedLowercase:s,values:a,containsPathSeparator:o,expectContiguousMatch:r}}function NK(n){let e;zs?e=n.replace(/\//g,sc):e=n.replace(/\\/g,sc);const t=Lve(e).replace(/\s|"/g,"");return{pathNormalized:e,normalized:t,normalizedLowercase:t.toLowerCase()}}function AK(n){return Array.isArray(n)?Y5(n.map(e=>e.original).join(Hse)):Y5(n.original)}var DWe=globalThis&&globalThis.__decorate||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},MK=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},x1=globalThis&&globalThis.__awaiter||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())})},cb;let _d=cb=class extends Fse{constructor(e,t,i=Object.create(null)){super(i),this._languageFeaturesService=e,this._outlineModelService=t,this.options=i,this.options.canAcceptInBackground=!0}provideWithoutTextEditor(e){return this.provideLabelPick(e,m("cannotRunGotoSymbolWithoutEditor","To go to a symbol, first open a text editor with symbol information.")),te.None}provideWithTextEditor(e,t,i){const s=e.editor,o=this.getModel(s);return o?this._languageFeaturesService.documentSymbolProvider.has(o)?this.doProvideWithEditorSymbols(e,o,t,i):this.doProvideWithoutEditorSymbols(e,o,t,i):te.None}doProvideWithoutEditorSymbols(e,t,i,s){const o=new be;return this.provideLabelPick(i,m("cannotRunGotoSymbolWithoutSymbolProvider","The active text editor does not provide symbol information.")),x1(this,void 0,void 0,function*(){!(yield this.waitForLanguageSymbolRegistry(t,o))||s.isCancellationRequested||o.add(this.doProvideWithEditorSymbols(e,t,i,s))}),o}provideLabelPick(e,t){e.items=[{label:t,index:0,kind:14}],e.ariaLabel=t}waitForLanguageSymbolRegistry(e,t){return x1(this,void 0,void 0,function*(){if(this._languageFeaturesService.documentSymbolProvider.has(e))return!0;const i=new ax,s=t.add(this._languageFeaturesService.documentSymbolProvider.onDidChange(()=>{this._languageFeaturesService.documentSymbolProvider.has(e)&&(s.dispose(),i.complete(!0))}));return t.add(vt(()=>i.complete(!1))),i.p})}doProvideWithEditorSymbols(e,t,i,s){var o;const r=e.editor,a=new be;a.add(i.onDidAccept(u=>{const[h]=i.selectedItems;h&&h.range&&(this.gotoLocation(e,{range:h.range.selection,keyMods:i.keyMods,preserveFocus:u.inBackground}),u.inBackground||i.hide())})),a.add(i.onDidTriggerItemButton(({item:u})=>{u&&u.range&&(this.gotoLocation(e,{range:u.range.selection,keyMods:i.keyMods,forceSideBySide:!0}),i.hide())}));const l=this.getDocumentSymbols(t,s);let c;const d=u=>x1(this,void 0,void 0,function*(){c==null||c.dispose(!0),i.busy=!1,c=new Tn(s),i.busy=!0;try{const h=Y5(i.value.substr(cb.PREFIX.length).trim()),f=yield this.doGetSymbolPicks(l,h,void 0,c.token);if(s.isCancellationRequested)return;if(f.length>0){if(i.items=f,u&&h.original.length===0){const g=EE(f,p=>!!(p.type!=="separator"&&p.range&&I.containsPosition(p.range.decoration,u)));g&&(i.activeItems=[g])}}else h.original.length>0?this.provideLabelPick(i,m("noMatchingSymbolResults","No matching editor symbols")):this.provideLabelPick(i,m("noSymbolResults","No editor symbols"))}finally{s.isCancellationRequested||(i.busy=!1)}});return a.add(i.onDidChangeValue(()=>d(void 0))),d((o=r.getSelection())===null||o===void 0?void 0:o.getPosition()),a.add(i.onDidChangeActive(()=>{const[u]=i.activeItems;u&&u.range&&(r.revealRangeInCenter(u.range.selection,0),this.addDecorations(r,u.range.decoration))})),a}doGetSymbolPicks(e,t,i,s){var o,r;return x1(this,void 0,void 0,function*(){const a=yield e;if(s.isCancellationRequested)return[];const l=t.original.indexOf(cb.SCOPE_PREFIX)===0,c=l?1:0;let d,u;t.values&&t.values.length>1?(d=AK(t.values[0]),u=AK(t.values.slice(1))):d=t;let h;const f=(r=(o=this.options)===null||o===void 0?void 0:o.openSideBySideDirection)===null||r===void 0?void 0:r.call(o);f&&(h=[{iconClass:f==="right"?dt.asClassName(Me.splitHorizontal):dt.asClassName(Me.splitVertical),tooltip:f==="right"?m("openToSide","Open to the Side"):m("openToBottom","Open to the Bottom")}]);const g=[];for(let v=0;vc){let T=!1;if(d!==t&&([S,k]=zR(w,Object.assign(Object.assign({},t),{values:void 0}),c,y),typeof S=="number"&&(T=!0)),typeof S!="number"&&([S,k]=zR(w,d,c,y),typeof S!="number"))continue;if(!T&&u){if(L&&u.original.length>0&&([D,x]=zR(L,u)),typeof D!="number")continue;typeof S=="number"&&(S+=D)}}const A=b.tags&&b.tags.indexOf(1)>=0;g.push({index:v,kind:b.kind,score:S,label:w,ariaLabel:vve(b.name,b.kind),description:L,highlights:A?void 0:{label:k,description:x},range:{selection:I.collapseToStart(b.selectionRange),decoration:b.range},strikethrough:A,buttons:h})}const p=g.sort((v,b)=>l?this.compareByKindAndScore(v,b):this.compareByScore(v,b));let _=[];if(l){let w=function(){b&&typeof v=="number"&&C>0&&(b.label=sm(jR[v]||UR,C))},v,b,C=0;for(const y of p)v!==y.kind?(w(),v=y.kind,C=1,b={type:"separator"},_.push(b)):C++,_.push(y);w()}else p.length>0&&(_=[{label:m("symbols","symbols ({0})",g.length),type:"separator"},...p]);return _})}compareByScore(e,t){if(typeof e.score!="number"&&typeof t.score=="number")return 1;if(typeof e.score=="number"&&typeof t.score!="number")return-1;if(typeof e.score=="number"&&typeof t.score=="number"){if(e.score>t.score)return-1;if(e.scoret.index?1:0}compareByKindAndScore(e,t){const i=jR[e.kind]||UR,s=jR[t.kind]||UR,o=i.localeCompare(s);return o===0?this.compareByScore(e,t):o}getDocumentSymbols(e,t){return x1(this,void 0,void 0,function*(){const i=yield this._outlineModelService.getOrCreate(e,t);return t.isCancellationRequested?[]:i.asListOfDocumentSymbols()})}};_d.PREFIX="@";_d.SCOPE_PREFIX=":";_d.PREFIX_BY_CATEGORY="".concat(cb.PREFIX).concat(cb.SCOPE_PREFIX);_d=cb=DWe([MK(0,Ze),MK(1,NN)],_d);const UR=m("property","properties ({0})"),jR={5:m("method","methods ({0})"),11:m("function","functions ({0})"),8:m("_constructor","constructors ({0})"),12:m("variable","variables ({0})"),4:m("class","classes ({0})"),22:m("struct","structs ({0})"),23:m("event","events ({0})"),24:m("operator","operators ({0})"),10:m("interface","interfaces ({0})"),2:m("namespace","namespaces ({0})"),3:m("package","packages ({0})"),25:m("typeParameter","type parameters ({0})"),1:m("modules","modules ({0})"),6:m("property","properties ({0})"),9:m("enum","enumerations ({0})"),21:m("enumMember","enumeration members ({0})"),14:m("string","strings ({0})"),0:m("file","files ({0})"),17:m("array","arrays ({0})"),15:m("number","numbers ({0})"),16:m("boolean","booleans ({0})"),18:m("object","objects ({0})"),19:m("key","keys ({0})"),7:m("field","fields ({0})"),13:m("constant","constants ({0})")};var EWe=globalThis&&globalThis.__decorate||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},KR=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let Z5=class extends _d{constructor(e,t,i){super(t,i),this.editorService=e,this.onDidActiveTextEditorControlChange=We.None}get activeTextEditorControl(){var e;return(e=this.editorService.getFocusedCodeEditor())!==null&&e!==void 0?e:void 0}};Z5=EWe([KR(0,ai),KR(1,Ze),KR(2,NN)],Z5);class GS extends Ue{constructor(){super({id:GS.ID,label:Zw.quickOutlineActionLabel,alias:"Go to Symbol...",precondition:O.hasDocumentSymbolProvider,kbOpts:{kbExpr:O.focus,primary:3117,weight:100},contextMenuOpts:{group:"navigation",order:3}})}run(e){e.get(yc).quickAccess.show(_d.PREFIX,{itemActivation:Bl.NONE})}}GS.ID="editor.action.quickOutline";De(GS);en.as(i_.Quickaccess).registerQuickAccessProvider({ctor:Z5,prefix:_d.PREFIX,helpEntries:[{description:Zw.quickOutlineActionLabel,prefix:_d.PREFIX,commandId:GS.ID},{description:Zw.quickOutlineByCategoryActionLabel,prefix:_d.PREFIX_BY_CATEGORY}]});function qR(n,e){return e&&(n.stack||n.stacktrace)?m("stackTrace.format","{0}: {1}",PK(n),RK(n.stack)||RK(n.stacktrace)):PK(n)}function RK(n){return Array.isArray(n)?n.join("\n"):n}function PK(n){return n.code==="ERR_UNC_HOST_NOT_ALLOWED"?"".concat(n.message,". Please update the 'security.allowedUNCHosts' setting if you want to allow this host."):typeof n.code=="string"&&typeof n.errno=="number"&&typeof n.syscall=="string"?m("nodeExceptionMessage","A system error occurred ({0})",n.message):n.message||m("error.defaultMessage","An unknown error occurred. Please consult the log for more details.")}function $se(n=null,e=!1){if(!n)return m("error.defaultMessage","An unknown error occurred. Please consult the log for more details.");if(Array.isArray(n)){const t=wd(n),i=$se(t[0],e);return t.length>1?m("error.moreErrors","{0} ({1} errors in total)",i,t.length):i}if(Mo(n))return n;if(n.detail){const t=n.detail;if(t.error)return qR(t.error,e);if(t.exception)return qR(t.exception,e)}return n.stack?qR(n,e):n.message?n.message:m("error.defaultMessage","An unknown error occurred. Please consult the log for more details.")}function IWe(n){var e;const t=new Map;for(const i of n)t.set(i,((e=t.get(i))!==null&&e!==void 0?e:0)+1);return t}class qC{constructor(){this.chunkCount=0,this.chunkOccurrences=new Map,this.documents=new Map}calculateScores(e,t){const i=this.computeEmbedding(e),s=new Map,o=[];for(const[r,a]of this.documents){if(t.isCancellationRequested)return[];for(const l of a.chunks){const c=this.computeSimilarityScore(l,i,s);c>0&&o.push({key:r,score:c})}}return o}static termFrequencies(e){return IWe(qC.splitTerms(e))}static*splitTerms(e){const t=i=>i.toLowerCase();for(const[i]of e.matchAll(/\b\p{Letter}[\p{Letter}\d]{2,}\b/gu)){yield t(i);const s=i.split(new RegExp("(?<=[a-z])(?=[A-Z])","g"));if(s.length>1)for(const o of s)o.length>2&&/\p{Letter}{3,}/gu.test(o)&&(yield t(o))}}updateDocuments(e){var t;for(const{key:i}of e)this.deleteDocument(i);for(const i of e){const s=[];for(const o of i.textChunks){const r=qC.termFrequencies(o);for(const a of r.keys())this.chunkOccurrences.set(a,((t=this.chunkOccurrences.get(a))!==null&&t!==void 0?t:0)+1);s.push({text:o,tf:r})}this.chunkCount+=s.length,this.documents.set(i.key,{chunks:s})}return this}deleteDocument(e){const t=this.documents.get(e);if(t){this.documents.delete(e),this.chunkCount-=t.chunks.length;for(const i of t.chunks)for(const s of i.tf.keys()){const o=this.chunkOccurrences.get(s);if(typeof o=="number"){const r=o-1;r<=0?this.chunkOccurrences.delete(s):this.chunkOccurrences.set(s,r)}}}}computeSimilarityScore(e,t,i){let s=0;for(const[o,r]of Object.entries(t)){const a=e.tf.get(o);if(!a)continue;let l=i.get(o);typeof l!="number"&&(l=this.computeIdf(o),i.set(o,l));const c=a*l;s+=c*r}return s}computeEmbedding(e){const t=qC.termFrequencies(e);return this.computeTfidf(t)}computeIdf(e){var t;const i=(t=this.chunkOccurrences.get(e))!==null&&t!==void 0?t:0;return i>0?Math.log((this.chunkCount+1)/i):0}computeTfidf(e){const t=Object.create(null);for(const[i,s]of e){const o=this.computeIdf(i);o>0&&(t[i]=s*o)}return t}}function TWe(n){var e,t;const i=n.slice(0);i.sort((o,r)=>r.score-o.score);const s=(t=(e=i[0])===null||e===void 0?void 0:e.score)!==null&&t!==void 0?t:0;if(s>0)for(const o of i)o.score/=s;return i}var N1=globalThis&&globalThis.__awaiter||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())})},kv;(function(n){n[n.NO_ACTION=0]="NO_ACTION",n[n.CLOSE_PICKER=1]="CLOSE_PICKER",n[n.REFRESH_PICKER=2]="REFRESH_PICKER",n[n.REMOVE_ITEM=3]="REMOVE_ITEM"})(kv||(kv={}));function GR(n){const e=n;return Array.isArray(e.items)}function OK(n){const e=n;return!!e.picks&&e.additionalPicks instanceof Promise}class xWe extends te{constructor(e,t){super(),this.prefix=e,this.options=t}provide(e,t,i){var s;const o=new be;e.canAcceptInBackground=!!(!((s=this.options)===null||s===void 0)&&s.canAcceptInBackground),e.matchOnLabel=e.matchOnDescription=e.matchOnDetail=e.sortByLabel=!1;let r;const a=o.add(new Ts),l=()=>N1(this,void 0,void 0,function*(){const c=a.value=new be;r==null||r.dispose(!0),e.busy=!1,r=new Tn(t);const d=r.token,u=e.value.substr(this.prefix.length).trim(),h=this._getPicks(u,c,d,i),f=(p,_)=>{var v;let b,C;if(GR(p)?(b=p.items,C=p.active):b=p,b.length===0){if(_)return!1;(u.length>0||e.hideInput)&&(!((v=this.options)===null||v===void 0)&&v.noResultsPick)&&(hw(this.options.noResultsPick)?b=[this.options.noResultsPick(u)]:b=[this.options.noResultsPick])}return e.items=b,C&&(e.activeItems=[C]),!0},g=p=>N1(this,void 0,void 0,function*(){let _=!1,v=!1;yield Promise.all([(()=>N1(this,void 0,void 0,function*(){typeof p.mergeDelay=="number"&&(yield jf(p.mergeDelay),d.isCancellationRequested)||v||(_=f(p.picks,!0))}))(),(()=>N1(this,void 0,void 0,function*(){e.busy=!0;try{const b=yield p.additionalPicks;if(d.isCancellationRequested)return;let C,w;GR(p.picks)?(C=p.picks.items,w=p.picks.active):C=p.picks;let y,L;if(GR(b)?(y=b.items,L=b.active):y=b,y.length>0||!_){let S;if(!w&&!L){const k=e.activeItems[0];k&&C.indexOf(k)!==-1&&(S=k)}f({items:[...C,...y],active:w||L||S})}}finally{d.isCancellationRequested||(e.busy=!1),v=!0}}))()])});if(h!==null)if(OK(h))yield g(h);else if(!(h instanceof Promise))f(h);else{e.busy=!0;try{const p=yield h;if(d.isCancellationRequested)return;OK(p)?yield g(p):f(p)}finally{d.isCancellationRequested||(e.busy=!1)}}});return o.add(e.onDidChangeValue(()=>l())),l(),o.add(e.onDidAccept(c=>{const[d]=e.selectedItems;typeof(d==null?void 0:d.accept)=="function"&&(c.inBackground||e.hide(),d.accept(e.keyMods,c))})),o.add(e.onDidTriggerItemButton(({button:c,item:d})=>N1(this,void 0,void 0,function*(){var u,h;if(typeof d.trigger=="function"){const f=(h=(u=d.buttons)===null||u===void 0?void 0:u.indexOf(c))!==null&&h!==void 0?h:-1;if(f>=0){const g=d.trigger(f,e.keyMods),p=typeof g=="number"?g:yield g;if(t.isCancellationRequested)return;switch(p){case kv.NO_ACTION:break;case kv.CLOSE_PICKER:e.hide();break;case kv.REFRESH_PICKER:l();break;case kv.REMOVE_ITEM:{const _=e.items.indexOf(d);if(_!==-1){const v=e.items.slice(),b=v.splice(_,1),C=e.activeItems.filter(y=>y!==b[0]),w=e.keepScrollPosition;e.keepScrollPosition=!0,e.items=v,C&&(e.activeItems=C),e.keepScrollPosition=w}break}}}}}))),o}}var zse=globalThis&&globalThis.__decorate||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},Sp=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},YR=globalThis&&globalThis.__awaiter||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())})},lp,Jn;let Om=lp=class extends xWe{constructor(e,t,i,s,o,r){super(lp.PREFIX,e),this.instantiationService=t,this.keybindingService=i,this.commandService=s,this.telemetryService=o,this.dialogService=r,this.commandsHistory=this._register(this.instantiationService.createInstance(Fm)),this.options=e}_getPicks(e,t,i,s){var o,r,a,l;return YR(this,void 0,void 0,function*(){const c=yield this.getCommandPicks(i);if(i.isCancellationRequested)return[];const d=$f(()=>{const v=new qC;v.updateDocuments(c.map(C=>({key:C.commandId,textChunks:[C.label+(C.commandAlias?" ".concat(C.commandAlias):"")]})));const b=v.calculateScores(e,i);return TWe(b).filter(C=>C.score>lp.TFIDF_THRESHOLD).slice(0,lp.TFIDF_MAX_RESULTS)}),u=[];for(const v of c){const b=(o=lp.WORD_FILTER(e,v.label))!==null&&o!==void 0?o:void 0,C=v.commandAlias&&(r=lp.WORD_FILTER(e,v.commandAlias))!==null&&r!==void 0?r:void 0;if(b||C)v.highlights={label:b,detail:this.options.showAlias?C:void 0},u.push(v);else if(e===v.commandId)u.push(v);else if(e.length>=3){const w=d();if(i.isCancellationRequested)return[];const y=w.find(L=>L.key===v.commandId);y&&(v.tfIdfScore=y.score,u.push(v))}}const h=new Map;for(const v of u){const b=h.get(v.label);b?(v.description=v.commandId,b.description=b.commandId):h.set(v.label,v)}u.sort((v,b)=>{if(v.tfIdfScore&&b.tfIdfScore)return v.tfIdfScore===b.tfIdfScore?v.label.localeCompare(b.label):b.tfIdfScore-v.tfIdfScore;if(v.tfIdfScore)return 1;if(b.tfIdfScore)return-1;const C=this.commandsHistory.peek(v.commandId),w=this.commandsHistory.peek(b.commandId);if(C&&w)return C>w?-1:1;if(C)return-1;if(w)return 1;if(this.options.suggestedCommandIds){const y=this.options.suggestedCommandIds.has(v.commandId),L=this.options.suggestedCommandIds.has(b.commandId);if(y&&L)return 0;if(y)return-1;if(L)return 1}return v.label.localeCompare(b.label)});const f=[];let g=!1,p=!0,_=!!this.options.suggestedCommandIds;for(let v=0;vYR(this,void 0,void 0,function*(){var v;const b=yield this.getAdditionalCommandPicks(c,u,e,i);if(i.isCancellationRequested)return[];const C=b.map(w=>this.toCommandPick(w,s));return p&&((v=C[0])===null||v===void 0?void 0:v.type)!=="separator"&&C.unshift({type:"separator",label:m("suggested","similar commands")}),C}))()}:f})}toCommandPick(e,t){if(e.type==="separator")return e;const i=this.keybindingService.lookupKeybinding(e.commandId),s=i?m("commandPickAriaLabelWithKeybinding","{0}, {1}",e.label,i.getAriaLabel()):e.label;return Object.assign(Object.assign({},e),{ariaLabel:s,detail:this.options.showAlias&&e.commandAlias!==e.label?e.commandAlias:void 0,keybinding:i,accept:()=>YR(this,void 0,void 0,function*(){var o,r;this.commandsHistory.push(e.commandId),this.telemetryService.publicLog2("workbenchActionExecuted",{id:e.commandId,from:(o=t==null?void 0:t.from)!==null&&o!==void 0?o:"quick open"});try{!((r=e.args)===null||r===void 0)&&r.length?yield this.commandService.executeCommand(e.commandId,...e.args):yield this.commandService.executeCommand(e.commandId)}catch(a){bc(a)||this.dialogService.error(m("canNotRun","Command '{0}' resulted in an error",e.label),$se(a))}})})}};Om.PREFIX=">";Om.TFIDF_THRESHOLD=.5;Om.TFIDF_MAX_RESULTS=5;Om.WORD_FILTER=B9(ey,xTe,gee);Om=lp=zse([Sp(1,_t),Sp(2,Di),Sp(3,gn),Sp(4,ra),Sp(5,LS)],Om);let Fm=Jn=class extends te{constructor(e,t){super(),this.storageService=e,this.configurationService=t,this.configuredCommandsHistoryLength=0,this.updateConfiguration(),this.load(),this.registerListeners()}registerListeners(){this._register(this.configurationService.onDidChangeConfiguration(e=>this.updateConfiguration(e)))}updateConfiguration(e){e&&!e.affectsConfiguration("workbench.commandPalette.history")||(this.configuredCommandsHistoryLength=Jn.getConfiguredCommandHistoryLength(this.configurationService),Jn.cache&&Jn.cache.limit!==this.configuredCommandsHistoryLength&&(Jn.cache.limit=this.configuredCommandsHistoryLength,Jn.saveState(this.storageService)))}load(){const e=this.storageService.get(Jn.PREF_KEY_CACHE,0);let t;if(e)try{t=JSON.parse(e)}catch{}const i=Jn.cache=new Dg(this.configuredCommandsHistoryLength,1);if(t){let s;t.usesLRU?s=t.entries:s=t.entries.sort((o,r)=>o.value-r.value),s.forEach(o=>i.set(o.key,o.value))}Jn.counter=this.storageService.getNumber(Jn.PREF_KEY_COUNTER,0,Jn.counter)}push(e){Jn.cache&&(Jn.cache.set(e,Jn.counter++),Jn.saveState(this.storageService))}peek(e){var t;return(t=Jn.cache)===null||t===void 0?void 0:t.peek(e)}static saveState(e){if(!Jn.cache)return;const t={usesLRU:!0,entries:[]};Jn.cache.forEach((i,s)=>t.entries.push({key:s,value:i})),e.store(Jn.PREF_KEY_CACHE,JSON.stringify(t),0,0),e.store(Jn.PREF_KEY_COUNTER,Jn.counter,0,0)}static getConfiguredCommandHistoryLength(e){var t,i;const o=(i=(t=e.getValue().workbench)===null||t===void 0?void 0:t.commandPalette)===null||i===void 0?void 0:i.history;return typeof o=="number"?o:Jn.DEFAULT_COMMANDS_HISTORY_LENGTH}};Fm.DEFAULT_COMMANDS_HISTORY_LENGTH=50;Fm.PREF_KEY_CACHE="commandPalette.mru.cache";Fm.PREF_KEY_COUNTER="commandPalette.mru.counter";Fm.counter=1;Fm=Jn=zse([Sp(0,yl),Sp(1,zt)],Fm);class NWe extends Om{constructor(e,t,i,s,o,r){super(e,t,i,s,o,r)}getCodeEditorCommandPicks(){const e=this.activeTextEditorControl;if(!e)return[];const t=[];for(const i of e.getSupportedActions())t.push({commandId:i.id,commandAlias:i.alias,label:U9(i.label)||i.id});return t}}var AWe=globalThis&&globalThis.__decorate||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},W_=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},FK=globalThis&&globalThis.__awaiter||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 Hy=class extends NWe{get activeTextEditorControl(){var e;return(e=this.codeEditorService.getFocusedCodeEditor())!==null&&e!==void 0?e:void 0}constructor(e,t,i,s,o,r){super({showAlias:!1},e,i,s,o,r),this.codeEditorService=t}getCommandPicks(){return FK(this,void 0,void 0,function*(){return this.getCodeEditorCommandPicks()})}hasAdditionalCommandPicks(){return!1}getAdditionalCommandPicks(){return FK(this,void 0,void 0,function*(){return[]})}};Hy=AWe([W_(0,_t),W_(1,ai),W_(2,Di),W_(3,gn),W_(4,ra),W_(5,LS)],Hy);class YS extends Ue{constructor(){super({id:YS.ID,label:nI.quickCommandActionLabel,alias:"Command Palette",precondition:void 0,kbOpts:{kbExpr:O.focus,primary:59,weight:100},contextMenuOpts:{group:"z_commands",order:1}})}run(e){e.get(yc).quickAccess.show(Hy.PREFIX)}}YS.ID="editor.action.quickCommand";De(YS);en.as(i_.Quickaccess).registerQuickAccessProvider({ctor:Hy,prefix:Hy.PREFIX,helpEntries:[{description:nI.quickCommandHelp,commandId:YS.ID}]});var MWe=globalThis&&globalThis.__decorate||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},V_=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let X5=class extends rg{constructor(e,t,i,s,o,r,a){super(!0,e,t,i,s,o,r,a)}};X5=MWe([V_(1,bt),V_(2,ai),V_(3,Nn),V_(4,_t),V_(5,yl),V_(6,zt)],X5);ti(rg.ID,X5,4);class RWe extends Ue{constructor(){super({id:"editor.action.toggleHighContrast",label:KO.toggleHighContrast,alias:"Toggle High Contrast Theme",precondition:void 0}),this._originalThemeName=null}run(e,t){const i=e.get(la),s=i.getColorTheme();ac(s.type)?(i.setTheme(this._originalThemeName||(Nb(s.type)?sb:Cu)),this._originalThemeName=null):(i.setTheme(Nb(s.type)?Gp:Yp),this._originalThemeName=s.themeName)}}De(RWe);var PWe=Object.defineProperty,cT=Object.getOwnPropertySymbols,Use=Object.prototype.hasOwnProperty,jse=Object.prototype.propertyIsEnumerable,BK=(n,e,t)=>e in n?PWe(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,OWe=(n,e)=>{for(var t in e||(e={}))Use.call(e,t)&&BK(n,t,e[t]);if(cT)for(var t of cT(e))jse.call(e,t)&&BK(n,t,e[t]);return n},FWe=(n,e)=>{var t={};for(var i in n)Use.call(n,i)&&e.indexOf(i)<0&&(t[i]=n[i]);if(n!=null&&cT)for(var i of cT(n))e.indexOf(i)<0&&jse.call(n,i)&&(t[i]=n[i]);return t};function Vo(n){let e=!1;bd(()=>{n(),Fn(()=>{e=!0})}),eh(()=>{e&&n()})}function fg(n,e,t,i={}){if(!nh())return;const{passive:s=!1,capture:o=!1}=i;let r=!1,a=!1;const l=f=>v0(f)?f():ud(f),c=f=>{if(r||a)return;const g=l(f);g&&(g.addEventListener(e,t,{passive:s,capture:o}),r=!0)},d=f=>{if(!r||a)return;const g=l(f);g&&(g.removeEventListener(e,t,{capture:o}),r=!1)};let u;eo(n)&&(u=ht(()=>n.value,(f,g)=>{d(g),c(f)}));const h=()=>{u==null||u(),d(n),a=!0};return Vo(()=>{c(n)}),zm(()=>{d(n)}),$m(()=>{d(n)}),h}function Kse(n,e,t){if(!nh())return;fg(document,e,s=>{const o=v0(n)?n():ud(n);o&&!o.contains(s.target)&&t(s)})}function rA(n){Cd(()=>{n()}),$m(()=>{n()})}function BWe(n){const e=ih();return n in e.provides}function Ho(n){if(!BWe(n))return{index:null,parentProvider:null,bindParent:null};const t=lC(n),{childInstances:i,collect:s,clear:o}=t,r=FWe(t,["childInstances","collect","clear"]),a=ih();return{index:ve(()=>i.indexOf(a)),parentProvider:r,bindParent:d=>{bd(()=>{Fn().then(()=>{s(a,d)})}),zm(()=>{Fn().then(()=>{o(a,d)})})}}}function WWe(n){const e=[],t=i=>{if(i!=null&&i.component){t(i==null?void 0:i.component.subTree);return}Array.isArray(i==null?void 0:i.children)&&i.children.forEach(s=>{ow(s)&&(e.push(s),t(s))})};return t(n),e}function $o(n){const e=ih(),t=Cn([]),i=[],s=ve(()=>t.length),o=()=>{const c=WWe(e.subTree);t.sort((d,u)=>c.indexOf(d.vnode)-c.indexOf(u.vnode))},r=(c,d)=>{t.push(c),i.push(d),o()},a=(c,d)=>{JD(t,c),JD(i,d)};return{length:s,childProviders:i,bindChildren:c=>{MY(n,OWe({childInstances:t,collect:r,clear:a},c))}}}function U0(n){fg(()=>window,"resize",n,{passive:!0}),fg(()=>window,"orientationchange",n,{passive:!0})}function VWe(n,e){const t=se(!1);return ht(n,i=>{e===i&&(t.value=!0)},{immediate:!0}),t}function HWe(n,e){if(n>e)return"horizontal";if(e>n)return"vertical"}function j0(){const n=se(0),e=se(0),t=se(0),i=se(0),s=se(0),o=se(0),r=se(0),a=se(0),l=se(0),c=se(0),d=se(),u=se(!1),h=se(!1),f=se(0),g=se(0);let p=null;const _=()=>{n.value=0,e.value=0,t.value=0,i.value=0,s.value=0,o.value=0,r.value=0,a.value=0,l.value=0,c.value=0,d.value=void 0,u.value=!1,h.value=!1,f.value=0,g.value=0};return{startX:n,startY:e,deltaX:t,deltaY:i,offsetX:s,offsetY:o,prevX:r,prevY:a,moveX:l,moveY:c,direction:d,touching:u,dragging:h,startTime:f,distance:g,resetTouch:_,startTouch:L=>{_();const{clientX:S,clientY:k}=L.touches[0];n.value=S,e.value=k,r.value=S,a.value=k,u.value=!0,f.value=performance.now(),h.value=!1,p&&window.cancelAnimationFrame(p)},moveTouch:L=>{const{clientX:S,clientY:k}=L.touches[0];h.value=!0,t.value=S-n.value,i.value=k-e.value,s.value=Math.abs(t.value),o.value=Math.abs(i.value),g.value=Math.sqrt(s.value**2+o.value**2),l.value=S-r.value,c.value=k-a.value,d.value||(d.value=HWe(s.value,o.value)),r.value=S,a.value=k},endTouch:()=>{u.value=!1,p=window.requestAnimationFrame(()=>{h.value=!1})},isReachTop:L=>hb(L)===0&&i.value>0,isReachBottom:(L,S=1)=>{const{scrollHeight:k,clientHeight:D,scrollTop:x}=L,A=Math.abs(k-x-D);return i.value<0&&A<=S}}}function qse(){const n=se(),e=ih(),t=JY(e.type.name);return n.value="".concat(t,"-").concat(e.uid),n}function Gse(n={}){const{initialWidth:e=0,initialHeight:t=0}=n,i=se(e),s=se(t),o=()=>{nh()&&(i.value=window.innerWidth,s.value=window.innerHeight)};return Vo(o),U0(o),{width:i,height:s}}function Yse(n,e,t={}){const{passive:i=!0,eventName:s,defaultValue:o,emit:r}=t,a=s!=null?s:"onUpdate:".concat(e.toString()),l=()=>n[e]!=null?n[e]:o;if(!i)return ve({get(){return l()},set(d){r?r(a,d):eE(n[a],d)}});const c=se(l());return ht(()=>n[e],()=>{c.value=l()}),ht(()=>c.value,d=>{r?r(a,d):eE(n[a],d)}),c}function $We(){return new Worker(""+new URL("editor.worker-0d50d69b.js",import.meta.url).href)}function zWe(){return new Worker(""+new URL("json.worker-1c455b7b.js",import.meta.url).href)}function UWe(){return new Worker(""+new URL("css.worker-915947ab.js",import.meta.url).href)}function jWe(){return new Worker(""+new URL("html.worker-dc0570f2.js",import.meta.url).href)}function KWe(){return new Worker(""+new URL("ts.worker-4c71b1fc.js",import.meta.url).href)}var qWe=Object.defineProperty,GWe=Object.defineProperties,YWe=Object.getOwnPropertyDescriptors,WK=Object.getOwnPropertySymbols,ZWe=Object.prototype.hasOwnProperty,XWe=Object.prototype.propertyIsEnumerable,VK=(n,e,t)=>e in n?qWe(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,ZR=(n,e)=>{for(var t in e||(e={}))ZWe.call(e,t)&&VK(n,t,e[t]);if(WK)for(var t of WK(e))XWe.call(e,t)&&VK(n,t,e[t]);return n},XR=(n,e)=>GWe(n,YWe(e));self.MonacoEnvironment={getWorker(n,e){return e==="json"?new zWe:e==="css"||e==="scss"||e==="less"?new UWe:e==="html"||e==="handlebars"||e==="razor"?new jWe:e==="typescript"||e==="javascript"?new KWe:new $We}};var QWe=720,JWe=["h","ref","reactive","computed","readonly","watch","watchEffect","watchSyncEffect","watchPostEffect","isRef","unref","toRefs","isProxy","isReactive","isReadonly","onBeforeMount","onMounted","onBeforeUpdate","onUpdated","onBeforeUnmount","onUnmounted","axle"],eVe=et({props:{schema:{type:Object,default:()=>({})},components:{type:Object,default:()=>({})},injects:{type:Object,default:()=>({})},theme:{type:String,default:"vs"},activeTab:{type:String,default:"JSON"},editorFontSize:{type:Number,default:13},onChange:{type:[Function,Array]},"onUpdate:activeTab":{type:[Function,Array]}},setup(n){const e=GD(n.schema),t=se(null),i=Yse(n,"activeTab"),s=se(!0),o=se(["JSON","SCRIPT","CSS"]),{width:r}=Gse(),a=ve(()=>r.value>QWe);let l,c;bd(d),Cd(()=>{l.dispose(),c.dispose()}),ht(()=>[n.theme,n.schema],u);function d(){l=ID.create(t.value,h()),l.addCommand(Kte.CtrlCmd|jte.KeyS,g),lF.registerCompletionItemProvider("javascript",{provideCompletionItems(b,C){const w=b.getWordUntilPosition(C),y={startLineNumber:C.lineNumber,endLineNumber:C.lineNumber,startColumn:w.startColumn,endColumn:w.endColumn};return{suggestions:[...JWe,...Object.keys(n.injects)].map(L=>({label:L,kind:lF.CompletionItemKind.Variable,insertText:L,range:y}))}}})}function u(){e.value=n.schema;const b=h();l.updateOptions(b),l.setValue(b.value),ID.setModelLanguage(l.getModel(),b.language)}function h(){var b,C;const w={scrollBeyondLastLine:!1,fontSize:n.editorFontSize,theme:n.theme,automaticLayout:!0,minimap:{enabled:!1}};return i.value==="JSON"?XR(ZR({},w),{value:JSON.stringify(e.value,null,2),language:"json"}):i.value==="SCRIPT"?XR(ZR({},w),{value:(b=e.value.code)!=null?b:"function setup() {}",language:"javascript"}):XR(ZR({},w),{value:(C=e.value.css)!=null?C:"",language:"css"})}function f(b){return JSON.parse(JSON.stringify(b))}function g(){const b=l.getValue();let C="";if(i.value==="JSON"&&(C=b),i.value==="SCRIPT"){const w=f(e.value);w.code=b,C=JSON.stringify(w)}if(i.value==="CSS"){const w=f(e.value);w.css=b,C=JSON.stringify(w)}try{const w=JSON.parse(C);C!==JSON.stringify(e.value)&&eE(n.onChange,w),e.value=w}catch{alert("JSON parse error")}}function p(b){i.value=b;const C=h();l.setValue(C.value),ID.setModelLanguage(l.getModel(),C.language)}function _(){s.value=!s.value}function v(){return o.value.map(b=>Oe("div",{class:k2("var-schema-repl-tab",[b===i.value,"var-schema-repl-tab-active"]),onClick:()=>p(b)},[b]))}return()=>Oe("div",{class:k2("var-schema-repl",[n.theme==="vs-dark","var-schema-repl-vs-dark"])},[Oe("div",{class:"var-schema-repl-tab-container"},[v()]),Oe("div",{class:"var-schema-repl-editor-container"},[wi(Oe("div",{class:"var-schema-repl-editor",style:{width:a.value?"50%":"100%"},ref:t},null),[[hl,a.value||s.value]]),wi(Oe(bme,{style:{width:a.value?"50%":"100%"},schema:e.value,components:n.components,injects:n.injects},null),[[hl,a.value||!s.value]]),!a.value&&Oe("button",{class:"var-schema-repl-transfer",onClick:_},[s.value?"SHOW PREVIEW":"SHOW EDITOR"])])])}});const Zse={locks:{},zIndex:2e3,enableRipple:!0};Cn(Zse);var Ea=Cn(Zse),tVe=Object.defineProperty,HK=Object.getOwnPropertySymbols,iVe=Object.prototype.hasOwnProperty,nVe=Object.prototype.propertyIsEnumerable,$K=(n,e,t)=>e in n?tVe(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,zK=(n,e)=>{for(var t in e||(e={}))iVe.call(e,t)&&$K(n,t,e[t]);if(HK)for(var t of HK(e))nVe.call(e,t)&&$K(n,t,e[t]);return n},UK=(n,e,t)=>new Promise((i,s)=>{var o=l=>{try{a(t.next(l))}catch(c){s(c)}},r=l=>{try{a(t.throw(l))}catch(c){s(c)}},a=l=>l.done?i(l.value):Promise.resolve(l.value).then(o,r);a((t=t.apply(n,e)).next())});function yi(n,e){return Array.isArray(e)?e.reduce((t,i)=>(t[i]=n[i],t),{}):n[e]}function lt(n,e){const t=e!=null?e:n;return t.install=function(i){const{name:s}=n;s&&i.component(s,n)},t}function sVe(n){const e=XY(n),t=document.createElement("div");return document.body.appendChild(t),{instance:e.mount(t),unmount(){e.unmount(),document.body.removeChild(t)}}}function K0(n,e={},t={}){const i={setup(){return()=>Bc(n,zK(zK({},e),t))}},{unmount:s}=sVe(i);return{unmountInstance:s}}function Xse(n){const e=[];return n.forEach(t=>{if(t.type!==ya){if(t.type===li&&tn(t.children)){t.children.forEach(i=>{e.push(i)});return}e.push(t)}}),e}function Ll(){const n=se(""),e=(s,o,r)=>UK(this,null,function*(){return!tn(s)||!s.length?!0:!(yield Promise.all(s.map(l=>l(o,r)))).some(l=>l!==!0?(n.value=String(l),!0):!1)});return{errorMessage:n,validate:e,resetValidation:()=>{n.value=""},validateWithTrigger:(s,o,r,a,l)=>UK(this,null,function*(){s.includes(o)&&(yield e(r,a,l))&&(n.value="")})}}function oVe(n){fg(()=>window,"hashchange",n),fg(()=>window,"popstate",n)}function u_(){const n=se(!1);return eh(()=>{n.value=!1}),$m(()=>{n.value=!0}),{disabled:n}}const st=Nhe("var"),oe=eE,Xu=Yse;function Se(n){return{type:[Function,Array],default:n}}function or(n,e){return n===!1?null:(n===!0&&e&&(n=e),"var-elevation--".concat(n))}var rVe=Object.defineProperty,aVe=Object.defineProperties,lVe=Object.getOwnPropertyDescriptors,jK=Object.getOwnPropertySymbols,cVe=Object.prototype.hasOwnProperty,dVe=Object.prototype.propertyIsEnumerable,KK=(n,e,t)=>e in n?rVe(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,Qse=(n,e)=>{for(var t in e||(e={}))cVe.call(e,t)&&KK(n,t,e[t]);if(jK)for(var t of jK(e))dVe.call(e,t)&&KK(n,t,e[t]);return n},uVe=(n,e)=>aVe(n,lVe(e));const{n:Jse}=st("ripple"),qK=250;function hVe(n){const{zIndex:e,position:t}=Um(n);n.style.overflow="hidden",n.style.overflowX="hidden",n.style.overflowY="hidden",t==="static"&&(n.style.position="relative"),e==="auto"&&(n.style.zIndex="1")}function fVe(n,e){const{top:t,left:i}=no(n),{clientWidth:s,clientHeight:o}=n,r=Math.sqrt(s**2+o**2)/2,a=r*2,l=e.touches[0].clientX-i,c=e.touches[0].clientY-t,d=(s-r*2)/2,u=(o-r*2)/2,h=l-r,f=c-r;return{x:h,y:f,centerX:d,centerY:u,size:a}}function eoe(n){const e=this._ripple;if(e.removeRipple(),e.disabled||e.tasker||!Ea.enableRipple)return;const t=()=>{e.tasker=null;const{x:i,y:s,centerX:o,centerY:r,size:a}=fVe(this,n),l=document.createElement("div");l.classList.add(Jse()),l.style.opacity="0",l.style.transform="translate(".concat(i,"px, ").concat(s,"px) scale3d(.3, .3, .3)"),l.style.width="".concat(a,"px"),l.style.height="".concat(a,"px"),e.color&&(l.style.backgroundColor=e.color),l.dataset.createdAt=String(performance.now()),hVe(this),this.appendChild(l),window.setTimeout(()=>{l.style.transform="translate(".concat(o,"px, ").concat(r,"px) scale3d(1, 1, 1)"),l.style.opacity=".25"},20)};e.tasker=window.setTimeout(t,30)}function Q5(){const n=this._ripple,e=()=>{const t=this.querySelectorAll(".".concat(Jse()));if(!t.length)return;const i=t[t.length-1],s=qK-performance.now()+Number(i.dataset.createdAt);window.setTimeout(()=>{i.style.opacity="0",window.setTimeout(()=>{var o;return(o=i.parentNode)==null?void 0:o.removeChild(i)},qK)},s)};n.tasker?window.setTimeout(e,30):e()}function toe(){if(!khe()||!Ea.enableRipple)return;const n=this._ripple;n.tasker&&window.clearTimeout(n.tasker),n.tasker=null}function gVe(n,e){var t;n._ripple=uVe(Qse({tasker:null},(t=e.value)!=null?t:{}),{removeRipple:Q5.bind(n)}),n.addEventListener("touchstart",eoe,{passive:!0}),n.addEventListener("touchmove",toe,{passive:!0}),n.addEventListener("dragstart",Q5,{passive:!0}),document.addEventListener("touchend",n._ripple.removeRipple,{passive:!0}),document.addEventListener("touchcancel",n._ripple.removeRipple,{passive:!0}),document.addEventListener("dragend",n._ripple.removeRipple,{passive:!0})}function pVe(n){n.removeEventListener("touchstart",eoe),n.removeEventListener("touchmove",toe),n.removeEventListener("dragstart",Q5),document.removeEventListener("touchend",n._ripple.removeRipple),document.removeEventListener("touchcancel",n._ripple.removeRipple),document.removeEventListener("dragend",n._ripple.removeRipple)}function mVe(n,e){var t,i,s,o,r,a;const l={color:(t=e.value)==null?void 0:t.color,disabled:(i=e.value)==null?void 0:i.disabled};(l.color!==((s=n._ripple)==null?void 0:s.color)||l.disabled!==((o=n._ripple)==null?void 0:o.disabled))&&(n._ripple=Qse({tasker:l.disabled?null:(r=n._ripple)==null?void 0:r.tasker,removeRipple:(a=n._ripple)==null?void 0:a.removeRipple},l))}const _Ve={mounted:gVe,unmounted:pVe,updated:mVe,install(n){n.directive("ripple",this)}};var Ns=_Ve;const ZS={show:Boolean,position:{type:String,default:"center"},transition:String,overlay:{type:Boolean,default:!0},overlayClass:String,overlayStyle:Object,lockScroll:{type:Boolean,default:!0},closeOnClickOverlay:{type:Boolean,default:!0},defaultStyle:{type:Boolean,default:!0},safeArea:Boolean,safeAreaTop:Boolean,teleport:{type:[String,Object,Boolean],default:"body"},onOpen:Se(),onOpened:Se(),onClose:Se(),onClosed:Se(),onClickOverlay:Se(),"onUpdate:show":Se(),onRouteChange:Se()};function ioe(){Object.keys(Ea.locks).length<=0?document.body.classList.remove("var--lock"):document.body.classList.add("var--lock")}function Mk(n){Ea.locks[n]=1,ioe()}function Rk(n){delete Ea.locks[n],ioe()}function XS(n,e){const{uid:t}=ih();e&&ht(e,i=>{i===!1?Rk(t):i===!0&&n()===!0&&Mk(t)}),ht(n,i=>{e&&e()===!1||(i===!0?Mk(t):Rk(t))}),BB(()=>{e&&e()===!1||n()===!0&&Mk(t)}),Cd(()=>{e&&e()===!1||n()===!0&&Rk(t)}),eh(()=>{e&&e()===!1||n()===!0&&Mk(t)}),$m(()=>{e&&e()===!1||n()===!0&&Rk(t)})}function QS(n,e){const t=se(Ea.zIndex);return ht(n,i=>{i&&(Ea.zIndex+=e,t.value=Ea.zIndex)},{immediate:!0}),{zIndex:t}}const noe=Symbol("POPUP_BIND_POPUP_ITEM_KEY");function vVe(){const{bindParent:n,parentProvider:e,index:t}=Ho(noe);return{index:t,popup:e,bindPopup:n}}function bVe(){const{bindChildren:n,childProviders:e,length:t}=$o(noe);return{length:t,popupItems:e,bindPopupItems:n}}var CVe=Object.defineProperty,GK=Object.getOwnPropertySymbols,wVe=Object.prototype.hasOwnProperty,yVe=Object.prototype.propertyIsEnumerable,YK=(n,e,t)=>e in n?CVe(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,SVe=(n,e)=>{for(var t in e||(e={}))wVe.call(e,t)&&YK(n,t,e[t]);if(GK)for(var t of GK(e))yVe.call(e,t)&&YK(n,t,e[t]);return n};const{name:LVe,n:Tl,classes:QR}=st("popup");var soe=et({name:LVe,inheritAttrs:!1,props:ZS,setup(n,{slots:e,attrs:t}){const i=VWe(()=>n.show,!0),{zIndex:s}=QS(()=>n.show,3),{disabled:o}=u_(),{bindPopupItems:r}=bVe();XS(()=>n.show,()=>n.lockScroll),ht(()=>n.show,u=>{oe(u?n.onOpen:n.onClose)}),r({show:ve(()=>n.show)}),oVe(()=>oe(n.onRouteChange));function a(){const{closeOnClickOverlay:u,onClickOverlay:h}=n;oe(h),u&&oe(n["onUpdate:show"],!1)}function l(){const{overlayClass:u="",overlayStyle:h}=n;return Oe("div",{class:QR(Tl("overlay"),u),style:SVe({zIndex:s.value-1},h),onClick:a},null)}function c(){return wi(Oe("div",fn({class:QR(Tl("content"),Tl("--".concat(n.position)),[n.defaultStyle,Tl("--content-background-color")],[n.defaultStyle,Tl("$-elevation--3")],[n.safeArea,Tl("--safe-area")],[n.safeAreaTop,Tl("--safe-area-top")]),style:{zIndex:s.value}},t),[i.value&&oe(e.default)]),[[hl,n.show]])}function d(){return Oe(On,{name:Tl("$-fade"),onAfterEnter:n.onOpened,onAfterLeave:n.onClosed},{default:()=>[wi(Oe("div",{class:QR(Tl("$--box"),Tl()),style:{zIndex:s.value-2}},[n.overlay&&l(),Oe(On,{name:n.transition||Tl("$-pop-".concat(n.position))},{default:()=>[c()]})]),[[hl,n.show]])]})}return()=>{const{teleport:u}=n;return u?Oe(Bd,{to:u,disabled:o.value},{default:()=>[d()]}):d()}}});lt(soe);var gg=soe;const Ss={name:String,size:[Number,String],color:String,namespace:{type:String,default:"var-icon"},transition:{type:[Number,String],default:0},animationClass:String,onClick:Se()};function Oa(n,e){throw Error("Varlet [".concat(n,"]: ").concat(e))}function ZK(n,e){console.warn("Varlet [".concat(n,"]: ").concat(e))}function kVe(n){const{left:e}=no(n);return e+(document.body.scrollLeft||document.documentElement.scrollLeft)}function XK(n){const{top:e}=no(n);return e+(document.body.scrollTop||document.documentElement.scrollTop)}function JR(n){const{transform:e}=Um(n);return+e.slice(e.lastIndexOf(",")+2,e.length-1)}function pg(n){let e=n;for(;e&&!(!e.parentNode||(e=e.parentNode,e===document.body||e===document.documentElement));){const t=/(scroll|auto)/,{overflowY:i,overflow:s}=Um(e);if(t.test(i)||t.test(s))return e}return window}function DVe(n){const e=[];let t=n;for(;!qB(t);)t=pg(t),e.push(t);return e}function ooe(n,e){if(Us(n)){const t=document.querySelector(n);return t||Oa(e,"target element cannot found"),t}if(She(n))return n;Oa(e,'type of prop "target" should be a selector or an element object')}function EVe(){const{width:n,height:e}=no(window);return{vw:n,vh:e,vMin:Math.min(n,e),vMax:Math.max(n,e)}}const roe=n=>Us(n)&&n.endsWith("rem"),IVe=n=>Us(n)&&n.endsWith("em")&&!n.endsWith("rem"),TVe=n=>Us(n)&&n.endsWith("px")||qr(n),xVe=n=>Us(n)&&n.endsWith("%"),aoe=n=>Us(n)&&n.endsWith("vw"),loe=n=>Us(n)&&n.endsWith("vh"),coe=n=>Us(n)&&n.endsWith("vmin"),doe=n=>Us(n)&&n.endsWith("vmax"),NVe=n=>Us(n)&&n.startsWith("calc("),AVe=n=>Us(n)&&n.startsWith("var("),jn=n=>{if(qr(n))return n;if(TVe(n))return+n.replace("px","");if(!nh())return 0;const{vw:e,vh:t,vMin:i,vMax:s}=EVe();if(aoe(n))return+n.replace("vw","")*e/100;if(loe(n))return+n.replace("vh","")*t/100;if(coe(n))return+n.replace("vmin","")*i/100;if(doe(n))return+n.replace("vmax","")*s/100;if(roe(n)){const o=+n.replace("rem",""),r=Um(document.documentElement).fontSize;return o*parseFloat(r)}return Us(n)?Ie(n):0},ri=n=>{if(n!=null)return xVe(n)||aoe(n)||loe(n)||IVe(n)||roe(n)||NVe(n)||AVe(n)||coe(n)||doe(n)?n:"".concat(jn(n),"px")},dr=(n,e=1)=>{if(n==null)return;const t=ri(n),i=t.match(/(vh|%|r?em|px|vw|vmin|vmax)$/)[0];return"".concat(parseFloat(t)*e).concat(i)};function $y(n,{top:e=0,left:t=0,duration:i=300,animation:s}){const o=Date.now(),r=hb(n),a=GB(n);return new Promise(l=>{const c=()=>{const d=(Date.now()-o)/i;if(d<1){const u=r+(e-r)*s(d),h=a+(t-a)*s(d);n.scrollTo(h,u),requestAnimationFrame(c)}else n.scrollTo(t,e),l()};requestAnimationFrame(c)})}function uoe(n){return Object.entries(n!=null?n:{}).reduce((e,[t,i])=>{const s=t.startsWith("--")?t:"--".concat(JY(t));return e[s]=i,e},{})}function dT(n){return n==="start"||n==="end"?"flex-".concat(n):n}var MVe=(n,e,t)=>new Promise((i,s)=>{var o=l=>{try{a(t.next(l))}catch(c){s(c)}},r=l=>{try{a(t.throw(l))}catch(c){s(c)}},a=l=>l.done?i(l.value):Promise.resolve(l.value).then(o,r);a((t=t.apply(n,e)).next())});const{name:RVe,n:PVe,classes:OVe}=st("icon");function FVe(n,e){return q(),ei(m0(n.isURL(n.name)?"img":"i"),{class:B(n.classes(n.n(),[n.namespace!==n.n(),n.namespace],"".concat(n.namespace,"--set"),[n.isURL(n.name),n.n("image"),"".concat(n.namespace,"-").concat(n.nextName)],[n.animateInProgress,n.animationClass==null?n.n("--shrinking"):n.animationClass])),style:Fe({color:n.color,"transition-duration":"".concat(n.toNumber(n.transition),"ms"),width:n.isURL(n.name)?n.toSizeUnit(n.size):null,height:n.isURL(n.name)?n.toSizeUnit(n.size):null,fontSize:n.toSizeUnit(n.size)}),src:n.isURL(n.name)?n.nextName:null,onClick:n.onClick},null,8,["class","style","src","onClick"])}const hoe=et({name:RVe,props:Ss,setup(n){const e=se(""),t=se(!1);ht(()=>n.name,i,{immediate:!0});function i(s,o){return MVe(this,null,function*(){const{transition:r}=n;if(o==null||Ie(r)===0){e.value=s;return}t.value=!0,yield Fn(),setTimeout(()=>{o!=null&&(e.value=s),t.value=!1},Ie(r))})}return{nextName:e,animateInProgress:t,n:PVe,classes:OVe,isURL:Lhe,toNumber:Ie,toSizeUnit:ri}}});hoe.render=FVe;var foe=hoe;lt(foe);var Wn=foe,BVe=Object.defineProperty,QK=Object.getOwnPropertySymbols,WVe=Object.prototype.hasOwnProperty,VVe=Object.prototype.propertyIsEnumerable,JK=(n,e,t)=>e in n?BVe(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,HVe=(n,e)=>{for(var t in e||(e={}))WVe.call(e,t)&&JK(n,t,e[t]);if(QK)for(var t of QK(e))VVe.call(e,t)&&JK(n,t,e[t]);return n};const $Ve=HVe({show:Boolean,title:String,actions:{type:Array,default:()=>[]},closeOnClickAction:{type:Boolean,default:!0},onSelect:Se(),"onUpdate:show":Se()},yi(ZS,["overlay","overlayClass","overlayStyle","lockScroll","closeOnClickOverlay","safeArea","teleport","onOpen","onClose","onOpened","onClosed","onClickOverlay","onRouteChange"]));var goe={dialogTitle:"提示",dialogConfirmButtonText:"确认",dialogCancelButtonText:"取消",actionSheetTitle:"请选择",listLoadingText:"加载中",listFinishedText:"没有更多了",listErrorText:"加载失败",pickerTitle:"请选择",pickerConfirmButtonText:"确认",pickerCancelButtonText:"取消",datePickerMonthDict:{"01":{name:"一月",abbr:"一月"},"02":{name:"二月",abbr:"二月"},"03":{name:"三月",abbr:"三月"},"04":{name:"四月",abbr:"四月"},"05":{name:"五月",abbr:"五月"},"06":{name:"六月",abbr:"六月"},"07":{name:"七月",abbr:"七月"},"08":{name:"八月",abbr:"八月"},"09":{name:"九月",abbr:"九月"},10:{name:"十月",abbr:"十月"},11:{name:"十一月",abbr:"十一月"},12:{name:"十二月",abbr:"十二月"}},datePickerWeekDict:{0:{name:"星期日",abbr:"日"},1:{name:"星期一",abbr:"一"},2:{name:"星期二",abbr:"二"},3:{name:"星期三",abbr:"三"},4:{name:"星期四",abbr:"四"},5:{name:"星期五",abbr:"五"},6:{name:"星期六",abbr:"六"}},datePickerSelected:"个被选择",datePickerHint:"选择日期",paginationItem:"条",paginationPage:"页",paginationJump:"前往",timePickerHint:"选择时间"},zVe={dialogTitle:"Hint",dialogConfirmButtonText:"Confirm",dialogCancelButtonText:"Cancel",actionSheetTitle:"Select One",listLoadingText:"Loading",listFinishedText:"No more",listErrorText:"Load fail",pickerTitle:"Pick it",pickerConfirmButtonText:"Confirm",pickerCancelButtonText:"Cancel",datePickerMonthDict:{"01":{name:"January",abbr:"JAN"},"02":{name:"February",abbr:"FEB"},"03":{name:"March",abbr:"MAR"},"04":{name:"April",abbr:"APR"},"05":{name:"May",abbr:"MAY"},"06":{name:"June",abbr:"JUN"},"07":{name:"July",abbr:"JUL"},"08":{name:"August",abbr:"AUG"},"09":{name:"September",abbr:"SEP"},10:{name:"October",abbr:"OCT"},11:{name:"November",abbr:"NOV"},12:{name:"December",abbr:"DEC"}},datePickerWeekDict:{0:{name:"Sunday",abbr:"S"},1:{name:"Monday",abbr:"M"},2:{name:"Tuesday",abbr:"T"},3:{name:"Wednesday",abbr:"W"},4:{name:"Thursday",abbr:"T"},5:{name:"Friday",abbr:"F"},6:{name:"Saturday",abbr:"S"}},datePickerSelected:" selected",datePickerHint:"SELECT DATE",paginationItem:"",paginationPage:"page",paginationJump:"Go to",timePickerHint:"SELECT TIME"},poe={dialogTitle:"提示",dialogConfirmButtonText:"確認",dialogCancelButtonText:"取消",actionSheetTitle:"請選擇",listLoadingText:"載入中",listFinishedText:"沒有更多了",listErrorText:"載入失敗",pickerTitle:"請選擇",pickerConfirmButtonText:"確認",pickerCancelButtonText:"取消",datePickerMonthDict:{"01":{name:"一月",abbr:"一月"},"02":{name:"二月",abbr:"二月"},"03":{name:"三月",abbr:"三月"},"04":{name:"四月",abbr:"四月"},"05":{name:"五月",abbr:"五月"},"06":{name:"六月",abbr:"六月"},"07":{name:"七月",abbr:"七月"},"08":{name:"八月",abbr:"八月"},"09":{name:"九月",abbr:"九月"},10:{name:"十月",abbr:"十月"},11:{name:"十一月",abbr:"十一月"},12:{name:"十二月",abbr:"十二月"}},datePickerWeekDict:{0:{name:"星期日",abbr:"日"},1:{name:"星期一",abbr:"一"},2:{name:"星期二",abbr:"二"},3:{name:"星期三",abbr:"三"},4:{name:"星期四",abbr:"四"},5:{name:"星期五",abbr:"五"},6:{name:"星期六",abbr:"六"}},datePickerSelected:"個被選擇",paginationItem:"條",paginationPage:"頁",paginationJump:"前往"},UVe=poe,jVe=Object.defineProperty,eq=Object.getOwnPropertySymbols,KVe=Object.prototype.hasOwnProperty,qVe=Object.prototype.propertyIsEnumerable,tq=(n,e,t)=>e in n?jVe(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,iq=(n,e)=>{for(var t in e||(e={}))KVe.call(e,t)&&tq(n,t,e[t]);if(eq)for(var t of eq(e))qVe.call(e,t)&&tq(n,t,e[t]);return n};function moe(){const n={},e=se({}),t=(o,r)=>{r.lang=o,n[o]=r},i=o=>{if(!n[o])return console.warn("The ".concat(o," does not exist. You can mount a language package using the add method")),{};e.value=n[o]};return{packs:n,pack:e,add:t,use:i,merge:(o,r)=>{if(!n[o]){console.warn("The ".concat(o," does not exist. You can mount a language package using the add method"));return}n[o]=iq(iq({},n[o]),r),i(o)}}}const{packs:GVe,pack:Xs,add:_oe,use:voe,merge:YVe}=moe();_oe("zh-CN",goe);voe("zh-CN");var J5={zhCN:goe,enUS:zVe,zhTW:poe,zhHK:UVe,packs:GVe,pack:Xs,add:_oe,use:voe,merge:YVe,useLocale:moe};const{name:ZVe,n:XVe,classes:QVe}=st("action-sheet"),JVe=["onClick"];function eHe(n,e){const t=gt("var-icon"),i=gt("var-popup"),s=hn("ripple");return q(),ei(i,fn({class:n.n("popup-radius"),position:"bottom",show:n.popupShow,overlay:n.overlay,"overlay-class":n.overlayClass,"overlay-style":n.overlayStyle,"lock-scroll":n.lockScroll,"close-on-click-overlay":n.closeOnClickOverlay,teleport:n.teleport,"safe-area":n.safeArea},{"onUpdate:show":n.handlePopupUpdateShow},{onOpen:n.onOpen,onClose:n.onClose,onClosed:n.onClosed,onOpened:n.onOpened,onRouteChange:n.onRouteChange}),{default:Lt(()=>[me("div",fn({class:n.classes(n.n(),n.n("$--box"))},n.$attrs),[xe(n.$slots,"title",{},()=>{var o;return[me("div",{class:B(n.n("title"))},ut((o=n.title)!=null?o:n.pack.actionSheetTitle),3)]}),xe(n.$slots,"actions",{},()=>[(q(!0),re(li,null,ss(n.actions,o=>wi((q(),re("div",{class:B(n.classes(n.n("action-item"),o.className,[o.disabled,n.n("--disabled")])),key:o.name,style:Fe({color:o.color}),onClick:r=>n.handleSelect(o)},[o.icon?(q(),ei(t,{key:0,class:B(n.n("action-icon")),"var-action-sheet-cover":"",namespace:o.namespace,name:o.icon,size:o.iconSize},null,8,["class","namespace","name","size"])):Qe("v-if",!0),me("div",{class:B(n.n("action-name"))},ut(o.name),3)],14,JVe)),[[s,{disabled:o.disabled}]])),128))])],16)]),_:3},16,["class","show","overlay","overlay-class","overlay-style","lock-scroll","close-on-click-overlay","teleport","safe-area","onOpen","onClose","onClosed","onOpened","onRouteChange"])}const boe=et({name:ZVe,directives:{Ripple:Ns},components:{VarPopup:gg,VarIcon:Wn},inheritAttrs:!1,props:$Ve,setup(n){const e=se(!1);ht(()=>n.show,s=>{e.value=s},{immediate:!0});function t(s){if(s.disabled)return;const{closeOnClickAction:o,onSelect:r}=n;oe(r,s),o&&oe(n["onUpdate:show"],!1)}function i(s){oe(n["onUpdate:show"],s)}return{popupShow:e,pack:Xs,n:XVe,classes:QVe,handlePopupUpdateShow:i,handleSelect:t}}});boe.render=eHe;var aA=boe,tHe=Object.defineProperty,nq=Object.getOwnPropertySymbols,iHe=Object.prototype.hasOwnProperty,nHe=Object.prototype.propertyIsEnumerable,sq=(n,e,t)=>e in n?tHe(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,oq=(n,e)=>{for(var t in e||(e={}))iHe.call(e,t)&&sq(n,t,e[t]);if(nq)for(var t of nq(e))nHe.call(e,t)&&sq(n,t,e[t]);return n};let qh,I6={};function sHe(n={}){return oq(oq({},I6),n)}function h_(n){return nh()?new Promise(e=>{h_.close();const t=Cn(sHe(n));t.teleport="body",qh=t;const{unmountInstance:i}=K0(aA,t,{onSelect:s=>{oe(t.onSelect,s),e(s)},onClose:()=>{oe(t.onClose),e("close")},onClosed:()=>{oe(t.onClosed),i(),qh===t&&(qh=null)},onRouteChange:()=>{i(),qh===t&&(qh=null)},"onUpdate:show":s=>{t.show=s}});t.show=!0}):Promise.resolve()}h_.setDefaultOptions=function(n){I6=n};h_.resetDefaultOptions=function(){I6={}};h_.close=function(){if(qh!=null){const n=qh;qh=null,Fn().then(()=>{n.show=!1})}};h_.Component=aA;lt(aA);lt(aA,h_);var e3=h_;const oHe={color:String,textColor:String,title:String,titlePosition:{type:String,default:"left"},elevation:{type:[Boolean,String,Number],default:!0},round:Boolean,image:String,imageLinearGradient:String,safeAreaTop:Boolean},{name:rHe,n:aHe,classes:lHe}=st("app-bar");function cHe(n,e){return q(),re("div",{class:B(n.classes(n.n(),n.n("$--box"),[n.safeAreaTop,n.n("--safe-area-top")],[n.round,n.n("--round")],n.formatElevation(n.elevation,3))),style:Fe(n.rootStyles)},[me("div",{class:B(n.n("toolbar"))},[me("div",{class:B(n.n("left"))},[xe(n.$slots,"left"),n.titlePosition==="left"?(q(),re("div",{key:0,class:B(n.n("title")),style:Fe({paddingLeft:n.paddingLeft})},[xe(n.$slots,"default",{},()=>[Mi(ut(n.title),1)])],6)):Qe("v-if",!0)],2),n.titlePosition==="center"?(q(),re("div",{key:0,class:B(n.n("title"))},[xe(n.$slots,"default",{},()=>[Mi(ut(n.title),1)])],2)):Qe("v-if",!0),me("div",{class:B(n.n("right"))},[n.titlePosition==="right"?(q(),re("div",{key:0,class:B(n.n("title")),style:Fe({paddingRight:n.paddingRight})},[xe(n.$slots,"default",{},()=>[Mi(ut(n.title),1)])],6)):Qe("v-if",!0),xe(n.$slots,"right")],2)],2),xe(n.$slots,"content")],6)}const Coe=et({name:rHe,props:oHe,setup(n,{slots:e}){const t=se(),i=se(),s=ve(()=>{const{image:r,color:a,textColor:l,imageLinearGradient:c}=n;if(r!=null){const d=c?"linear-gradient(".concat(c,"), "):"";return{"background-image":"".concat(d,"url(").concat(r,")"),"background-position":"center center","background-size":"cover"}}return{background:a,color:l}});Vo(o),Cg(o);function o(){t.value=e.left?0:void 0,i.value=e.right?0:void 0}return{rootStyles:s,paddingLeft:t,paddingRight:i,n:aHe,classes:lHe,formatElevation:or}}});Coe.render=cHe;var woe=Coe;lt(woe);var t3=woe;const rq=n=>Us(n)?n.startsWith("data:image")||/\.(png|jpg|gif|jpeg|svg|webp|ico)$/i.test(n):!1,aq=n=>Us(n)?n.startsWith("data:video")||/\.(mp4|webm|ogg)$/.test(n):!1,dHe=n=>{const e=[];return{cache:e,has(t){return this.cache.includes(t)},add(t){this.has(t)||(this.cache.length===n&&e.shift(),this.cache.push(t))},remove(t){this.has(t)&&JD(this.cache,t)},clear(){this.cache.length=0}}},i3=n=>n,lq=n=>n**3,yoe=n=>n<.5?lq(n*2)/2:1-lq((1-n)*2)/2,Bm=(n="",e,t="")=>{if(n.length>=e)return n;const i=e-n.length,s=Math.floor(i/t.length);return t.repeat(s)+t.slice(0,i%t.length)+n};var uHe=Object.defineProperty,cq=Object.getOwnPropertySymbols,hHe=Object.prototype.hasOwnProperty,fHe=Object.prototype.propertyIsEnumerable,dq=(n,e,t)=>e in n?uHe(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,gHe=(n,e)=>{for(var t in e||(e={}))hHe.call(e,t)&&dq(n,t,e[t]);if(cq)for(var t of cq(e))fHe.call(e,t)&&dq(n,t,e[t]);return n},lA=(n,e,t)=>new Promise((i,s)=>{var o=l=>{try{a(t.next(l))}catch(c){s(c)}},r=l=>{try{a(t.throw(l))}catch(c){s(c)}},a=l=>l.done?i(l.value):Promise.resolve(l.value).then(o,r);a((t=t.apply(n,e)).next())});const pHe="background-image",mHe="lazy-loading",_He="lazy-error",uq="lazy-attempt",vHe=["scroll","wheel","mousewheel","resize","animationend","transitionend","touchmove"],n3="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==",a0=[],uT=[],Soe=dHe(100),Ks={loading:n3,error:n3,attempt:3,throttleWait:300,events:vHe};let T6=YB(JS,Ks.throttleWait);function cA(n,e){n._lazy.arg===pHe?n.style.backgroundImage="url(".concat(e,")"):n.setAttribute("src",e)}function bHe(n){n._lazy.loading&&cA(n,n._lazy.loading),JS()}function CHe(n){n._lazy.error&&cA(n,n._lazy.error),n._lazy.state="error",N6(n),JS()}function Loe(n,e){cA(n,e),n._lazy.state="success",N6(n),JS()}function wHe(n){var e;uT.includes(n)||(uT.push(n),(e=Ks.events)==null||e.forEach(t=>{n.addEventListener(t,T6,{passive:!0})}))}function yHe(){uT.forEach(n=>{var e;(e=Ks.events)==null||e.forEach(t=>{n.removeEventListener(t,T6)})}),uT.length=0}function SHe(n,e){var t,i;const s={loading:(t=n.getAttribute(mHe))!=null?t:Ks.loading,error:(i=n.getAttribute(_He))!=null?i:Ks.error,attempt:n.getAttribute(uq)?Number(n.getAttribute(uq)):Ks.attempt};n._lazy=gHe({src:e.value,arg:e.arg,currentAttempt:0,state:"pending",attemptLock:!1},s),cA(n,n3),oe(Ks.filter,n._lazy)}function LHe(n,e){const t=new Image;t.src=e,n._lazy.preloadImage=t,t.addEventListener("load",()=>{n._lazy.attemptLock=!1,Soe.add(e),Loe(n,e)}),t.addEventListener("error",()=>{n._lazy.attemptLock=!1,n._lazy.currentAttempt>=n._lazy.attempt?CHe(n):koe(n)})}function koe(n){if(n._lazy.attemptLock)return;n._lazy.attemptLock=!0,n._lazy.currentAttempt++;const{src:e}=n._lazy;if(Soe.has(e)){Loe(n,e),n._lazy.attemptLock=!1;return}bHe(n),LHe(n,e)}function x6(n){return lA(this,null,function*(){yield Cr(),Ehe(n)&&koe(n)})}function JS(){a0.forEach(n=>x6(n))}function kHe(n){return lA(this,null,function*(){!a0.includes(n)&&a0.push(n),DVe(n).forEach(wHe),yield x6(n)})}function N6(n){JD(a0,n),a0.length===0&&yHe()}function DHe(n,e){const{src:t,arg:i}=n._lazy;return t!==e.value||i!==e.arg}function Doe(n,e){return lA(this,null,function*(){SHe(n,e),yield kHe(n)})}function EHe(n,e){return lA(this,null,function*(){if(!DHe(n,e)){a0.includes(n)&&(yield x6(n));return}yield Doe(n,e)})}function IHe(n={}){const{events:e,loading:t,error:i,attempt:s,throttleWait:o,filter:r}=n;Ks.events=e!=null?e:Ks.events,Ks.loading=t!=null?t:Ks.loading,Ks.error=i!=null?i:Ks.error,Ks.attempt=s!=null?s:Ks.attempt,Ks.throttleWait=o!=null?o:Ks.throttleWait,Ks.filter=r}const THe={mounted:Doe,unmounted:N6,updated:EHe,install(n,e){IHe(e),T6=YB(JS,Ks.throttleWait),n.directive("lazy",this)}};var zy=THe;const xHe={round:{type:Boolean,default:!0},size:{type:[String,Number],default:"normal"},alt:String,color:String,src:String,fit:{type:String,default:"cover"},bordered:Boolean,borderColor:String,loading:String,error:String,lazy:Boolean,hoverable:Boolean,onClick:Se(),onLoad:Se(),onError:Se()},NHe=n=>["mini","small","normal","large"].includes(n),{name:AHe,n:MHe,classes:RHe}=st("avatar"),PHe=["src","alt","lazy-loading","lazy-error"],OHe=["src","alt"];function FHe(n,e){const t=hn("lazy");return q(),re("div",{ref:"avatarElement",class:B(n.classes(n.n(),n.n("$--box"),[n.isInternalSize(n.size),n.n("--".concat(n.size))],[n.round,n.n("--round")],[n.bordered,n.n("--bordered")],[n.hoverable,n.n("--hoverable")])),style:Fe({width:n.isInternalSize(n.size)?void 0:n.toSizeUnit(n.size),height:n.isInternalSize(n.size)?void 0:n.toSizeUnit(n.size),borderColor:n.borderColor,backgroundColor:n.color}),onClick:e[3]||(e[3]=(...i)=>n.handleClick&&n.handleClick(...i))},[n.src?(q(),re(li,{key:0},[n.lazy?wi((q(),re("img",{key:0,class:B(n.n("image")),src:n.src,alt:n.alt,style:Fe({objectFit:n.fit}),"lazy-loading":n.loading,"lazy-error":n.error,onLoad:e[0]||(e[0]=(...i)=>n.handleLoad&&n.handleLoad(...i))},null,46,PHe)),[[t,n.src]]):(q(),re("img",{key:1,class:B(n.n("image")),src:n.src,alt:n.alt,style:Fe({objectFit:n.fit}),onLoad:e[1]||(e[1]=(...i)=>n.handleLoad&&n.handleLoad(...i)),onError:e[2]||(e[2]=(...i)=>n.handleError&&n.handleError(...i))},null,46,OHe))],64)):(q(),re("div",{key:1,ref:"textElement",class:B(n.n("text")),style:Fe({transform:"scale(".concat(n.scale,")")})},[xe(n.$slots,"default")],6))],6)}const Eoe=et({name:AHe,directives:{Lazy:zy},props:xHe,setup(n){const e=se(null),t=se(null),i=se(1);Vo(s),Cg(s);function s(){if(!e.value||!t.value){i.value=1;return}const l=e.value.offsetWidth,c=t.value.offsetWidth;l>c?i.value=1:i.value=l/c}function o(l){const c=l.currentTarget,{lazy:d,onLoad:u,onError:h}=n;d?(c._lazy.state==="success"&&oe(u,l),c._lazy.state==="error"&&oe(h,l)):oe(u,l)}function r(l){oe(n.onError,l)}function a(l){oe(n.onClick,l)}return{avatarElement:e,textElement:t,scale:i,n:MHe,classes:RHe,isInternalSize:NHe,toSizeUnit:ri,handleLoad:o,handleError:r,handleClick:a}}});Eoe.render=FHe;var Ioe=Eoe;lt(Ioe);var s3=Ioe;const BHe={offset:[Number,String],vertical:Boolean},{name:WHe,n:VHe,classes:HHe}=st("avatar-group");function $He(n,e){return q(),re("div",{class:B(n.classes(n.n(),[n.vertical,n.n("--column"),n.n("--row")])),style:Fe(n.rootStyles)},[xe(n.$slots,"default")],6)}const Toe=et({name:WHe,props:BHe,setup(n){return{rootStyles:ve(()=>n.offset==null?{}:{"--avatar-group-offset":ri(n.offset)}),n:VHe,classes:HHe,toSizeUnit:ri}}});Toe.render=$He;var xoe=Toe;lt(xoe);var o3=xoe;const hf={type:{type:String,default:"circle"},radius:[String,Number],size:{type:String,default:"normal"},color:String,description:String,loading:Boolean},{name:zHe,n:UHe,classes:jHe}=st("loading"),KHe=n=>(vg(""),n=n(),bg(),n),qHe=KHe(()=>me("svg",{viewBox:"25 25 50 50"},[me("circle",{cx:"50",cy:"50",r:"20",fill:"none"})],-1)),GHe=[qHe];function YHe(n,e){return q(),re("div",{class:B(n.n())},[n.$slots.default?(q(),re("div",{key:0,class:B(n.classes(n.n("content"),[n.loading,n.n("content--active")]))},[xe(n.$slots,"default"),n.loading?(q(),re("div",{key:0,class:B(n.n("content-mask"))},null,2)):Qe("v-if",!0)],2)):Qe("v-if",!0),n.isShow?(q(),re("div",{key:1,class:B(n.classes(n.n("$--box"),n.n("body"),[n.$slots.default,n.n("inside")]))},[n.type==="circle"?(q(),re("div",{key:0,class:B(n.n("circle"))},[me("span",{class:B(n.classes(n.n("circle-block"),n.n("circle-block--".concat(n.size)))),style:Fe({width:n.multiplySizeUnit(n.radius,2),height:n.multiplySizeUnit(n.radius,2),color:n.color})},GHe,6)],2)):Qe("v-if",!0),(q(!0),re(li,null,ss(n.loadingTypeDict,(t,i)=>(q(),re(li,{key:i},[n.type===i?(q(),re("div",{key:0,class:B(n.classes(n.n(i),n.n("".concat(i,"--").concat(n.size))))},[(q(!0),re(li,null,ss(t,s=>(q(),re("div",{key:s+i,style:Fe({backgroundColor:n.color}),class:B(n.classes(n.n("".concat(i,"-item")),n.n("".concat(i,"-item--").concat(n.size))))},null,6))),128))],2)):Qe("v-if",!0)],64))),128)),n.$slots.description||n.description?(q(),re("div",{key:1,class:B(n.classes(n.n("description"),n.n("description--".concat(n.size)))),style:Fe({color:n.color})},[xe(n.$slots,"description",{},()=>[Mi(ut(n.description),1)])],6)):Qe("v-if",!0)],2)):Qe("v-if",!0)],2)}const Noe=et({name:zHe,props:hf,setup(n,{slots:e}){const t=ve(()=>oe(e.default)?n.loading:!0);return{loadingTypeDict:{wave:5,cube:4,rect:8,disappear:3},isShow:t,n:UHe,classes:jHe,multiplySizeUnit:dr}}});Noe.render=YHe;var Aoe=Noe;lt(Aoe);var l0=Aoe;const ZHe={hovering:{type:Boolean,default:!0}},{name:XHe,n:QHe,classes:JHe}=st("hover-overlay");function e$e(n,e){return q(),re("div",{class:B(n.classes(n.n(),[n.hovering,n.n("--hovering")]))},null,2)}const Moe=et({name:XHe,props:ZHe,setup:()=>({n:QHe,classes:JHe})});Moe.render=e$e;var Roe=Moe;lt(Roe);function Pd(){const n=se(!1);return{hovering:n,handleHovering:t=>{n.value=t}}}var ml=Roe;function Poe(n){if(!n)return!1;const e=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);return!!(n==="desktop"&&e||n==="mobile"&&!e)}function t$e(n){const e=n.getAttribute("style");return e?e.split(";").filter(Boolean).reduce((t,i)=>{const[s,o]=i.split(":").map(r=>r.trim());return t[ZB(s)]=o,t},{}):{}}function i$e(n){const{value:e}=n._hover,t=t$e(n);Object.keys(e).forEach(i=>{const s=ZB(i);e[s]!=null&&t[s]&&(n._hover.rawStyle[s]=t[s])})}function A6(n,e){Object.keys(e).forEach(t=>{const i=e[t];i!=null&&(n.style[t]=i)})}function n$e(n){Object.keys(n._hover.value).forEach(e=>{n._hover.value[e]!=null&&(n.style[e]="")})}function Ooe(n){n$e(n),A6(n,n._hover.rawStyle)}function Foe(){const{value:n}=this._hover;if(this._hover.hovering=!0,v0(n)){n(this._hover.hovering);return}A6(this,n)}function Boe(){if(this._hover.hovering=!1,v0(this._hover.value)){this._hover.value(this._hover.hovering);return}Ooe(this)}function Woe(n,e){var t,i;const{arg:s,value:o}=e;Poe(s)||(n._hover={value:o,hovering:(i=(t=n._hover)==null?void 0:t.hovering)!=null?i:!1,rawStyle:{}},i$e(n),n.addEventListener("mouseenter",Foe),n.addEventListener("mouseleave",Boe))}function Voe(n,e){Poe(e.arg)||(Ooe(n),n.removeEventListener("mouseenter",Foe),n.removeEventListener("mouseleave",Boe))}function s$e(n,e){n._hover&&Voe(n,e)}function o$e(n,e){return!v0(e.value)&&n._hover.hovering}function r$e(n,e){Woe(n,e),o$e(n,e)&&A6(n,e.value)}const a$e={mounted:Woe,unmounted:Voe,beforeUpdate:s$e,updated:r$e,install(n){n.directive("hover",this)}};var Fa=a$e,l$e=Object.defineProperty,c$e=Object.defineProperties,d$e=Object.getOwnPropertyDescriptors,hq=Object.getOwnPropertySymbols,u$e=Object.prototype.hasOwnProperty,h$e=Object.prototype.propertyIsEnumerable,fq=(n,e,t)=>e in n?l$e(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,f$e=(n,e)=>{for(var t in e||(e={}))u$e.call(e,t)&&fq(n,t,e[t]);if(hq)for(var t of hq(e))h$e.call(e,t)&&fq(n,t,e[t]);return n},g$e=(n,e)=>c$e(n,d$e(e));const p$e={type:String,nativeType:{type:String,default:"button"},size:String,loading:Boolean,round:Boolean,block:Boolean,text:Boolean,outline:Boolean,disabled:Boolean,autoLoading:Boolean,ripple:{type:Boolean,default:!0},color:String,textColor:String,elevation:{type:[Boolean,Number,String],default:!0},loadingRadius:[Number,String],loadingType:yi(hf,"type"),loadingSize:yi(hf,"size"),loadingColor:g$e(f$e({},yi(hf,"color")),{default:"currentColor"}),onClick:Se(),onTouchstart:Se()},Hoe=Symbol("BUTTON_GROUP_BIND_BUTTON_KEY");function m$e(){const{bindChildren:n,childProviders:e,length:t}=$o(Hoe);return{length:t,buttons:e,bindButtons:n}}function _$e(){const{bindParent:n,parentProvider:e,index:t}=Ho(Hoe);return{index:t,buttonGroup:e,bindButtonGroup:n}}const{name:v$e,n:b$e,classes:C$e}=st("button"),w$e=["type","disabled"];function y$e(n,e){const t=gt("var-loading"),i=gt("var-hover-overlay"),s=hn("ripple"),o=hn("hover");return wi((q(),re("button",{class:B(n.classes(n.n(),n.n("$--box"),n.n("--".concat(n.states.size)),[n.block,"".concat(n.n("$--flex")," ").concat(n.n("--block")),n.n("$--inline-flex")],[n.disabled,n.n("--disabled")],[n.states.text,"".concat(n.n("--text-".concat(n.states.type))," ").concat(n.n("--text")),"".concat(n.n("--".concat(n.states.type))," ").concat(n.states.elevation)],[n.states.text&&n.disabled,n.n("--text-disabled")],[n.round,n.n("--round")],[n.states.outline,n.n("--outline")])),style:Fe({color:n.states.textColor,background:n.states.color}),type:n.nativeType,disabled:n.disabled,onClick:e[0]||(e[0]=(...r)=>n.handleClick&&n.handleClick(...r)),onTouchstart:e[1]||(e[1]=(...r)=>n.handleTouchstart&&n.handleTouchstart(...r))},[n.loading||n.pending?(q(),ei(t,{key:0,class:B(n.n("loading")),"var-button-cover":"",color:n.loadingColor,type:n.loadingType,size:n.loadingSize,radius:n.loadingRadius},null,8,["class","color","type","size","radius"])):Qe("v-if",!0),me("div",{class:B(n.classes(n.n("content"),[n.loading||n.pending,n.n("--hidden")]))},[xe(n.$slots,"default")],2),Oe(i,{hovering:n.disabled?!1:n.hovering},null,8,["hovering"])],46,w$e)),[[s,{disabled:n.disabled||!n.ripple}],[o,n.handleHovering,"desktop"]])}const $oe=et({name:v$e,components:{VarLoading:l0,VarHoverOverlay:ml},directives:{Ripple:Ns,Hover:Fa},props:p$e,setup(n){const e=se(!1),{buttonGroup:t}=_$e(),{hovering:i,handleHovering:s}=Pd(),o=ve(()=>{if(!t)return{elevation:or(n.elevation,2),type:n.type!=null?n.type:"default",size:n.size!=null?n.size:"normal",color:n.color,text:n.text,textColor:n.textColor,outline:n.outline};const{type:c,size:d,color:u,textColor:h,mode:f}=t;return{elevation:"",type:n.type!=null?n.type:c.value,size:n.size!=null?n.size:d.value,color:n.color!=null?n.color:u.value,textColor:n.textColor!=null?n.textColor:h.value,text:f.value!=="normal",outline:f.value==="outline"}});function r(c){n.autoLoading&&(e.value=!0,c=tn(c)?c:[c],Promise.all(c).then(()=>{e.value=!1}).catch(()=>{e.value=!1}))}function a(c){const{loading:d,disabled:u,onClick:h}=n;!h||d||u||e.value||r(oe(h,c))}function l(c){const{loading:d,disabled:u,onTouchstart:h}=n;!h||d||u||e.value||r(oe(h,c))}return{pending:e,states:o,hovering:i,n:b$e,classes:C$e,handleHovering:s,handleClick:a,handleTouchstart:l}}});$oe.render=y$e;var zoe=$oe;lt(zoe);var ia=zoe;const S$e={visibilityHeight:{type:[Number,String],default:200},duration:{type:Number,default:300},right:[Number,String],elevation:{type:[Boolean,Number,String],default:!0},bottom:[Number,String],target:[String,Object],onClick:Se()},{name:L$e,n:k$e,classes:D$e}=st("back-top");function E$e(n,e){const t=gt("var-icon"),i=gt("var-button");return q(),ei(Bd,{to:"body",disabled:n.disabled},[me("div",fn({class:n.classes(n.n(),[n.show,n.n("--active")]),ref:"backTopEl",style:{right:n.toSizeUnit(n.right),bottom:n.toSizeUnit(n.bottom)}},n.$attrs,{onClick:e[0]||(e[0]=Ia((...s)=>n.handleClick&&n.handleClick(...s),["stop"]))}),[xe(n.$slots,"default",{},()=>[Oe(i,{elevation:n.elevation,type:"primary",round:"","var-back-top-cover":""},{default:Lt(()=>[Oe(t,{name:"chevron-up"})]),_:1},8,["elevation"])])],16)],8,["disabled"])}const Uoe=et({name:L$e,components:{VarButton:ia,VarIcon:Wn},inheritAttrs:!1,props:S$e,setup(n){const e=se(!1),t=se(null),i=se(!0);let s;const o=YB(()=>{e.value=hb(s)>=jn(n.visibilityHeight)},200);bd(()=>{a(),l(),i.value=!1}),eh(l),rA(c);function r(d){oe(n.onClick,d);const u=GB(s);$y(s,{left:u,duration:n.duration,animation:yoe})}function a(){s=n.target?ooe(n.target,"BackTop"):pg(t.value)}function l(){s.addEventListener("scroll",o)}function c(){s.removeEventListener("scroll",o)}return{disabled:i,show:e,backTopEl:t,toSizeUnit:ri,n:k$e,classes:D$e,handleClick:r}}});Uoe.render=E$e;var joe=Uoe;lt(joe);var r3=joe;const I$e={type:{type:String,default:"default"},position:{type:String,default:"right-top"},hidden:Boolean,value:{type:[String,Number],default:0},maxValue:[String,Number],dot:Boolean,icon:yi(Ss,"name"),namespace:yi(Ss,"namespace"),color:String},{name:T$e,n:x$e,classes:N$e}=st("badge");function A$e(n,e){const t=gt("var-icon");return q(),re("div",{class:B(n.classes(n.n(),n.n("$--box")))},[xe(n.$slots,"default"),Oe(On,{name:n.n("$-badge-fade"),persisted:""},{default:Lt(()=>[wi(me("span",fn({class:n.classes(n.n("content"),n.n("--".concat(n.type)),[n.$slots.default,n.n("--".concat(n.position))],[n.dot,n.n("--dot")],[n.icon,n.n("--icon")]),style:{background:n.color}},n.$attrs),[n.icon?(q(),ei(t,{key:0,class:B(n.n("icon")),"var-badge-cover":"",name:n.icon,namespace:n.namespace},null,8,["class","name","namespace"])):Qe("v-if",!0),xe(n.$slots,"value",{},()=>[!n.icon&&!n.dot?(q(),re("span",{key:0,class:B(n.n("value"))},ut(n.value),3)):Qe("v-if",!0)])],16),[[hl,!n.hidden]])]),_:3},8,["name"])],2)}const Koe=et({name:T$e,components:{VarIcon:Wn},inheritAttrs:!1,props:I$e,setup(n){return{value:ve(()=>{const{value:t,maxValue:i}=n;return t!=null&&i!=null&&Ie(t)>Ie(i)?"".concat(i,"+"):t}),n:x$e,classes:N$e}}});Koe.render=A$e;var qoe=Koe;lt(qoe);var hT=qoe;const M$e={active:{type:[Number,String],default:0},zIndex:{type:[Number,String],default:1},fixed:Boolean,border:Boolean,safeArea:Boolean,activeColor:String,inactiveColor:String,fabProps:Object,onChange:Se(),onBeforeChange:Se(),onFabClick:Se(),"onUpdate:active":Se()},Goe=Symbol("BOTTOM_NAVIGATION_BIND_BOTTOM_NAVIGATION_ITEM_KEY");function R$e(){const{childProviders:n,length:e,bindChildren:t}=$o(Goe);return{length:e,bottomNavigationItems:n,bindBottomNavigationItem:t}}var P$e=Object.defineProperty,gq=Object.getOwnPropertySymbols,O$e=Object.prototype.hasOwnProperty,F$e=Object.prototype.propertyIsEnumerable,pq=(n,e,t)=>e in n?P$e(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,mq=(n,e)=>{for(var t in e||(e={}))O$e.call(e,t)&&pq(n,t,e[t]);if(gq)for(var t of gq(e))F$e.call(e,t)&&pq(n,t,e[t]);return n};const{name:B$e,n:W$e,classes:V$e}=st("bottom-navigation"),{n:dA}=st("bottom-navigation-item"),_q=dA("--right-half-space"),vq=dA("--left-half-space"),bq=dA("--right-space"),H$e={type:"primary"};function $$e(n,e){const t=gt("var-button");return q(),re("div",{class:B(n.classes(n.n(),n.n("$--box"),[n.fixed,n.n("--fixed")],[n.border,n.n("--border")],[n.safeArea,n.n("--safe-area")])),ref:"bottomNavigationDom",style:Fe("z-index:".concat(n.zIndex))},[xe(n.$slots,"default"),n.$slots.fab?(q(),ei(t,fn({key:0,class:n.classes(n.n("fab"),[n.length%2,n.n("--fab-right"),n.n("--fab-center")]),"var-bottom-navigation__fab":"",onClick:n.handleFabClick},n.fabProps,{round:""}),{default:Lt(()=>[xe(n.$slots,"fab")]),_:3},16,["class","onClick"])):Qe("v-if",!0)],6)}const Yoe=et({name:B$e,components:{VarButton:ia},props:M$e,setup(n,{slots:e}){const t=se(null),i=ve(()=>n.active),s=ve(()=>n.activeColor),o=ve(()=>n.inactiveColor),r=se({}),{length:a,bottomNavigationItems:l,bindBottomNavigationItem:c}=R$e();c({active:i,activeColor:s,inactiveColor:o,onToggle:p}),ht(()=>a.value,u),ht(()=>n.fabProps,S=>{r.value=mq(mq({},H$e),S)},{immediate:!0,deep:!0}),Vo(()=>{e.fab&&C(a.value)}),Cg(()=>{b(),e.fab&&C(a.value)});function u(){a.value===0||h()||f()||g()}function h(){return l.find(({name:S})=>i.value===S.value)}function f(){return l.find(({index:S})=>i.value===S.value)}function g(){qr(i.value)&&(i.value<0?oe(n["onUpdate:active"],0):i.value>a.value-1&&oe(n["onUpdate:active"],a.value-1))}function p(S){i.value!==S&&(n.onBeforeChange?_(S):v(S))}function _(S){const k=qk(oe(n.onBeforeChange,S));Promise.all(k).then(D=>{D.every(Boolean)&&v(S)})}function v(S){oe(n["onUpdate:active"],S),oe(n.onChange,S)}function b(){y().forEach(k=>{k.classList.remove(_q,vq,bq)})}function C(S){const k=y(),D=k.length,x=S%2===0;k.forEach((A,T)=>{w(x,A,T,D)})}function w(S,k,D,x){const A=D===x-1;if(!S&&A){k.classList.add(bq);return}const T=D===x/2-1,P=D===x/2;T?k.classList.add(_q):P&&k.classList.add(vq)}function y(){return Array.from(t.value.querySelectorAll(".".concat(dA())))}function L(){oe(n.onFabClick)}return{length:a,bottomNavigationDom:t,fabProps:r,n:W$e,classes:V$e,handleFabClick:L}}});Yoe.render=$$e;var Zoe=Yoe;lt(Zoe);var a3=Zoe;const z$e={name:String,label:String,icon:yi(Ss,"name"),namespace:yi(Ss,"namespace"),badge:{type:[Boolean,Object],default:!1},onClick:Se()};function U$e(){const{parentProvider:n,index:e,bindParent:t}=Ho(Goe);return t||Oa("BottomNavigationItem"," must in "),{index:e,bottomNavigation:n,bindBottomNavigation:t}}const{name:j$e,n:K$e,classes:q$e}=st("bottom-navigation-item"),G$e={type:"danger",dot:!0};function Y$e(n,e){const t=gt("var-icon"),i=gt("var-badge"),s=hn("ripple");return wi((q(),re("button",{class:B(n.classes(n.n(),n.n("$--box"),[n.active===n.index||n.active===n.name,n.n("--active")])),style:Fe({color:n.computeColorStyle()}),onClick:e[0]||(e[0]=(...o)=>n.handleClick&&n.handleClick(...o))},[n.icon&&!n.$slots.icon?(q(),ei(t,{key:0,name:n.icon,namespace:n.namespace,class:B(n.n("icon")),"var-bottom-navigation-item-cover":""},null,8,["name","namespace","class"])):Qe("v-if",!0),xe(n.$slots,"icon",{active:n.active===n.index||n.active===n.name}),n.badge?(q(),ei(i,fn({key:1},n.badgeProps,{class:n.n("badge"),"var-bottom-navigation-item-cover":""}),null,16,["class"])):Qe("v-if",!0),me("span",{class:B(n.n("label"))},[n.$slots.default?Qe("v-if",!0):(q(),re(li,{key:0},[Mi(ut(n.label),1)],64)),xe(n.$slots,"default")],2)],6)),[[s]])}const Xoe=et({name:j$e,components:{VarBadge:hT,VarIcon:Wn},directives:{Ripple:Ns},props:z$e,setup(n){const e=ve(()=>n.name),t=ve(()=>n.badge),i=se({}),{index:s,bottomNavigation:o,bindBottomNavigation:r}=U$e(),{active:a,activeColor:l,inactiveColor:c}=o;r({name:e,index:s}),ht(()=>t.value,f=>{i.value=f===!0?G$e:t.value},{immediate:!0});function u(){return a.value===e.value||a.value===s.value?l.value:c.value}function h(){var f;const g=(f=e.value)!=null?f:s.value;oe(n.onClick,g),oe(o.onToggle,g)}return{index:s,active:a,badge:t,badgeProps:i,n:K$e,classes:q$e,computeColorStyle:u,handleClick:h}}});Xoe.render=Y$e;var Qoe=Xoe;lt(Qoe);var l3=Qoe;const Z$e={separator:String,onClick:Se()},Joe=Symbol("BREADCRUMBS_BIND_BREADCRUMB_KEY");function X$e(){const{childProviders:n,bindChildren:e,length:t}=$o(Joe);return{length:t,breadcrumbList:n,bindBreadcrumbList:e}}function Q$e(){const{parentProvider:n,bindParent:e,index:t}=Ho(Joe);return e||Oa("Breadcrumb"," must in "),{index:t,breadcrumb:n,bindBreadcrumb:e}}const{name:J$e,n:eze,classes:tze}=st("breadcrumb");function ize(n,e){return q(),re("div",{class:B(n.n())},[me("div",{class:B(n.classes(n.n("content"),[!n.isLast,n.n("--active")])),onClick:e[0]||(e[0]=(...t)=>n.handleClick&&n.handleClick(...t))},[xe(n.$slots,"default")],2),n.isLast?Qe("v-if",!0):xe(n.$slots,"separator",{key:0},()=>{var t;return[me("div",{class:B(n.n("separator"))},ut((t=n.separator)!=null?t:n.parentSeparator),3)]})],2)}const ere=et({name:J$e,props:Z$e,setup(n){const{index:e,breadcrumb:t,bindBreadcrumb:i}=Q$e(),s=ve(()=>e.value===t.length.value-1),o=ve(()=>t.separator.value);i(null);function r(a){s.value||oe(n.onClick,a)}return{n:eze,classes:tze,isLast:s,parentSeparator:o,handleClick:r}}});ere.render=ize;var tre=ere;lt(tre);var c3=tre;const nze={separator:{type:String,default:"/"}},{name:sze,n:oze}=st("breadcrumbs");function rze(n,e){return q(),re("div",{class:B(n.n())},[xe(n.$slots,"default")],2)}const ire=et({name:sze,props:nze,setup(n){const e=ve(()=>n.separator),{bindBreadcrumbList:t,length:i}=X$e();return t({length:i,separator:e}),{n:oze}}});ire.render=rze;var nre=ire;lt(nre);var d3=nre;const aze={type:{type:String,default:"default"},size:{type:String,default:"normal"},color:String,textColor:String,mode:{type:String,default:"normal"},elevation:{type:[Boolean,Number,String],default:!0},vertical:Boolean},{name:lze,n:cze,classes:dze}=st("button-group");function uze(n,e){return q(),re("div",{class:B(n.classes(n.n(),n.n("$--box"),[n.mode,"".concat(n.n("--mode-".concat(n.mode)))],[n.vertical,n.n("--vertical"),n.n("--horizontal")],[n.mode==="normal",n.formatElevation(n.elevation,2)]))},[xe(n.$slots,"default")],2)}const sre=et({name:lze,props:aze,setup(n){const{bindButtons:e}=m$e(),t={elevation:ve(()=>n.elevation),type:ve(()=>n.type),size:ve(()=>n.size),color:ve(()=>n.color),textColor:ve(()=>n.textColor),mode:ve(()=>n.mode)};return e(t),{n:cze,classes:dze,formatElevation:or}}});sre.render=uze;var ore=sre;lt(ore);var u3=ore;const hze={src:String,fit:{type:String,default:"cover"},imageHeight:[String,Number],imageWidth:[String,Number],outline:Boolean,layout:{type:String,default:"column"},floating:Boolean,floatingDuration:{type:Number,default:250},alt:String,title:String,subtitle:String,description:String,elevation:{type:[Boolean,Number,String],default:!0},ripple:Boolean,onClick:Se(),"onUpdate:floating":Se()};var Cq=(n,e,t)=>new Promise((i,s)=>{var o=l=>{try{a(t.next(l))}catch(c){s(c)}},r=l=>{try{a(t.throw(l))}catch(c){s(c)}},a=l=>l.done?i(l.value):Promise.resolve(l.value).then(o,r);a((t=t.apply(n,e)).next())});const{name:fze,n:gze,classes:pze}=st("card"),mze=500,_ze=["src","alt"];function vze(n,e){const t=gt("var-icon"),i=gt("var-button"),s=hn("ripple");return wi((q(),re("div",{ref:"card",class:B(n.classes(n.n(),[n.isRow,n.n("--layout-row")],[n.outline,n.n("--outline")],n.formatElevation(n.elevation,1))),style:Fe({zIndex:n.floated?n.zIndex:void 0}),onClick:e[0]||(e[0]=(...o)=>n.handleClick&&n.handleClick(...o))},[me("div",{ref:"cardFloater",class:B(n.n("floater")),style:Fe({width:n.floaterWidth,height:n.floaterHeight,top:n.floaterTop,left:n.floaterLeft,overflow:n.floaterOverflow,position:n.floaterPosition,transition:n.floated?"background-color ".concat(n.floatingDuration,"ms, color ").concat(n.floatingDuration,"ms, width ").concat(n.floatingDuration,"ms, height ").concat(n.floatingDuration,"ms, top ").concat(n.floatingDuration,"ms, left ").concat(n.floatingDuration,"ms"):void 0})},[xe(n.$slots,"image",{},()=>[n.src?(q(),re("img",{key:0,class:B(n.n("image")),style:Fe({objectFit:n.fit,height:n.toSizeUnit(n.imageHeight),width:n.toSizeUnit(n.imageWidth)}),src:n.src,alt:n.alt},null,14,_ze)):Qe("v-if",!0)]),me("div",{class:B(n.n("container"))},[xe(n.$slots,"title",{},()=>[n.title?(q(),re("div",{key:0,class:B(n.n("title"))},ut(n.title),3)):Qe("v-if",!0)]),xe(n.$slots,"subtitle",{},()=>[n.subtitle?(q(),re("div",{key:0,class:B(n.n("subtitle"))},ut(n.subtitle),3)):Qe("v-if",!0)]),xe(n.$slots,"description",{},()=>[n.description?(q(),re("div",{key:0,class:B(n.n("description"))},ut(n.description),3)):Qe("v-if",!0)]),n.$slots.extra?(q(),re("div",{key:0,class:B(n.n("footer"))},[xe(n.$slots,"extra")],2)):Qe("v-if",!0),n.$slots["floating-content"]&&!n.isRow?(q(),re("div",{key:1,class:B(n.n("floating-content")),style:Fe({height:n.contentHeight,opacity:n.opacity,transition:"opacity ".concat(n.floatingDuration*2,"ms")})},[xe(n.$slots,"floating-content")],6)):Qe("v-if",!0)],2),n.showFloatingButtons?(q(),re("div",{key:0,class:B(n.classes(n.n("floating-buttons"),n.n("$--box"))),style:Fe({zIndex:n.zIndex,opacity:n.opacity,transition:"opacity ".concat(n.floatingDuration*2,"ms")})},[xe(n.$slots,"close-button",{},()=>[Oe(i,{"var-card-cover":"",round:"",class:B(n.classes(n.n("close-button"),n.n("$-elevation--6"))),onClick:Ia(n.close,["stop"])},{default:Lt(()=>[Oe(t,{"var-card-cover":"",name:"window-close",class:B(n.n("close-button-icon"))},null,8,["class"])]),_:1},8,["class","onClick"])])],6)):Qe("v-if",!0)],6),me("div",{class:B(n.n("holder")),style:Fe({width:n.holderWidth,height:n.holderHeight})},null,6)],6)),[[s,{disabled:!n.ripple||n.floater}]])}const rre=et({name:fze,directives:{Ripple:Ns},components:{VarIcon:Wn,VarButton:ia},props:hze,setup(n){const e=se(null),t=se(null),i=se("auto"),s=se("auto"),o=se("100%"),r=se("100%"),a=se("auto"),l=se("auto"),c=se(void 0),d=se("hidden"),u=se("0px"),h=se("0"),f=ve(()=>n.layout==="row"),g=se(!1),p=se(!1),{zIndex:_}=QS(()=>n.floating,1);let v="auto",b="auto",C=null;const w=se(null);XS(()=>n.floating,()=>!f.value),ht(()=>n.floating,D=>{f.value||Fn(()=>{D?y():L()})},{immediate:!0});function y(){return Cq(this,null,function*(){clearTimeout(w.value),clearTimeout(C),w.value=null,w.value=setTimeout(()=>Cq(this,null,function*(){const{width:D,height:x,left:A,top:T}=no(e.value);i.value=ri(D),s.value=ri(x),o.value=i.value,r.value=s.value,a.value=ri(T),l.value=ri(A),c.value="fixed",v=a.value,b=l.value,g.value=!0,yield Cr(),a.value="0",l.value="0",o.value="100vw",r.value="100vh",u.value="auto",h.value="1",d.value="auto",p.value=!0}),n.ripple?mze:0)})}function L(){clearTimeout(C),clearTimeout(w.value),w.value=null,o.value=i.value,r.value=s.value,a.value=v,l.value=b,u.value="0px",h.value="0",g.value=!1,C=setTimeout(()=>{i.value="auto",s.value="auto",o.value="100%",r.value="100%",a.value="auto",l.value="auto",v="auto",b="auto",d.value="hidden",c.value=void 0,p.value=!1},n.floatingDuration)}function S(){oe(n["onUpdate:floating"],!1)}function k(D){oe(n.onClick,D)}return{card:e,cardFloater:t,holderWidth:i,holderHeight:s,floater:w,floaterWidth:o,floaterHeight:r,floaterTop:a,floaterLeft:l,floaterPosition:c,floaterOverflow:d,contentHeight:u,opacity:h,zIndex:_,isRow:f,showFloatingButtons:g,floated:p,n:gze,classes:pze,toSizeUnit:ri,close:S,formatElevation:or,handleClick:k}}});rre.render=vze;var are=rre;lt(are);var h3=are;const bze={title:[Number,String],icon:yi(Ss,"name"),namespace:yi(Ss,"namespace"),description:String,border:Boolean,borderOffset:[Number,String],iconClass:String,titleClass:String,descriptionClass:String,extraClass:String,ripple:Boolean,onClick:Se()},{name:Cze,n:wze,classes:yze}=st("cell");function Sze(n,e){const t=gt("var-icon"),i=hn("ripple");return wi((q(),re("div",{class:B(n.classes(n.n(),[n.border,n.n("--border")],[n.onClick,n.n("--cursor")])),style:Fe(n.borderOffsetStyles),onClick:e[0]||(e[0]=(...s)=>n.handleClick&&n.handleClick(...s))},[xe(n.$slots,"icon",{},()=>[n.icon?(q(),re("div",{key:0,class:B(n.classes(n.n("icon"),n.iconClass))},[Oe(t,{name:n.icon,namespace:n.namespace},null,8,["name","namespace"])],2)):Qe("v-if",!0)]),me("div",{class:B(n.n("content"))},[xe(n.$slots,"default",{},()=>[n.title?(q(),re("div",{key:0,class:B(n.classes(n.n("title"),n.titleClass))},ut(n.title),3)):Qe("v-if",!0)]),xe(n.$slots,"description",{},()=>[n.description?(q(),re("div",{key:0,class:B(n.classes(n.n("description"),n.descriptionClass))},ut(n.description),3)):Qe("v-if",!0)])],2),n.$slots.extra?(q(),re("div",{key:0,class:B(n.classes(n.n("extra"),n.extraClass))},[xe(n.$slots,"extra")],2)):Qe("v-if",!0)],6)),[[i,{disabled:!n.ripple}]])}const lre=et({name:Cze,components:{VarIcon:Wn},directives:{Ripple:Ns},props:bze,setup(n){const e=ve(()=>n.borderOffset==null?{}:{"--cell-border-left":ri(n.borderOffset),"--cell-border-right":ri(n.borderOffset)});function t(i){oe(n.onClick,i)}return{borderOffsetStyles:e,n:wze,classes:yze,toSizeUnit:ri,handleClick:t}}});lre.render=Sze;var cre=lre;lt(cre);var fT=cre;const Lze={errorMessage:{type:String,default:""},extraMessage:{type:String,default:""}},{name:kze,n:Dze}=st("form-details"),Eze={key:0},Ize={key:0};function Tze(n,e){return q(),ei(On,{name:n.n()},{default:Lt(()=>[n.errorMessage||n.extraMessage||n.$slots["extra-message"]?(q(),re("div",{key:0,class:B(n.n())},[me("div",{class:B(n.n("error-message"))},[Oe(On,{name:n.n("message")},{default:Lt(()=>[n.errorMessage?(q(),re("div",Eze,ut(n.errorMessage),1)):Qe("v-if",!0)]),_:1},8,["name"])],2),me("div",{class:B(n.n("extra-message"))},[Oe(On,{name:n.n("message")},{default:Lt(()=>[xe(n.$slots,"extra-message",{},()=>[n.extraMessage?(q(),re("div",Ize,ut(n.extraMessage),1)):Qe("v-if",!0)])]),_:3},8,["name"])],2)],2)):Qe("v-if",!0)]),_:3},8,["name"])}const dre=et({name:kze,props:Lze,setup:()=>({n:Dze})});dre.render=Tze;var ure=dre;lt(ure);var na=ure;const xze={modelValue:{type:[String,Number,Boolean,Object,Array],default:!1},checkedValue:{type:[String,Number,Boolean,Object,Array],default:!0},uncheckedValue:{type:[String,Number,Boolean,Object,Array],default:!1},checkedColor:String,uncheckedColor:String,disabled:Boolean,readonly:Boolean,indeterminate:Boolean,iconSize:[String,Number],ripple:{type:Boolean,default:!0},validateTrigger:{type:Array,default:()=>["onChange"]},rules:Array,onClick:Se(),onChange:Se(),"onUpdate:modelValue":Se(),"onUpdate:indeterminate":Se()},hre=Symbol("CHECKBOX_GROUP_BIND_CHECKBOX_KEY");function Nze(){const{bindChildren:n,childProviders:e,length:t}=$o(hre);return{length:t,checkboxes:e,bindCheckboxes:n}}function Aze(){const{bindParent:n,parentProvider:e,index:t}=Ho(hre);return{index:t,checkboxGroup:e,bindCheckboxGroup:n}}var Mze=Object.defineProperty,Rze=Object.defineProperties,Pze=Object.getOwnPropertyDescriptors,wq=Object.getOwnPropertySymbols,Oze=Object.prototype.hasOwnProperty,Fze=Object.prototype.propertyIsEnumerable,yq=(n,e,t)=>e in n?Mze(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,Bze=(n,e)=>{for(var t in e||(e={}))Oze.call(e,t)&&yq(n,t,e[t]);if(wq)for(var t of wq(e))Fze.call(e,t)&&yq(n,t,e[t]);return n},Wze=(n,e)=>Rze(n,Pze(e));const fre=Symbol("FORM_BIND_FORM_ITEM_KEY");function kl(){const{parentProvider:n,index:e,bindParent:t}=Ho(fre),i=ih();return{index:e,form:n,bindForm:t?o=>{t(Wze(Bze({},o),{instance:i}))}:null}}function Vze(){const{childProviders:n,length:e,bindChildren:t}=$o(fre);return{length:e,formItems:n,bindFormItems:t}}const{name:Hze,n:$ze,classes:zze}=st("checkbox");function Uze(n,e){const t=gt("var-icon"),i=gt("var-hover-overlay"),s=gt("var-form-details"),o=hn("hover"),r=hn("ripple");return q(),re("div",{class:B(n.n("wrap")),onClick:e[0]||(e[0]=(...a)=>n.handleClick&&n.handleClick(...a))},[me("div",{class:B(n.n())},[wi((q(),re("div",{class:B(n.classes(n.n("action"),[n.checked||n.isIndeterminate,n.n("--checked"),n.n("--unchecked")],[n.errorMessage||n.checkboxGroupErrorMessage,n.n("--error")],[n.formDisabled||n.disabled,n.n("--disabled")])),style:Fe({color:n.checked||n.isIndeterminate?n.checkedColor:n.uncheckedColor})},[n.isIndeterminate?xe(n.$slots,"indeterminate-icon",{key:0},()=>[Oe(t,{class:B(n.classes(n.n("icon"),[n.withAnimation,n.n("--with-animation")])),name:"minus-box",size:n.iconSize,"var-checkbox-cover":""},null,8,["class","size"])]):Qe("v-if",!0),n.checked&&!n.isIndeterminate?xe(n.$slots,"checked-icon",{key:1},()=>[Oe(t,{class:B(n.classes(n.n("icon"),[n.withAnimation,n.n("--with-animation")])),name:"checkbox-marked",size:n.iconSize,"var-checkbox-cover":""},null,8,["class","size"])]):Qe("v-if",!0),!n.checked&&!n.isIndeterminate?xe(n.$slots,"unchecked-icon",{key:2},()=>[Oe(t,{class:B(n.classes(n.n("icon"),[n.withAnimation,n.n("--with-animation")])),name:"checkbox-blank-outline",size:n.iconSize,"var-checkbox-cover":""},null,8,["class","size"])]):Qe("v-if",!0),Oe(i,{hovering:!n.disabled&&!n.formDisabled&&n.hovering},null,8,["hovering"])],6)),[[o,n.handleHovering,"desktop"],[r,{disabled:n.formReadonly||n.readonly||n.formDisabled||n.disabled||!n.ripple}]]),me("div",{class:B(n.classes(n.n("text"),[n.errorMessage||n.checkboxGroupErrorMessage,n.n("--error")],[n.formDisabled||n.disabled,n.n("--disabled")]))},[xe(n.$slots,"default")],2)],2),Oe(s,{"error-message":n.errorMessage},null,8,["error-message"])],2)}const gre=et({name:Hze,directives:{Ripple:Ns,Hover:Fa},components:{VarIcon:Wn,VarFormDetails:na,VarHoverOverlay:ml},props:xze,setup(n){const e=Xu(n,"modelValue"),t=Xu(n,"indeterminate"),i=ve(()=>e.value===n.checkedValue),s=ve(()=>n.checkedValue),o=se(!1),{checkboxGroup:r,bindCheckboxGroup:a}=Aze(),{hovering:l,handleHovering:c}=Pd(),{form:d,bindForm:u}=kl(),{errorMessage:h,validateWithTrigger:f,validate:g,resetValidation:p}=Ll(),_={checkedValue:s,checked:i,sync:w,validate:k,resetValidation:p,reset:L,resetWithAnimation:y};oe(a,_),oe(u,_);function v(D){Fn(()=>{const{validateTrigger:x,rules:A,modelValue:T}=n;f(x,D,A,T)})}function b(D){const{checkedValue:x,onChange:A}=n;e.value=D,t.value=!1,oe(A,e.value),v("onChange"),D===x?r==null||r.onChecked(x):r==null||r.onUnchecked(x)}function C(D){const{disabled:x,readonly:A,checkedValue:T,uncheckedValue:P,onClick:W}=n;if(d!=null&&d.disabled.value||x||(oe(W,D),d!=null&&d.readonly.value||A))return;o.value=!0;const $=r?r.checkedCount.value>=Number(r.max.value):!1;!i.value&&$||b(i.value?P:T)}function w(D){const{checkedValue:x,uncheckedValue:A}=n;e.value=D.includes(x)?x:A}function y(){o.value=!1}function L(){e.value=n.uncheckedValue,p()}function S(D){const{checkedValue:x,uncheckedValue:A}=n;![x,A].includes(D)&&(D=i.value?A:x),b(D)}function k(){return g(n.rules,n.modelValue)}return{isIndeterminate:t,withAnimation:o,checked:i,errorMessage:h,checkboxGroupErrorMessage:r==null?void 0:r.errorMessage,formDisabled:d==null?void 0:d.disabled,formReadonly:d==null?void 0:d.readonly,hovering:l,n:$ze,classes:zze,handleHovering:c,handleClick:C,toggle:S,reset:L,validate:k,resetValidation:p}}});gre.render=Uze;var pre=gre;lt(pre);var Uy=pre;const jze={modelValue:{type:Array,default:()=>[]},max:[String,Number],direction:{type:String,default:"horizontal"},validateTrigger:{type:Array,default:()=>["onChange"]},rules:Array,onChange:Se(),"onUpdate:modelValue":Se()},{name:Kze,n:qze,classes:Gze}=st("checkbox-group");function Yze(n,e){const t=gt("var-form-details");return q(),re("div",{class:B(n.n("wrap"))},[me("div",{class:B(n.classes(n.n(),n.n("--".concat(n.direction))))},[xe(n.$slots,"default")],2),Oe(t,{"error-message":n.errorMessage},null,8,["error-message"])],2)}const mre=et({name:Kze,components:{VarFormDetails:na},props:jze,setup(n){const e=ve(()=>n.max),t=ve(()=>n.modelValue.length),{length:i,checkboxes:s,bindCheckboxes:o}=Nze(),{bindForm:r}=kl(),{errorMessage:a,validateWithTrigger:l,validate:c,resetValidation:d}=Ll(),u=ve(()=>a.value),h={max:e,checkedCount:t,onChecked:p,onUnchecked:_,validate:L,resetValidation:d,reset:y,errorMessage:u};ht(()=>n.modelValue,v,{deep:!0}),ht(()=>i.value,v),o(h),oe(r,h);function f(S){Fn(()=>{const{validateTrigger:k,rules:D,modelValue:x}=n;l(k,S,D,x)})}function g(S){oe(n["onUpdate:modelValue"],S),oe(n.onChange,S),f("onChange")}function p(S){const{modelValue:k}=n;k.includes(S)||g([...k,S])}function _(S){const{modelValue:k}=n;k.includes(S)&&g(k.filter(D=>D!==S))}function v(){return s.forEach(({sync:S})=>S(n.modelValue))}function b(){s.forEach(S=>S.resetWithAnimation())}function C(){const S=s.map(({checkedValue:D})=>D.value),k=UW(S);return b(),oe(n["onUpdate:modelValue"],k),k}function w(){const S=s.filter(({checked:D})=>!D.value).map(({checkedValue:D})=>D.value),k=UW(S);return b(),oe(n["onUpdate:modelValue"],k),k}function y(){oe(n["onUpdate:modelValue"],[]),d()}function L(){return c(n.rules,n.modelValue)}return{errorMessage:a,n:qze,classes:Gze,checkAll:C,inverseAll:w,reset:y,validate:L,resetValidation:d}}});mre.render=Yze;var _re=mre;lt(_re);var f3=_re;const Zze={type:{type:String,default:"default"},size:{type:String,default:"normal"},color:String,textColor:String,iconName:yi(Ss,"name"),namespace:yi(Ss,"namespace"),plain:Boolean,round:{type:Boolean,default:!0},block:Boolean,closable:Boolean,closeable:Boolean,onClose:Se()},{name:Xze,n:Sh,classes:Qze}=st("chip");function Jze(n,e){const t=gt("var-icon");return q(),ei(On,{name:n.n("$-fade")},{default:Lt(()=>[me("span",fn({class:n.classes(n.n(),n.n("$--box"),...n.contentClass),style:n.chipStyles},n.$attrs),[xe(n.$slots,"left"),me("span",{class:B(n.n("text-".concat(n.size)))},[xe(n.$slots,"default")],2),xe(n.$slots,"right"),n.closeable||n.closable?(q(),re("span",{key:0,class:B(n.n("--close")),onClick:e[0]||(e[0]=(...i)=>n.handleClose&&n.handleClose(...i))},[Oe(t,{name:"".concat(n.iconName?n.iconName:"close-circle"),namespace:n.namespace},null,8,["name","namespace"])],2)):Qe("v-if",!0)],16)]),_:3},8,["name"])}const vre=et({name:Xze,components:{VarIcon:Wn},inheritAttrs:!1,props:Zze,setup(n){const e=ve(()=>{const{plain:s,textColor:o,color:r}=n;return s?{color:o||r,borderColor:r}:{color:o,background:r}}),t=ve(()=>{const{size:s,block:o,type:r,plain:a,round:l}=n,c=Sh(o?"$--flex":"$--inline-flex"),d=a?"".concat(Sh("plain")," ").concat(Sh("plain-".concat(r))):Sh("--".concat(r)),u=l?Sh("--round"):null;return[Sh("--".concat(s)),c,d,u]});function i(s){oe(n.onClose,s)}return{chipStyles:e,contentClass:t,n:Sh,classes:Qze,handleClose:i}}});vre.render=Jze;var bre=vre;lt(bre);var gT=bre;const eUe={span:{type:[String,Number],default:24},offset:{type:[String,Number],default:0},direction:{type:String,default:"row"},justify:String,align:String,xs:[Object,Number,String],sm:[Object,Number,String],md:[Object,Number,String],lg:[Object,Number,String],xl:[Object,Number,String],onClick:Se()},Cre=Symbol("ROW_BIND_COL_KEY");function tUe(){const{bindChildren:n,childProviders:e,length:t}=$o(Cre);return{length:t,cols:e,bindCols:n}}function iUe(){const{parentProvider:n,index:e,bindParent:t}=Ho(Cre);return{index:e,row:n,bindRow:t}}const{name:nUe,n:Pk,classes:sUe}=st("col");function oUe(n,e){return q(),re("div",{class:B(n.classes(n.n(),n.n("$--box"),[n.span>=0,n.n("--span-".concat(n.span))],[n.offset,n.n("--offset-".concat(n.offset))],...n.getSize("xs",n.xs),...n.getSize("sm",n.sm),...n.getSize("md",n.md),...n.getSize("lg",n.lg),...n.getSize("xl",n.xl))),style:Fe({flexDirection:n.direction,justifyContent:n.padStartFlex(n.justify),alignItems:n.padStartFlex(n.align),paddingLeft:n.toSizeUnit(n.padding.left),paddingRight:n.toSizeUnit(n.padding.right),paddingTop:n.toSizeUnit(n.padding.top),paddingBottom:n.toSizeUnit(n.padding.bottom)}),onClick:e[0]||(e[0]=(...t)=>n.handleClick&&n.handleClick(...t))},[xe(n.$slots,"default")],6)}const wre=et({name:nUe,props:eUe,setup(n){const e=ve(()=>Ie(n.span)),t=ve(()=>Ie(n.offset)),i=se({left:0,right:0,top:0,bottom:0}),{row:s,bindRow:o}=iUe(),r={setPadding(c){i.value=c}};ht([()=>n.span,()=>n.offset],()=>{s==null||s.computePadding()}),oe(o,r);function a(c,d){const u=[];if(d==null)return u;if(ju(d)){const{offset:h,span:f}=d;Number(f)>=0&&u.push(Pk("--span-".concat(c,"-").concat(f))),h&&u.push(Pk("--offset-".concat(c,"-").concat(h)))}else Number(d)>=0&&u.push(Pk("--span-".concat(c,"-").concat(d)));return u}function l(c){oe(n.onClick,c)}return{span:e,offset:t,padding:i,n:Pk,classes:sUe,toNumber:Ie,toSizeUnit:ri,getSize:a,handleClick:l,padStartFlex:dT}}});wre.render=oUe;var yre=wre;lt(yre);var g3=yre;const Sre=Symbol("COLLAPSE_BIND_COLLAPSE_ITEM_KEY");function rUe(){const{childProviders:n,length:e,bindChildren:t}=$o(Sre);return{length:e,collapseItem:n,bindCollapseItem:t}}const aUe={modelValue:[Array,String,Number],accordion:Boolean,offset:{type:Boolean,default:!0},divider:{type:Boolean,default:!0},elevation:{type:[Boolean,String,Number],default:!0},onChange:Se(),"onUpdate:modelValue":Se()},{name:lUe,n:cUe}=st("collapse");function dUe(n,e){return q(),re("div",{class:B(n.n())},[xe(n.$slots,"default")],2)}const Lre=et({name:lUe,props:aUe,setup(n){const e=ve(()=>n.modelValue),t=ve(()=>n.offset),i=ve(()=>n.divider),s=ve(()=>n.elevation),{length:o,collapseItem:r,bindCollapseItem:a}=rUe(),l={active:e,offset:t,divider:i,elevation:s,updateItem:u};ht(()=>o.value,()=>Fn().then(g)),ht(()=>n.modelValue,()=>Fn().then(g)),a(l);function c(){return!n.accordion&&!tn(n.modelValue)?(console.error('[Varlet] Collapse: type of prop "modelValue" should be an Array'),!1):n.accordion&&tn(n.modelValue)?(console.error('[Varlet] Collapse: type of prop "modelValue" should be a String or Number'),!1):!0}function d(p,_){return c()?_?n.accordion?p:[...n.modelValue,p]:n.accordion?null:n.modelValue.filter(v=>v!==p):null}function u(p,_){const v=d(p,_);oe(n["onUpdate:modelValue"],v),oe(n.onChange,v)}function h(){if(n.accordion)return r.find(({name:_})=>n.modelValue===_.value);const p=r.filter(({name:_})=>_.value===void 0?!1:n.modelValue.includes(_.value));return p.length?p:void 0}function f(){return n.accordion?r.find(({index:p,name:_})=>_.value===void 0&&n.modelValue===p.value):r.filter(({index:p,name:_})=>_.value===void 0&&n.modelValue.includes(p.value))}function g(){if(!c())return;const p=h()||f();if(n.accordion&&!p||!n.accordion&&!p.length){r.forEach(_=>{_.init(n.accordion,!1)});return}r.forEach(_=>{const v=n.accordion?p===_:p.includes(_);_.init(n.accordion,v)})}return{divider:i,n:cUe}}});Lre.render=dUe;var kre=Lre;lt(kre);var p3=kre;function uUe(){const{parentProvider:n,index:e,bindParent:t}=Ho(Sre);return t||Oa("Collapse"," must in "),{index:e,collapse:n,bindCollapse:t}}const hUe={name:[String,Number],title:String,icon:{type:String,default:"chevron-down"},disabled:Boolean};var Sq=(n,e,t)=>new Promise((i,s)=>{var o=l=>{try{a(t.next(l))}catch(c){s(c)}},r=l=>{try{a(t.throw(l))}catch(c){s(c)}},a=l=>l.done?i(l.value):Promise.resolve(l.value).then(o,r);a((t=t.apply(n,e)).next())});const{name:fUe,n:gUe,classes:pUe}=st("collapse-item");function mUe(n,e){const t=gt("var-icon");return q(),re("div",{class:B(n.classes(n.n(),[n.offset&&n.isShow,n.n("--active")],[n.disabled,n.n("--disable")])),style:Fe("--collapse-divider-top: ".concat(n.divider?"var(--collapse-border-top)":"none"))},[me("div",{class:B(n.classes(n.n("shadow"),n.formatElevation(n.elevation,2)))},null,2),me("div",{class:B(n.n("header")),onClick:e[0]||(e[0]=i=>n.toggle())},[me("div",{class:B(n.n("header-title"))},[xe(n.$slots,"title",{},()=>[Mi(ut(n.title),1)])],2),me("div",{class:B(n.n("header-icon"))},[xe(n.$slots,"icon",{},()=>[Oe(t,{name:n.icon,transition:250,class:B(n.classes(n.n("header-icon"),[n.isShow&&n.icon==="chevron-down",n.n("header-open")],[n.disabled,n.n("header--disable")]))},null,8,["name","class"])])],2)],2),wi(me("div",{class:B(n.n("content")),ref:"contentEl",onTransitionend:e[1]||(e[1]=(...i)=>n.transitionend&&n.transitionend(...i)),onTransitionstart:e[2]||(e[2]=(...i)=>n.start&&n.start(...i))},[me("div",{class:B(n.n("content-wrap"))},[xe(n.$slots,"default")],2)],34),[[hl,n.showContent]])],6)}const Dre=et({name:fUe,components:{VarIcon:Wn},props:hUe,setup(n){const e=se(!1),t=se(!1),i=se(null),s=ve(()=>n.name),{index:o,collapse:r,bindCollapse:a}=uUe(),{active:l,offset:c,divider:d,elevation:u,updateItem:h}=r,f={index:o,name:s,init:v};let g=!0;ht(e,y=>{y?p():_()}),a(f);function p(){return Sq(this,null,function*(){if(!i.value||(i.value.style.height="",t.value=!0,yield Gk(),!i.value))return;const{offsetHeight:y}=i.value;i.value.style.height="0px",yield Gk(),i.value&&(i.value.style.height=y+"px",g&&(yield Cr(),g&&w()))})}function _(){return Sq(this,null,function*(){if(!i.value)return;const{offsetHeight:y}=i.value;i.value.style.height=y+"px",yield Gk(),i.value.style.height="0px"})}function v(y,L){l.value===void 0||y&&tn(l.value)||L===e.value||(e.value=L,b(!0))}function b(y){n.disabled||y||h(n.name||o.value,!e.value)}function C(){g=!1}function w(){e.value||(t.value=!1),i.value.style.height=""}return{isShow:e,showContent:t,offset:c,divider:d,elevation:u,contentEl:i,n:gUe,start:C,classes:pUe,toggle:b,transitionend:w,formatElevation:or}}});Dre.render=mUe;var Ere=Dre;lt(Ere);var m3=Ere;const _Ue={time:{type:[String,Number],default:0},format:{type:String,default:"HH : mm : ss"},autoStart:{type:Boolean,default:!0},onEnd:Se(),onChange:Se()},{name:vUe,n:bUe}=st("countdown"),_3=1e3,v3=60*_3,b3=60*v3,Lq=24*b3;function CUe(n,e){return q(),re("div",{class:B(n.n())},[xe(n.$slots,"default",pf(_0(n.timeData)),()=>[Mi(ut(n.showTime),1)])],2)}const Ire=et({name:vUe,props:_Ue,setup(n){const e=se(""),t=se({days:0,hours:0,minutes:0,seconds:0,milliseconds:0});let i=0,s=!1,o=0,r=0,a;ht(()=>n.time,()=>{f(),n.autoStart&&u()},{immediate:!0}),eh(()=>{a!=null&&(s=a,s===!0&&u(!0))}),$m(()=>{a=s,h()}),Cd(h);function l(g,p){const _=Object.values(p),v=["DD","HH","mm","ss"],b=[24,60,60,1e3];if(v.forEach((C,w)=>{g.includes(C)?g=g.replace(C,Bm("".concat(_[w]),2,"0")):_[w+1]+=_[w]*b[w]}),g.includes("S")){const C=Bm("".concat(_[_.length-1]),3,"0");g.includes("SSS")?g=g.replace("SSS",C):g.includes("SS")?g=g.replace("SS",C.slice(0,2)):g=g.replace("S",C.slice(0,1))}return g}function c(g){const p=Math.floor(g/Lq),_=Math.floor(g%Lq/b3),v=Math.floor(g%b3/v3),b=Math.floor(g%v3/_3),C=Math.floor(g%_3),w={days:p,hours:_,minutes:v,seconds:b,milliseconds:C};t.value=w,oe(n.onChange,t.value),e.value=l(n.format,w)}function d(){const{time:g,onEnd:p}=n,_=performance.now();if(i||(i=_+Ie(g)),r=i-_,r<0&&(r=0),c(r),r===0){oe(p);return}s&&(o=aw(d))}function u(g=!1){s&&!g||(s=!0,i=performance.now()+(r||Ie(n.time)),d())}function h(){s=!1,jW(o)}function f(){i=0,s=!1,jW(o),d()}return{showTime:e,timeData:t,n:bUe,start:u,pause:h,reset:f}}});Ire.render=CUe;var Tre=Ire;lt(Tre);var C3=Tre;/*! * decimal.js v10.4.3 * An arbitrary-precision Decimal type for JavaScript. * https://github.com/MikeMcl/decimal.js * Copyright (c) 2022 Michael Mclaughlin * MIT Licence - */var Dv=9e15,Og=1e9,w3="0123456789abcdef",gT="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",pT="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",y3={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-Dv,maxE:Dv,crypto:!1},xre,Nu,si=!0,dA="[DecimalError] ",mg=dA+"Invalid argument: ",Nre=dA+"Precision limit exceeded",Are=dA+"crypto unavailable",Mre="[object Decimal]",nr=Math.floor,Gs=Math.pow,wUe=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,yUe=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,SUe=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,Rre=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,cc=1e7,Zt=7,LUe=9007199254740991,kUe=gT.length-1,S3=pT.length-1,Ge={toStringTag:Mre};Ge.absoluteValue=Ge.abs=function(){var n=new this.constructor(this);return n.s<0&&(n.s=1),Ot(n)};Ge.ceil=function(){return Ot(new this.constructor(this),this.e+1,2)};Ge.clampedTo=Ge.clamp=function(n,e){var t,i=this,s=i.constructor;if(n=new s(n),e=new s(e),!n.s||!e.s)return new s(NaN);if(n.gt(e))throw Error(mg+e);return t=i.cmp(n),t<0?n:i.cmp(e)>0?e:new s(i)};Ge.comparedTo=Ge.cmp=function(n){var e,t,i,s,o=this,r=o.d,a=(n=new o.constructor(n)).d,l=o.s,c=n.s;if(!r||!a)return!l||!c?NaN:l!==c?l:r===a?0:!r^l<0?1:-1;if(!r[0]||!a[0])return r[0]?l:a[0]?-c:0;if(l!==c)return l;if(o.e!==n.e)return o.e>n.e^l<0?1:-1;for(i=r.length,s=a.length,e=0,t=ia[e]^l<0?1:-1;return i===s?0:i>s^l<0?1:-1};Ge.cosine=Ge.cos=function(){var n,e,t=this,i=t.constructor;return t.d?t.d[0]?(n=i.precision,e=i.rounding,i.precision=n+Math.max(t.e,t.sd())+Zt,i.rounding=1,t=DUe(i,Wre(i,t)),i.precision=n,i.rounding=e,Ot(Nu==2||Nu==3?t.neg():t,n,e,!0)):new i(1):new i(NaN)};Ge.cubeRoot=Ge.cbrt=function(){var n,e,t,i,s,o,r,a,l,c,d=this,u=d.constructor;if(!d.isFinite()||d.isZero())return new u(d);for(si=!1,o=d.s*Gs(d.s*d,1/3),!o||Math.abs(o)==1/0?(t=Ao(d.d),n=d.e,(o=(n-t.length+1)%3)&&(t+=o==1||o==-2?"0":"00"),o=Gs(t,1/3),n=nr((n+1)/3)-(n%3==(n<0?-1:2)),o==1/0?t="5e"+n:(t=o.toExponential(),t=t.slice(0,t.indexOf("e")+1)+n),i=new u(t),i.s=d.s):i=new u(o.toString()),r=(n=u.precision)+3;;)if(a=i,l=a.times(a).times(a),c=l.plus(d),i=En(c.plus(d).times(a),c.plus(l),r+2,1),Ao(a.d).slice(0,r)===(t=Ao(i.d)).slice(0,r))if(t=t.slice(r-3,r+1),t=="9999"||!s&&t=="4999"){if(!s&&(Ot(a,n+1,0),a.times(a).times(a).eq(d))){i=a;break}r+=4,s=1}else{(!+t||!+t.slice(1)&&t.charAt(0)=="5")&&(Ot(i,n+1,1),e=!i.times(i).times(i).eq(d));break}return si=!0,Ot(i,n,u.rounding,e)};Ge.decimalPlaces=Ge.dp=function(){var n,e=this.d,t=NaN;if(e){if(n=e.length-1,t=(n-nr(this.e/Zt))*Zt,n=e[n],n)for(;n%10==0;n/=10)t--;t<0&&(t=0)}return t};Ge.dividedBy=Ge.div=function(n){return En(this,new this.constructor(n))};Ge.dividedToIntegerBy=Ge.divToInt=function(n){var e=this,t=e.constructor;return Ot(En(e,new t(n),0,1,1),t.precision,t.rounding)};Ge.equals=Ge.eq=function(n){return this.cmp(n)===0};Ge.floor=function(){return Ot(new this.constructor(this),this.e+1,3)};Ge.greaterThan=Ge.gt=function(n){return this.cmp(n)>0};Ge.greaterThanOrEqualTo=Ge.gte=function(n){var e=this.cmp(n);return e==1||e===0};Ge.hyperbolicCosine=Ge.cosh=function(){var n,e,t,i,s,o=this,r=o.constructor,a=new r(1);if(!o.isFinite())return new r(o.s?1/0:NaN);if(o.isZero())return a;t=r.precision,i=r.rounding,r.precision=t+Math.max(o.e,o.sd())+4,r.rounding=1,s=o.d.length,s<32?(n=Math.ceil(s/3),e=(1/hA(4,n)).toString()):(n=16,e="2.3283064365386962890625e-10"),o=c0(r,1,o.times(e),new r(1),!0);for(var l,c=n,d=new r(8);c--;)l=o.times(o),o=a.minus(l.times(d.minus(l.times(d))));return Ot(o,r.precision=t,r.rounding=i,!0)};Ge.hyperbolicSine=Ge.sinh=function(){var n,e,t,i,s=this,o=s.constructor;if(!s.isFinite()||s.isZero())return new o(s);if(e=o.precision,t=o.rounding,o.precision=e+Math.max(s.e,s.sd())+4,o.rounding=1,i=s.d.length,i<3)s=c0(o,2,s,s,!0);else{n=1.4*Math.sqrt(i),n=n>16?16:n|0,s=s.times(1/hA(5,n)),s=c0(o,2,s,s,!0);for(var r,a=new o(5),l=new o(16),c=new o(20);n--;)r=s.times(s),s=s.times(a.plus(r.times(l.times(r).plus(c))))}return o.precision=e,o.rounding=t,Ot(s,e,t,!0)};Ge.hyperbolicTangent=Ge.tanh=function(){var n,e,t=this,i=t.constructor;return t.isFinite()?t.isZero()?new i(t):(n=i.precision,e=i.rounding,i.precision=n+7,i.rounding=1,En(t.sinh(),t.cosh(),i.precision=n,i.rounding=e)):new i(t.s)};Ge.inverseCosine=Ge.acos=function(){var n,e=this,t=e.constructor,i=e.abs().cmp(1),s=t.precision,o=t.rounding;return i!==-1?i===0?e.isNeg()?tc(t,s,o):new t(0):new t(NaN):e.isZero()?tc(t,s+4,o).times(.5):(t.precision=s+6,t.rounding=1,e=e.asin(),n=tc(t,s+4,o).times(.5),t.precision=s,t.rounding=o,n.minus(e))};Ge.inverseHyperbolicCosine=Ge.acosh=function(){var n,e,t=this,i=t.constructor;return t.lte(1)?new i(t.eq(1)?0:NaN):t.isFinite()?(n=i.precision,e=i.rounding,i.precision=n+Math.max(Math.abs(t.e),t.sd())+4,i.rounding=1,si=!1,t=t.times(t).minus(1).sqrt().plus(t),si=!0,i.precision=n,i.rounding=e,t.ln()):new i(t)};Ge.inverseHyperbolicSine=Ge.asinh=function(){var n,e,t=this,i=t.constructor;return!t.isFinite()||t.isZero()?new i(t):(n=i.precision,e=i.rounding,i.precision=n+2*Math.max(Math.abs(t.e),t.sd())+6,i.rounding=1,si=!1,t=t.times(t).plus(1).sqrt().plus(t),si=!0,i.precision=n,i.rounding=e,t.ln())};Ge.inverseHyperbolicTangent=Ge.atanh=function(){var n,e,t,i,s=this,o=s.constructor;return s.isFinite()?s.e>=0?new o(s.abs().eq(1)?s.s/0:s.isZero()?s:NaN):(n=o.precision,e=o.rounding,i=s.sd(),Math.max(i,n)<2*-s.e-1?Ot(new o(s),n,e,!0):(o.precision=t=i-s.e,s=En(s.plus(1),new o(1).minus(s),t+n,1),o.precision=n+4,o.rounding=1,s=s.ln(),o.precision=n,o.rounding=e,s.times(.5))):new o(NaN)};Ge.inverseSine=Ge.asin=function(){var n,e,t,i,s=this,o=s.constructor;return s.isZero()?new o(s):(e=s.abs().cmp(1),t=o.precision,i=o.rounding,e!==-1?e===0?(n=tc(o,t+4,i).times(.5),n.s=s.s,n):new o(NaN):(o.precision=t+6,o.rounding=1,s=s.div(new o(1).minus(s.times(s)).sqrt().plus(1)).atan(),o.precision=t,o.rounding=i,s.times(2)))};Ge.inverseTangent=Ge.atan=function(){var n,e,t,i,s,o,r,a,l,c=this,d=c.constructor,u=d.precision,h=d.rounding;if(c.isFinite()){if(c.isZero())return new d(c);if(c.abs().eq(1)&&u+4<=S3)return r=tc(d,u+4,h).times(.25),r.s=c.s,r}else{if(!c.s)return new d(NaN);if(u+4<=S3)return r=tc(d,u+4,h).times(.5),r.s=c.s,r}for(d.precision=a=u+10,d.rounding=1,t=Math.min(28,a/Zt+2|0),n=t;n;--n)c=c.div(c.times(c).plus(1).sqrt().plus(1));for(si=!1,e=Math.ceil(a/Zt),i=1,l=c.times(c),r=new d(c),s=c;n!==-1;)if(s=s.times(l),o=r.minus(s.div(i+=2)),s=s.times(l),r=o.plus(s.div(i+=2)),r.d[e]!==void 0)for(n=e;r.d[n]===o.d[n]&&n--;);return t&&(r=r.times(2<this.d.length-2};Ge.isNaN=function(){return!this.s};Ge.isNegative=Ge.isNeg=function(){return this.s<0};Ge.isPositive=Ge.isPos=function(){return this.s>0};Ge.isZero=function(){return!!this.d&&this.d[0]===0};Ge.lessThan=Ge.lt=function(n){return this.cmp(n)<0};Ge.lessThanOrEqualTo=Ge.lte=function(n){return this.cmp(n)<1};Ge.logarithm=Ge.log=function(n){var e,t,i,s,o,r,a,l,c=this,d=c.constructor,u=d.precision,h=d.rounding,f=5;if(n==null)n=new d(10),e=!0;else{if(n=new d(n),t=n.d,n.s<0||!t||!t[0]||n.eq(1))return new d(NaN);e=n.eq(10)}if(t=c.d,c.s<0||!t||!t[0]||c.eq(1))return new d(t&&!t[0]?-1/0:c.s!=1?NaN:t?0:1/0);if(e)if(t.length>1)o=!0;else{for(s=t[0];s%10===0;)s/=10;o=s!==1}if(si=!1,a=u+f,r=ff(c,a),i=e?mT(d,a+10):ff(n,a),l=En(r,i,a,1),jy(l.d,s=u,h))do if(a+=10,r=ff(c,a),i=e?mT(d,a+10):ff(n,a),l=En(r,i,a,1),!o){+Ao(l.d).slice(s+1,s+15)+1==1e14&&(l=Ot(l,u+1,0));break}while(jy(l.d,s+=10,h));return si=!0,Ot(l,u,h)};Ge.minus=Ge.sub=function(n){var e,t,i,s,o,r,a,l,c,d,u,h,f=this,g=f.constructor;if(n=new g(n),!f.d||!n.d)return!f.s||!n.s?n=new g(NaN):f.d?n.s=-n.s:n=new g(n.d||f.s!==n.s?f:NaN),n;if(f.s!=n.s)return n.s=-n.s,f.plus(n);if(c=f.d,h=n.d,a=g.precision,l=g.rounding,!c[0]||!h[0]){if(h[0])n.s=-n.s;else if(c[0])n=new g(f);else return new g(l===3?-0:0);return si?Ot(n,a,l):n}if(t=nr(n.e/Zt),d=nr(f.e/Zt),c=c.slice(),o=d-t,o){for(u=o<0,u?(e=c,o=-o,r=h.length):(e=h,t=d,r=c.length),i=Math.max(Math.ceil(a/Zt),r)+2,o>i&&(o=i,e.length=1),e.reverse(),i=o;i--;)e.push(0);e.reverse()}else{for(i=c.length,r=h.length,u=i0;--i)c[r++]=0;for(i=h.length;i>o;){if(c[--i]r?o+1:r+1,s>r&&(s=r,t.length=1),t.reverse();s--;)t.push(0);t.reverse()}for(r=c.length,s=d.length,r-s<0&&(s=r,t=d,d=c,c=t),e=0;s;)e=(c[--s]=c[s]+d[s]+e)/cc|0,c[s]%=cc;for(e&&(c.unshift(e),++i),r=c.length;c[--r]==0;)c.pop();return n.d=c,n.e=uA(c,i),si?Ot(n,a,l):n};Ge.precision=Ge.sd=function(n){var e,t=this;if(n!==void 0&&n!==!!n&&n!==1&&n!==0)throw Error(mg+n);return t.d?(e=Pre(t.d),n&&t.e+1>e&&(e=t.e+1)):e=NaN,e};Ge.round=function(){var n=this,e=n.constructor;return Ot(new e(n),n.e+1,e.rounding)};Ge.sine=Ge.sin=function(){var n,e,t=this,i=t.constructor;return t.isFinite()?t.isZero()?new i(t):(n=i.precision,e=i.rounding,i.precision=n+Math.max(t.e,t.sd())+Zt,i.rounding=1,t=IUe(i,Wre(i,t)),i.precision=n,i.rounding=e,Ot(Nu>2?t.neg():t,n,e,!0)):new i(NaN)};Ge.squareRoot=Ge.sqrt=function(){var n,e,t,i,s,o,r=this,a=r.d,l=r.e,c=r.s,d=r.constructor;if(c!==1||!a||!a[0])return new d(!c||c<0&&(!a||a[0])?NaN:a?r:1/0);for(si=!1,c=Math.sqrt(+r),c==0||c==1/0?(e=Ao(a),(e.length+l)%2==0&&(e+="0"),c=Math.sqrt(e),l=nr((l+1)/2)-(l<0||l%2),c==1/0?e="5e"+l:(e=c.toExponential(),e=e.slice(0,e.indexOf("e")+1)+l),i=new d(e)):i=new d(c.toString()),t=(l=d.precision)+3;;)if(o=i,i=o.plus(En(r,o,t+2,1)).times(.5),Ao(o.d).slice(0,t)===(e=Ao(i.d)).slice(0,t))if(e=e.slice(t-3,t+1),e=="9999"||!s&&e=="4999"){if(!s&&(Ot(o,l+1,0),o.times(o).eq(r))){i=o;break}t+=4,s=1}else{(!+e||!+e.slice(1)&&e.charAt(0)=="5")&&(Ot(i,l+1,1),n=!i.times(i).eq(r));break}return si=!0,Ot(i,l,d.rounding,n)};Ge.tangent=Ge.tan=function(){var n,e,t=this,i=t.constructor;return t.isFinite()?t.isZero()?new i(t):(n=i.precision,e=i.rounding,i.precision=n+10,i.rounding=1,t=t.sin(),t.s=1,t=En(t,new i(1).minus(t.times(t)).sqrt(),n+10,0),i.precision=n,i.rounding=e,Ot(Nu==2||Nu==4?t.neg():t,n,e,!0)):new i(NaN)};Ge.times=Ge.mul=function(n){var e,t,i,s,o,r,a,l,c,d=this,u=d.constructor,h=d.d,f=(n=new u(n)).d;if(n.s*=d.s,!h||!h[0]||!f||!f[0])return new u(!n.s||h&&!h[0]&&!f||f&&!f[0]&&!h?NaN:!h||!f?n.s/0:n.s*0);for(t=nr(d.e/Zt)+nr(n.e/Zt),l=h.length,c=f.length,l=0;){for(e=0,s=l+i;s>i;)a=o[s]+f[i]*h[s-i-1]+e,o[s--]=a%cc|0,e=a/cc|0;o[s]=(o[s]+e)%cc|0}for(;!o[--r];)o.pop();return e?++t:o.shift(),n.d=o,n.e=uA(o,t),si?Ot(n,u.precision,u.rounding):n};Ge.toBinary=function(n,e){return M6(this,2,n,e)};Ge.toDecimalPlaces=Ge.toDP=function(n,e){var t=this,i=t.constructor;return t=new i(t),n===void 0?t:(sa(n,0,Og),e===void 0?e=i.rounding:sa(e,0,8),Ot(t,n+t.e+1,e))};Ge.toExponential=function(n,e){var t,i=this,s=i.constructor;return n===void 0?t=Od(i,!0):(sa(n,0,Og),e===void 0?e=s.rounding:sa(e,0,8),i=Ot(new s(i),n+1,e),t=Od(i,!0,n+1)),i.isNeg()&&!i.isZero()?"-"+t:t};Ge.toFixed=function(n,e){var t,i,s=this,o=s.constructor;return n===void 0?t=Od(s):(sa(n,0,Og),e===void 0?e=o.rounding:sa(e,0,8),i=Ot(new o(s),n+s.e+1,e),t=Od(i,!1,n+i.e+1)),s.isNeg()&&!s.isZero()?"-"+t:t};Ge.toFraction=function(n){var e,t,i,s,o,r,a,l,c,d,u,h,f=this,g=f.d,p=f.constructor;if(!g)return new p(f);if(c=t=new p(1),i=l=new p(0),e=new p(i),o=e.e=Pre(g)-f.e-1,r=o%Zt,e.d[0]=Gs(10,r<0?Zt+r:r),n==null)n=o>0?e:c;else{if(a=new p(n),!a.isInt()||a.lt(c))throw Error(mg+a);n=a.gt(e)?o>0?e:c:a}for(si=!1,a=new p(Ao(g)),d=p.precision,p.precision=o=g.length*Zt*2;u=En(a,e,0,1,1),s=t.plus(u.times(i)),s.cmp(n)!=1;)t=i,i=s,s=c,c=l.plus(u.times(s)),l=s,s=e,e=a.minus(u.times(s)),a=s;return s=En(n.minus(t),i,0,1,1),l=l.plus(s.times(c)),t=t.plus(s.times(i)),l.s=c.s=f.s,h=En(c,i,o,1).minus(f).abs().cmp(En(l,t,o,1).minus(f).abs())<1?[c,i]:[l,t],p.precision=d,si=!0,h};Ge.toHexadecimal=Ge.toHex=function(n,e){return M6(this,16,n,e)};Ge.toNearest=function(n,e){var t=this,i=t.constructor;if(t=new i(t),n==null){if(!t.d)return t;n=new i(1),e=i.rounding}else{if(n=new i(n),e===void 0?e=i.rounding:sa(e,0,8),!t.d)return n.s?t:n;if(!n.d)return n.s&&(n.s=t.s),n}return n.d[0]?(si=!1,t=En(t,n,0,e,1).times(n),si=!0,Ot(t)):(n.s=t.s,t=n),t};Ge.toNumber=function(){return+this};Ge.toOctal=function(n,e){return M6(this,8,n,e)};Ge.toPower=Ge.pow=function(n){var e,t,i,s,o,r,a=this,l=a.constructor,c=+(n=new l(n));if(!a.d||!n.d||!a.d[0]||!n.d[0])return new l(Gs(+a,c));if(a=new l(a),a.eq(1))return a;if(i=l.precision,o=l.rounding,n.eq(1))return Ot(a,i,o);if(e=nr(n.e/Zt),e>=n.d.length-1&&(t=c<0?-c:c)<=LUe)return s=Ore(l,a,t,i),n.s<0?new l(1).div(s):Ot(s,i,o);if(r=a.s,r<0){if(el.maxE+1||e0?r/0:0):(si=!1,l.rounding=a.s=1,t=Math.min(12,(e+"").length),s=L3(n.times(ff(a,i+t)),i),s.d&&(s=Ot(s,i+5,1),jy(s.d,i,o)&&(e=i+10,s=Ot(L3(n.times(ff(a,e+t)),e),e+5,1),+Ao(s.d).slice(i+1,i+15)+1==1e14&&(s=Ot(s,i+1,0)))),s.s=r,si=!0,l.rounding=o,Ot(s,i,o))};Ge.toPrecision=function(n,e){var t,i=this,s=i.constructor;return n===void 0?t=Od(i,i.e<=s.toExpNeg||i.e>=s.toExpPos):(sa(n,1,Og),e===void 0?e=s.rounding:sa(e,0,8),i=Ot(new s(i),n,e),t=Od(i,n<=i.e||i.e<=s.toExpNeg,n)),i.isNeg()&&!i.isZero()?"-"+t:t};Ge.toSignificantDigits=Ge.toSD=function(n,e){var t=this,i=t.constructor;return n===void 0?(n=i.precision,e=i.rounding):(sa(n,1,Og),e===void 0?e=i.rounding:sa(e,0,8)),Ot(new i(t),n,e)};Ge.toString=function(){var n=this,e=n.constructor,t=Od(n,n.e<=e.toExpNeg||n.e>=e.toExpPos);return n.isNeg()&&!n.isZero()?"-"+t:t};Ge.truncated=Ge.trunc=function(){return Ot(new this.constructor(this),this.e+1,1)};Ge.valueOf=Ge.toJSON=function(){var n=this,e=n.constructor,t=Od(n,n.e<=e.toExpNeg||n.e>=e.toExpPos);return n.isNeg()?"-"+t:t};function Ao(n){var e,t,i,s=n.length-1,o="",r=n[0];if(s>0){for(o+=r,e=1;et)throw Error(mg+n)}function jy(n,e,t,i){var s,o,r,a;for(o=n[0];o>=10;o/=10)--e;return--e<0?(e+=Zt,s=0):(s=Math.ceil((e+1)/Zt),e%=Zt),o=Gs(10,Zt-e),a=n[s]%o|0,i==null?e<3?(e==0?a=a/100|0:e==1&&(a=a/10|0),r=t<4&&a==99999||t>3&&a==49999||a==5e4||a==0):r=(t<4&&a+1==o||t>3&&a+1==o/2)&&(n[s+1]/o/100|0)==Gs(10,e-2)-1||(a==o/2||a==0)&&(n[s+1]/o/100|0)==0:e<4?(e==0?a=a/1e3|0:e==1?a=a/100|0:e==2&&(a=a/10|0),r=(i||t<4)&&a==9999||!i&&t>3&&a==4999):r=((i||t<4)&&a+1==o||!i&&t>3&&a+1==o/2)&&(n[s+1]/o/1e3|0)==Gs(10,e-3)-1,r}function WD(n,e,t){for(var i,s=[0],o,r=0,a=n.length;rt-1&&(s[i+1]===void 0&&(s[i+1]=0),s[i+1]+=s[i]/t|0,s[i]%=t)}return s.reverse()}function DUe(n,e){var t,i,s;if(e.isZero())return e;i=e.d.length,i<32?(t=Math.ceil(i/3),s=(1/hA(4,t)).toString()):(t=16,s="2.3283064365386962890625e-10"),n.precision+=t,e=c0(n,1,e.times(s),new n(1));for(var o=t;o--;){var r=e.times(e);e=r.times(r).minus(r).times(8).plus(1)}return n.precision-=t,e}var En=function(){function n(i,s,o){var r,a=0,l=i.length;for(i=i.slice();l--;)r=i[l]*s+a,i[l]=r%o|0,a=r/o|0;return a&&i.unshift(a),i}function e(i,s,o,r){var a,l;if(o!=r)l=o>r?1:-1;else for(a=l=0;as[a]?1:-1;break}return l}function t(i,s,o,r){for(var a=0;o--;)i[o]-=a,a=i[o]1;)i.shift()}return function(i,s,o,r,a,l){var c,d,u,h,f,g,p,_,v,b,C,w,y,L,S,k,D,x,A,T,P=i.constructor,W=i.s==s.s?1:-1,$=i.d,X=s.d;if(!$||!$[0]||!X||!X[0])return new P(!i.s||!s.s||($?X&&$[0]==X[0]:!X)?NaN:$&&$[0]==0||!X?W*0:W/0);for(l?(f=1,d=i.e-s.e):(l=cc,f=Zt,d=nr(i.e/f)-nr(s.e/f)),A=X.length,D=$.length,v=new P(W),b=v.d=[],u=0;X[u]==($[u]||0);u++);if(X[u]>($[u]||0)&&d--,o==null?(L=o=P.precision,r=P.rounding):a?L=o+(i.e-s.e)+1:L=o,L<0)b.push(1),g=!0;else{if(L=L/f+2|0,u=0,A==1){for(h=0,X=X[0],L++;(u1&&(X=n(X,h,l),$=n($,h,l),A=X.length,D=$.length),k=A,C=$.slice(0,A),w=C.length;w=l/2&&++x;do h=0,c=e(X,C,A,w),c<0?(y=C[0],A!=w&&(y=y*l+(C[1]||0)),h=y/x|0,h>1?(h>=l&&(h=l-1),p=n(X,h,l),_=p.length,w=C.length,c=e(p,C,_,w),c==1&&(h--,t(p,A<_?T:X,_,l))):(h==0&&(c=h=1),p=X.slice()),_=p.length,_=10;h/=10)u++;v.e=u+d*f-1,Ot(v,a?o+v.e+1:o,r,g)}return v}}();function Ot(n,e,t,i){var s,o,r,a,l,c,d,u,h,f=n.constructor;e:if(e!=null){if(u=n.d,!u)return n;for(s=1,a=u[0];a>=10;a/=10)s++;if(o=e-s,o<0)o+=Zt,r=e,d=u[h=0],l=d/Gs(10,s-r-1)%10|0;else if(h=Math.ceil((o+1)/Zt),a=u.length,h>=a)if(i){for(;a++<=h;)u.push(0);d=l=0,s=1,o%=Zt,r=o-Zt+1}else break e;else{for(d=a=u[h],s=1;a>=10;a/=10)s++;o%=Zt,r=o-Zt+s,l=r<0?0:d/Gs(10,s-r-1)%10|0}if(i=i||e<0||u[h+1]!==void 0||(r<0?d:d%Gs(10,s-r-1)),c=t<4?(l||i)&&(t==0||t==(n.s<0?3:2)):l>5||l==5&&(t==4||i||t==6&&(o>0?r>0?d/Gs(10,s-r):0:u[h-1])%10&1||t==(n.s<0?8:7)),e<1||!u[0])return u.length=0,c?(e-=n.e+1,u[0]=Gs(10,(Zt-e%Zt)%Zt),n.e=-e||0):u[0]=n.e=0,n;if(o==0?(u.length=h,a=1,h--):(u.length=h+1,a=Gs(10,Zt-o),u[h]=r>0?(d/Gs(10,s-r)%Gs(10,r)|0)*a:0),c)for(;;)if(h==0){for(o=1,r=u[0];r>=10;r/=10)o++;for(r=u[0]+=a,a=1;r>=10;r/=10)a++;o!=a&&(n.e++,u[0]==cc&&(u[0]=1));break}else{if(u[h]+=a,u[h]!=cc)break;u[h--]=0,a=1}for(o=u.length;u[--o]===0;)u.pop()}return si&&(n.e>f.maxE?(n.d=null,n.e=NaN):n.e0?o=o.charAt(0)+"."+o.slice(1)+Wh(i):r>1&&(o=o.charAt(0)+"."+o.slice(1)),o=o+(n.e<0?"e":"e+")+n.e):s<0?(o="0."+Wh(-s-1)+o,t&&(i=t-r)>0&&(o+=Wh(i))):s>=r?(o+=Wh(s+1-r),t&&(i=t-s-1)>0&&(o=o+"."+Wh(i))):((i=s+1)0&&(s+1===r&&(o+="."),o+=Wh(i))),o}function uA(n,e){var t=n[0];for(e*=Zt;t>=10;t/=10)e++;return e}function mT(n,e,t){if(e>kUe)throw si=!0,t&&(n.precision=t),Error(Nre);return Ot(new n(gT),e,1,!0)}function tc(n,e,t){if(e>S3)throw Error(Nre);return Ot(new n(pT),e,t,!0)}function Pre(n){var e=n.length-1,t=e*Zt+1;if(e=n[e],e){for(;e%10==0;e/=10)t--;for(e=n[0];e>=10;e/=10)t++}return t}function Wh(n){for(var e="";n--;)e+="0";return e}function Ore(n,e,t,i){var s,o=new n(1),r=Math.ceil(i/Zt+4);for(si=!1;;){if(t%2&&(o=o.times(e),Dq(o.d,r)&&(s=!0)),t=nr(t/2),t===0){t=o.d.length-1,s&&o.d[t]===0&&++o.d[t];break}e=e.times(e),Dq(e.d,r)}return si=!0,o}function kq(n){return n.d[n.d.length-1]&1}function Fre(n,e,t){for(var i,s=new n(e[0]),o=0;++o17)return new h(n.d?n.d[0]?n.s<0?0:1/0:1:n.s?n.s<0?0:n:0/0);for(e==null?(si=!1,l=g):l=e,a=new h(.03125);n.e>-2;)n=n.times(a),u+=5;for(i=Math.log(Gs(2,u))/Math.LN10*2+5|0,l+=i,t=o=r=new h(1),h.precision=l;;){if(o=Ot(o.times(n),l,1),t=t.times(++d),a=r.plus(En(o,t,l,1)),Ao(a.d).slice(0,l)===Ao(r.d).slice(0,l)){for(s=u;s--;)r=Ot(r.times(r),l,1);if(e==null)if(c<3&&jy(r.d,l-i,f,c))h.precision=l+=10,t=o=a=new h(1),d=0,c++;else return Ot(r,h.precision=g,f,si=!0);else return h.precision=g,r}r=a}}function ff(n,e){var t,i,s,o,r,a,l,c,d,u,h,f=1,g=10,p=n,_=p.d,v=p.constructor,b=v.rounding,C=v.precision;if(p.s<0||!_||!_[0]||!p.e&&_[0]==1&&_.length==1)return new v(_&&!_[0]?-1/0:p.s!=1?NaN:_?0:p);if(e==null?(si=!1,d=C):d=e,v.precision=d+=g,t=Ao(_),i=t.charAt(0),Math.abs(o=p.e)<15e14){for(;i<7&&i!=1||i==1&&t.charAt(1)>3;)p=p.times(n),t=Ao(p.d),i=t.charAt(0),f++;o=p.e,i>1?(p=new v("0."+t),o++):p=new v(i+"."+t.slice(1))}else return c=mT(v,d+2,C).times(o+""),p=ff(new v(i+"."+t.slice(1)),d-g).plus(c),v.precision=C,e==null?Ot(p,C,b,si=!0):p;for(u=p,l=r=p=En(p.minus(1),p.plus(1),d,1),h=Ot(p.times(p),d,1),s=3;;){if(r=Ot(r.times(h),d,1),c=l.plus(En(r,new v(s),d,1)),Ao(c.d).slice(0,d)===Ao(l.d).slice(0,d))if(l=l.times(2),o!==0&&(l=l.plus(mT(v,d+2,C).times(o+""))),l=En(l,new v(f),d,1),e==null)if(jy(l.d,d-g,b,a))v.precision=d+=g,c=r=p=En(u.minus(1),u.plus(1),d,1),h=Ot(p.times(p),d,1),s=a=1;else return Ot(l,v.precision=C,b,si=!0);else return v.precision=C,l;l=c,s+=2}}function Bre(n){return String(n.s*n.s/0)}function k3(n,e){var t,i,s;for((t=e.indexOf("."))>-1&&(e=e.replace(".","")),(i=e.search(/e/i))>0?(t<0&&(t=i),t+=+e.slice(i+1),e=e.substring(0,i)):t<0&&(t=e.length),i=0;e.charCodeAt(i)===48;i++);for(s=e.length;e.charCodeAt(s-1)===48;--s);if(e=e.slice(i,s),e){if(s-=i,n.e=t=t-i-1,n.d=[],i=(t+1)%Zt,t<0&&(i+=Zt),in.constructor.maxE?(n.d=null,n.e=NaN):n.e-1){if(e=e.replace(/(\d)_(?=\d)/g,"$1"),Rre.test(e))return k3(n,e)}else if(e==="Infinity"||e==="NaN")return+e||(n.s=NaN),n.e=NaN,n.d=null,n;if(yUe.test(e))t=16,e=e.toLowerCase();else if(wUe.test(e))t=2;else if(SUe.test(e))t=8;else throw Error(mg+e);for(o=e.search(/p/i),o>0?(l=+e.slice(o+1),e=e.substring(2,o)):e=e.slice(2),o=e.indexOf("."),r=o>=0,i=n.constructor,r&&(e=e.replace(".",""),a=e.length,o=a-o,s=Ore(i,new i(t),o,o*2)),c=WD(e,t,cc),d=c.length-1,o=d;c[o]===0;--o)c.pop();return o<0?new i(n.s*0):(n.e=uA(c,d),n.d=c,si=!1,r&&(n=En(n,s,a*4)),l&&(n=n.times(Math.abs(l)<54?Gs(2,l):gf.pow(2,l))),si=!0,n)}function IUe(n,e){var t,i=e.d.length;if(i<3)return e.isZero()?e:c0(n,2,e,e);t=1.4*Math.sqrt(i),t=t>16?16:t|0,e=e.times(1/hA(5,t)),e=c0(n,2,e,e);for(var s,o=new n(5),r=new n(16),a=new n(20);t--;)s=e.times(e),e=e.times(o.plus(s.times(r.times(s).minus(a))));return e}function c0(n,e,t,i,s){var o,r,a,l,c=n.precision,d=Math.ceil(c/Zt);for(si=!1,l=t.times(t),a=new n(i);;){if(r=En(a.times(l),new n(e++*e++),c,1),a=s?i.plus(r):i.minus(r),i=En(r.times(l),new n(e++*e++),c,1),r=a.plus(i),r.d[d]!==void 0){for(o=d;r.d[o]===a.d[o]&&o--;);if(o==-1)break}o=a,a=i,i=r,r=o}return si=!0,r.d.length=d+1,r}function hA(n,e){for(var t=n;--e;)t*=n;return t}function Wre(n,e){var t,i=e.s<0,s=tc(n,n.precision,1),o=s.times(.5);if(e=e.abs(),e.lte(o))return Nu=i?4:1,e;if(t=e.divToInt(s),t.isZero())Nu=i?3:2;else{if(e=e.minus(t.times(s)),e.lte(o))return Nu=kq(t)?i?2:3:i?4:1,e;Nu=kq(t)?i?1:4:i?3:2}return e.minus(s).abs()}function M6(n,e,t,i){var s,o,r,a,l,c,d,u,h,f=n.constructor,g=t!==void 0;if(g?(sa(t,1,Og),i===void 0?i=f.rounding:sa(i,0,8)):(t=f.precision,i=f.rounding),!n.isFinite())d=Bre(n);else{for(d=Od(n),r=d.indexOf("."),g?(s=2,e==16?t=t*4-3:e==8&&(t=t*3-2)):s=e,r>=0&&(d=d.replace(".",""),h=new f(1),h.e=d.length-r,h.d=WD(Od(h),10,s),h.e=h.d.length),u=WD(d,10,s),o=l=u.length;u[--l]==0;)u.pop();if(!u[0])d=g?"0p+0":"0";else{if(r<0?o--:(n=new f(n),n.d=u,n.e=o,n=En(n,h,t,i,0,s),u=n.d,o=n.e,c=xre),r=u[t],a=s/2,c=c||u[t+1]!==void 0,c=i<4?(r!==void 0||c)&&(i===0||i===(n.s<0?3:2)):r>a||r===a&&(i===4||c||i===6&&u[t-1]&1||i===(n.s<0?8:7)),u.length=t,c)for(;++u[--t]>s-1;)u[t]=0,t||(++o,u.unshift(1));for(l=u.length;!u[l-1];--l);for(r=0,d="";r1)if(e==16||e==8){for(r=e==16?4:3,--l;l%r;l++)d+="0";for(u=WD(d,s,e),l=u.length;!u[l-1];--l);for(r=1,d="1.";rl)for(o-=l;o--;)d+="0";else oe)return n.length=e,!0}function TUe(n){return new this(n).abs()}function xUe(n){return new this(n).acos()}function NUe(n){return new this(n).acosh()}function AUe(n,e){return new this(n).plus(e)}function MUe(n){return new this(n).asin()}function RUe(n){return new this(n).asinh()}function PUe(n){return new this(n).atan()}function OUe(n){return new this(n).atanh()}function FUe(n,e){n=new this(n),e=new this(e);var t,i=this.precision,s=this.rounding,o=i+4;return!n.s||!e.s?t=new this(NaN):!n.d&&!e.d?(t=tc(this,o,1).times(e.s>0?.25:.75),t.s=n.s):!e.d||n.isZero()?(t=e.s<0?tc(this,i,s):new this(0),t.s=n.s):!n.d||e.isZero()?(t=tc(this,o,1).times(.5),t.s=n.s):e.s<0?(this.precision=o,this.rounding=1,t=this.atan(En(n,e,o,1)),e=tc(this,o,1),this.precision=i,this.rounding=s,t=n.s<0?t.minus(e):t.plus(e)):t=this.atan(En(n,e,o,1)),t}function BUe(n){return new this(n).cbrt()}function WUe(n){return Ot(n=new this(n),n.e+1,2)}function VUe(n,e,t){return new this(n).clamp(e,t)}function HUe(n){if(!n||typeof n!="object")throw Error(dA+"Object expected");var e,t,i,s=n.defaults===!0,o=["precision",1,Og,"rounding",0,8,"toExpNeg",-Dv,0,"toExpPos",0,Dv,"maxE",0,Dv,"minE",-Dv,0,"modulo",0,9];for(e=0;e=o[e+1]&&i<=o[e+2])this[t]=i;else throw Error(mg+t+": "+i);if(t="crypto",s&&(this[t]=y3[t]),(i=n[t])!==void 0)if(i===!0||i===!1||i===0||i===1)if(i)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))this[t]=!0;else throw Error(Are);else this[t]=!1;else throw Error(mg+t+": "+i);return this}function $Ue(n){return new this(n).cos()}function zUe(n){return new this(n).cosh()}function Vre(n){var e,t,i;function s(o){var r,a,l,c=this;if(!(c instanceof s))return new s(o);if(c.constructor=s,Eq(o)){c.s=o.s,si?!o.d||o.e>s.maxE?(c.e=NaN,c.d=null):o.e=10;a/=10)r++;si?r>s.maxE?(c.e=NaN,c.d=null):r=429e7?e[o]=crypto.getRandomValues(new Uint32Array(1))[0]:a[o++]=s%1e7;else if(crypto.randomBytes){for(e=crypto.randomBytes(i*=4);o=214e7?crypto.randomBytes(4).copy(e,o):(a.push(s%1e7),o+=4);o=i/4}else throw Error(Are);else for(;o=10;s/=10)i++;i["onInputChange","onLazyChange","onIncrement","onDecrement"]},rules:Array,onBeforeChange:Se(),onChange:Se(),onIncrement:Se(),onDecrement:Se(),"onUpdate:modelValue":Se()},Iq=100,Tq=600,{name:pje,n:mje,classes:_je}=st("counter"),vje=["inputmode","readonly","disabled"];function bje(n,e){const t=gt("var-icon"),i=gt("var-button"),s=gt("var-form-details");return q(),re("div",{class:B(n.classes(n.n(),n.n("$--box")))},[me("div",fn({class:n.classes(n.n("controller"),n.formatElevation(n.elevation,2),[n.disabled||n.formDisabled,n.n("--disabled")],[n.errorMessage,n.n("--error")]),style:{background:n.color}},n.$attrs),[Oe(i,{class:B(n.classes(n.n("decrement-button"),[!n.decrementButton,n.n("--hidden")],[n.disabled||n.formDisabled,n.n("--not-allowed")])),style:Fe({width:n.toSizeUnit(n.buttonSize),height:n.toSizeUnit(n.buttonSize)}),round:"","var-counter-cover":"",ripple:n.ripple&&n.decrementButton&&!n.disabled&&!n.formDisabled&&!n.readonly&&!n.formReadonly&&!n.disableDecrement&&!n.isMin,onClick:n.decrement,onTouchstart:n.pressDecrement,onTouchend:n.releaseDecrement,onTouchcancel:n.releaseDecrement},{default:Lt(()=>[Oe(t,{name:"minus"})]),_:1},8,["class","style","ripple","onClick","onTouchstart","onTouchend","onTouchcancel"]),wi(me("input",{class:B(n.classes(n.n("input"),[n.disabled||n.formDisabled,n.n("--not-allowed")])),style:Fe({width:n.toSizeUnit(n.inputWidth),fontSize:n.toSizeUnit(n.inputTextSize)}),inputmode:n.toNumber(n.decimalLength)===0?"numeric":"decimal",readonly:n.readonly||n.formReadonly,disabled:n.disabled||n.formDisabled||n.disableInput,"onUpdate:modelValue":e[0]||(e[0]=o=>n.inputValue=o),onChange:e[1]||(e[1]=(...o)=>n.handleChange&&n.handleChange(...o))},null,46,vje),[[che,n.inputValue]]),Oe(i,{class:B(n.classes(n.n("increment-button"),[!n.incrementButton,n.n("--hidden")],[n.disabled||n.formDisabled,n.n("--not-allowed")])),style:Fe({width:n.toSizeUnit(n.buttonSize),height:n.toSizeUnit(n.buttonSize)}),round:"","var-counter-cover":"",ripple:n.ripple&&n.incrementButton&&!n.disabled&&!n.formDisabled&&!n.readonly&&!n.formReadonly&&!n.disableIncrement&&!n.isMax,onClick:n.increment,onTouchstart:n.pressIncrement,onTouchend:n.releaseIncrement,onTouchcancel:n.releaseIncrement},{default:Lt(()=>[Oe(t,{name:"plus"})]),_:1},8,["class","style","ripple","onClick","onTouchstart","onTouchend","onTouchcancel"])],16),Oe(s,{"error-message":n.errorMessage},null,8,["error-message"])],2)}const Hre=et({name:pje,components:{VarButton:ia,VarIcon:Wn,VarFormDetails:na},directives:{Ripple:Ns},inheritAttrs:!1,props:gje,setup(n){const e=se(""),{bindForm:t,form:i}=kl(),{errorMessage:s,validateWithTrigger:o,validate:r,resetValidation:a}=Ll(),{readonly:l,disabled:c}=i!=null?i:{},d=ve(()=>{const{max:X,modelValue:J}=n;return X!=null&&Ie(J)>=Ie(X)}),u=ve(()=>{const{min:X,modelValue:J}=n;return X!=null&&Ie(J)<=Ie(X)});let h,f,g,p;oe(t,{reset:C,validate:v,resetValidation:a}),ht(()=>n.modelValue,X=>{W(w(String(X))),oe(n.onChange,Ie(X))}),W(w(String(n.modelValue)));function v(){return r(n.rules,n.modelValue)}function b(X){Fn(()=>{const{validateTrigger:J,rules:Q,modelValue:le}=n;o(J,X,Q,le)})}function C(){const{min:X}=n;oe(n["onUpdate:modelValue"],X!=null?Ie(X):0),a()}function w(X){const{decimalLength:J,max:Q,min:le}=n;let de=Ie(X);return Q!=null&&de>Ie(Q)&&(de=Ie(Q)),le!=null&&de{P()},Tq))}function D(){const{press:X,lazyChange:J}=n;!X||J||(g=window.setTimeout(()=>{T()},Tq))}function x(){f&&clearTimeout(f),p&&clearTimeout(p)}function A(){h&&clearTimeout(h),g&&clearTimeout(g)}function T(){h=window.setTimeout(()=>{S(),T()},Iq)}function P(){f=window.setTimeout(()=>{L(),P()},Iq)}function W(X){e.value=X;const J=Ie(X);oe(n["onUpdate:modelValue"],J)}function $(X){W(w(String(X))),b("onLazyChange")}return{inputValue:e,errorMessage:s,formDisabled:c,formReadonly:l,isMax:d,isMin:u,n:mje,classes:_je,formatElevation:or,validate:v,reset:C,resetValidation:a,handleChange:y,decrement:L,increment:S,pressDecrement:k,pressIncrement:D,releaseDecrement:x,releaseIncrement:A,toSizeUnit:ri,toNumber:Ie}}});Hre.render=bje;var $re=Hre;lt($re);var D3=$re,zre=60,Ure=zre*60,jre=Ure*24,Cje=jre*7,d0=1e3,JR=zre*d0,xq=Ure*d0,wje=jre*d0,yje=Cje*d0,R6="millisecond",Ev="second",Iv="minute",Tv="hour",Vh="day",VD="week",$l="month",Kre="quarter",Hh="year",xv="date",Sje="YYYY-MM-DDTHH:mm:ssZ",Nq="Invalid Date",Lje=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,kje=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g;const Dje={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(e){var t=["th","st","nd","rd"],i=e%100;return"["+e+(t[(i-20)%10]||t[i]||t[0])+"]"}};var E3=function(e,t,i){var s=String(e);return!s||s.length>=t?e:""+Array(t+1-s.length).join(i)+e},Eje=function(e){var t=-e.utcOffset(),i=Math.abs(t),s=Math.floor(i/60),o=i%60;return(t<=0?"+":"-")+E3(s,2,"0")+":"+E3(o,2,"0")},Ije=function n(e,t){if(e.date()1)return n(r[0])}else{var a=e.name;em[a]=e,s=a}return!i&&s&&(GC=s),s||!i&&GC},wt=function(e,t){if(P6(e))return e.clone();var i=typeof t=="object"?t:{};return i.date=e,i.args=arguments,new fA(i)},Mje=function(e,t){return wt(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})},mn=Aje;mn.l=_T;mn.i=P6;mn.w=Mje;var Rje=function(e){var t=e.date,i=e.utc;if(t===null)return new Date(NaN);if(mn.u(t))return new Date;if(t instanceof Date)return new Date(t);if(typeof t=="string"&&!/Z$/i.test(t)){var s=t.match(Lje);if(s){var o=s[2]-1||0,r=(s[7]||"0").substring(0,3);return i?new Date(Date.UTC(s[1],o,s[3]||1,s[4]||0,s[5]||0,s[6]||0,r)):new Date(s[1],o,s[3]||1,s[4]||0,s[5]||0,s[6]||0,r)}}return new Date(t)},fA=function(){function n(t){this.$L=_T(t.locale,null,!0),this.parse(t),this.$x=this.$x||t.x||{},this[qre]=!0}var e=n.prototype;return e.parse=function(i){this.$d=Rje(i),this.init()},e.init=function(){var i=this.$d;this.$y=i.getFullYear(),this.$M=i.getMonth(),this.$D=i.getDate(),this.$W=i.getDay(),this.$H=i.getHours(),this.$m=i.getMinutes(),this.$s=i.getSeconds(),this.$ms=i.getMilliseconds()},e.$utils=function(){return mn},e.isValid=function(){return this.$d.toString()!==Nq},e.isSame=function(i,s){var o=wt(i);return this.startOf(s)<=o&&o<=this.endOf(s)},e.isAfter=function(i,s){return wt(i)n.checkDate("prev"))},{default:Lt(()=>[Oe(t,{name:"chevron-left"})]),_:1},8,["disabled"]),me("div",{class:B(n.n("value")),onClick:e[1]||(e[1]=s=>n.$emit("check-panel"))},[Oe(On,{name:"var-date-picker".concat(n.reverse?"-reverse":"","-translatex")},{default:Lt(()=>[(q(),re("div",{key:n.showDate},ut(n.showDate),1))]),_:1},8,["name"])],2),Oe(i,{round:"",text:"",style:{filter:"opacity(0.54)"},disabled:n.disabled.right,onClick:e[2]||(e[2]=s=>n.checkDate("next"))},{default:Lt(()=>[Oe(t,{name:"chevron-right"})]),_:1},8,["disabled"])],2)}const Xre=et({name:"PanelHeader",components:{VarButton:ia,VarIcon:Wn},props:{date:{type:Object,required:!0},type:{type:String,default:"date"},disabled:{type:Object,required:!0}},emits:["check-panel","check-date"],setup(n,{emit:e}){const t=se(!1),i=se(0),s=ve(()=>{var r;const{date:a,type:l}=n,{previewMonth:c,previewYear:d}=a;if(l==="month")return Ie(d)+i.value;const u=(r=Xs.value.datePickerMonthDict)==null?void 0:r[c.index].name;return Xs.value.lang==="zh-CN"?"".concat(d," ").concat(u):"".concat(u," ").concat(d)}),o=r=>{r==="prev"&&n.disabled.left||r==="next"&&n.disabled.right||(e("check-date",r),t.value=r==="prev",i.value+=r==="prev"?-1:1)};return ht(()=>n.date,()=>{i.value=0}),{n:Oje,reverse:t,showDate:s,checkDate:o}}});Xre.render=Fje;var Qre=Xre,Bje=Object.defineProperty,Aq=Object.getOwnPropertySymbols,Wje=Object.prototype.hasOwnProperty,Vje=Object.prototype.propertyIsEnumerable,Mq=(n,e,t)=>e in n?Bje(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,Hje=(n,e)=>{for(var t in e||(e={}))Wje.call(e,t)&&Mq(n,t,e[t]);if(Aq)for(var t of Aq(e))Vje.call(e,t)&&Mq(n,t,e[t]);return n};wt.extend(Yre);wt.extend(Zre);const{n:Ok,classes:$je}=st("month-picker"),{n:Fk}=st("date-picker");function zje(n,e){const t=gt("panel-header"),i=gt("var-button");return q(),re("div",{class:B(n.n())},[me("div",{class:B(n.n("content"))},[Oe(t,{ref:"headerEl",type:"month",date:n.preview,disabled:n.panelBtnDisabled,onCheckPanel:n.clickYear,onCheckDate:n.checkDate},null,8,["date","disabled","onCheckPanel","onCheckDate"]),Oe(On,{name:"".concat(n.nDate()).concat(n.reverse?"-reverse":"","-translatex")},{default:Lt(()=>[(q(),re("ul",{key:n.panelKey},[(q(!0),re(li,null,ss(n.MONTH_LIST,s=>(q(),re("li",{key:s.index},[Oe(i,fn({type:"primary","var-month-picker-cover":"",ripple:!1,elevation:n.componentProps.buttonElevation},Hje({},n.buttonProps(s.index)),{onClick:o=>n.chooseMonth(s,o)}),{default:Lt(()=>[Mi(ut(n.getMonthAbbr(s.index)),1)]),_:2},1040,["elevation","onClick"])]))),128))]))]),_:1},8,["name"])],2)],2)}const Jre=et({name:"MonthPickerPanel",components:{VarButton:ia,PanelHeader:Qre},props:{choose:{type:Object,required:!0},preview:{type:Object,required:!0},current:{type:String,required:!0},clickYear:{type:Function,required:!0},componentProps:{type:Object,required:!0}},emits:["check-preview","choose-month"],setup(n,{emit:e}){const[t,i]=n.current.split("-"),s=se(!1),o=se(0),r=se(null),a=Cn({left:!1,right:!1}),l=ve(()=>n.choose.chooseYear===n.preview.previewYear),c=ve(()=>n.preview.previewYear===t),d=v=>{var b,C;return(C=(b=Xs.value.datePickerMonthDict)==null?void 0:b[v].abbr)!=null?C:""},u=v=>{const{preview:{previewYear:b},componentProps:{min:C,max:w}}=n;let y=!0,L=!0;const S="".concat(b,"-").concat(v);return w&&(y=wt(S).isSameOrBefore(wt(w),"month")),C&&(L=wt(S).isSameOrAfter(wt(C),"month")),y&&L},h=v=>{const{choose:{chooseMonths:b,chooseDays:C,chooseRangeMonth:w},componentProps:{type:y,range:L}}=n;if(L){if(!w.length)return!1;const S=wt(v).isSameOrBefore(wt(w[1]),"month"),k=wt(v).isSameOrAfter(wt(w[0]),"month");return S&&k}return y==="month"?b.includes(v):C.some(S=>S.includes(v))},f=v=>{const{choose:{chooseMonth:b},preview:{previewYear:C},componentProps:{allowedDates:w,color:y,multiple:L,range:S}}=n,k="".concat(C,"-").concat(v),D=()=>S||L?h(k):(b==null?void 0:b.index)===v&&l.value,A=(()=>u(v)?w?!w(k):!1:!0)(),T=()=>A?!0:S||L?!h(k):!l.value||(b==null?void 0:b.index)!==v,P=()=>c.value&&i===v&&n.componentProps.showCurrent?(S||L||l.value)&&A?!0:S||L?!h(k):l.value?(b==null?void 0:b.index)!==i:!0:!1,W=()=>A?"":P()?y!=null?y:"":D()?"":"".concat(Fk(),"-color-cover"),$=W().startsWith(Fk());return{outline:P(),text:T(),color:T()?"":y,textColor:$?"":W(),["".concat(Fk(),"-color-cover")]:$,class:$je(Ok("button"),[A,Ok("button--disabled")]),disabled:A}},g=(v,b)=>{b.currentTarget.classList.contains(Ok("button--disabled"))||e("choose-month",v)},p=v=>{s.value=v==="prev",o.value+=v==="prev"?-1:1,e("check-preview","year",v)},_=v=>{r.value.checkDate(v)};return ht(()=>n.preview.previewYear,v=>{const{componentProps:{min:b,max:C}}=n;C&&(a.right=!wt("".concat(Ie(v)+1)).isSameOrBefore(wt(C),"year")),b&&(a.left=!wt("".concat(Ie(v)-1)).isSameOrAfter(wt(b),"year"))},{immediate:!0}),{n:Ok,nDate:Fk,pack:Xs,MONTH_LIST:HD,headerEl:r,reverse:s,panelKey:o,panelBtnDisabled:a,forwardRef:_,buttonProps:f,getMonthAbbr:d,chooseMonth:g,checkDate:p}}});Jre.render=zje;var Uje=Jre;const{n:Rq,classes:jje}=st("year-picker"),Kje=["onClick"];function qje(n,e){return q(),re("ul",{ref:"panel",class:B(n.n())},[(q(!0),re(li,null,ss(n.yearList,t=>(q(),re("li",{key:t,class:B(n.classes(n.n("item"),[t===n.toNumber(n.preview),n.n("item--active")])),style:Fe({color:t===n.toNumber(n.preview)?n.componentProps.color:""}),onClick:i=>n.chooseYear(t)},ut(t),15,Kje))),128))],2)}const eae=et({name:"YearPickerPanel",props:{preview:{type:String},componentProps:{type:Object,required:!0}},emits:["choose-year"],setup(n,{emit:e}){const t=se(),i=ve(()=>{const o=[],{preview:r,componentProps:{max:a,min:l}}=n;if(!r)return o;let c=[Ie(r)+100,Ie(r)-100];if(a){const d=wt(a).format("YYYY-MM-D"),u=Ie(d.split("-")[0]);if(uc[1]&&(c=[u,c[1]]),u<=c[1])return[u]}if(l){const d=wt(l).format("YYYY-MM-D"),u=Ie(d.split("-")[0]);if(uc[1]&&(c=[c[0],u]),u>=c[0])return[u]}for(let d=c[0];d>=c[1];d--)o.push(d);return o}),s=o=>{e("choose-year",o)};return Vo(()=>{const o=t.value.querySelector(".".concat(Rq("item--active")));o==null||o.scrollIntoView({block:"center"})}),{n:Rq,classes:jje,panel:t,yearList:i,chooseYear:s,toNumber:Ie}}});eae.render=qje;var Gje=eae,Yje=Object.defineProperty,Pq=Object.getOwnPropertySymbols,Zje=Object.prototype.hasOwnProperty,Xje=Object.prototype.propertyIsEnumerable,Oq=(n,e,t)=>e in n?Yje(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,Qje=(n,e)=>{for(var t in e||(e={}))Zje.call(e,t)&&Oq(n,t,e[t]);if(Pq)for(var t of Pq(e))Xje.call(e,t)&&Oq(n,t,e[t]);return n};wt.extend(Yre);wt.extend(Zre);const{n:H_,classes:Jje}=st("day-picker"),{n:Bk}=st("date-picker");function eKe(n,e){const t=gt("panel-header"),i=gt("var-button");return q(),re("div",{class:B(n.n())},[me("div",{class:B(n.n("content"))},[Oe(t,{ref:"headerEl",type:"day",date:n.preview,disabled:n.panelBtnDisabled,onCheckPanel:n.clickMonth,onCheckDate:n.checkDate},null,8,["date","disabled","onCheckPanel","onCheckDate"]),Oe(On,{name:"".concat(n.nDate()).concat(n.reverse?"-reverse":"","-translatex")},{default:Lt(()=>[(q(),re("div",{key:n.panelKey},[me("ul",{class:B(n.n("head"))},[(q(!0),re(li,null,ss(n.sortWeekList,s=>(q(),re("li",{key:s.index},ut(n.getDayAbbr(s.index)),1))),128))],2),me("ul",{class:B(n.n("body"))},[(q(!0),re(li,null,ss(n.days,(s,o)=>(q(),re("li",{key:o},[Oe(i,fn({type:"primary","var-day-picker-cover":"",round:"",ripple:!1,elevation:n.componentProps.buttonElevation},Qje({},n.buttonProps(s)),{onClick:r=>n.chooseDay(s,r)}),{default:Lt(()=>[Mi(ut(n.filterDay(s)),1)]),_:2},1040,["elevation","onClick"])]))),128))],2)]))]),_:1},8,["name"])],2)],2)}const tae=et({name:"DayPickerPanel",components:{VarButton:ia,PanelHeader:Qre},props:{choose:{type:Object,required:!0},preview:{type:Object,required:!0},current:{type:String,required:!0},clickMonth:{type:Function,required:!0},componentProps:{type:Object,required:!0}},emits:["check-preview","choose-day"],setup(n,{emit:e}){const[t,i,s]=n.current.split("-"),o=se([]),r=se(!1),a=se(0),l=se(null),c=Cn({left:!1,right:!1}),d=ve(()=>n.preview.previewYear===t&&n.preview.previewMonth.index===i),u=ve(()=>{var S;return n.choose.chooseYear===n.preview.previewYear&&((S=n.choose.chooseMonth)==null?void 0:S.index)===n.preview.previewMonth.index}),h=ve(()=>{const S=oC.findIndex(k=>k.index===n.componentProps.firstDayOfWeek);return S===-1||S===0?oC:oC.slice(S).concat(oC.slice(0,S))}),f=S=>{var k,D;return(D=(k=Xs.value.datePickerWeekDict)==null?void 0:k[S].abbr)!=null?D:""},g=S=>S>0?S:"",p=()=>{const{preview:{previewMonth:S,previewYear:k}}=n,D=wt("".concat(k,"-").concat(S.index)).daysInMonth(),x=wt("".concat(k,"-").concat(S.index,"-01")).day(),A=h.value.findIndex(T=>T.index==="".concat(x));o.value=[...Array(A).fill(-1),...Array.from(Array(D+1).keys())].filter(T=>T)},_=()=>{const{preview:{previewYear:S,previewMonth:k},componentProps:{max:D,min:x}}=n;if(D){const A="".concat(S,"-").concat(Ie(k.index)+1);c.right=!wt(A).isSameOrBefore(wt(D),"month")}if(x){const A="".concat(S,"-").concat(Ie(k.index)-1);c.left=!wt(A).isSameOrAfter(wt(x),"month")}},v=S=>{const{preview:{previewYear:k,previewMonth:D},componentProps:{min:x,max:A}}=n;let T=!0,P=!0;const W="".concat(k,"-").concat(D.index,"-").concat(S);return A&&(T=wt(W).isSameOrBefore(wt(A),"day")),x&&(P=wt(W).isSameOrAfter(wt(x),"day")),T&&P},b=S=>{const{choose:{chooseDays:k,chooseRangeDay:D},componentProps:{range:x}}=n;if(x){if(!D.length)return!1;const A=wt(S).isSameOrBefore(wt(D[1]),"day"),T=wt(S).isSameOrAfter(wt(D[0]),"day");return A&&T}return k.includes(S)},C=S=>{if(S<0)return{text:!0,outline:!1,textColor:"",class:H_("button"),disabled:!0};const{choose:{chooseDay:k},preview:{previewYear:D,previewMonth:x},componentProps:{allowedDates:A,color:T,multiple:P,range:W}}=n,$="".concat(D,"-").concat(x.index,"-").concat(S),X=()=>W||P?b($):Ie(k)===S&&u.value,Q=(()=>v(S)?A?!A($):!1:!0)(),le=()=>Q?!0:W||P?!b($):!u.value||Ie(k)!==S,de=()=>d.value&&Ie(s)===S&&n.componentProps.showCurrent?(W||P||u.value)&&Q?!0:W||P?!b($):u.value?k!==s:!0:!1,_e=()=>Q?"":de()?T!=null?T:"":X()?"":"".concat(Bk(),"-color-cover"),ie=_e().startsWith(Bk());return{text:le(),outline:de(),textColor:ie?"":_e(),["".concat(Bk(),"-color-cover")]:ie,class:Jje(H_("button"),H_("button--usable"),[Q,H_("button--disabled")]),disabled:Q}},w=S=>{r.value=S==="prev",a.value+=S==="prev"?-1:1,e("check-preview","month",S)},y=(S,k)=>{k.currentTarget.classList.contains(H_("button--disabled"))||e("choose-day",S)},L=S=>{l.value.checkDate(S)};return Vo(()=>{p(),_()}),ht(()=>n.preview,()=>{p(),_()}),{n:H_,nDate:Bk,days:o,reverse:r,headerEl:l,panelKey:a,sortWeekList:h,panelBtnDisabled:c,forwardRef:L,filterDay:g,getDayAbbr:f,checkDate:w,chooseDay:y,buttonProps:C}}});tae.render=eKe;var tKe=tae,iKe=(n,e,t)=>new Promise((i,s)=>{var o=l=>{try{a(t.next(l))}catch(c){s(c)}},r=l=>{try{a(t.throw(l))}catch(c){s(c)}},a=l=>l.done?i(l.value):Promise.resolve(l.value).then(o,r);a((t=t.apply(n,e)).next())});const{name:nKe,n:sKe,classes:oKe}=st("date-picker");function rKe(n,e){var t;const i=gt("year-picker-panel"),s=gt("month-picker-panel"),o=gt("day-picker-panel");return q(),re("div",{class:B(n.classes(n.n(),n.formatElevation(n.elevation,2)))},[me("div",{class:B(n.n("title")),style:Fe({background:n.titleColor||n.headerColor||n.color})},[me("div",{class:B(n.n("title-select"))},[me("div",{class:B(n.n("title-hint"))},ut((t=n.hint)!=null?t:n.pack.datePickerHint),3),me("div",{class:B(n.classes(n.n("title-year"),[n.isYearPanel,n.n("title-year--active")])),onClick:e[0]||(e[0]=r=>n.clickEl("year"))},[xe(n.$slots,"year",{year:n.chooseYear},()=>[Mi(ut(n.chooseYear),1)])],2)],2),me("div",{class:B(n.classes(n.n("title-date"),[!n.isYearPanel,n.n("title-date--active")],[n.range,n.n("title-date--range")])),onClick:e[1]||(e[1]=r=>n.clickEl("date"))},[Oe(On,{name:n.multiple?"":"".concat(n.n()).concat(n.reverse?"-reverse":"","-translatey")},{default:Lt(()=>{var r,a,l;return[n.type==="month"?(q(),re("div",{key:"".concat(n.chooseYear).concat((r=n.chooseMonth)==null?void 0:r.index)},[n.range?xe(n.$slots,"range",{key:0,choose:n.getChoose.chooseRangeMonth},()=>[Mi(ut(n.getMonthTitle),1)]):n.multiple?xe(n.$slots,"multiple",{key:1,choose:n.getChoose.chooseMonths},()=>[Mi(ut(n.getMonthTitle),1)]):xe(n.$slots,"month",{key:2,month:(a=n.chooseMonth)==null?void 0:a.index,year:n.chooseYear},()=>[Mi(ut(n.getMonthTitle),1)])])):(q(),re("div",{key:"".concat(n.chooseYear).concat((l=n.chooseMonth)==null?void 0:l.index).concat(n.chooseDay)},[n.range?xe(n.$slots,"range",{key:0,choose:n.formatRange},()=>[Mi(ut(n.getDateTitle),1)]):n.multiple?xe(n.$slots,"multiple",{key:1,choose:n.getChoose.chooseDays},()=>[Mi(ut(n.getDateTitle),1)]):xe(n.$slots,"date",pf(fn({key:2},n.slotProps)),()=>[Mi(ut(n.getDateTitle),1)])]))]}),_:3},8,["name"])],2)],6),me("div",{class:B(n.n("body")),onTouchstart:e[2]||(e[2]=(...r)=>n.handleTouchstart&&n.handleTouchstart(...r)),onTouchmove:e[3]||(e[3]=(...r)=>n.handleTouchmove&&n.handleTouchmove(...r)),onTouchend:e[4]||(e[4]=(...r)=>n.handleTouchend&&n.handleTouchend(...r))},[Oe(On,{name:"".concat(n.n(),"-panel-fade")},{default:Lt(()=>[n.getPanelType==="year"?(q(),ei(i,{key:0,"component-props":n.componentProps,preview:n.previewYear,onChooseYear:n.getChooseYear},null,8,["component-props","preview","onChooseYear"])):n.getPanelType==="month"?(q(),ei(s,{key:1,ref:"monthPanelEl",current:n.currentDate,choose:n.getChoose,preview:n.getPreview,"click-year":()=>n.clickEl("year"),"component-props":n.componentProps,onChooseMonth:n.getChooseMonth,onCheckPreview:n.checkPreview},null,8,["current","choose","preview","click-year","component-props","onChooseMonth","onCheckPreview"])):n.getPanelType==="date"?(q(),ei(o,{key:2,ref:"dayPanelEl",current:n.currentDate,choose:n.getChoose,preview:n.getPreview,"component-props":n.componentProps,"click-month":()=>n.clickEl("month"),onChooseDay:n.getChooseDay,onCheckPreview:n.checkPreview},null,8,["current","choose","preview","component-props","click-month","onChooseDay","onCheckPreview"])):Qe("v-if",!0)]),_:1},8,["name"])],34)],2)}const iae=et({name:nKe,components:{MonthPickerPanel:Uje,YearPickerPanel:Gje,DayPickerPanel:tKe},props:Pje,setup(n){const e=wt().format("YYYY-MM-D"),[t,i]=e.split("-"),s=HD.find(Ce=>Ce.index===i),o=se(!1),r=se(!1),a=se(!0),l=se(),c=se(),d=se(),u=se(s),h=se(t),f=se(!1),g=se([]),p=se([]),_=se([]),v=se([]),b=se(null),C=se(null),w=Cn({allowedDates:n.allowedDates,type:n.type,color:n.color,firstDayOfWeek:n.firstDayOfWeek,min:n.min,max:n.max,showCurrent:n.showCurrent,multiple:n.multiple,range:n.range,buttonElevation:n.buttonElevation}),y=ve(()=>({chooseMonth:l.value,chooseYear:c.value,chooseDay:d.value,chooseMonths:g.value,chooseDays:p.value,chooseRangeMonth:_.value,chooseRangeDay:v.value})),L=ve(()=>({previewMonth:u.value,previewYear:h.value})),S=ve(()=>{var Ce,Be;const{multiple:Ae,range:K}=n;if(K)return _.value.length?"".concat(_.value[0]," ~ ").concat(_.value[1]):"";let V="";return l.value&&(V=(Be=(Ce=Xs.value.datePickerMonthDict)==null?void 0:Ce[l.value.index].name)!=null?Be:""),Ae?"".concat(g.value.length).concat(Xs.value.datePickerSelected):V}),k=ve(()=>{var Ce,Be,Ae,K;const{multiple:V,range:G}=n;if(G){const Le=v.value.map(qe=>wt(qe).format("YYYY-MM-DD"));return Le.length?"".concat(Le[0]," ~ ").concat(Le[1]):""}if(V)return"".concat(p.value.length).concat(Xs.value.datePickerSelected);if(!c.value||!l.value||!d.value)return"";const N=wt("".concat(c.value,"-").concat(l.value.index,"-").concat(d.value)).day(),R=oC.find(Le=>Le.index==="".concat(N)),U=(Be=(Ce=Xs.value.datePickerWeekDict)==null?void 0:Ce[R.index].name)!=null?Be:"",H=(K=(Ae=Xs.value.datePickerMonthDict)==null?void 0:Ae[l.value.index].name)!=null?K:"",he=Bm(d.value,2,"0");return Xs.value.lang==="zh-CN"?"".concat(l.value.index,"-").concat(he," ").concat(U.slice(0,3)):"".concat(U.slice(0,3),", ").concat(H.slice(0,3)," ").concat(d.value)}),D=ve(()=>o.value?"year":n.type==="month"||r.value?"month":n.type==="date"?"date":""),x=ve(()=>!n.touchable||["","year"].includes(D.value)),A=ve(()=>{var Ce,Be,Ae,K;const V=wt("".concat(c.value,"-").concat((Ce=l.value)==null?void 0:Ce.index,"-").concat(d.value)).day(),G=d.value?Bm(d.value,2,"0"):"";return{week:"".concat(V),year:(Be=c.value)!=null?Be:"",month:(K=(Ae=l.value)==null?void 0:Ae.index)!=null?K:"",date:G}}),T=ve(()=>y.value.chooseRangeDay.map(Ce=>wt(Ce).format("YYYY-MM-DD"))),P=ve(()=>c.value===h.value),W=ve(()=>{var Ce;return((Ce=l.value)==null?void 0:Ce.index)===u.value.index});let $=0,X=0,J="",Q;ht(()=>n.modelValue,Ce=>{if(!(!je()||Z(Ce)||!Ce))if(n.range){if(!tn(Ce))return;a.value=Ce.length!==1,z(Ce,n.type)}else if(n.multiple){if(!tn(Ce))return;ae(Ce,n.type)}else we(Ce)},{immediate:!0}),ht(D,Ne);function le(Ce){Ce==="year"?o.value=!0:Ce==="month"?r.value=!0:(o.value=!1,r.value=!1)}function de(Ce){if(x.value)return;const{clientX:Be,clientY:Ae}=Ce.touches[0];$=Be,X=Ae}function _e(Ce,Be){return Ce>=Be&&Ce>20?"x":"y"}function ie(Ce){if(x.value)return;const{clientX:Be,clientY:Ae}=Ce.touches[0],K=Be-$,V=Ae-X;Q=_e(Math.abs(K),Math.abs(V)),J=K>0?"prev":"next"}function ne(){return iKe(this,null,function*(){if(x.value||Q!=="x")return;const Ce=D.value==="month"?b:C;yield Cr(),Ce.value.forwardRef(J),Ne()})}function Ye(Ce,Be){const Ae=Be==="month"?_:v;if(Ae.value=a.value?[Ce,Ce]:[Ae.value[0],Ce],a.value=!a.value,a.value){const V=wt(Ae.value[0]).isAfter(Ae.value[1])?[Ae.value[1],Ae.value[0]]:[...Ae.value];oe(n["onUpdate:modelValue"],V),oe(n.onChange,V)}}function pe(Ce,Be){const Ae=Be==="month"?g:p,K=Be==="month"?"YYYY-MM":"YYYY-MM-DD",V=Ae.value.map(N=>wt(N).format(K)),G=V.findIndex(N=>N===Ce);G===-1?V.push(Ce):V.splice(G,1),oe(n["onUpdate:modelValue"],V),oe(n.onChange,V)}function Ee(Ce,Be){return!c.value||!l.value?!1:P.value?Ce==="month"?Be.indexu.value.index:c.value>h.value}function ze(Ce){const{readonly:Be,range:Ae,multiple:K,onChange:V,"onUpdate:modelValue":G}=n;if(Ce<0||Be)return;f.value=Ee("day",Ce);const N="".concat(h.value,"-").concat(u.value.index,"-").concat(Ce),R=wt(N).format("YYYY-MM-DD");Ae?Ye(R,"day"):K?pe(R,"day"):(oe(G,R),oe(V,R))}function It(Ce){const{type:Be,readonly:Ae,range:K,multiple:V,onChange:G,onPreview:N,"onUpdate:modelValue":R}=n;if(f.value=Ee("month",Ce),Be==="month"&&!Ae){const U="".concat(h.value,"-").concat(Ce.index);K?Ye(U,"month"):V?pe(U,"month"):(oe(R,U),oe(G,U))}else u.value=Ce,oe(N,Ie(h.value),Ie(u.value.index));r.value=!1}function Ke(Ce){h.value="".concat(Ce),o.value=!1,r.value=!0,oe(n.onPreview,Ie(h.value),Ie(u.value.index))}function Xe(Ce,Be){const Ae=Be==="prev"?-1:1;if(Ce==="year")h.value="".concat(Ie(h.value)+Ae);else{let K=Ie(u.value.index)+Ae;K<1&&(h.value="".concat(Ie(h.value)-1),K=12),K>12&&(h.value="".concat(Ie(h.value)+1),K=1),u.value=HD.find(V=>Ie(V.index)===K)}oe(n.onPreview,Ie(h.value),Ie(u.value.index))}function je(){return(n.multiple||n.range)&&!tn(n.modelValue)?(console.error('[Varlet] DatePicker: type of prop "modelValue" should be an Array'),!1):!n.multiple&&!n.range&&tn(n.modelValue)?(console.error('[Varlet] DatePicker: type of prop "modelValue" should be a String'),!1):!0}function Z(Ce){return tn(Ce)?!1:Ce==="Invalid Date"?(console.error('[Varlet] DatePicker: "modelValue" is an Invalid Date'),!0):!1}function z(Ce,Be){const Ae=Be==="month"?_:v,K=Be==="month"?"YYYY-MM":"YYYY-MM-D",V=Ce.map(R=>wt(R).format(K)).slice(0,2);if(Ae.value.some(R=>Z(R)))return;Ae.value=V;const N=wt(Ae.value[0]).isAfter(Ae.value[1]);Ae.value.length===2&&N&&(Ae.value=[Ae.value[1],Ae.value[0]])}function ae(Ce,Be){const Ae=Be==="month"?g:p,K=Be==="month"?"YYYY-MM":"YYYY-MM-D",V=Array.from(new Set(Ce.map(G=>wt(G).format(K))));Ae.value=V.filter(G=>G!=="Invalid Date")}function we(Ce){const Be=wt(Ce).format("YYYY-MM-D");if(Z(Be))return;const[Ae,K,V]=Be.split("-"),G=HD.find(N=>N.index===K);l.value=G,c.value=Ae,d.value=V,u.value=G,h.value=Ae}function Ne(){X=0,$=0,J="",Q=void 0}return{monthPanelEl:b,dayPanelEl:C,reverse:f,currentDate:e,chooseMonth:l,chooseYear:c,chooseDay:d,previewYear:h,isYearPanel:o,isMonthPanel:r,getMonthTitle:S,getDateTitle:k,getPanelType:D,getChoose:y,getPreview:L,componentProps:w,slotProps:A,formatRange:T,pack:Xs,n:sKe,classes:oKe,clickEl:le,handleTouchstart:de,handleTouchmove:ie,handleTouchend:ne,getChooseDay:ze,getChooseMonth:It,getChooseYear:Ke,checkPreview:Xe,formatElevation:or}}});iae.render=rKe;var nae=iae;lt(nae);var I3=nae,aKe=Object.defineProperty,Fq=Object.getOwnPropertySymbols,lKe=Object.prototype.hasOwnProperty,cKe=Object.prototype.propertyIsEnumerable,Bq=(n,e,t)=>e in n?aKe(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,dKe=(n,e)=>{for(var t in e||(e={}))lKe.call(e,t)&&Bq(n,t,e[t]);if(Fq)for(var t of Fq(e))cKe.call(e,t)&&Bq(n,t,e[t]);return n};const uKe=dKe({show:Boolean,width:[Number,String],title:String,message:String,messageAlign:{type:String,default:"left"},confirmButton:{type:Boolean,default:!0},cancelButton:{type:Boolean,default:!0},confirmButtonText:String,cancelButtonText:String,confirmButtonTextColor:String,cancelButtonTextColor:String,confirmButtonColor:String,cancelButtonColor:String,dialogClass:String,dialogStyle:Object,onBeforeClose:Se(),onConfirm:Se(),onCancel:Se(),"onUpdate:show":Se()},yi(ZS,["overlay","overlayClass","overlayStyle","lockScroll","closeOnClickOverlay","teleport","onOpen","onClose","onOpened","onClosed","onClickOverlay","onRouteChange"]));var hKe=Object.defineProperty,Wq=Object.getOwnPropertySymbols,fKe=Object.prototype.hasOwnProperty,gKe=Object.prototype.propertyIsEnumerable,Vq=(n,e,t)=>e in n?hKe(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,pKe=(n,e)=>{for(var t in e||(e={}))fKe.call(e,t)&&Vq(n,t,e[t]);if(Wq)for(var t of Wq(e))gKe.call(e,t)&&Vq(n,t,e[t]);return n};const{name:mKe,n:_Ke,classes:vKe}=st("dialog");function bKe(n,e){const t=gt("var-button"),i=gt("var-popup");return q(),ei(i,{class:B(n.n("popup")),"var-dialog-cover":"",show:n.popupShow,overlay:n.overlay,"overlay-class":n.overlayClass,"overlay-style":n.overlayStyle,"lock-scroll":n.lockScroll,"close-on-click-overlay":n.popupCloseOnClickOverlay,teleport:n.teleport,onOpen:n.onOpen,onClose:n.onClose,onClosed:n.onClosed,onOpened:n.onOpened,onRouteChange:n.onRouteChange,onClickOverlay:n.handleClickOverlay},{default:Lt(()=>[me("div",fn({class:n.classes(n.n("$--box"),n.n(),n.dialogClass),style:pKe({width:n.toSizeUnit(n.width)},n.dialogStyle)},n.$attrs),[me("div",{class:B(n.n("title"))},[xe(n.$slots,"title",{},()=>{var s;return[Mi(ut((s=n.title)!=null?s:n.pack.dialogTitle),1)]})],2),me("div",{class:B(n.n("message")),style:Fe({textAlign:n.messageAlign})},[xe(n.$slots,"default",{},()=>[Mi(ut(n.message),1)])],6),me("div",{class:B(n.n("actions"))},[n.cancelButton?(q(),ei(t,{key:0,class:B(n.classes(n.n("button"),n.n("cancel-button"))),"var-dialog-cover":"",text:"","text-color":n.cancelButtonTextColor,color:n.cancelButtonColor,onClick:n.cancel},{default:Lt(()=>{var s;return[Mi(ut((s=n.cancelButtonText)!=null?s:n.pack.dialogCancelButtonText),1)]}),_:1},8,["class","text-color","color","onClick"])):Qe("v-if",!0),n.confirmButton?(q(),ei(t,{key:1,class:B(n.classes(n.n("button"),n.n("confirm-button"))),"var-dialog-cover":"",text:"","text-color":n.confirmButtonTextColor,color:n.confirmButtonColor,onClick:n.confirm},{default:Lt(()=>{var s;return[Mi(ut((s=n.confirmButtonText)!=null?s:n.pack.dialogConfirmButtonText),1)]}),_:1},8,["class","text-color","color","onClick"])):Qe("v-if",!0)],2)],16)]),_:3},8,["class","show","overlay","overlay-class","overlay-style","lock-scroll","close-on-click-overlay","teleport","onOpen","onClose","onClosed","onOpened","onRouteChange","onClickOverlay"])}const sae=et({name:mKe,components:{VarPopup:gg,VarButton:ia},inheritAttrs:!1,props:uKe,setup(n){const e=se(!1),t=se(!1);ht(()=>n.show,a=>{e.value=a},{immediate:!0}),ht(()=>n.closeOnClickOverlay,a=>{if(n.onBeforeClose!=null){t.value=!1;return}t.value=a},{immediate:!0});function i(){return oe(n["onUpdate:show"],!1)}function s(){const{closeOnClickOverlay:a,onClickOverlay:l,onBeforeClose:c}=n;if(oe(l),!!a){if(c!=null){oe(c,"close",i);return}oe(n["onUpdate:show"],!1)}}function o(){const{onBeforeClose:a,onConfirm:l}=n;if(oe(l),a!=null){oe(a,"confirm",i);return}oe(n["onUpdate:show"],!1)}function r(){const{onBeforeClose:a,onCancel:l}=n;if(oe(l),a!=null){oe(a,"cancel",i);return}oe(n["onUpdate:show"],!1)}return{pack:Xs,popupShow:e,popupCloseOnClickOverlay:t,n:_Ke,classes:vKe,handleClickOverlay:s,confirm:o,cancel:r,toSizeUnit:ri}}});sae.render=bKe;var gA=sae,CKe=Object.defineProperty,wKe=Object.defineProperties,yKe=Object.getOwnPropertyDescriptors,Hq=Object.getOwnPropertySymbols,SKe=Object.prototype.hasOwnProperty,LKe=Object.prototype.propertyIsEnumerable,$q=(n,e,t)=>e in n?CKe(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,e2=(n,e)=>{for(var t in e||(e={}))SKe.call(e,t)&&$q(n,t,e[t]);if(Hq)for(var t of Hq(e))LKe.call(e,t)&&$q(n,t,e[t]);return n},kKe=(n,e)=>wKe(n,yKe(e));let Gh,vT={};function DKe(n={}){return Us(n)?kKe(e2({},vT),{message:n}):e2(e2({},vT),n)}function f_(n){return nh()?new Promise(e=>{f_.close();const t=DKe(n),i=Cn(t);i.teleport="body",Gh=i;const{unmountInstance:s}=K0(gA,i,{onConfirm:()=>{oe(i.onConfirm),e("confirm")},onCancel:()=>{oe(i.onCancel),e("cancel")},onClose:()=>{oe(i.onClose),e("close")},onClosed:()=>{oe(i.onClosed),s(),Gh===i&&(Gh=null)},onRouteChange:()=>{s(),Gh===i&&(Gh=null)},"onUpdate:show":o=>{i.show=o}});i.show=!0}):Promise.resolve()}f_.setDefaultOptions=function(n){vT=n};f_.resetDefaultOptions=function(){vT={}};f_.close=function(){if(Gh!=null){const n=Gh;Gh=null,Fn().then(()=>{n.show=!1})}};f_.Component=gA;lt(gA);lt(gA,f_);var T3=f_;const EKe={inset:{type:[Boolean,Number,String],default:!1},vertical:Boolean,description:String,margin:String,dashed:Boolean,hairline:Boolean},{name:IKe,n:TKe,classes:xKe}=st("divider");function NKe(n,e){return q(),re("div",{class:B(n.classes(n.n(),n.n("$--box"),[n.vertical,n.n("--vertical")],[n.withText,n.n("--with-text")],[n.withPresetInset,n.n("--inset")],[n.dashed,n.n("--dashed")],[n.hairline,n.n("--hairline")])),style:Fe(n.style)},[n.vertical?Qe("v-if",!0):xe(n.$slots,"default",{key:0},()=>[n.description?(q(),re("span",{key:0,class:B(n.n("text"))},ut(n.description),3)):Qe("v-if",!0)])],6)}const oae=et({name:IKe,props:EKe,setup(n,{slots:e}){const t=se(!1),i=ve(()=>{const{vertical:r,inset:a}=n;return!r&&a===!0}),s=ve(()=>{const{inset:r,vertical:a,margin:l}=n;if(KB(r)||a)return{margin:l};const c=Ie(r),d=Math.abs(c)+(r+"").replace(c+"","");return{margin:l,width:"calc(100% - ".concat(ri(d),")"),left:c>0?ri(d):ri(0)}});Vo(o),Cg(o);function o(){const{description:r,vertical:a}=n;t.value=(e.default||r!=null)&&!a}return{n:TKe,classes:xKe,withText:t,style:s,withPresetInset:i}}});oae.render=NKe;var rae=oae;lt(rae);var x3=rae;const AKe={direction:{type:String,default:"xy"},attraction:String,disabled:Boolean,boundary:{type:Object,default:()=>({top:0,bottom:0,left:0,right:0})},zIndex:{type:[Number,String],default:90},teleport:{type:[String,Object,Boolean],default:"body"},onClick:Se()};var MKe=Object.defineProperty,RKe=Object.defineProperties,PKe=Object.getOwnPropertyDescriptors,zq=Object.getOwnPropertySymbols,OKe=Object.prototype.hasOwnProperty,FKe=Object.prototype.propertyIsEnumerable,Uq=(n,e,t)=>e in n?MKe(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,jq=(n,e)=>{for(var t in e||(e={}))OKe.call(e,t)&&Uq(n,t,e[t]);if(zq)for(var t of zq(e))FKe.call(e,t)&&Uq(n,t,e[t]);return n},Kq=(n,e)=>RKe(n,PKe(e)),BKe=(n,e,t)=>new Promise((i,s)=>{var o=l=>{try{a(t.next(l))}catch(c){s(c)}},r=l=>{try{a(t.throw(l))}catch(c){s(c)}},a=l=>l.done?i(l.value):Promise.resolve(l.value).then(o,r);a((t=t.apply(n,e)).next())});const{name:WKe,n:VKe,classes:HKe}=st("drag");function $Ke(n,e){return q(),ei(Bd,{to:n.teleport===!1?void 0:n.teleport,disabled:n.teleportDisabled||n.teleport===!1},[me("div",fn({ref:"drag",class:n.classes(n.n(),n.n("$--box"),[n.enableTransition,n.n("--transition")]),style:{"z-index":n.zIndex},onTouchstart:e[0]||(e[0]=(...t)=>n.handleTouchstart&&n.handleTouchstart(...t)),onTouchmove:e[1]||(e[1]=(...t)=>n.handleTouchmove&&n.handleTouchmove(...t)),onTouchend:e[2]||(e[2]=(...t)=>n.handleTouchend&&n.handleTouchend(...t)),onTouchcancel:e[3]||(e[3]=(...t)=>n.handleTouchend&&n.handleTouchend(...t)),onClick:e[4]||(e[4]=(...t)=>n.handleClick&&n.handleClick(...t))},n.getAttrs()),[xe(n.$slots,"default")],16)],8,["to","disabled"])}const aae=et({name:WKe,inheritAttrs:!1,props:AKe,setup(n,{attrs:e}){const t=se(null),i=se(0),s=se(0),o=se(!1),r=se(!1),{touching:a,dragging:l,moveX:c,moveY:d,startTouch:u,moveTouch:h,endTouch:f,resetTouch:g}=j0(),{disabled:p}=u_(),_=Cn({top:0,bottom:0,left:0,right:0});ht(()=>n.boundary,x),U0(T),Vo(()=>{x(),T()});function v(W){n.disabled||(u(W),y())}function b(W){return BKe(this,null,function*(){!a.value||n.disabled||(h(W),dc(W),r.value=!1,o.value=!0,n.direction.includes("x")&&(i.value+=c.value),n.direction.includes("y")&&(s.value+=d.value),D())})}function C(){n.disabled||(f(),r.value=!0,k())}function w(W){l.value||oe(n.onClick,W)}function y(){const{left:W,top:$}=L();i.value=W,s.value=$}function L(){const W=no(t.value),$=no(window),X=W.top-$.top,J=$.bottom-W.bottom,Q=W.left-$.left,le=$.right-W.right,{width:de,height:_e}=W,{width:ie,height:ne}=$;return{top:X,bottom:J,left:Q,right:le,width:de,height:_e,halfWidth:de/2,halfHeight:_e/2,windowWidth:ie,windowHeight:ne}}function S(){const W=L(),$=_.left,X=W.windowWidth-_.right-W.width,J=_.top,Q=W.windowHeight-_.bottom-W.height;return{minX:$,minY:J,maxX:$"u")return!1;var e=Ba(n).ShadowRoot;return n instanceof e||n instanceof ShadowRoot}function Fg(n){return((Vm(n)?n.ownerDocument:n.document)||window.document).documentElement}var YC=Math.max,Yq=Math.min,u0=Math.round;function N3(){var n=navigator.userAgentData;return n!=null&&n.brands&&Array.isArray(n.brands)?n.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function uae(){return!/^((?!chrome|android).)*safari/i.test(N3())}function h0(n,e,t){e===void 0&&(e=!1),t===void 0&&(t=!1);var i=n.getBoundingClientRect(),s=1,o=1;e&&dl(n)&&(s=n.offsetWidth>0&&u0(i.width)/n.offsetWidth||1,o=n.offsetHeight>0&&u0(i.height)/n.offsetHeight||1);var r=Vm(n)?Ba(n):window,a=r.visualViewport,l=!uae()&&t,c=(i.left+(l&&a?a.offsetLeft:0))/s,d=(i.top+(l&&a?a.offsetTop:0))/o,u=i.width/s,h=i.height/o;return{width:u,height:h,top:d,right:c+u,bottom:d+h,left:c,x:c,y:d}}function B6(n){var e=Ba(n),t=e.pageXOffset,i=e.pageYOffset;return{scrollLeft:t,scrollTop:i}}function W6(n){return h0(Fg(n)).left+B6(n).scrollLeft}function nqe(n,e){var t=Ba(n),i=Fg(n),s=t.visualViewport,o=i.clientWidth,r=i.clientHeight,a=0,l=0;if(s){o=s.width,r=s.height;var c=uae();(c||!c&&e==="fixed")&&(a=s.offsetLeft,l=s.offsetTop)}return{width:o,height:r,x:a+W6(n),y:l}}function Qu(n){return Ba(n).getComputedStyle(n)}function sqe(n){var e,t=Fg(n),i=B6(n),s=(e=n.ownerDocument)==null?void 0:e.body,o=YC(t.scrollWidth,t.clientWidth,s?s.scrollWidth:0,s?s.clientWidth:0),r=YC(t.scrollHeight,t.clientHeight,s?s.scrollHeight:0,s?s.clientHeight:0),a=-i.scrollLeft+W6(n),l=-i.scrollTop;return Qu(s||t).direction==="rtl"&&(a+=YC(t.clientWidth,s?s.clientWidth:0)-o),{width:o,height:r,x:a,y:l}}function Fd(n){return n?(n.nodeName||"").toLowerCase():null}function _A(n){return Fd(n)==="html"?n:n.assignedSlot||n.parentNode||(F6(n)?n.host:null)||Fg(n)}function V6(n){var e=Qu(n),t=e.overflow,i=e.overflowX,s=e.overflowY;return/auto|scroll|overlay|hidden/.test(t+s+i)}function hae(n){return["html","body","#document"].indexOf(Fd(n))>=0?n.ownerDocument.body:dl(n)&&V6(n)?n:hae(_A(n))}function ZC(n,e){var t;e===void 0&&(e=[]);var i=hae(n),s=i===((t=n.ownerDocument)==null?void 0:t.body),o=Ba(i),r=s?[o].concat(o.visualViewport||[],V6(i)?i:[]):i,a=e.concat(r);return s?a:a.concat(ZC(_A(r)))}function oqe(n){return["table","td","th"].indexOf(Fd(n))>=0}function Zq(n){return!dl(n)||Qu(n).position==="fixed"?null:n.offsetParent}function rqe(n){var e=/firefox/i.test(N3()),t=/Trident/i.test(N3());if(t&&dl(n)){var i=Qu(n);if(i.position==="fixed")return null}var s=_A(n);for(F6(s)&&(s=s.host);dl(s)&&["html","body"].indexOf(Fd(s))<0;){var o=Qu(s);if(o.transform!=="none"||o.perspective!=="none"||o.contain==="paint"||["transform","perspective"].indexOf(o.willChange)!==-1||e&&o.willChange==="filter"||e&&o.filter&&o.filter!=="none")return s;s=s.parentNode}return null}function H6(n){for(var e=Ba(n),t=Zq(n);t&&oqe(t)&&Qu(t).position==="static";)t=Zq(t);return t&&(Fd(t)==="html"||Fd(t)==="body"&&Qu(t).position==="static")?e:t||rqe(n)||e}function aqe(n,e){var t=e.getRootNode&&e.getRootNode();if(n.contains(e))return!0;if(t&&F6(t)){var i=e;do{if(i&&n.isSameNode(i))return!0;i=i.parentNode||i.host}while(i)}return!1}function A3(n){return Object.assign({},n,{left:n.x,top:n.y,right:n.x+n.width,bottom:n.y+n.height})}function lqe(n,e){var t=h0(n,!1,e==="fixed");return t.top=t.top+n.clientTop,t.left=t.left+n.clientLeft,t.bottom=t.top+n.clientHeight,t.right=t.left+n.clientWidth,t.width=n.clientWidth,t.height=n.clientHeight,t.x=t.left,t.y=t.top,t}function Xq(n,e,t){return e===cae?A3(nqe(n,t)):Vm(e)?lqe(e,t):A3(sqe(Fg(n)))}function cqe(n){var e=ZC(_A(n)),t=["absolute","fixed"].indexOf(Qu(n).position)>=0,i=t&&dl(n)?H6(n):n;return Vm(i)?e.filter(function(s){return Vm(s)&&aqe(s,i)&&Fd(s)!=="body"}):[]}function dqe(n,e,t,i){var s=e==="clippingParents"?cqe(n):[].concat(e),o=[].concat(s,[t]),r=o[0],a=o.reduce(function(l,c){var d=Xq(n,c,i);return l.top=YC(d.top,l.top),l.right=Yq(d.right,l.right),l.bottom=Yq(d.bottom,l.bottom),l.left=YC(d.left,l.left),l},Xq(n,r,i));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function qy(n){return n.split("-")[1]}function uqe(n){return["top","bottom"].indexOf(n)>=0?"x":"y"}function fae(n){var e=n.reference,t=n.element,i=n.placement,s=i?Of(i):null,o=i?qy(i):null,r=e.x+e.width/2-t.width/2,a=e.y+e.height/2-t.height/2,l;switch(s){case zu:l={x:r,y:e.y-t.height};break;case _g:l={x:r,y:e.y+e.height};break;case Wm:l={x:e.x+e.width,y:a};break;case Pf:l={x:e.x-t.width,y:a};break;default:l={x:e.x,y:e.y}}var c=s?uqe(s):null;if(c!=null){var d=c==="y"?"height":"width";switch(o){case mA:l[c]=l[c]-(e[d]/2-t[d]/2);break;case Ky:l[c]=l[c]+(e[d]/2-t[d]/2);break}}return l}function hqe(){return{top:0,right:0,bottom:0,left:0}}function fqe(n){return Object.assign({},hqe(),n)}function gqe(n,e){return e.reduce(function(t,i){return t[i]=n,t},{})}function gae(n,e){e===void 0&&(e={});var t=e,i=t.placement,s=i===void 0?n.placement:i,o=t.strategy,r=o===void 0?n.strategy:o,a=t.boundary,l=a===void 0?UKe:a,c=t.rootBoundary,d=c===void 0?cae:c,u=t.elementContext,h=u===void 0?A1:u,f=t.altBoundary,g=f===void 0?!1:f,p=t.padding,_=p===void 0?0:p,v=fqe(typeof _!="number"?_:gqe(_,pA)),b=h===A1?jKe:A1,C=n.rects.popper,w=n.elements[g?b:h],y=dqe(Vm(w)?w:w.contextElement||Fg(n.elements.popper),l,d,r),L=h0(n.elements.reference),S=fae({reference:L,element:C,strategy:"absolute",placement:s}),k=A3(Object.assign({},C,S)),D=h===A1?k:L,x={top:y.top-D.top+v.top,bottom:D.bottom-y.bottom+v.bottom,left:y.left-D.left+v.left,right:D.right-y.right+v.right},A=n.modifiersData.offset;if(h===A1&&A){var T=A[s];Object.keys(x).forEach(function(P){var W=[Wm,_g].indexOf(P)>=0?1:-1,$=[zu,_g].indexOf(P)>=0?"y":"x";x[P]+=T[$]*W})}return x}function pqe(n,e){e===void 0&&(e={});var t=e,i=t.placement,s=t.boundary,o=t.rootBoundary,r=t.padding,a=t.flipVariations,l=t.allowedAutoPlacements,c=l===void 0?dae:l,d=qy(i),u=d?a?qq:qq.filter(function(g){return qy(g)===d}):pA,h=u.filter(function(g){return c.indexOf(g)>=0});h.length===0&&(h=u);var f=h.reduce(function(g,p){return g[p]=gae(n,{placement:p,boundary:s,rootBoundary:o,padding:r})[Of(p)],g},{});return Object.keys(f).sort(function(g,p){return f[g]-f[p]})}function mqe(n){if(Of(n)===O6)return[];var e=$D(n);return[Gq(n),e,Gq(e)]}function _qe(n){var e=n.state,t=n.options,i=n.name;if(!e.modifiersData[i]._skip){for(var s=t.mainAxis,o=s===void 0?!0:s,r=t.altAxis,a=r===void 0?!0:r,l=t.fallbackPlacements,c=t.padding,d=t.boundary,u=t.rootBoundary,h=t.altBoundary,f=t.flipVariations,g=f===void 0?!0:f,p=t.allowedAutoPlacements,_=e.options.placement,v=Of(_),b=v===_,C=l||(b||!g?[$D(_)]:mqe(_)),w=[_].concat(C).reduce(function(Ye,pe){return Ye.concat(Of(pe)===O6?pqe(e,{placement:pe,boundary:d,rootBoundary:u,padding:c,flipVariations:g,allowedAutoPlacements:p}):pe)},[]),y=e.rects.reference,L=e.rects.popper,S=new Map,k=!0,D=w[0],x=0;x=0,$=W?"width":"height",X=gae(e,{placement:A,boundary:d,rootBoundary:u,altBoundary:h,padding:c}),J=W?P?Wm:Pf:P?_g:zu;y[$]>L[$]&&(J=$D(J));var Q=$D(J),le=[];if(o&&le.push(X[T]<=0),a&&le.push(X[J]<=0,X[Q]<=0),le.every(function(Ye){return Ye})){D=A,k=!1;break}S.set(A,le)}if(k)for(var de=g?3:1,_e=function(pe){var Ee=w.find(function(ze){var It=S.get(ze);if(It)return It.slice(0,pe).every(function(Ke){return Ke})});if(Ee)return D=Ee,"break"},ie=de;ie>0;ie--){var ne=_e(ie);if(ne==="break")break}e.placement!==D&&(e.modifiersData[i]._skip=!0,e.placement=D,e.reset=!0)}}const vqe={name:"flip",enabled:!0,phase:"main",fn:_qe,requiresIfExists:["offset"],data:{_skip:!1}};function bqe(n,e,t){var i=Of(n),s=[Pf,zu].indexOf(i)>=0?-1:1,o=typeof t=="function"?t(Object.assign({},e,{placement:n})):t,r=o[0],a=o[1];return r=r||0,a=(a||0)*s,[Pf,Wm].indexOf(i)>=0?{x:a,y:r}:{x:r,y:a}}function Cqe(n){var e=n.state,t=n.options,i=n.name,s=t.offset,o=s===void 0?[0,0]:s,r=dae.reduce(function(d,u){return d[u]=bqe(u,e.rects,o),d},{}),a=r[e.placement],l=a.x,c=a.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=l,e.modifiersData.popperOffsets.y+=c),e.modifiersData[i]=r}const wqe={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:Cqe};var yqe={top:"auto",right:"auto",bottom:"auto",left:"auto"};function Sqe(n,e){var t=n.x,i=n.y,s=e.devicePixelRatio||1;return{x:u0(t*s)/s||0,y:u0(i*s)/s||0}}function Qq(n){var e,t=n.popper,i=n.popperRect,s=n.placement,o=n.variation,r=n.offsets,a=n.position,l=n.gpuAcceleration,c=n.adaptive,d=n.roundOffsets,u=n.isFixed,h=r.x,f=h===void 0?0:h,g=r.y,p=g===void 0?0:g,_=typeof d=="function"?d({x:f,y:p}):{x:f,y:p};f=_.x,p=_.y;var v=r.hasOwnProperty("x"),b=r.hasOwnProperty("y"),C=Pf,w=zu,y=window;if(c){var L=H6(t),S="clientHeight",k="clientWidth";if(L===Ba(t)&&(L=Fg(t),Qu(L).position!=="static"&&a==="absolute"&&(S="scrollHeight",k="scrollWidth")),L=L,s===zu||(s===Pf||s===Wm)&&o===Ky){w=_g;var D=u&&L===y&&y.visualViewport?y.visualViewport.height:L[S];p-=D-i.height,p*=l?1:-1}if(s===Pf||(s===zu||s===_g)&&o===Ky){C=Wm;var x=u&&L===y&&y.visualViewport?y.visualViewport.width:L[k];f-=x-i.width,f*=l?1:-1}}var A=Object.assign({position:a},c&&yqe),T=d===!0?Sqe({x:f,y:p},Ba(t)):{x:f,y:p};if(f=T.x,p=T.y,l){var P;return Object.assign({},A,(P={},P[w]=b?"0":"",P[C]=v?"0":"",P.transform=(y.devicePixelRatio||1)<=1?"translate("+f+"px, "+p+"px)":"translate3d("+f+"px, "+p+"px, 0)",P))}return Object.assign({},A,(e={},e[w]=b?p+"px":"",e[C]=v?f+"px":"",e.transform="",e))}function Lqe(n){var e=n.state,t=n.options,i=t.gpuAcceleration,s=i===void 0?!0:i,o=t.adaptive,r=o===void 0?!0:o,a=t.roundOffsets,l=a===void 0?!0:a,c={placement:Of(e.placement),variation:qy(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:s,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,Qq(Object.assign({},c,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:r,roundOffsets:l})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,Qq(Object.assign({},c,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}const pae={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:Lqe,data:{}};function kqe(n){return{scrollLeft:n.scrollLeft,scrollTop:n.scrollTop}}function Dqe(n){return n===Ba(n)||!dl(n)?B6(n):kqe(n)}function Eqe(n){var e=n.getBoundingClientRect(),t=u0(e.width)/n.offsetWidth||1,i=u0(e.height)/n.offsetHeight||1;return t!==1||i!==1}function Iqe(n,e,t){t===void 0&&(t=!1);var i=dl(e),s=dl(e)&&Eqe(e),o=Fg(e),r=h0(n,s,t),a={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(i||!i&&!t)&&((Fd(e)!=="body"||V6(o))&&(a=Dqe(e)),dl(e)?(l=h0(e,!0),l.x+=e.clientLeft,l.y+=e.clientTop):o&&(l.x=W6(o))),{x:r.left+a.scrollLeft-l.x,y:r.top+a.scrollTop-l.y,width:r.width,height:r.height}}function Tqe(n){var e=h0(n),t=n.offsetWidth,i=n.offsetHeight;return Math.abs(e.width-t)<=1&&(t=e.width),Math.abs(e.height-i)<=1&&(i=e.height),{x:n.offsetLeft,y:n.offsetTop,width:t,height:i}}function xqe(n){var e=new Map,t=new Set,i=[];n.forEach(function(o){e.set(o.name,o)});function s(o){t.add(o.name);var r=[].concat(o.requires||[],o.requiresIfExists||[]);r.forEach(function(a){if(!t.has(a)){var l=e.get(a);l&&s(l)}}),i.push(o)}return n.forEach(function(o){t.has(o.name)||s(o)}),i}function Nqe(n){var e=xqe(n);return tqe.reduce(function(t,i){return t.concat(e.filter(function(s){return s.phase===i}))},[])}function Aqe(n){var e;return function(){return e||(e=new Promise(function(t){Promise.resolve().then(function(){e=void 0,t(n())})})),e}}function Mqe(n){var e=n.reduce(function(t,i){var s=t[i.name];return t[i.name]=s?Object.assign({},s,i,{options:Object.assign({},s.options,i.options),data:Object.assign({},s.data,i.data)}):i,t},{});return Object.keys(e).map(function(t){return e[t]})}var Jq={placement:"bottom",modifiers:[],strategy:"absolute"};function eG(){for(var n=arguments.length,e=new Array(n),t=0;te in n?Uqe(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,t2=(n,e)=>{for(var t in e||(e={}))qqe.call(e,t)&&iG(n,t,e[t]);if(tG)for(var t of tG(e))Gqe.call(e,t)&&iG(n,t,e[t]);return n},i2=(n,e)=>jqe(n,Kqe(e)),nG=(n,e,t)=>new Promise((i,s)=>{var o=l=>{try{a(t.next(l))}catch(c){s(c)}},r=l=>{try{a(t.throw(l))}catch(c){s(c)}},a=l=>l.done?i(l.value):Promise.resolve(l.value).then(o,r);a((t=t.apply(n,e)).next())});function mae(n){const e=se(null),t=se(null),i=se({width:0,height:0}),s=Xu(n,"show",{passive:!0,defaultValue:!1,emit(D,x){x?(L(),oe(n.onOpen)):oe(n.onClose)}}),{zIndex:o}=QS(()=>s.value,1);let r=null,a=!1,l=!1;const c=()=>{const{width:D,height:x}=Um(e.value);i.value={width:jn(D),height:jn(x)}},d=()=>{switch(n.placement){case"top":case"cover-bottom":return"bottom";case"top-start":case"right-end":case"cover-bottom-start":return"bottom left";case"top-end":case"left-end":case"cover-bottom-end":return"bottom right";case"bottom":case"cover-top":return"top";case"bottom-start":case"right-start":case"cover-top-start":return"top left";case"bottom-end":case"left-start":case"cover-top-end":return"top right";case"left":case"cover-right":return"right";case"right":case"cover-left":return"left"}},u=()=>{n.trigger==="hover"&&(l=!0,S())},h=()=>nG(this,null,function*(){n.trigger==="hover"&&(l=!1,yield Cr(),!a&&k())}),f=()=>{n.trigger==="hover"&&(a=!0)},g=()=>nG(this,null,function*(){n.trigger==="hover"&&(a=!1,yield Cr(),!l&&k())}),p=()=>{n.closeOnClickReference&&s.value?k():S()},_=()=>{k()},v=D=>{n.trigger==="click"&&(_(),oe(n.onClickOutside,D))},b=()=>{L(),oe(n.onClosed)},C=()=>{const{offsetX:D,offsetY:x,placement:A}=n;c();const T={x:jn(D),y:jn(x)};switch(A){case"cover-top":return{placement:"bottom",skidding:T.x,distance:T.y-i.value.height};case"cover-top-start":return{placement:"bottom-start",skidding:T.x,distance:T.y-i.value.height};case"cover-top-end":return{placement:"bottom-end",skidding:T.x,distance:T.y-i.value.height};case"cover-bottom":return{placement:"top",skidding:T.x,distance:-T.y-i.value.height};case"cover-bottom-start":return{placement:"top-start",skidding:T.x,distance:-T.y-i.value.height};case"cover-bottom-end":return{placement:"top-end",skidding:T.x,distance:-T.y-i.value.height};case"cover-left":return{placement:"right",skidding:T.y,distance:T.x-i.value.width};case"cover-right":return{placement:"left",skidding:T.y,distance:-T.x-i.value.width};case"left":case"left-start":case"left-end":return{placement:A,skidding:T.y,distance:-T.x};case"top":case"top-start":case"top-end":return{placement:A,skidding:T.x,distance:-T.y};case"bottom":case"bottom-start":case"bottom-end":return{placement:A,skidding:T.x,distance:T.y};case"right":case"right-start":case"right-end":return{placement:A,skidding:T.y,distance:T.x}}},w=()=>{const{placement:D,skidding:x,distance:A}=C(),T=[i2(t2({},vqe),{enabled:s.value}),i2(t2({},wqe),{options:{offset:[x,A]}}),i2(t2({},pae),{options:{adaptive:!1,gpuAcceleration:!1},enabled:s.value}),{name:"applyTransformOrigin",enabled:s.value,phase:"beforeWrite",fn({state:P}){P.styles.popper.transformOrigin=d()}}];return{placement:D,modifiers:T,strategy:n.strategy}},y=()=>n.reference?e.value.querySelector(n.reference):e.value,L=()=>{r.setOptions(w())},S=()=>{const{disabled:D}=n;D||(s.value=!0,oe(n["onUpdate:show"],!0))},k=()=>{s.value=!1,oe(n["onUpdate:show"],!1)};return Kse(y,"click",v),ht(()=>[n.offsetX,n.offsetY,n.placement,n.strategy],L),ht(()=>n.disabled,k),bd(()=>{var D;r=zqe((D=y())!=null?D:e.value,t.value,w())}),Cd(()=>{r.destroy()}),{show:s,popover:t,zIndex:o,host:e,hostSize:i,handleHostClick:p,handleHostMouseenter:u,handleHostMouseleave:h,handlePopoverClose:_,handlePopoverMouseenter:f,handlePopoverMouseleave:g,handleClosed:b,resize:L,open:S,close:k}}const Yqe={type:{type:String,default:"default"},color:String,content:String,show:Boolean,disabled:Boolean,trigger:{type:String,default:"hover"},reference:String,placement:{type:String,default:"bottom"},strategy:{type:String,default:"absolute"},offsetX:{type:[Number,String],default:0},offsetY:{type:[Number,String],default:0},teleport:{type:[String,Object,Boolean],default:"body"},sameWidth:Boolean,closeOnClickReference:Boolean,onOpen:Se(),onOpened:Se(),onClose:Se(),onClosed:Se(),onClickOutside:Se(),"onUpdate:show":Se()},{name:Zqe,n:Xqe,classes:Qqe}=st("tooltip");function Jqe(n,e){return q(),re("div",{ref:"host",class:B(n.classes(n.n(),n.n("$--box"))),onClick:e[3]||(e[3]=(...t)=>n.handleHostClick&&n.handleHostClick(...t)),onMouseenter:e[4]||(e[4]=(...t)=>n.handleHostMouseenter&&n.handleHostMouseenter(...t)),onMouseleave:e[5]||(e[5]=(...t)=>n.handleHostMouseleave&&n.handleHostMouseleave(...t))},[xe(n.$slots,"default"),(q(),ei(Bd,{to:n.teleport===!1?void 0:n.teleport,disabled:n.teleportDisabled||n.teleport===!1},[Oe(On,{name:n.n(),onAfterEnter:n.onOpened,onAfterLeave:n.handleClosed,persisted:""},{default:Lt(()=>[wi(me("div",{ref:"popover",class:B(n.classes(n.n("tooltip"),n.n("$--box"))),style:Fe({zIndex:n.zIndex}),onClick:e[0]||(e[0]=Ia(()=>{},["stop"])),onMouseenter:e[1]||(e[1]=(...t)=>n.handlePopoverMouseenter&&n.handlePopoverMouseenter(...t)),onMouseleave:e[2]||(e[2]=(...t)=>n.handlePopoverMouseleave&&n.handlePopoverMouseleave(...t))},[me("div",{style:Fe({background:n.color,width:n.sameWidth?n.toSizeUnit(Math.ceil(n.hostSize.width)):void 0}),class:B(n.classes(n.n("content-container"),n.n("--".concat(n.type))))},[xe(n.$slots,"content",{},()=>[Mi(ut(n.content),1)])],6)],38),[[hl,n.show]])]),_:3},8,["name","onAfterEnter","onAfterLeave"])],8,["to","disabled"]))],34)}const _ae=et({name:Zqe,props:Yqe,setup(n){const{disabled:e}=u_(),{popover:t,host:i,hostSize:s,show:o,zIndex:r,handleHostClick:a,handleHostMouseenter:l,handleHostMouseleave:c,handlePopoverMouseenter:d,handlePopoverMouseleave:u,handlePopoverClose:h,handleClosed:f,open:g,close:p,resize:_}=mae(n);return{popover:t,host:i,hostSize:s,show:o,zIndex:r,teleportDisabled:e,toSizeUnit:ri,n:Xqe,classes:Qqe,handleHostClick:a,handlePopoverClose:h,handleHostMouseenter:l,handleHostMouseleave:c,handlePopoverMouseenter:d,handlePopoverMouseleave:u,handleClosed:f,resize:_,open:g,close:p}}});_ae.render=Jqe;var vae=_ae;lt(vae);var CT=vae;const eGe={expand:Boolean,expandTrigger:String,lineClamp:[Number,String],tooltip:{type:[Object,Boolean],default:!0},"onUpdate:expand":Se()};var tGe=Object.defineProperty,sG=Object.getOwnPropertySymbols,iGe=Object.prototype.hasOwnProperty,nGe=Object.prototype.propertyIsEnumerable,oG=(n,e,t)=>e in n?tGe(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,sGe=(n,e)=>{for(var t in e||(e={}))iGe.call(e,t)&&oG(n,t,e[t]);if(sG)for(var t of sG(e))nGe.call(e,t)&&oG(n,t,e[t]);return n};const{name:oGe,n:rGe,classes:aGe}=st("ellipsis"),lGe={key:0};function cGe(n,e){const t=gt("var-tooltip");return q(),ei(t,pf(_0(n.tooltip)),{content:Lt(()=>[xe(n.$slots,"tooltip-content",{},()=>{var i;return[(i=n.tooltip)!=null&&i.content?(q(),re("span",lGe,ut(n.tooltip.content),1)):xe(n.$slots,"default",{key:1})]})]),default:Lt(()=>[me("span",{class:B(n.classes(n.n(),[n.lineClamp,n.n("--clamp"),n.n("--line")],[n.expandTrigger,n.n("--cursor")],[n.expanding,n.n("--expand")])),style:Fe(n.rootStyles),onClick:e[0]||(e[0]=(...i)=>n.handleClick&&n.handleClick(...i))},[xe(n.$slots,"default")],6)]),_:3},16)}const bae=et({name:oGe,components:{VarTooltip:CT},props:eGe,setup(n){const e=Xu(n,"expand"),t=ve(()=>n.lineClamp?{"-webkit-line-clamp":n.lineClamp}:{}),i=ve(()=>n.tooltip===!1?{disabled:!0}:n.tooltip===!0?{sameWidth:!0}:sGe({sameWidth:!0},n.tooltip));function s(){n.expandTrigger&&(e.value=!e.value)}return{tooltip:i,expanding:e,rootStyles:t,n:rGe,classes:aGe,handleClick:s}}});bae.render=cGe;var Cae=bae;lt(Cae);var M3=Cae;const dGe={active:Boolean,show:{type:Boolean,default:!0},drag:{type:[Object,Boolean],default:!1},type:{type:String,default:"primary"},position:{type:String,default:"right-bottom"},direction:{type:String,default:"top"},trigger:{type:String,default:"click"},disabled:Boolean,color:String,inactiveIcon:{type:String,default:"plus"},activeIcon:{type:String,default:"window-close"},inactiveIconSize:yi(Ss,"size"),activeIconSize:yi(Ss,"size"),inactiveIconNamespace:yi(Ss,"namespace"),activeIconNamespace:yi(Ss,"namespace"),fixed:{type:Boolean,default:!0},zIndex:{type:[Number,String],default:90},top:[Number,String],bottom:[Number,String],left:[Number,String],right:[Number,String],elevation:{type:[Boolean,Number,String],default:!0},safeArea:Boolean,teleport:{type:[String,Object,Boolean],default:"body"},onClick:Se(),onOpen:Se(),onOpened:Se(),onClose:Se(),onClosed:Se(),"onUpdate:active":Se()},{name:uGe,classes:n2,n:ua}=st("fab");var wae=et({name:uGe,inheritAttrs:!1,props:dGe,setup(n,{slots:e,attrs:t}){const i=Xu(n,"active"),s=se(null),o=se(null);ht(()=>n.trigger,()=>{i.value=!1}),ht(()=>n.disabled,()=>{i.value=!1}),ht(()=>[n.position,n.fixed,n.top,n.bottom,n.left,n.right],()=>{var d;(d=o.value)==null||d.reset()}),Kse(s,"click",l);function r(d,u,h){if(d.stopPropagation(),!(n.trigger!=="click"||n.disabled)){if(h===0){oe(n.onClick,i.value,d);return}i.value=u,oe(n.onClick,i.value,d),oe(i.value?n.onOpen:n.onClose)}}function a(d,u){n.trigger!=="hover"||n.disabled||u===0||(i.value=d,oe(i.value?n.onOpen:n.onClose))}function l(){n.trigger!=="click"||n.disabled||i.value!==!1&&(i.value=!1,oe(n.onClose))}function c(){return e.trigger?n.show?e.trigger({active:i.value}):null:wi(Oe(ia,{"var-fab-cover":!0,class:ua("trigger"),type:n.type,color:n.color,disabled:n.disabled,elevation:n.elevation,round:!0},{default:()=>[Oe(Wn,{"var-fab-cover":!0,class:n2([i.value,ua("trigger-active-icon"),ua("trigger-inactive-icon")]),name:i.value?n.activeIcon:n.inactiveIcon,size:i.value?n.activeIconSize:n.inactiveIconSize,namespace:i.value?n.activeIconNamespace:n.inactiveIconNamespace,transition:200,animationClass:ua("--trigger-icon-animation")},null)]}),[[hl,n.show]])}return()=>{var d;const u=Xse((d=oe(e.default))!=null?d:[]),h=KB(n.drag)?{}:n.drag;return Oe(bT,fn({ref:o,class:n2(ua("--position-".concat(n.position)),[!n.fixed,ua("--absolute")]),style:{top:ri(n.top),bottom:ri(n.bottom),left:ri(n.left),right:ri(n.right)},zIndex:n.zIndex,teleport:n.teleport,disabled:n.disabled||!n.drag||!n.fixed,direction:h.direction,attraction:h.attraction,boundary:h.boundary,onClick:f=>r(f,!i.value,u.length)},t),{default:()=>[Oe("div",{class:n2(ua(),ua("--direction-".concat(n.direction)),[n.safeArea,ua("--safe-area")]),ref:s,onMouseleave:()=>a(!1,u.length),onMouseenter:()=>a(!0,u.length)},[Oe(On,{name:ua("--active-transition")},{default:()=>[c()]}),Oe(On,{name:ua("--actions-transition-".concat(n.direction)),onAfterEnter:n.onOpened,onAfterLeave:n.onClosed},{default:()=>[wi(Oe("div",{class:ua("actions"),onClick:f=>f.stopPropagation()},[u.map(f=>Oe("div",{class:ua("action")},[f]))]),[[hl,n.show&&i.value&&u.length]])]})])]})}}});lt(wae);var R3=wae;const $6={value:{type:null,required:!0},id:{type:String,default:""},isFocus:Boolean,size:{type:String,default:"normal"},variant:{type:String,default:"standard"},placeholder:String,line:{type:Boolean,default:!0},hint:{type:Boolean,default:!0},textColor:String,focusColor:String,blurColor:String,errorMessage:String,formDisabled:Boolean,disabled:Boolean,clearable:Boolean,cursor:String,composing:Boolean,onClick:Se(),onClear:Se()},{name:hGe,n:s2,classes:fGe}=st("field-decorator"),gGe=["for"];function pGe(n,e){const t=gt("var-icon");return q(),re("div",{class:B(n.classes(n.n(),n.n("$--box"),n.n("--".concat(n.variant)),[n.size==="small",n.n("--small")],[n.disabled,n.n("--disabled")])),onClick:e[0]||(e[0]=(...i)=>n.handleClick&&n.handleClick(...i))},[me("div",{class:B(n.classes(n.n("controller"),[n.isFocus,n.n("--focus")],[n.errorMessage,n.n("--error")],[n.formDisabled||n.disabled,n.n("--disabled")])),style:Fe({color:n.color,cursor:n.cursor,overflow:n.isFloating?"visible":"hidden"})},[me("div",{class:B(n.classes(n.n("icon"),[!n.hint,n.n("--icon-non-hint")]))},[xe(n.$slots,"prepend-icon")],2),me("div",{class:B(n.classes(n.n("middle"),[!n.hint,n.n("--middle-non-hint")]))},[xe(n.$slots,"default")],2),n.placeholder&&n.hint?(q(),re("label",{key:0,class:B(n.classes(n.n("placeholder"),n.n("$--ellipsis"),[n.isFocus,n.n("--focus")],[n.formDisabled||n.disabled,n.n("--disabled")],[n.errorMessage,n.n("--error")],n.computePlaceholderState())),style:Fe({color:n.color}),for:n.id},[me("span",null,ut(n.placeholder),1)],14,gGe)):Qe("v-if",!0),me("div",{class:B(n.classes(n.n("icon"),[!n.hint,n.n("--icon-non-hint")]))},[n.clearable&&!n.isEmpty(n.value)?(q(),ei(t,{key:0,class:B(n.n("clear-icon")),"var-field-decorator-cover":"",name:"close-circle",onClick:n.handleClear},null,8,["class","onClick"])):Qe("v-if",!0),xe(n.$slots,"append-icon")],2)],6),n.line?(q(),re(li,{key:0},[n.variant==="outlined"?(q(),re("fieldset",{key:0,class:B(n.classes(n.n("line"),[n.isFocus,n.n("--line-focus")],[n.errorMessage,n.n("--line-error")],[n.formDisabled||n.disabled,n.n("--line-disabled")])),style:Fe({borderColor:n.color})},[me("legend",{class:B(n.classes(n.n("line-legend"),[n.isFloating,n.n("line-legend--hint")])),style:Fe({width:n.legendWidth})},[n.placeholder&&n.hint?(q(),ei(Bd,{key:0,to:"body"},[me("span",{ref:"placeholderTextEl",class:B(n.classes(n.n("placeholder-text"),n.n("$--ellipsis"),[n.size==="small",n.n("placeholder-text--small")]))},ut(n.placeholder),3)])):Qe("v-if",!0)],6)],6)):(q(),re("div",{key:1,class:B(n.classes(n.n("line"),[n.formDisabled||n.disabled,n.n("--line-disabled")],[n.errorMessage,n.n("--line-error")])),style:Fe({background:n.errorMessage?void 0:n.blurColor})},[me("div",{class:B(n.classes(n.n("dot"),[n.isFocus,n.n("--line-focus")],[n.formDisabled||n.disabled,n.n("--line-disabled")],[n.errorMessage,n.n("--line-error")])),style:Fe({background:n.errorMessage?void 0:n.focusColor})},null,6)],6))],64)):Qe("v-if",!0)],2)}const yae=et({name:hGe,components:{VarIcon:Wn},props:$6,setup(n,{slots:e}){const t=se(null),i=se(""),s=ve(()=>n.hint&&(!hd(n.value)||n.isFocus||e["prepend-icon"])),o=ve(()=>n.errorMessage?void 0:n.isFocus?n.focusColor:n.blurColor);U0(a),Vo(a),Cg(a);function r(){const{hint:d,value:u,composing:h}=n;if(!d&&(!hd(u)||h))return s2("--placeholder-hidden");if(s.value)return s2("--placeholder-hint")}function a(){const{size:d,hint:u,variant:h,placeholder:f}=n;if(!f||!u||h!=="outlined"){i.value="";return}const g=Um(t.value),p="var(--field-decorator-outlined-".concat(d,"-placeholder-space)");i.value="calc(".concat(g.width," * 0.75 + ").concat(p," * 2)")}function l(d){oe(n.onClear,d)}function c(d){oe(n.onClick,d)}return{placeholderTextEl:t,color:o,legendWidth:i,isFloating:s,computePlaceholderState:r,n:s2,classes:fGe,isEmpty:hd,handleClear:l,handleClick:c}}});yae.render=pGe;var Sae=yae;lt(Sae);var Gy=Sae;const mGe={anchor:Number,anchors:Array,contentDraggable:{type:Boolean,default:!0},duration:{type:[Number,String],default:300},elevation:{type:[Boolean,Number,String],default:!0},teleport:{type:[String,Object,Boolean],default:"body"},safeArea:Boolean,"onUpdate:anchor":Se(),onAnchorChange:Se()},{name:_Ge,n:vGe,classes:bGe}=st("floating-panel"),CGe=100,rG=.2;function wGe(n,e){return q(),ei(Bd,{to:n.teleport===!1?void 0:n.teleport,disabled:n.teleportDisabled||n.teleport===!1},[me("div",{class:B(n.classes(n.n(),[n.safeArea,n.n("--safe-area")],n.formatElevation(n.elevation,3))),style:Fe({height:"".concat(n.toSizeUnit(n.maxAnchor)),transform:"translateY(calc(100% - ".concat(n.toSizeUnit(n.visibleHeight),"))"),transition:n.touching?"none":"transform ".concat(n.toNumber(n.duration),"ms var(--floating-panel-transition-timing-function), background-color 0.25s")}),onTouchstart:e[0]||(e[0]=(...t)=>n.handleTouchstart&&n.handleTouchstart(...t)),onTouchmove:e[1]||(e[1]=(...t)=>n.handleTouchmove&&n.handleTouchmove(...t)),onTouchend:e[2]||(e[2]=(...t)=>n.handleTouchend&&n.handleTouchend(...t)),onTouchcancel:e[3]||(e[3]=(...t)=>n.handleTouchend&&n.handleTouchend(...t))},[me("div",{class:B(n.n("header"))},[me("div",{class:B(n.n("header-toolbar"))},null,2)],2),me("div",{class:B(n.n("content")),ref:"contentRef"},[xe(n.$slots,"default")],2)],38)],8,["to","disabled"])}const Lae=et({name:_Ge,props:mGe,setup(n){const e=se(0),t=se(null),{height:i}=Gse(),s=ve(()=>i.value*.6),o=Xu(n,"anchor"),r=ve(()=>{const D=[CGe,s.value],{anchors:x}=n;return hd(x)?D:x}),a=ve(()=>Math.min(...r.value)),l=ve(()=>Math.max(...r.value)),{disabled:c}=u_(),{deltaY:d,touching:u,startTouch:h,moveTouch:f,endTouch:g,isReachTop:p,isReachBottom:_}=j0();let v;XS(()=>u.value),ht(()=>o.value,b,{immediate:!0}),ht(()=>r.value,()=>{b(o.value)},{immediate:!0});function b(D){L(D!=null?D:a.value)}function C(D){h(D),v=e.value}function w(D){var x;f(D);const A=D.target,T=t.value===A||((x=t.value)==null?void 0:x.contains(A));if(T&&!n.contentDraggable)return;if(T&&n.contentDraggable&&e.value>=l.value&&!p(t.value)){_(t.value)&&dc(D);return}const P=v-d.value;L(S(P)),dc(D)}function y(){g();const D=o.value;L(e.value),o.value=e.value,o.value!==D&&oe(n.onAnchorChange,e.value)}function L(D){e.value=u.value?D:k(D)}function S(D){if(D>l.value){const x=D-l.value;return l.value+x*rG}if(D{const P=Math.abs(T-D);Pnew Promise((i,s)=>{var o=l=>{try{a(t.next(l))}catch(c){s(c)}},r=l=>{try{a(t.throw(l))}catch(c){s(c)}},a=l=>l.done?i(l.value):Promise.resolve(l.value).then(o,r);a((t=t.apply(n,e)).next())});const{name:SGe,n:LGe}=st("form");function kGe(n,e){return q(),re("form",{class:B(n.n()),onSubmit:e[0]||(e[0]=(...t)=>n.handleSubmit&&n.handleSubmit(...t)),onReset:e[1]||(e[1]=(...t)=>n.handleReset&&n.handleReset(...t))},[xe(n.$slots,"default")],34)}const Dae=et({name:SGe,props:yGe,setup(n){const e=ve(()=>n.disabled),t=ve(()=>n.readonly),{formItems:i,bindFormItems:s}=Vze();s({disabled:e,readonly:t});function r(h){setTimeout(()=>{const f=pg(h),g=f===window?0:XK(f),p=XK(h)-g-jn(n.scrollToErrorOffsetY);$y(f,{top:p,animation:i3})},300)}function a(h){return aG(this,null,function*(){dc(h);const f=yield c();oe(n.onSubmit,f)})}function l(h){dc(h),d(),oe(n.onReset)}function c(){return aG(this,null,function*(){var h;const f=yield Promise.all(i.map(({validate:g})=>g()));if(n.scrollToError){const[,g]=Dhe(f,_=>_===!1,n.scrollToError),p=g>-1;if(p){const _=(h=i[g].instance.proxy)==null?void 0:h.$el;r(_)}return!p}return f.every(g=>g===!0)})}function d(){return i.forEach(({reset:h})=>h())}function u(){return i.forEach(({resetValidation:h})=>h())}return{n:LGe,handleSubmit:a,handleReset:l,validate:c,reset:d,resetValidation:u}}});Dae.render=kGe;var vA=Dae;vA.useValidation=Ll;vA.useForm=kl;lt(vA);var O3=vA;const DGe={src:String,fit:{type:String,default:"fill"},alt:String,title:String,width:[String,Number],height:[String,Number],radius:{type:[String,Number],default:0},loading:String,error:String,lazy:Boolean,ripple:Boolean,block:{type:Boolean,default:!0},onClick:Se(),onLoad:Se(),onError:Se()},{name:EGe,n:IGe,classes:TGe}=st("image"),xGe=["alt","title","lazy-loading","lazy-error"],NGe=["alt","title","src"];function AGe(n,e){var t;const i=hn("lazy"),s=hn("ripple");return wi((q(),re("div",{class:B(n.classes(n.n(),n.n("$--box"),[!n.block,n.n("$--inline-block")])),style:Fe({width:n.toSizeUnit(n.width),height:n.toSizeUnit(n.height),borderRadius:n.toSizeUnit(n.radius)})},[n.lazy&&!n.showErrorSlot?wi((q(),re("img",{key:0,class:B(n.n("image")),alt:n.alt,title:n.title,"lazy-loading":n.loading,"lazy-error":n.error,style:Fe({objectFit:n.fit}),onLoad:e[0]||(e[0]=(...o)=>n.handleLoad&&n.handleLoad(...o)),onClick:e[1]||(e[1]=(...o)=>n.handleClick&&n.handleClick(...o))},null,46,xGe)),[[i,(t=n.src)!=null?t:""]]):Qe("v-if",!0),!n.lazy&&!n.showErrorSlot?(q(),re("img",{key:1,class:B(n.n("image")),alt:n.alt,title:n.title,style:Fe({objectFit:n.fit}),src:n.src,onLoad:e[2]||(e[2]=(...o)=>n.handleLoad&&n.handleLoad(...o)),onError:e[3]||(e[3]=(...o)=>n.handleError&&n.handleError(...o)),onClick:e[4]||(e[4]=(...o)=>n.handleClick&&n.handleClick(...o))},null,46,NGe)):Qe("v-if",!0),n.showErrorSlot?xe(n.$slots,"error",{key:2}):Qe("v-if",!0)],6)),[[s,{disabled:!n.ripple}]])}const Eae=et({name:EGe,directives:{Lazy:zy,Ripple:Ns},props:DGe,setup(n,{slots:e}){const t=se(!1);ht(()=>n.src,()=>{t.value=!1});function i(r){t.value=!!e.error,oe(n.onError,r)}function s(r){const a=r.currentTarget;if(n.lazy){if(a._lazy.state==="success"){oe(n.onLoad,r);return}a._lazy.state==="error"&&i(r)}else oe(n.onLoad,r)}function o(r){oe(n.onClick,r)}return{showErrorSlot:t,n:IGe,classes:TGe,toSizeUnit:ri,handleLoad:s,handleError:i,handleClick:o}}});Eae.render=AGe;var Iae=Eae;lt(Iae);var F3=Iae;const Tae=Symbol("SWIPE_BIND_SWIPE_ITEM_KEY");function MGe(){const{childProviders:n,length:e,bindChildren:t}=$o(Tae);return{length:e,swipeItems:n,bindSwipeItems:t}}const xae={loop:{type:Boolean,default:!0},autoplay:[String,Number],duration:{type:[String,Number],default:300},initialIndex:{type:[String,Number],default:0},navigation:{type:[Boolean,String],default:!1},indicator:{type:Boolean,default:!0},indicatorColor:String,vertical:Boolean,touchable:{type:Boolean,default:!0},onChange:Se()};var $_=(n,e,t)=>new Promise((i,s)=>{var o=l=>{try{a(t.next(l))}catch(c){s(c)}},r=l=>{try{a(t.throw(l))}catch(c){s(c)}},a=l=>l.done?i(l.value):Promise.resolve(l.value).then(o,r);a((t=t.apply(n,e)).next())});const RGe=250,PGe=20,{name:OGe,n:lG,classes:FGe}=st("swipe"),BGe=["onClick"];function WGe(n,e){const t=gt("var-icon"),i=gt("var-button"),s=hn("hover");return wi((q(),re("div",{class:B(n.n()),ref:"swipeEl"},[me("div",{class:B(n.classes(n.n("track"),[n.vertical,n.n("--vertical")])),style:Fe({width:n.vertical?void 0:"".concat(n.trackSize,"px"),height:n.vertical?"".concat(n.trackSize,"px"):void 0,transform:"translate".concat(n.vertical?"Y":"X","(").concat(n.trackTranslate,"px)"),transitionDuration:n.lockDuration?"0ms":"".concat(n.toNumber(n.duration),"ms")}),onTouchstart:e[0]||(e[0]=(...o)=>n.handleTouchstart&&n.handleTouchstart(...o)),onTouchmove:e[1]||(e[1]=(...o)=>n.handleTouchmove&&n.handleTouchmove(...o)),onTouchend:e[2]||(e[2]=(...o)=>n.handleTouchend&&n.handleTouchend(...o))},[xe(n.$slots,"default")],38),n.navigation?xe(n.$slots,"prev",pf(fn({key:0},{index:n.index,length:n.length,prev:n.prev,next:n.next,to:n.to,hovering:n.hovering})),()=>[Oe(On,{name:n.getNavigationAnimation("prev")},{default:Lt(()=>[n.navigation===!0||n.hovering?(q(),re("div",{key:0,class:B(n.classes(n.n("navigation"),n.n("navigation-prev"),[n.vertical,n.n("--navigation-vertical-prev")]))},[Oe(i,{"var-swipe-cover":"",disabled:!n.loop&&n.index===0,class:B(n.n("navigation-prev-button")),onClick:e[3]||(e[3]=o=>n.prev())},{default:Lt(()=>[Oe(t,{"var-swipe-cover":"",class:B(n.n("navigation-prev-button-icon")),name:n.vertical?"chevron-up":"chevron-left"},null,8,["class","name"])]),_:1},8,["disabled","class"])],2)):Qe("v-if",!0)]),_:1},8,["name"])]):Qe("v-if",!0),n.navigation?xe(n.$slots,"next",pf(fn({key:1},{index:n.index,length:n.length,hovering:n.hovering,prev:n.prev,next:n.next,to:n.to})),()=>[Oe(On,{name:n.getNavigationAnimation("next")},{default:Lt(()=>[n.navigation===!0||n.hovering?(q(),re("div",{key:0,class:B(n.classes(n.n("navigation"),n.n("navigation-next"),[n.vertical,n.n("--navigation-vertical-next")]))},[Oe(i,{"var-swipe-cover":"",class:B(n.n("navigation-next-button")),disabled:!n.loop&&n.index===n.length-1,onClick:e[4]||(e[4]=o=>n.next())},{default:Lt(()=>[Oe(t,{"var-swipe-cover":"",class:B(n.n("navigation-next-button-icon")),name:n.vertical?"chevron-down":"chevron-right"},null,8,["class","name"])]),_:1},8,["class","disabled"])],2)):Qe("v-if",!0)]),_:1},8,["name"])]):Qe("v-if",!0),xe(n.$slots,"indicator",pf(_0({index:n.index,length:n.length,hovering:n.hovering,prev:n.prev,next:n.next,to:n.to})),()=>[n.indicator&&n.length?(q(),re("div",{key:0,class:B(n.classes(n.n("indicators"),[n.vertical,n.n("--indicators-vertical")]))},[(q(!0),re(li,null,ss(n.length,(o,r)=>(q(),re("div",{class:B(n.classes(n.n("indicator"),[n.index===r,n.n("--indicator-active")],[n.vertical,n.n("--indicator-vertical")])),style:Fe({background:n.indicatorColor}),key:o,onClick:a=>n.to(r)},null,14,BGe))),128))],2)):Qe("v-if",!0)])],2)),[[s,n.handleHovering]])}const Nae=et({name:OGe,directives:{Hover:Fa},components:{VarButton:ia,VarIcon:Wn},props:xae,setup(n){const e=se(null),t=se(0),i=ve(()=>n.vertical),s=se(0),o=se(0),r=se(!1),a=se(0),l=se(!1),{swipeItems:c,bindSwipeItems:d,length:u}=MGe(),{popup:h,bindPopup:f}=vVe(),{deltaX:g,deltaY:p,moveX:_,moveY:v,offsetX:b,offsetY:C,touching:w,direction:y,startTime:L,startTouch:S,moveTouch:k,endTouch:D}=j0(),x=ve(()=>y.value===(n.vertical?"vertical":"horizontal"));let A=!1,T=-1;d({size:t,vertical:i}),oe(f,null),ht(()=>u.value,()=>$_(this,null,function*(){yield Cr(),de(),Ke()})),h&&ht(()=>h.show.value,z=>$_(this,null,function*(){z?(yield Cr(),Ke()):ie()})),eh(Ke),oA(ie),U0(Ke);function W(z){return c.find(({index:ae})=>ae.value===z)}function $(){n.loop&&(o.value>=0&&W(u.value-1).setTranslate(-s.value),o.value<=-(s.value-t.value)&&W(0).setTranslate(s.value),o.value>-(s.value-t.value)&&o.value<0&&(W(u.value-1).setTranslate(0),W(0).setTranslate(0)))}function X(z){const ae=qr(z)?z:Math.floor((o.value-t.value/2)/-t.value),{loop:we}=n;return ae<=-1?we?-1:0:ae>=u.value?we?u.value:u.value-1:ae}function J(z){const{loop:ae}=n;return z===-1?ae?u.value-1:0:z===u.value?ae?0:u.value-1:z}function Q(z){return n.loop?z<0?u.value+z:z>=u.value?z-u.value:z:Wf(z,0,u.value-1)}function le(){return $_(this,null,function*(){const z=o.value>=t.value,ae=o.value<=-s.value,we=0,Ne=-(s.value-t.value);r.value=!0,(z||ae)&&(r.value=!0,o.value=ae?we:Ne,W(0).setTranslate(0),W(u.value-1).setTranslate(0)),yield Cr(),r.value=!1})}function de(){A||(a.value=Q(Ie(n.initialIndex)),A=!0)}function _e(){const{autoplay:z}=n;!z||u.value<=1||(ie(),T=window.setTimeout(()=>{Xe(),_e()},Ie(z)))}function ie(){T&&clearTimeout(T)}function ne(z){o.value=z,$()}function Ye(z){return $_(this,null,function*(){u.value<=1||!n.touchable||(S(z),ie(),yield le(),r.value=!0)})}function pe(z){const{touchable:ae,vertical:we}=n;!w.value||!ae||(k(z),x.value&&(dc(z),ne(o.value+(we?v.value:_.value))))}function Ee(){if(!w.value||(D(),!x.value))return;const{vertical:z,onChange:ae}=n,we=z?p.value<0:g.value<0,Ne=z?C.value:b.value,Be=performance.now()-L.value<=RGe&&Ne>=PGe?X(we?a.value+1:a.value-1):X();r.value=!1,ne(Be*-t.value);const Ae=a.value;a.value=J(Be),_e(),Ae!==a.value&&oe(ae,a.value)}function ze(z){n.navigation==="hover"&&(l.value=z)}function It(z){return n.navigation!=="hover"?"":lG("--navigation".concat(n.vertical?"-vertical":"","-").concat(z,"-animation"))}function Ke(){e.value&&(r.value=!0,t.value=n.vertical?e.value.offsetHeight:e.value.offsetWidth,s.value=t.value*u.value,o.value=a.value*-t.value,c.forEach(z=>{z.setTranslate(0)}),_e(),setTimeout(()=>{r.value=!1}))}function Xe(z){return $_(this,null,function*(){if(u.value<=1)return;de();const{loop:ae,onChange:we}=n,Ne=a.value;if(a.value=Q(Ne+1),(z==null?void 0:z.event)!==!1&&oe(we,a.value),yield le(),Ne===u.value-1&&ae){W(0).setTranslate(s.value),o.value=u.value*-t.value;return}Ne!==u.value-1&&(o.value=a.value*-t.value)})}function je(z){return $_(this,null,function*(){if(u.value<=1)return;de();const{loop:ae,onChange:we}=n,Ne=a.value;if(a.value=Q(Ne-1),(z==null?void 0:z.event)!==!1&&oe(we,a.value),yield le(),Ne===0&&ae){W(u.value-1).setTranslate(-s.value),o.value=t.value;return}Ne!==0&&(o.value=a.value*-t.value)})}function Z(z,ae){if(u.value<=1||z===a.value)return;z=z<0?0:z,z=z>=u.value?u.value:z;const we=z>a.value?Xe:je,Ne=Math.abs(z-a.value);Array.from({length:Ne}).forEach((Ce,Be)=>{we({event:Be===Ne-1?ae==null?void 0:ae.event:!1})})}return{length:u,index:a,swipeEl:e,trackSize:s,trackTranslate:o,lockDuration:r,hovering:l,n:lG,classes:FGe,handleTouchstart:Ye,handleTouchmove:pe,handleTouchend:Ee,next:Xe,prev:je,to:Z,resize:Ke,toNumber:Ie,handleHovering:ze,getNavigationAnimation:It}}});Nae.render=WGe;var Aae=Nae;lt(Aae);var Yy=Aae;function VGe(){const{bindParent:n,index:e,parentProvider:t}=Ho(Tae);return n||Oa("SwipeItem"," must in "),{index:e,swipe:t,bindSwipe:n}}const{name:HGe,n:$Ge}=st("swipe-item");function zGe(n,e){return q(),re("div",{class:B(n.n()),style:Fe({width:n.vertical?void 0:"".concat(n.size,"px"),height:n.vertical?"".concat(n.size,"px"):void 0,transform:"translate".concat(n.vertical?"Y":"X","(").concat(n.translate,"px)")})},[xe(n.$slots,"default")],6)}const Mae=et({name:HGe,setup(){const n=se(0),{swipe:e,bindSwipe:t,index:i}=VGe(),{size:s,vertical:o}=e;t({index:i,setTranslate:a});function a(l){n.value=l}return{n:$Ge,size:s,vertical:o,translate:n}}});Mae.render=zGe;var Rae=Mae;lt(Rae);var Zy=Rae,UGe=Object.defineProperty,cG=Object.getOwnPropertySymbols,jGe=Object.prototype.hasOwnProperty,KGe=Object.prototype.propertyIsEnumerable,dG=(n,e,t)=>e in n?UGe(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,uG=(n,e)=>{for(var t in e||(e={}))jGe.call(e,t)&&dG(n,t,e[t]);if(cG)for(var t of cG(e))KGe.call(e,t)&&dG(n,t,e[t]);return n};const qGe=uG(uG({show:Boolean,imagePreventDefault:Boolean,images:{type:Array,default:()=>[]},current:String,initialIndex:{type:[String,Number],default:0},zoom:{type:[String,Number],default:2},closeable:Boolean,"onUpdate:show":Se(),onLongPress:Se()},yi(xae,["loop","indicator","onChange"])),yi(ZS,["lockScroll","teleport","onOpen","onClose","onOpened","onClosed","onRouteChange"])),{name:GGe,n:hG,classes:YGe}=st("image-preview"),o2=12,fG=200,ZGe=350,gG=200,XGe=500,QGe=["onTouchstart"],JGe=["src","alt"];function eYe(n,e){const t=gt("var-swipe-item"),i=gt("var-swipe"),s=gt("var-icon"),o=gt("var-popup");return q(),ei(o,{class:B(n.n("popup")),"var-image-preview-cover":"",transition:n.n("$-fade"),show:n.popupShow,overlay:!1,"close-on-click-overlay":!1,"lock-scroll":n.lockScroll,teleport:n.teleport,onOpen:n.onOpen,onClose:n.onClose,onClosed:n.onClosed,onOpened:n.onOpened,onRouteChange:n.onRouteChange},{default:Lt(()=>[Oe(i,fn({ref:"swipeRef",class:n.n("swipe"),"var-image-preview-cover":"",touchable:n.canSwipe,indicator:n.indicator&&n.images.length>1,"initial-index":n.initialIndex,loop:n.loop,onChange:n.onChange},n.$attrs),{default:Lt(()=>[(q(!0),re(li,null,ss(n.images,(r,a)=>(q(),ei(t,{class:B(n.n("swipe-item")),"var-image-preview-cover":"",key:r},{default:Lt(()=>[me("div",{class:B(n.n("zoom-container")),style:Fe({transform:"scale(".concat(n.scale,") translate(").concat(n.translateX,"px, ").concat(n.translateY,"px)"),transitionTimingFunction:n.transitionTimingFunction,transitionDuration:n.transitionDuration}),onTouchstart:l=>n.handleTouchstart(l,a),onTouchmove:e[0]||(e[0]=(...l)=>n.handleTouchmove&&n.handleTouchmove(...l)),onTouchend:e[1]||(e[1]=(...l)=>n.handleTouchend&&n.handleTouchend(...l)),onTouchcancel:e[2]||(e[2]=(...l)=>n.handleTouchcancel&&n.handleTouchcancel(...l))},[me("img",{class:B(n.classes(n.n("image"),[n.isPreventDefault,n.n("--prevent")])),src:r,alt:r},null,10,JGe)],46,QGe)]),_:2},1032,["class"]))),128))]),indicator:Lt(({index:r,length:a})=>[xe(n.$slots,"indicator",{index:r,length:a},()=>[n.indicator&&n.images.length>1?(q(),re("div",{key:0,class:B(n.n("indicators"))},ut(r+1)+" / "+ut(a),3)):Qe("v-if",!0)])]),_:3},16,["class","touchable","indicator","initial-index","loop","onChange"]),xe(n.$slots,"close-icon",{},()=>[n.closeable?(q(),ei(s,{key:0,class:B(n.n("close-icon")),name:"close-circle","var-image-preview-cover":"",onClick:n.close},null,8,["class","onClick"])):Qe("v-if",!0)]),me("div",{class:B(n.n("extra"))},[xe(n.$slots,"extra")],2)]),_:3},8,["class","transition","show","lock-scroll","teleport","onOpen","onClose","onClosed","onOpened","onRouteChange"])}const Pae=et({name:GGe,components:{VarSwipe:Yy,VarSwipeItem:Zy,VarPopup:gg,VarIcon:Wn},inheritAttrs:!1,props:qGe,setup(n){const e=se(!1),t=se(1),i=se(0),s=se(0),o=se(),r=se(),a=se(!0),l=se(null),{moveX:c,moveY:d,distance:u,startTime:h,startTouch:f,moveTouch:g,endTouch:p}=j0(),_=ve(()=>{const{images:ie,current:ne,initialIndex:Ye}=n;if(Ye!=null)return Ie(Ye);const pe=ie.findIndex(Ee=>Ee===ne);return Math.max(pe,0)}),v=ve(()=>{const{imagePreventDefault:ie,show:ne}=n;return ne&&ie});let b=null,C=null,w=!1;const y={start:null,prev:null};fg(()=>document,"contextmenu",_e),ht(()=>n.show,ie=>{e.value=ie},{immediate:!0});function L(){t.value=Ie(n.zoom),a.value=!1,y.prev=null,window.setTimeout(()=>{o.value="linear",r.value="0s"},gG)}function S(){t.value=1,i.value=0,s.value=0,a.value=!0,y.prev=null,o.value=void 0,r.value=void 0}function k(ie){return y.prev?u.value<=o2&&performance.now()-h.value<=fG&&y.prev===ie:!1}function D(ie){return!ie||!y.start||!y.prev?!1:u.value<=o2&&performance.now()-h.value{ne&&J(),y.start=null},fG)}function T(ie,ne){window.clearTimeout(b),window.clearTimeout(C);const Ye=ie.currentTarget;if(y.start=Ye,C=window.setTimeout(()=>{w=!0,oe(n.onLongPress,ne)},XGe),k(Ye)){t.value>1?S():L();return}f(ie),y.prev=Ye}function P(ie){const{offsetWidth:ne,offsetHeight:Ye}=ie,{naturalWidth:pe,naturalHeight:Ee}=ie.querySelector(".".concat(hG("image")));return{width:ne,height:Ye,imageRadio:Ee/pe,rootRadio:Ye/ne,zoom:Ie(n.zoom)}}function W(ie){const{zoom:ne,imageRadio:Ye,rootRadio:pe,width:Ee,height:ze}=P(ie);if(!Ye)return 0;const It=Ye>pe?ze/Ye:Ee;return Math.max(0,(ne*It-Ee)/2)/ne}function $(ie){const{zoom:ne,imageRadio:Ye,rootRadio:pe,width:Ee,height:ze}=P(ie);if(!Ye)return 0;const It=Ye>pe?ze:Ee*Ye;return Math.max(0,(ne*It-ze)/2)/ne}function X(ie){if(!y.prev)return;g(ie);const ne=ie.currentTarget;if(u.value>o2&&window.clearTimeout(C),t.value>1){const Ye=W(ne),pe=$(ne);i.value=Wf(i.value+c.value,-Ye,Ye),s.value=Wf(s.value+d.value,-pe,pe)}y.prev=ne}function J(){if(t.value>1){S(),setTimeout(()=>oe(n["onUpdate:show"],!1),gG);return}oe(n["onUpdate:show"],!1)}function Q(ie){var ne;(ne=l.value)==null||ne.prev(ie)}function le(ie){var ne;(ne=l.value)==null||ne.next(ie)}function de(ie,ne){var Ye;(Ye=l.value)==null||Ye.to(ie,ne)}function _e(ie){n.imagePreventDefault&&n.show&&dc(ie)}return{swipeRef:l,isPreventDefault:v,initialIndex:_,popupShow:e,scale:t,translateX:i,translateY:s,canSwipe:a,transitionTimingFunction:o,transitionDuration:r,n:hG,classes:YGe,handleTouchstart:T,handleTouchmove:X,handleTouchend:A,handleTouchcancel:x,close:J,prev:Q,next:le,to:de}}});Pae.render=eYe;var bA=Pae,tYe=Object.defineProperty,iYe=Object.defineProperties,nYe=Object.getOwnPropertyDescriptors,pG=Object.getOwnPropertySymbols,sYe=Object.prototype.hasOwnProperty,oYe=Object.prototype.propertyIsEnumerable,mG=(n,e,t)=>e in n?tYe(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,Vk=(n,e)=>{for(var t in e||(e={}))sYe.call(e,t)&&mG(n,t,e[t]);if(pG)for(var t of pG(e))oYe.call(e,t)&&mG(n,t,e[t]);return n},_G=(n,e)=>iYe(n,nYe(e));let Yh,XC={};function rYe(n={}){return Us(n)?_G(Vk({},XC),{images:[n]}):tn(n)?_G(Vk({},XC),{images:n}):Vk(Vk({},XC),n)}function g_(n){if(!nh())return;g_.close();const e=rYe(n),t=Cn(e);t.teleport="body",Yh=t;const{unmountInstance:i}=K0(bA,t,{onClose:()=>oe(t.onClose),onClosed:()=>{oe(t.onClosed),i(),Yh===t&&(Yh=null)},onRouteChange:()=>{i(),Yh===t&&(Yh=null)},"onUpdate:show":s=>{t.show=s}});t.show=!0}g_.close=()=>{if(Yh!=null){const n=Yh;Yh=null,Fn().then(()=>{n.show=!1})}};g_.setDefaultOptions=n=>{XC=n};g_.resetDefaultOptions=()=>{XC={}};g_.Component=bA;lt(bA);lt(bA,g_);var Xy=g_;const zD={offsetTop:{type:[String,Number],default:0},zIndex:{type:[String,Number],default:10},cssMode:Boolean,disabled:Boolean,onScroll:Se()};var vG=(n,e,t)=>new Promise((i,s)=>{var o=l=>{try{a(t.next(l))}catch(c){s(c)}},r=l=>{try{a(t.throw(l))}catch(c){s(c)}},a=l=>l.done?i(l.value):Promise.resolve(l.value).then(o,r);a((t=t.apply(n,e)).next())});const{name:aYe,n:lYe,classes:cYe}=st("sticky");function dYe(n,e){return q(),re("div",{class:B(n.classes(n.n(),[n.enableCSSMode,n.n("--css-mode")])),ref:"stickyEl",style:Fe({zIndex:n.toNumber(n.zIndex),top:n.enableCSSMode?"".concat(n.offsetTop,"px"):void 0,width:n.enableFixedMode?n.fixedWidth:void 0,height:n.enableFixedMode?n.fixedHeight:void 0})},[me("div",{class:B(n.n("wrapper")),ref:"wrapperEl",style:Fe({zIndex:n.toNumber(n.zIndex),position:n.enableFixedMode?"fixed":void 0,width:n.enableFixedMode?n.fixedWrapperWidth:void 0,height:n.enableFixedMode?n.fixedWrapperHeight:void 0,left:n.enableFixedMode?n.fixedLeft:void 0,top:n.enableFixedMode?n.fixedTop:void 0})},[xe(n.$slots,"default")],6)],6)}const Oae=et({name:aYe,props:zD,setup(n){const e=se(null),t=se(null),i=se(!1),s=se("0px"),o=se("0px"),r=se("auto"),a=se("auto"),l=se("auto"),c=se("auto"),d=ve(()=>!n.disabled&&n.cssMode),u=ve(()=>!n.disabled&&!n.cssMode&&i.value),h=ve(()=>jn(n.offsetTop));let f;ht(()=>n.disabled,_),Vo(v),oA(b),U0(_),fg(()=>window,"scroll",p);function g(){const{cssMode:C,disabled:w}=n;if(w)return;let y=0;if(f!==window){const{top:A}=no(f);y=A}const L=t.value,S=e.value,{top:k,left:D}=no(S),x=k-y;return x<=h.value?(C||(r.value="".concat(S.offsetWidth,"px"),a.value="".concat(S.offsetHeight,"px"),s.value="".concat(y+h.value,"px"),o.value="".concat(D,"px"),l.value="".concat(L.offsetWidth,"px"),c.value="".concat(L.offsetHeight,"px"),i.value=!0),{offsetTop:h.value,isFixed:!0}):(i.value=!1,{offsetTop:x,isFixed:!1})}function p(){if(!f)return;const C=g();C&&oe(n.onScroll,C.offsetTop,C.isFixed)}function _(){return vG(this,null,function*(){i.value=!1,yield Gk(),g()})}function v(){return vG(this,null,function*(){yield Cr(),f=pg(e.value),f!==window&&f.addEventListener("scroll",p),p()})}function b(){f!==window&&f.removeEventListener("scroll",p)}return{stickyEl:e,wrapperEl:t,isFixed:i,offsetTop:h,fixedTop:s,fixedLeft:o,fixedWidth:r,fixedHeight:a,fixedWrapperWidth:l,fixedWrapperHeight:c,enableCSSMode:d,enableFixedMode:u,n:lYe,classes:cYe,resize:_,toNumber:Ie}}});Oae.render=dYe;var Fae=Oae;lt(Fae);var Qy=Fae;const Bae=Symbol("INDEX_BAR_BIND_INDEX_ANCHOR_KEY");function uYe(){const{bindChildren:n,length:e,childProviders:t}=$o(Bae);return{length:e,indexAnchors:t,bindIndexAnchors:n}}function hYe(){const{parentProvider:n,index:e,bindParent:t}=Ho(Bae);return t||Oa("IndexAnchor",'You should use this component in "IndexBar"'),{index:e,indexBar:n,bindIndexBar:t}}const fYe={index:[Number,String]},{name:gYe,n:pYe,classes:mYe}=st("index-anchor");function _Ye(n,e){return q(),ei(m0(n.sticky?n.n("$-sticky"):n.Transition),{"offset-top":n.sticky?n.stickyOffsetTop:null,"z-index":n.sticky?n.zIndex:null,disabled:n.disabled&&!n.cssMode,"css-mode":n.cssMode,ref:"anchorEl"},{default:Lt(()=>[me("div",fn({class:n.n()},n.$attrs),[xe(n.$slots,"default",{},()=>[Mi(ut(n.name),1)])],16)]),_:3},8,["offset-top","z-index","disabled","css-mode"])}const Wae=et({name:gYe,components:{VarSticky:Qy},inheritAttrs:!1,props:fYe,setup(n){const e=se(0),t=se(!1),i=ve(()=>n.index),s=se(null),{index:o,indexBar:r,bindIndexBar:a}=hYe(),{active:l,sticky:c,cssMode:d,stickyOffsetTop:u,zIndex:h}=r;a({index:o,name:i,ownTop:e,setOwnTop:g,setDisabled:p});function g(){s.value&&(e.value=s.value.$el?s.value.$el.offsetTop:s.value.offsetTop)}function p(_){t.value=_}return{n:pYe,classes:mYe,name:i,anchorEl:s,active:l,sticky:c,zIndex:h,disabled:t,cssMode:d,stickyOffsetTop:u,Transition:On}}});Wae.render=_Ye;var Vae=Wae;lt(Vae);var B3=Vae;const vYe={sticky:{type:Boolean,default:!0},stickyOffsetTop:{type:[String,Number],default:0},cssMode:Boolean,stickyCssMode:Boolean,hideList:Boolean,zIndex:{type:[Number,String],default:1},highlightColor:String,duration:{type:[Number,String],default:0},onClick:Se(),onChange:Se()};var Hk=(n,e,t)=>new Promise((i,s)=>{var o=l=>{try{a(t.next(l))}catch(c){s(c)}},r=l=>{try{a(t.throw(l))}catch(c){s(c)}},a=l=>l.done?i(l.value):Promise.resolve(l.value).then(o,r);a((t=t.apply(n,e)).next())});const{name:bYe,n:CYe,classes:wYe}=st("index-bar"),yYe=["onClick"];function SYe(n,e){return q(),re("div",{class:B(n.n()),ref:"barEl"},[xe(n.$slots,"default"),me("ul",{class:B(n.n("anchor-list")),style:Fe({zIndex:n.toNumber(n.zIndex)+2,display:n.hideList?"none":"block"})},[(q(!0),re(li,null,ss(n.anchorNameList,t=>(q(),re("li",{key:t,class:B(n.classes(n.n("anchor-item"),[n.active===t,n.n("anchor-item--active")])),style:Fe({color:n.active===t&&n.highlightColor?n.highlightColor:""}),onClick:i=>n.anchorClick({anchorName:t,manualCall:!0})},ut(t),15,yYe))),128))],6)],2)}const Hae=et({name:bYe,props:vYe,setup(n){const e=se(""),t=se(null),i=se([]),s=se(),o=ve(()=>n.sticky),r=ve(()=>n.stickyCssMode||n.cssMode),a=ve(()=>jn(n.stickyOffsetTop)),l=ve(()=>n.zIndex),{length:c,indexAnchors:d,bindIndexAnchors:u}=uYe();let h=null,f=!1;const g={active:s,sticky:o,cssMode:r,stickyOffsetTop:a,zIndex:l};ht(()=>c.value,()=>Hk(this,null,function*(){yield Cr(),d.forEach(({name:S,setOwnTop:k})=>{S.value&&i.value.push(S.value),k()})})),Vo(()=>Hk(this,null,function*(){yield C(),w()})),zm(y),$m(()=>{f=!0,y()}),eh(()=>{!f||s.value===void 0||(b({anchorName:s.value,options:{event:!1}}),f=!1)}),u(g);function p(S,k){const D=ju(S)?S.name.value:S;D===s.value||D===void 0||(s.value=D,(k==null?void 0:k.event)!==!1&&oe(n.onChange,D))}function _(){if(qB(h))return 0;const{top:S}=no(h),{scrollTop:k}=h,{top:D}=no(t.value);return k-S+D}function v(){const S=hb(h),k=h===window?document.body.scrollHeight:h.scrollHeight,D=_();d.forEach((x,A)=>{const T=x.ownTop.value,P=S-T+a.value-D,W=A===d.length-1?k:d[A+1].ownTop.value-x.ownTop.value;x.setDisabled(!0),P>=0&&Pk===$.value);if(!A)return;const T=_(),P=A.ownTop.value-a.value+T,W=GB(h);e.value=k,p(k,x),yield $y(h,{left:W,top:P,animation:yoe,duration:Ie(n.duration)}),yield Cr(),e.value=""})}function C(){return Hk(this,null,function*(){yield Cr(),h=pg(t.value)})}function w(){h.addEventListener("scroll",v)}function y(){h.removeEventListener("scroll",v)}function L(S,k){aw(()=>b({anchorName:S,options:k}))}return{barEl:t,active:s,zIndex:l,anchorNameList:i,n:CYe,classes:wYe,toNumber:Ie,scrollTo:L,anchorClick:b}}});Hae.render=SYe;var $ae=Hae;lt($ae);var W3=$ae,LYe=Object.defineProperty,bG=Object.getOwnPropertySymbols,kYe=Object.prototype.hasOwnProperty,DYe=Object.prototype.propertyIsEnumerable,CG=(n,e,t)=>e in n?LYe(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,EYe=(n,e)=>{for(var t in e||(e={}))kYe.call(e,t)&&CG(n,t,e[t]);if(bG)for(var t of bG(e))DYe.call(e,t)&&CG(n,t,e[t]);return n};const IYe=EYe({modelValue:String,modelModifiers:{type:Object,default:()=>({})},type:{type:String,default:"text"},textarea:Boolean,rows:{type:[String,Number],default:8},maxlength:[String,Number],readonly:Boolean,resize:Boolean,autofocus:Boolean,validateTrigger:{type:Array,default:()=>["onInput","onClear"]},rules:Array,enterkeyhint:String,onFocus:Se(),onBlur:Se(),onInput:Se(),onChange:Se(),onClear:Se(),"onUpdate:modelValue":Se()},yi($6,["size","variant","placeholder","line","hint","textColor","focusColor","blurColor","disabled","clearable","onClick"])),{name:TYe,n:xYe,classes:NYe}=st("input"),AYe=["placeholder","enterkeyhint"],MYe=["id","disabled","readonly","type","value","placeholder","maxlength","rows","enterkeyhint","inputmode"],RYe=["id","disabled","readonly","type","value","placeholder","maxlength","enterkeyhint","inputmode"];function PYe(n,e){const t=gt("var-field-decorator"),i=gt("var-form-details");return q(),re("div",{class:B(n.classes(n.n(),n.n("$--box"))),onMousedown:e[13]||(e[13]=(...s)=>n.handleMousedown&&n.handleMousedown(...s))},[Oe(t,pf(_0({value:n.modelValue,id:n.id,size:n.size,variant:n.variant,placeholder:n.placeholder,line:n.line,hint:n.hint,textColor:n.textColor,focusColor:n.focusColor,blurColor:n.blurColor,isFocus:n.isFocus,errorMessage:n.errorMessage,formDisabled:n.formDisabled,disabled:n.disabled,clearable:n.clearable,cursor:n.cursor,composing:n.isComposing,onClick:n.handleClick,onClear:n.handleClear})),YD({"append-icon":Lt(()=>[xe(n.$slots,"append-icon")]),default:Lt(()=>[n.normalizedType==="password"?(q(),re("input",{key:0,tabindex:"-1",class:B(n.n("autocomplete")),placeholder:n.hint?void 0:n.placeholder,style:Fe({"--input-placeholder-color":n.placeholderColor}),enterkeyhint:n.enterkeyhint},null,14,AYe)):Qe("v-if",!0),n.textarea?(q(),re("textarea",{key:1,class:B(n.classes(n.n("input"),n.n("--textarea"),[n.formDisabled||n.disabled,n.n("--disabled")],[n.errorMessage,n.n("--error")],[n.errorMessage,n.n("--caret-error")])),ref:"el",autocomplete:"new-password",id:n.id,disabled:n.formDisabled||n.disabled,readonly:n.formReadonly||n.readonly,type:n.normalizedType,value:n.modelValue,placeholder:n.hint?void 0:n.placeholder,maxlength:n.maxlength,rows:n.rows,enterkeyhint:n.enterkeyhint,inputmode:n.type==="number"?"numeric":void 0,style:Fe({color:n.errorMessage?void 0:n.textColor,caretColor:n.errorMessage?void 0:n.focusColor,resize:n.resize?"vertical":"none","--input-placeholder-color":n.placeholderColor}),onFocus:e[0]||(e[0]=(...s)=>n.handleFocus&&n.handleFocus(...s)),onBlur:e[1]||(e[1]=(...s)=>n.handleBlur&&n.handleBlur(...s)),onInput:e[2]||(e[2]=(...s)=>n.handleInput&&n.handleInput(...s)),onChange:e[3]||(e[3]=(...s)=>n.handleChange&&n.handleChange(...s)),onCompositionstart:e[4]||(e[4]=(...s)=>n.handleCompositionStart&&n.handleCompositionStart(...s)),onCompositionend:e[5]||(e[5]=(...s)=>n.handleCompositionEnd&&n.handleCompositionEnd(...s))},"\n ",46,MYe)):(q(),re("input",{key:2,class:B(n.classes(n.n("input"),[n.formDisabled||n.disabled,n.n("--disabled")],[n.errorMessage,n.n("--error")],[n.errorMessage,n.n("--caret-error")])),ref:"el",autocomplete:"new-password",id:n.id,disabled:n.formDisabled||n.disabled,readonly:n.formReadonly||n.readonly,type:n.normalizedType,value:n.modelValue,placeholder:n.hint?void 0:n.placeholder,maxlength:n.maxlength,enterkeyhint:n.enterkeyhint,inputmode:n.type==="number"?"numeric":void 0,style:Fe({color:n.errorMessage?void 0:n.textColor,caretColor:n.errorMessage?void 0:n.focusColor,"--input-placeholder-color":n.placeholderColor}),onFocus:e[6]||(e[6]=(...s)=>n.handleFocus&&n.handleFocus(...s)),onBlur:e[7]||(e[7]=(...s)=>n.handleBlur&&n.handleBlur(...s)),onInput:e[8]||(e[8]=(...s)=>n.handleInput&&n.handleInput(...s)),onChange:e[9]||(e[9]=(...s)=>n.handleChange&&n.handleChange(...s)),onCompositionstart:e[10]||(e[10]=(...s)=>n.handleCompositionStart&&n.handleCompositionStart(...s)),onCompositionend:e[11]||(e[11]=(...s)=>n.handleCompositionEnd&&n.handleCompositionEnd(...s))},null,46,RYe))]),_:2},[n.$slots["prepend-icon"]?{name:"prepend-icon",fn:Lt(()=>[xe(n.$slots,"prepend-icon")]),key:"0"}:void 0]),1040),Oe(i,{"error-message":n.errorMessage,"extra-message":n.maxlengthText,onMousedown:e[12]||(e[12]=Ia(()=>{},["stop"]))},YD({_:2},[n.$slots["extra-message"]?{name:"extra-message",fn:Lt(()=>[xe(n.$slots,"extra-message")]),key:"0"}:void 0]),1032,["error-message","extra-message"])],34)}const zae=et({name:TYe,components:{VarFormDetails:na,VarFieldDecorator:Gy},props:IYe,setup(n){const e=qse(),t=se(null),i=se(!1),s=se(!1),{bindForm:o,form:r}=kl(),{errorMessage:a,validateWithTrigger:l,validate:c,resetValidation:d}=Ll(),u=ve(()=>n.disabled||n.readonly?"":"text"),h=ve(()=>n.type==="number"?"text":n.type),f=ve(()=>{const{maxlength:Q,modelValue:le}=n;return Q?hd(le)?"0 / ".concat(Q):"".concat(String(le).length,"/").concat(Q):""}),g=ve(()=>{const{hint:Q,blurColor:le,focusColor:de}=n;if(!Q)return a.value?"var(--field-decorator-error-color)":i.value?de||"var(--field-decorator-focus-color)":le||"var(--field-decorator-placeholder-color, var(--field-decorator-blur-color))"});oe(o,{reset:W,validate:$,resetValidation:d}),Vo(()=>{n.autofocus&&X()});function _(Q){Fn(()=>{const{validateTrigger:le,rules:de,modelValue:_e}=n;l(le,Q,de,_e)})}function v(Q){i.value=!0,oe(n.onFocus,Q),_("onFocus")}function b(Q){i.value=!1,oe(n.onBlur,Q),_("onBlur")}function C(Q){const le=Q.target;let{value:de}=le;return n.type==="number"&&(de=x(de)),T(A(de))}function w(){s.value=!0}function y(Q){s.value&&(s.value=!1,Q.target.dispatchEvent(new Event("input")))}function L(Q){if(s.value)return;const le=C(Q);oe(n["onUpdate:modelValue"],le),oe(n.onInput,le,Q),_("onInput")}function S(Q){const le=C(Q);oe(n.onChange,le,Q),_("onChange")}function k(){const{disabled:Q,readonly:le,clearable:de,onClear:_e}=n;r!=null&&r.disabled.value||r!=null&&r.readonly.value||Q||le||!de||(oe(n["onUpdate:modelValue"],""),oe(_e,""),_("onClear"))}function D(Q){const{disabled:le,onClick:de}=n;r!=null&&r.disabled.value||le||(oe(de,Q),_("onClick"))}function x(Q){const le=Q.indexOf("-"),de=Q.indexOf(".");return le>-1&&(Q=le===0?"-"+Q.replace(/-/g,""):Q.replace(/-/g,"")),de>-1&&(Q=Q.slice(0,de+1)+Q.slice(de).replace(/\./g,"")),Q.replace(/[^-0-9.]/g,"")}function A(Q){return n.modelModifiers.trim?Q.trim():Q}function T(Q){return n.maxlength?Q.slice(0,Ie(n.maxlength)):Q}function P(Q){const{disabled:le}=n;r!=null&&r.disabled.value||le||Q.target===t.value||(X(),dc(Q))}function W(){oe(n["onUpdate:modelValue"],""),d()}function $(){return c(n.rules,n.modelValue)}function X(){var Q;(Q=t.value)==null||Q.focus()}function J(){t.value.blur()}return{el:t,id:e,isFocus:i,isComposing:s,errorMessage:a,placeholderColor:g,normalizedType:h,cursor:u,maxlengthText:f,formDisabled:r==null?void 0:r.disabled,formReadonly:r==null?void 0:r.readonly,n:xYe,classes:NYe,isEmpty:hd,handleFocus:v,handleBlur:b,handleInput:L,handleChange:S,handleClear:k,handleClick:D,handleCompositionStart:w,handleCompositionEnd:y,handleMousedown:P,validate:$,resetValidation:d,reset:W,focus:X,blur:J}}});zae.render=PYe;var Uae=zae;lt(Uae);var wT=Uae;const OYe={type:{type:String,default:"default"},href:String,target:String,rel:String,to:[String,Object],replace:Boolean,underline:{type:String,default:"always"},disabled:Boolean,textSize:[String,Number],textColor:String,onClick:Se()},{name:FYe,n:BYe,classes:WYe}=st("link");function VYe(n,e){return q(),ei(m0(n.tag),fn(n.linkProps,{class:n.classes(n.n(),n.n("$--box"),n.n("$--inline-flex"),n.n("--".concat(n.type)),[n.underline!=="none",n.n("--underline-".concat(n.underline))],[n.disabled,n.n("--disabled")]),style:{color:n.textColor,fontSize:n.toSizeUnit(n.textSize)},onClick:n.handleClick}),{default:Lt(()=>[xe(n.$slots,"default")]),_:3},16,["class","style","onClick"])}const jae=et({name:FYe,props:OYe,setup(n){const e=ve(()=>n.disabled?"span":n.href?"a":n.to?"router-link":"a"),t=ve(()=>{const{disabled:s,href:o,target:r,to:a,replace:l,rel:c}=n;return s?{}:o?{href:o,target:r,rel:c}:a?{to:a,target:r,replace:l}:{}});function i(s){n.disabled||oe(n.onClick,s)}return{tag:e,linkProps:t,n:BYe,classes:WYe,handleClick:i,toSizeUnit:ri}}});jae.render=VYe;var Kae=jae;lt(Kae);var V3=Kae;const HYe={loading:Boolean,immediateCheck:{type:Boolean,default:!0},finished:Boolean,error:Boolean,offset:{type:[String,Number],default:0},loadingText:String,finishedText:String,errorText:String,onLoad:Se(),"onUpdate:loading":Se(),"onUpdate:error":Se()},qae=Symbol("TABS_ITEMS_BIND_TAB_ITEM_KEY");function $Ye(){const{bindChildren:n,childProviders:e,length:t}=$o(qae);return{length:t,tabItemList:e,bindTabItem:n}}const Gae=Symbol("TAB_ITEM_BIND_LIST_KEY");function zYe(){const{parentProvider:n,bindParent:e,index:t}=Ho(qae);return e||Oa("TabItem"," must in "),{index:t,tabsItems:n,bindTabsItems:e}}function UYe(){const{childProviders:n,bindChildren:e,length:t}=$o(Gae);return{length:t,lists:n,bindLists:e}}function jYe(){const{parentProvider:n,bindParent:e,index:t}=Ho(Gae);return{index:t,tabItem:n,bindTabItem:e}}var KYe=(n,e,t)=>new Promise((i,s)=>{var o=l=>{try{a(t.next(l))}catch(c){s(c)}},r=l=>{try{a(t.throw(l))}catch(c){s(c)}},a=l=>l.done?i(l.value):Promise.resolve(l.value).then(o,r);a((t=t.apply(n,e)).next())});const{name:qYe,n:GYe,classes:YYe}=st("list");function ZYe(n,e){const t=gt("var-loading"),i=hn("ripple");return q(),re("div",{class:B(n.classes(n.n(),n.n("$--box"))),ref:"listEl"},[xe(n.$slots,"default"),n.loading?xe(n.$slots,"loading",{key:0},()=>{var s;return[me("div",{class:B(n.n("loading"))},[me("div",{class:B(n.n("loading-text"))},ut((s=n.loadingText)!=null?s:n.pack.listLoadingText),3),Oe(t,{size:"mini",radius:10})],2)]}):Qe("v-if",!0),n.finished?xe(n.$slots,"finished",{key:1},()=>{var s;return[me("div",{class:B(n.n("finished"))},ut((s=n.finishedText)!=null?s:n.pack.listFinishedText),3)]}):Qe("v-if",!0),n.error?xe(n.$slots,"error",{key:2},()=>{var s;return[wi((q(),re("div",{class:B(n.n("error")),onClick:e[0]||(e[0]=(...o)=>n.load&&n.load(...o))},[Mi(ut((s=n.errorText)!=null?s:n.pack.listErrorText),1)],2)),[[i]])]}):Qe("v-if",!0),me("div",{class:B(n.n("detector")),ref:"detectorEl"},null,2)],2)}const Yae=et({name:qYe,directives:{Ripple:Ns},components:{VarLoading:l0},props:HYe,setup(n){const e=se(null),t=se(null),{tabItem:i,bindTabItem:s}=jYe();let o;oe(s,{}),i&&ht(()=>i.current.value,c),ht(()=>[n.loading,n.error,n.finished],c),Vo(()=>{o=pg(e.value),o.addEventListener("scroll",c),n.immediateCheck&&c()}),oA(l);function r(){oe(n["onUpdate:error"],!1),oe(n["onUpdate:loading"],!0),oe(n.onLoad)}function a(){const{bottom:d}=no(o),{bottom:u}=no(t.value);return Math.floor(u)-jn(n.offset)<=d}function l(){o.removeEventListener("scroll",c)}function c(){return KYe(this,null,function*(){yield Fn(),!(n.loading||n.finished||n.error||(i==null?void 0:i.current.value)===!1||!a())&&r()})}return{pack:Xs,listEl:e,detectorEl:t,isNumber:qr,load:r,check:c,n:GYe,classes:YYe}}});Yae.render=ZYe;var Zae=Yae;lt(Zae);var H3=Zae;const XYe={value:{type:Number,default:0},opacity:{type:Number,default:0},error:Boolean,color:String,errorColor:String,height:[Number,String],top:[Number,String]},{name:QYe,classes:JYe,n:wG}=st("loading-bar");var eZe=et({name:QYe,props:XYe,setup(n){return()=>Oe("div",{class:JYe(wG(),[n.error,wG("--error")]),style:{zIndex:Ea.zIndex+10,width:"".concat(n.value,"%"),opacity:n.opacity,height:ri(n.height),backgroundColor:n.error?n.errorColor:n.color,top:ri(n.top)}},null)}});let Xae,Qae,CA,Jae,yG,ele={};const tZe={value:0,opacity:0,error:!1},vo=Cn(tZe),iZe=n=>{Object.assign(vo,n)},nZe=n=>{Object.assign(vo,n),ele=n},sZe=()=>{Object.keys(ele).forEach(n=>{vo[n]!==void 0&&(vo[n]=void 0)})},tle=()=>{yG||(yG=!0,K0(eZe,vo))},z6=()=>{Xae=window.setTimeout(()=>{if(vo.value>=95)return;let n=Math.random();vo.value<70&&(n=Math.round(5*Math.random())),vo.value+=n,z6()},200)},U6=()=>{window.clearTimeout(Qae),window.clearTimeout(Xae),window.clearTimeout(CA),window.clearTimeout(Jae)},oZe=()=>{U6(),vo.error=!1,vo.value=0,tle(),CA=window.setTimeout(()=>{vo.opacity=1},200),z6()},ile=()=>{U6(),vo.value=100,CA=window.setTimeout(()=>{vo.opacity=0,Qae=window.setTimeout(()=>{vo.error=!1},250)},300)},rZe=()=>{U6(),vo.error=!0,vo.value===100&&(vo.value=0),tle(),CA=window.setTimeout(()=>{vo.opacity=1},200),z6(),Jae=window.setTimeout(ile,300)},aZe={start:oZe,finish:ile,error:rZe,mergeConfig:iZe,setDefaultOptions:nZe,resetDefaultOptions:sZe};var $3=aZe;const nle={show:Boolean,disabled:Boolean,trigger:{type:String,default:"click"},reference:String,placement:{type:String,default:"cover-top-start"},strategy:{type:String,default:"absolute"},offsetX:{type:[Number,String],default:0},offsetY:{type:[Number,String],default:0},teleport:{type:[String,Object,Boolean],default:"body"},sameWidth:Boolean,elevation:{type:[Boolean,String,Number],default:!0},defaultStyle:{type:Boolean,default:!0},popoverClass:String,closeOnClickReference:Boolean,onOpen:Se(),onOpened:Se(),onClose:Se(),onClosed:Se(),onClickOutside:Se(),"onUpdate:show":Se()},{name:lZe,n:cZe,classes:dZe}=st("menu");function uZe(n,e){return q(),re("div",{ref:"host",class:B(n.classes(n.n(),n.n("$--box"))),onClick:e[3]||(e[3]=(...t)=>n.handleHostClick&&n.handleHostClick(...t)),onMouseenter:e[4]||(e[4]=(...t)=>n.handleHostMouseenter&&n.handleHostMouseenter(...t)),onMouseleave:e[5]||(e[5]=(...t)=>n.handleHostMouseleave&&n.handleHostMouseleave(...t))},[xe(n.$slots,"default"),(q(),ei(Bd,{to:n.teleport===!1?void 0:n.teleport,disabled:n.teleportDisabled||n.teleport===!1},[Oe(On,{name:n.n(),onAfterEnter:n.onOpened,onAfterLeave:n.handleClosed,persisted:""},{default:Lt(()=>[wi(me("div",{ref:"popover",style:Fe({zIndex:n.zIndex,width:n.sameWidth?n.toSizeUnit(Math.ceil(n.hostSize.width)):void 0}),class:B(n.classes(n.n("menu"),n.n("$--box"),n.popoverClass,[n.defaultStyle,n.n("--menu-background-color")],[n.defaultStyle,n.formatElevation(n.elevation,3)])),onClick:e[0]||(e[0]=Ia(()=>{},["stop"])),onMouseenter:e[1]||(e[1]=(...t)=>n.handlePopoverMouseenter&&n.handlePopoverMouseenter(...t)),onMouseleave:e[2]||(e[2]=(...t)=>n.handlePopoverMouseleave&&n.handlePopoverMouseleave(...t))},[xe(n.$slots,"menu")],38),[[hl,n.show]])]),_:3},8,["name","onAfterEnter","onAfterLeave"])],8,["to","disabled"]))],34)}const sle=et({name:lZe,props:nle,setup(n){const{disabled:e}=u_(),{popover:t,host:i,hostSize:s,show:o,zIndex:r,handleHostClick:a,handleHostMouseenter:l,handleHostMouseleave:c,handlePopoverMouseenter:d,handlePopoverMouseleave:u,handlePopoverClose:h,handleClosed:f,open:g,close:p,resize:_}=mae(n);return{popover:t,host:i,hostSize:s,show:o,zIndex:r,teleportDisabled:e,formatElevation:or,toSizeUnit:ri,n:cZe,classes:dZe,handleHostClick:a,handleHostMouseenter:l,handleHostMouseleave:c,handlePopoverMouseenter:d,handlePopoverMouseleave:u,handlePopoverClose:h,handleClosed:f,resize:_,open:g,close:p}}});sle.render=uZe;var ole=sle;lt(ole);var f0=ole;const rle=Symbol("MENU_SELECT_BIND_MENU_OPTION_KEY");function hZe(){const{length:n,childProviders:e,bindChildren:t}=$o(rle);return{length:n,menuOptions:e,bindMenuOptions:t}}function fZe(){const{index:n,parentProvider:e,bindParent:t}=Ho(rle);return t||Oa("MenuOption"," must in "),{index:n,menuSelect:e,bindMenuSelect:t}}const gZe={label:{},value:{},disabled:Boolean},{name:pZe,n:mZe,classes:_Ze}=st("menu-option");function vZe(n,e){const t=gt("var-checkbox"),i=gt("var-hover-overlay"),s=hn("ripple"),o=hn("hover");return wi((q(),re("div",{class:B(n.classes(n.n(),n.n("$--box"),n.n("--".concat(n.size)),[n.optionSelected,n.n("--selected-color")],[n.disabled,n.n("--disabled")])),onClick:e[2]||(e[2]=(...r)=>n.handleClick&&n.handleClick(...r))},[me("div",{class:B(n.classes(n.n("cover"),[n.optionSelected,n.n("--selected-background")]))},null,2),n.multiple?(q(),ei(t,{key:0,ref:"checkbox",modelValue:n.optionSelected,"onUpdate:modelValue":e[0]||(e[0]=r=>n.optionSelected=r),disabled:n.disabled,onClick:e[1]||(e[1]=Ia(()=>{},["stop"])),onChange:n.handleSelect},null,8,["modelValue","disabled","onChange"])):Qe("v-if",!0),xe(n.$slots,"default",{},()=>[me("div",{class:B(n.classes(n.n("text"),n.n("$--ellipsis")))},ut(n.label),3)]),Oe(i,{hovering:n.hovering&&!n.disabled},null,8,["hovering"])],2)),[[s,{disabled:n.disabled}],[o,n.handleHovering,"desktop"]])}const ale=et({name:pZe,directives:{Ripple:Ns,Hover:Fa},components:{VarCheckbox:Uy,VarHoverOverlay:ml},props:gZe,setup(n){const e=se(!1),t=ve(()=>e.value),i=ve(()=>n.label),s=ve(()=>n.value),{menuSelect:o,bindMenuSelect:r}=fZe(),{size:a,multiple:l,onSelect:c,computeLabel:d}=o,{hovering:u,handleHovering:h}=Pd(),f={label:i,value:s,selected:t,sync:_};ht([()=>n.label,()=>n.value],d),r(f);function g(){n.disabled||p()}function p(){l.value&&(e.value=!e.value),c(f)}function _(v){e.value=v}return{optionSelected:e,size:a,multiple:l,hovering:u,n:mZe,classes:_Ze,handleHovering:h,handleClick:g,handleSelect:p}}});ale.render=vZe;var lle=ale;lt(lle);var z3=lle,bZe=Object.defineProperty,SG=Object.getOwnPropertySymbols,CZe=Object.prototype.hasOwnProperty,wZe=Object.prototype.propertyIsEnumerable,LG=(n,e,t)=>e in n?bZe(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,yZe=(n,e)=>{for(var t in e||(e={}))CZe.call(e,t)&&LG(n,t,e[t]);if(SG)for(var t of SG(e))wZe.call(e,t)&&LG(n,t,e[t]);return n};const SZe=yZe({modelValue:{default:void 0},size:{type:String,default:"normal"},multiple:Boolean,scrollable:Boolean,closeOnSelect:{type:Boolean,default:!0},"onUpdate:modelValue":Se()},yi(nle,["show","disabled","trigger","reference","placement","strategy","offsetX","offsetY","teleport","sameWidth","elevation","popoverClass","closeOnClickReference","onOpen","onOpened","onClose","onClosed","onClickOutside","onUpdate:show"]));function cle(n){const{multiple:e,modelValue:t,optionProviders:i,optionProvidersLength:s}=n,o=se(""),r=se([]);ht(t,u,{deep:!0}),ht(s,u);function a(){const h=e(),f=t();h&&(r.value=f.map(l)),!h&&!hd(f)&&(o.value=l(f)),!h&&hd(f)&&(o.value="")}function l(h){var f;const g=i();let p=g.find(({value:_})=>_.value===h);return p||(p=g.find(({label:_})=>_.value===h)),(f=p==null?void 0:p.label.value)!=null?f:""}function c({value:h,label:f}){return h.value!=null?h.value:f.value}function d(h){const f=e(),g=i();return f?g.filter(({selected:p})=>p.value).map(c):c(h)}function u(){const h=e(),f=t(),g=i();h?g.forEach(p=>p.sync(f.includes(c(p)))):g.forEach(p=>p.sync(f===c(p))),a()}return{label:o,labels:r,computeLabel:a,getSelectedValue:d}}const{name:LZe,n:kZe,classes:DZe}=st("menu-select");function EZe(n,e){const t=gt("var-menu");return q(),ei(t,{ref:"menu",class:B(n.n()),disabled:n.disabled,trigger:n.trigger,reference:n.reference,placement:n.placement,strategy:n.strategy,"offset-x":n.offsetX,"offset-y":n.offsetY,teleport:n.teleport,"same-width":n.sameWidth,elevation:n.elevation,"default-style":!1,"popover-class":n.popoverClass,"close-on-click-reference":n.closeOnClickReference,show:n.show,"onUpdate:show":e[0]||(e[0]=i=>n.show=i),onOpen:n.onOpen,onOpened:n.onOpened,onClose:n.onClose,onClosed:n.onClosed,onClickOutside:n.onClickOutside},{menu:Lt(()=>[me("div",{class:B(n.classes(n.n("menu"),n.formatElevation(n.elevation,3),[n.scrollable,n.n("--scrollable")]))},[xe(n.$slots,"options")],2)]),default:Lt(()=>[xe(n.$slots,"default")]),_:3},8,["class","disabled","trigger","reference","placement","strategy","offset-x","offset-y","teleport","same-width","elevation","popover-class","close-on-click-reference","show","onOpen","onOpened","onClose","onClosed","onClickOutside"])}const dle=et({name:LZe,components:{VarMenu:f0},props:SZe,setup(n){const e=se(null),t=Xu(n,"show"),{menuOptions:i,length:s,bindMenuOptions:o}=hZe(),{computeLabel:r,getSelectedValue:a}=cle({modelValue:()=>n.modelValue,multiple:()=>n.multiple,optionProviders:()=>i,optionProvidersLength:()=>s.value}),l={size:ve(()=>n.size),multiple:ve(()=>n.multiple),computeLabel:r,onSelect:c};o(l);function c(f){const{multiple:g,closeOnSelect:p}=n;oe(n["onUpdate:modelValue"],a(f)),!g&&p&&(t.value=!1)}function d(){var f;(f=e.value)==null||f.open()}function u(){var f;(f=e.value)==null||f.close()}function h(){var f;(f=e.value)==null||f.resize()}return{show:t,menu:e,n:kZe,classes:DZe,formatElevation:or,open:d,close:u,resize:h}}});dle.render=EZe;var ule=dle;lt(ule);var U3=ule;const hle=Symbol("SELECT_BIND_OPTION_KEY");function IZe(){const{length:n,childProviders:e,bindChildren:t}=$o(hle);return{length:n,options:e,bindOptions:t}}function TZe(){const{index:n,parentProvider:e,bindParent:t}=Ho(hle);return t||Oa("Option"," must in "),{index:n,select:e,bindSelect:t}}const xZe={label:{},value:{},disabled:Boolean},{name:NZe,n:AZe,classes:MZe}=st("option");function RZe(n,e){const t=gt("var-checkbox"),i=gt("var-hover-overlay"),s=hn("ripple"),o=hn("hover");return wi((q(),re("div",{class:B(n.classes(n.n(),n.n("$--box"),[n.optionSelected,n.n("--selected-color")],[n.disabled,n.n("--disabled")])),style:Fe({color:n.optionSelected?n.focusColor:void 0}),onClick:e[2]||(e[2]=(...r)=>n.handleClick&&n.handleClick(...r))},[me("div",{class:B(n.classes(n.n("cover"),[n.optionSelected,n.n("--selected-background")])),style:Fe({background:n.optionSelected?n.focusColor:void 0})},null,6),n.multiple?(q(),ei(t,{key:0,ref:"checkbox",modelValue:n.optionSelected,"onUpdate:modelValue":e[0]||(e[0]=r=>n.optionSelected=r),"checked-color":n.focusColor,disabled:n.disabled,onClick:e[1]||(e[1]=Ia(()=>{},["stop"])),onChange:n.handleSelect},null,8,["modelValue","checked-color","disabled","onChange"])):Qe("v-if",!0),xe(n.$slots,"default",{},()=>[me("div",{class:B(n.classes(n.n("text"),n.n("$--ellipsis")))},ut(n.label),3)]),Oe(i,{hovering:n.hovering&&!n.disabled},null,8,["hovering"])],6)),[[s,{disabled:n.disabled}],[o,n.handleHovering,"desktop"]])}const fle=et({name:NZe,directives:{Ripple:Ns,Hover:Fa},components:{VarCheckbox:Uy,VarHoverOverlay:ml},props:xZe,setup(n){const e=se(!1),t=ve(()=>e.value),i=ve(()=>n.label),s=ve(()=>n.value),{select:o,bindSelect:r}=TZe(),{multiple:a,focusColor:l,onSelect:c,computeLabel:d}=o,{hovering:u,handleHovering:h}=Pd(),f={label:i,value:s,selected:t,sync:_};ht([()=>n.label,()=>n.value],d),r(f);function g(){n.disabled||p()}function p(){a.value&&(e.value=!e.value),c(f)}function _(v){e.value=v}return{optionSelected:e,multiple:a,focusColor:l,hovering:u,n:AZe,classes:MZe,handleHovering:h,handleClick:g,handleSelect:p}}});fle.render=RZe;var gle=fle;lt(gle);var j3=gle;const PZe={show:Boolean,lockScroll:{type:Boolean,default:!0},teleport:[String,Object,Boolean],onClick:Se(),"onUpdate:show":Se()},{name:OZe,n:kG}=st("overlay");var ple=et({name:OZe,inheritAttrs:!1,props:PZe,setup(n,{slots:e,attrs:t}){const{zIndex:i}=QS(()=>n.show,1),{disabled:s}=u_();XS(()=>n.show,()=>n.lockScroll);function o(){oe(n.onClick),oe(n["onUpdate:show"],!1)}function r(){return Oe("div",fn({class:kG(),style:{zIndex:i.value-1}},t,{onClick:o}),[oe(e.default)])}function a(){return Oe(On,{name:kG("--fade")},{default:()=>[n.show&&r()]})}return()=>{const{teleport:l}=n;return l?Oe(Bd,{to:l,disabled:s.value},{default:()=>[a()]}):a()}}});lt(ple);var K3=ple;const FZe={current:[Number,String],size:{type:[Number,String],default:10},total:{type:[Number,String],default:0},elevation:{type:[Boolean,Number,String],default:!0},maxPagerCount:{type:Number,default:3},disabled:Boolean,simple:{type:Boolean,default:!0},showSizeChanger:{type:Boolean,default:!0},showQuickJumper:Boolean,sizeOption:{type:Array,default:()=>[10,20,50,100]},showTotal:Function,onChange:Se(),"onUpdate:current":Se(),"onUpdate:size":Se()},{name:BZe,n:WZe,classes:VZe}=st("pagination"),HZe=["item-mode","onClick"];function $Ze(n,e){const t=gt("var-icon"),i=gt("var-input"),s=gt("var-cell"),o=gt("var-menu"),r=hn("ripple");return q(),re("ul",{class:B(n.n())},[wi((q(),re("li",{class:B(n.classes(n.n("item"),n.n("prev"),[n.current<=1||n.disabled,n.n("item--disabled")],[n.simple,n.n("item--simple"),n.formatElevation(n.elevation,2)])),onClick:e[0]||(e[0]=a=>n.clickItem("prev"))},[xe(n.$slots,"prev",{},()=>[Oe(t,{name:"chevron-left"})])],2)),[[r,{disabled:n.current<=1||n.disabled}]]),n.simple?(q(),re("li",{key:0,class:B(n.classes(n.n("simple"),[n.disabled,n.n("item--disabled")]))},[Oe(i,{"var-pagination-cover":"",hint:!1,disabled:n.disabled,modelValue:n.simpleCurrentValue,"onUpdate:modelValue":e[1]||(e[1]=a=>n.simpleCurrentValue=a),onBlur:e[2]||(e[2]=a=>n.setPage("simple",n.simpleCurrentValue,a)),onKeydown:e[3]||(e[3]=VW(a=>n.setPage("simple",n.simpleCurrentValue,a),["enter"]))},null,8,["disabled","modelValue"]),me("span",null,[Mi(" / "+ut(n.pageCount)+" ",1),me("div",{class:B(n.n("simple-line"))},null,2)])],2)):(q(!0),re(li,{key:1},ss(n.pageList,(a,l)=>wi((q(),re("li",{key:l,"item-mode":n.getMode(a,l),class:B(n.classes(n.n("item"),n.formatElevation(n.elevation,2),[a===n.current&&!n.disabled,n.n("item--active")],[n.isHideEllipsis(a,l),n.n("item--hide")],[n.disabled,n.n("item--disabled")],[a===n.current&&n.disabled,n.n("item--disabled--active")])),onClick:c=>n.clickItem(a,l)},[Mi(ut(a),1)],10,HZe)),[[r,{disabled:n.disabled}]])),128)),wi((q(),re("li",{class:B(n.classes(n.n("item"),n.n("next"),[n.current>=n.pageCount||n.disabled,n.n("item--disabled")],[n.simple,n.n("item--simple"),n.formatElevation(n.elevation,2)])),onClick:e[4]||(e[4]=a=>n.clickItem("next"))},[xe(n.$slots,"next",{},()=>[Oe(t,{name:"chevron-right"})])],2)),[[r,{disabled:n.current>=n.pageCount||n.disabled}]]),n.showSizeChanger?(q(),re("li",{key:2,class:B(n.classes(n.n("size"),[n.disabled,n.n("item--disabled")]))},[Oe(o,{placement:"cover-top",disabled:n.disabled,show:n.menuVisible,"onUpdate:show":e[6]||(e[6]=a=>n.menuVisible=a)},{menu:Lt(()=>[(q(!0),re(li,null,ss(n.sizeOption,(a,l)=>wi((q(),ei(s,{class:B(n.classes(n.n("list"),[n.size===a,n.n("list--active")])),key:l,onClick:c=>n.clickSize(a)},{default:Lt(()=>[Mi(ut(a)+ut(n.pack.paginationItem)+" / "+ut(n.pack.paginationPage),1)]),_:2},1032,["class","onClick"])),[[r]])),128))]),default:Lt(()=>[me("div",{class:B(n.classes(n.n("size--open"),[n.current<=1||n.disabled,n.n("size--open--disabled")])),onClick:e[5]||(e[5]=Ia((...a)=>n.showMenu&&n.showMenu(...a),["stop"]))},[me("span",null,ut(n.size)+ut(n.pack.paginationItem)+" / "+ut(n.pack.paginationPage),1),Oe(t,{class:B(n.n("size--open-icon")),"var-pagination-cover":"",name:"menu-down"},null,8,["class"])],2)]),_:1},8,["disabled","show"])],2)):Qe("v-if",!0),n.showQuickJumper&&!n.simple?(q(),re("li",{key:3,class:B(n.classes(n.n("quickly"),[n.disabled,n.n("item--disabled")]))},[Mi(ut(n.pack.paginationJump)+" ",1),Oe(i,{modelValue:n.quickJumperValue,"onUpdate:modelValue":e[7]||(e[7]=a=>n.quickJumperValue=a),disabled:n.disabled,"var-pagination-cover":"",onBlur:e[8]||(e[8]=a=>n.setPage("quick",n.quickJumperValue,a)),onKeydown:e[9]||(e[9]=VW(a=>n.setPage("quick",n.quickJumperValue,a),["enter"]))},null,8,["modelValue","disabled"])],2)):Qe("v-if",!0),n.totalText?(q(),re("li",{key:4,class:B(n.classes(n.n("total"),[n.disabled,n.n("item--disabled")]))},ut(n.totalText),3)):Qe("v-if",!0)],2)}const mle=et({name:BZe,components:{VarMenu:f0,VarIcon:Wn,VarCell:hT,VarInput:wT},directives:{Ripple:Ns},props:FZe,setup(n){const e=se(!1),t=se(""),i=se("1"),s=se(!1),o=se(!1),r=se(Ie(n.current)||1),a=se(Ie(n.size)||10),l=se([]),c=ve(()=>Math.ceil(n.maxPagerCount/2)),d=ve(()=>Math.ceil(Ie(n.total)/Ie(a.value))),u=ve(()=>{const w=a.value*(r.value-1)+1,y=Math.min(a.value*r.value,Ie(n.total));return[w,y]}),h=ve(()=>n.showTotal?n.showTotal(Ie(n.total),u.value):"");ht([()=>n.current,()=>n.size],([w,y])=>{r.value=Ie(w)||1,a.value=Ie(y||10)}),ht([r,a,d],([w,y,L],[S,k])=>{let D=[];const{maxPagerCount:x,total:A,onChange:T}=n,P=Math.ceil(Ie(A)/Ie(k)),W=L-(x-c.value)-1;if(i.value="".concat(w),L-2>x){if(S===void 0||L!==P)for(let $=2;$x&&w=W){D=[];for(let $=1;$0&&oe(T,w,y),oe(n["onUpdate:current"],w),oe(n["onUpdate:size"],y)},{immediate:!0});function f(w,y){return qr(w)?!1:y===1?s.value:o.value}function g(w,y){return qr(w)?"basic":y===1?"head":"tail"}function p(w,y){if(!(w===r.value||n.disabled)){if(w==="..."){r.value=y===1?Math.max(r.value-n.maxPagerCount,1):Math.min(r.value+n.maxPagerCount,d.value);return}if(w==="prev"){r.value=b(r.value-1);return}if(w==="next"){r.value=b(r.value+1);return}qr(w)&&(r.value=w)}}function _(){n.disabled||(e.value=!0)}function v(w){a.value=w,e.value=!1;const y=b(r.value);i.value=String(y),r.value=y}function b(w){return w>d.value?d.value:w<1?1:w}function C(w,y,L){L.target.blur();const S=b(Ie(y));i.value=String(S),r.value=S,w==="quick"&&(t.value="")}return{pack:Xs,current:r,menuVisible:e,size:a,pageCount:d,pageList:l,quickJumperValue:t,simpleCurrentValue:i,totalText:h,n:WZe,classes:VZe,getMode:g,isHideEllipsis:f,clickItem:p,showMenu:_,clickSize:v,setPage:C,toNumber:Ie,formatElevation:or}}});mle.render=$Ze;var _le=mle;lt(_le);var q3=_le;const zZe={elevation:{type:[Boolean,Number,String],default:!1},ripple:Boolean,radius:[Number,String],width:[Number,String],height:[Number,String],round:Boolean,inline:Boolean,onClick:Se()},{name:UZe,n:jZe,classes:KZe}=st("paper");function qZe(n,e){const t=hn("ripple");return wi((q(),re("div",{class:B(n.classes(n.n(),n.n("$--box"),n.formatElevation(n.elevation,2),[n.onClick,n.n("--cursor")],[n.round,n.n("--round")],[n.inline,n.n("$--inline-flex")])),style:Fe({width:n.toSizeUnit(n.width),height:n.toSizeUnit(n.height),"border-radius":n.toSizeUnit(n.radius)}),onClick:e[0]||(e[0]=(...i)=>n.handleClick&&n.handleClick(...i))},[xe(n.$slots,"default")],6)),[[t,{disabled:!n.ripple}]])}const vle=et({name:UZe,directives:{Ripple:Ns},props:zZe,setup(n){function e(t){oe(n.onClick,t)}return{n:jZe,classes:KZe,formatElevation:or,toSizeUnit:ri,handleClick:e}}});vle.render=qZe;var ble=vle;lt(ble);var G3=ble,GZe=Object.defineProperty,DG=Object.getOwnPropertySymbols,YZe=Object.prototype.hasOwnProperty,ZZe=Object.prototype.propertyIsEnumerable,EG=(n,e,t)=>e in n?GZe(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,XZe=(n,e)=>{for(var t in e||(e={}))YZe.call(e,t)&&EG(n,t,e[t]);if(DG)for(var t of DG(e))ZZe.call(e,t)&&EG(n,t,e[t]);return n};const QZe=XZe({modelValue:{type:Array,default:()=>[]},columns:{type:Array,default:()=>[]},title:String,textKey:{type:String,default:"text"},valueKey:{type:String,default:"value"},childrenKey:{type:String,default:"children"},toolbar:{type:Boolean,default:!0},cascade:Boolean,optionHeight:{type:[Number,String],default:44},optionCount:{type:[Number,String],default:6},confirmButtonText:String,cancelButtonText:String,confirmButtonTextColor:String,cancelButtonTextColor:String,dynamic:Boolean,onChange:Se(),onConfirm:Se(),onCancel:Se(),"onUpdate:modelValue":Se()},yi(ZS,["show","onUpdate:show","closeOnClickOverlay","teleport","safeArea","onOpen","onClose","onOpened","onClosed","onClickOverlay","onRouteChange"])),{name:JZe,n:eXe,classes:tXe}=st("picker"),IG=300,iXe=15,TG=200,nXe=1e3;let xG=0;const sXe=["onTouchstartPassive","onTouchmove","onTouchend"],oXe=["onTransitionend"],rXe=["onClick"];function aXe(n,e){const t=gt("var-button");return q(),ei(m0(n.dynamic?n.n("$-popup"):n.Transition),fn(n.dynamic?{onOpen:n.onOpen,onOpened:n.onOpened,onClose:n.onClose,onClosed:n.onClosed,onClickOverlay:n.onClickOverlay,onRouteChange:n.onRouteChange,closeOnClickOverlay:n.closeOnClickOverlay,teleport:n.teleport,show:n.show,safeArea:n.safeArea,"onUpdate:show":n.handlePopupUpdateShow,position:"bottom",class:n.n("popup")}:null,{"var-picker-cover":""}),{default:Lt(()=>[me("div",fn({class:n.n()},n.$attrs),[n.toolbar?(q(),re("div",{key:0,class:B(n.n("toolbar"))},[xe(n.$slots,"cancel",{},()=>[Oe(t,{class:B(n.n("cancel-button")),"var-picker-cover":"",text:"","text-color":n.cancelButtonTextColor,onClick:n.cancel},{default:Lt(()=>{var i;return[Mi(ut((i=n.cancelButtonText)!=null?i:n.pack.pickerCancelButtonText),1)]}),_:1},8,["class","text-color","onClick"])]),xe(n.$slots,"title",{},()=>{var i;return[me("div",{class:B(n.n("title"))},ut((i=n.title)!=null?i:n.pack.pickerTitle),3)]}),xe(n.$slots,"confirm",{},()=>[Oe(t,{class:B(n.n("confirm-button")),text:"","var-picker-cover":"","text-color":n.confirmButtonTextColor,onClick:n.confirm},{default:Lt(()=>{var i;return[Mi(ut((i=n.confirmButtonText)!=null?i:n.pack.pickerConfirmButtonText),1)]}),_:1},8,["class","text-color","onClick"])])],2)):Qe("v-if",!0),me("div",{class:B(n.n("columns")),style:Fe({height:"".concat(n.columnHeight,"px")})},[(q(!0),re(li,null,ss(n.scrollColumns,i=>(q(),re("div",{class:B(n.n("column")),key:i.id,onTouchstartPassive:s=>n.handleTouchstart(s,i),onTouchmove:Ia(s=>n.handleTouchmove(s,i),["prevent"]),onTouchend:s=>n.handleTouchend(i)},[me("div",{class:B(n.n("scroller")),ref_for:!0,ref:s=>n.setScrollEl(s,i),style:Fe({transform:"translateY(".concat(i.translate,"px)"),transitionDuration:"".concat(i.duration,"ms"),transitionProperty:i.duration?"transform":"none"}),onTransitionend:s=>n.handleTransitionend(i)},[(q(!0),re(li,null,ss(i.column,(s,o)=>(q(),re("div",{key:n.getValue(s),class:B(n.classes(n.n("option"),s.className)),style:Fe({height:"".concat(n.optionHeight,"px")}),onClick:r=>n.handleClick(i,o)},[me("div",{class:B(n.classes(n.n("text"),s.textClassName))},ut(s[n.getOptionKey("text")]),3)],14,rXe))),128))],46,oXe)],42,sXe))),128)),me("div",{class:B(n.n("picked")),style:Fe({top:"".concat(n.center,"px"),height:"".concat(n.optionHeight,"px")})},null,6),me("div",{class:B(n.n("mask")),style:Fe({backgroundSize:"100% ".concat((n.columnHeight-n.optionHeight)/2,"px")})},null,6)],6)],16)]),_:3},16)}const Cle=et({name:JZe,components:{VarButton:ia,VarPopup:gg},inheritAttrs:!1,props:QZe,setup(n){const e=Xu(n,"modelValue"),t=se([]),i=ve(()=>jn(n.optionHeight)),s=ve(()=>jn(n.optionCount)),o=ve(()=>s.value*i.value/2-i.value/2),r=ve(()=>s.value*i.value),{prevY:a,moveY:l,dragging:c,startTouch:d,moveTouch:u,endTouch:h}=j0();let f=[];y(),ht(()=>n.columns,y,{deep:!0}),ht(()=>e.value,L);function g(pe){return{text:n.textKey,value:n.valueKey,children:n.childrenKey}[pe]}function p(pe){var Ee;return(Ee=pe[g("value")])!=null?Ee:pe[g("text")]}function _(pe){f=[...pe]}function v(pe){return pe.map(Ee=>{const ze={id:xG++,prevY:0,momentumPrevY:0,touching:!1,translate:o.value,index:0,duration:0,momentumTime:0,column:Ee,scrollEl:null,scrolling:!1};return P(ze),ze})}function b(pe){const Ee=[];return C(Ee,pe),Ee}function C(pe,Ee){var ze;if(Ee.length){const It={id:xG++,prevY:0,momentumPrevY:0,touching:!1,translate:o.value,index:0,duration:0,momentumTime:0,column:Ee,scrollEl:null,scrolling:!1};pe.push(It),P(It),C(pe,(ze=It.column[It.index][g("children")])!=null?ze:[])}}function w(pe){var Ee;t.value.splice(t.value.indexOf(pe)+1),C(t.value,(Ee=pe.column[pe.index][g("children")])!=null?Ee:[])}function y(){t.value=n.cascade?b(n.columns):v(n.columns),L()}function L(){t.value.forEach((Ee,ze)=>{const It=Ee.column.findIndex(Ke=>e.value[ze]===p(Ke));Ee.index=It===-1?0:It,P(Ee)});const{indexes:pe}=T();_(pe)}function S(pe,Ee){Ee.scrollEl=pe}function k(pe){oe(n["onUpdate:show"],pe)}function D(pe){const Ee=o.value-pe.column.length*i.value,ze=i.value+o.value;pe.translate=Wf(pe.translate,Ee,ze)}function x(pe,Ee){const ze=Math.round((o.value-Ee)/i.value);return The(ze,pe.column)}function A(pe){return pe.translate=o.value-pe.index*i.value,pe.translate}function T(){const pe=[],Ee=[],ze=[];return t.value.forEach(({column:It,index:Ke})=>{const Xe=It[Ke];pe.push(p(Xe)),Ee.push(Ke),ze.push(Xe)}),{values:pe,indexes:Ee,options:ze}}function P(pe,Ee=0){A(pe),pe.duration=Ee}function W(pe,Ee,ze){pe.translate+=Math.abs(Ee/ze)/.003*(Ee<0?-1:1)}function $(pe,Ee){c.value||(pe.index=Ee,P(pe,TG))}function X(pe,Ee){Ee.touching=!0,Ee.translate=QR(Ee.scrollEl),d(pe)}function J(pe,Ee){if(!Ee.touching)return;u(pe),Ee.scrolling=!1,Ee.duration=0,Ee.prevY=a.value,Ee.translate+=l.value,D(Ee);const ze=performance.now();ze-Ee.momentumTime>IG&&(Ee.momentumTime=ze,Ee.momentumPrevY=Ee.translate)}function Q(pe){h(),pe.touching=!1,pe.prevY=0;const Ee=pe.translate-pe.momentumPrevY,ze=performance.now()-pe.momentumTime,It=Math.abs(Ee)>=iXe&&ze<=IG,Ke=pe.translate;It&&W(pe,Ee,ze),pe.index=x(pe,pe.translate),P(pe,It?nXe:TG),pe.scrolling=pe.translate!==Ke,pe.scrolling||_e(pe)}function le(pe){pe.scrolling=!1,_e(pe)}function de(){const{indexes:pe}=T();return pe.every((Ee,ze)=>Ee===f[ze])}function _e(pe){const{cascade:Ee,onChange:ze}=n;if(de())return;Ee&&w(pe);const It=t.value.some(z=>z.scrolling),Ke=t.value.some(z=>z.touching);if(It||Ke)return;const{values:Xe,indexes:je,options:Z}=T();_(je),oe(ze,Xe,je,Z),e.value=Xe}function ie(){if(n.cascade){const pe=t.value.find(Ee=>Ee.scrolling);pe&&(pe.index=x(pe,QR(pe.scrollEl)),pe.scrolling=!1,P(pe),w(pe))}else t.value.forEach(pe=>{pe.index=x(pe,QR(pe.scrollEl)),P(pe)})}function ne(){ie();const{values:pe,indexes:Ee,options:ze}=T();_(Ee),oe(n.onConfirm,pe,Ee,ze)}function Ye(){ie();const{values:pe,indexes:Ee,options:ze}=T();_(Ee),oe(n.onCancel,pe,Ee,ze)}return{pack:Xs,optionHeight:i,optionCount:s,scrollColumns:t,columnHeight:r,center:o,Transition:On,n:eXe,classes:tXe,setScrollEl:S,getOptionKey:g,getValue:p,handlePopupUpdateShow:k,handleTouchstart:X,handleTouchmove:J,handleTouchend:Q,handleTransitionend:le,confirm:ne,cancel:Ye,handleClick:$}}});Cle.render=aXe;var wA=Cle;let db;function eL(n){return new Promise(e=>{eL.close();const t=tn(n)?{columns:n}:n,i=Cn(t);i.dynamic=!0,i.teleport="body",db=i;function s(){db===i&&(db=null)}const{unmountInstance:o}=K0(wA,i,{onConfirm:(r,a,l)=>{oe(i.onConfirm,r,a,l),e({state:"confirm",values:r,indexes:a,options:l}),i.show=!1,s()},onCancel:(r,a,l)=>{oe(i.onCancel,r,a,l),e({state:"cancel",values:r,indexes:a,options:l}),i.show=!1,s()},onClose:()=>{oe(i.onClose),e({state:"close"}),s()},onClosed:()=>{oe(i.onClosed),o(),s()},onRouteChange:()=>{o(),s()},"onUpdate:show":r=>{i.show=r}});i.show=!0})}eL.close=function(){if(db==null)return;const n=db;db=null,Fn().then(()=>{n.show=!1})};eL.Component=wA;lt(wA);lt(wA,eL);var Y3=eL;const lXe={mode:{type:String,default:"linear"},lineWidth:{type:[Number,String],default:4},color:[String,Object],trackColor:String,ripple:Boolean,value:{type:[Number,String],default:0},label:Boolean,labelClass:String,size:{type:[Number,String],default:40},rotate:{type:Number,default:0},track:{type:Boolean,default:!0},indeterminate:Boolean,type:{type:String,default:"primary"}},Lh=100,nu=20,NG=2*Math.PI*nu,{name:cXe,n:dXe,classes:uXe}=st("progress"),hXe=["viewBox"],fXe={key:0},gXe=["id"],pXe=["offset","stop-color"],mXe=["d","stroke-width","stroke-dasharray"],_Xe=["d","stroke-width","stroke-dasharray","stroke-dashoffset"];function vXe(n,e){return q(),re("div",{class:B(n.n())},[n.mode==="linear"?(q(),re("div",{key:0,class:B(n.n("linear"))},[me("div",{class:B(n.classes(n.n("linear-block"),[n.track,n.n("linear-background")])),style:Fe({height:n.toSizeUnit(n.lineWidth),background:n.trackColor})},[n.indeterminate?(q(),re("div",{key:0,class:B(n.classes([n.indeterminate,n.n("linear-indeterminate")]))},[me("div",{class:B(n.classes(n.n("linear--".concat(n.type)))),style:Fe({background:n.progressColor})},null,6),me("div",{class:B(n.classes(n.n("linear--".concat(n.type)))),style:Fe({background:n.progressColor})},null,6)],2)):(q(),re("div",{key:1,class:B(n.classes(n.n("linear-certain"),n.n("linear--".concat(n.type)),[n.ripple,n.n("linear-ripple")])),style:Fe({background:n.progressColor,width:n.linearProps.width})},null,6))],6),n.label?(q(),re("div",{key:0,class:B(n.classes(n.n("linear-label"),[n.labelClass,n.labelClass]))},[xe(n.$slots,"default",{},()=>[Mi(ut(n.linearProps.roundValue),1)])],2)):Qe("v-if",!0)],2)):Qe("v-if",!0),n.mode==="circle"?(q(),re("div",{key:1,class:B(n.classes(n.n("circle"),[n.indeterminate,n.n("circle-indeterminate")])),style:Fe({width:n.toSizeUnit(n.size),height:n.toSizeUnit(n.size)})},[(q(),re("svg",{class:B(n.n("circle-svg")),viewBox:n.circleProps.viewBox},[n.isPlainObject(n.color)?(q(),re("defs",fXe,[me("linearGradient",{id:n.id,x1:"100%",y1:"0%",x2:"0%",y2:"0%"},[(q(!0),re(li,null,ss(n.linearGradientProgress,(t,i)=>(q(),re("stop",{key:i,offset:t,"stop-color":n.color[t]},null,8,pXe))),128))],8,gXe)])):Qe("v-if",!0),n.track?(q(),re("path",{key:1,class:B(n.n("circle-background")),d:n.circleProps.path,fill:"transparent","stroke-width":n.circleProps.strokeWidth,"stroke-dasharray":n.CIRCUMFERENCE,style:Fe({stroke:n.trackColor})},null,14,mXe)):Qe("v-if",!0),me("path",{class:B(n.classes(n.n("circle-certain"),n.n("circle--".concat(n.type)),[n.indeterminate,n.n("circle-overlay")])),d:n.circleProps.path,fill:"transparent","stroke-width":n.circleProps.strokeWidth,"stroke-dasharray":n.CIRCUMFERENCE,"stroke-dashoffset":n.circleProps.strokeOffset,style:Fe({stroke:n.progressColor,transform:"rotateZ(".concat(n.rotate,"deg)"),transformOrigin:"50% 50%"})},null,14,_Xe)],10,hXe)),n.label?(q(),re("div",{key:0,class:B(n.classes(n.n("circle-label"),[n.labelClass,n.labelClass]))},[xe(n.$slots,"default",{},()=>[Mi(ut(n.circleProps.roundValue),1)])],2)):Qe("v-if",!0)],6)):Qe("v-if",!0)],2)}const wle=et({name:cXe,props:lXe,setup(n){const e=qse(),t=ve(()=>{const r=Ie(n.value),a=r>Lh?Lh:r,l=r>Lh?Lh:Math.round(r);return{width:"".concat(a,"%"),roundValue:"".concat(l,"%")}}),i=ve(()=>{const{size:r,lineWidth:a,value:l}=n,c=nu/(1-jn(a)/jn(r))*2,d="0 0 ".concat(c," ").concat(c),u=Ie(l)>Lh?Lh:Math.round(Ie(l)),h="".concat((Lh-u)/Lh*NG),f=jn(a)/jn(r)*c,g=0,p=-nu,_=0,v=-2*nu,b="M ".concat(c/2," ").concat(c/2," m ").concat(g," ").concat(p," a ").concat(nu," ").concat(nu," \n 0 1 1 ").concat(_," ").concat(-v," a ").concat(nu," ").concat(nu," 0 1 1 ").concat(-_," ").concat(v);return{strokeWidth:f,viewBox:d,strokeOffset:h,roundValue:"".concat(u,"%"),path:b}}),s=ve(()=>ju(n.color)?"url(#".concat(e.value,")"):n.color),o=ve(()=>Object.keys(n.color).sort((r,a)=>parseFloat(r)-parseFloat(a)));return{id:e,linearProps:t,CIRCUMFERENCE:NG,RADIUS:nu,circleProps:i,progressColor:s,linearGradientProgress:o,n:dXe,classes:uXe,toSizeUnit:ri,isPlainObject:ju}}});wle.render=vXe;var yle=wle;lt(yle);var Z3=yle;const bXe={modelValue:Boolean,disabled:Boolean,animationDuration:{type:[Number,String],default:300},successDuration:{type:[Number,String],default:2e3},bgColor:String,successBgColor:String,color:String,successColor:String,target:[String,Object],onRefresh:Se(),"onUpdate:modelValue":Se()};var AG=(n,e,t)=>new Promise((i,s)=>{var o=l=>{try{a(t.next(l))}catch(c){s(c)}},r=l=>{try{a(t.throw(l))}catch(c){s(c)}},a=l=>l.done?i(l.value):Promise.resolve(l.value).then(o,r);a((t=t.apply(n,e)).next())});const{name:CXe,n:MG,classes:wXe}=st("pull-refresh"),RG=150;function yXe(n,e){const t=gt("var-icon");return q(),re("div",{ref:"freshNode",class:B(n.n()),onTouchstart:e[0]||(e[0]=(...i)=>n.handleTouchstart&&n.handleTouchstart(...i)),onTouchend:e[1]||(e[1]=(...i)=>n.handleTouchend&&n.handleTouchend(...i)),onTouchcancel:e[2]||(e[2]=(...i)=>n.handleTouchend&&n.handleTouchend(...i))},[me("div",{ref:"controlNode",class:B(n.classes(n.n("control"),n.n("$-elevation--2"),[n.isSuccess,n.n("control-success")])),style:Fe(n.controlStyle)},[Oe(t,{name:n.iconName,transition:n.ICON_TRANSITION,class:B(n.classes(n.n("icon"),[n.refreshStatus==="loading",n.n("animation")])),"var-pull-refresh-cover":""},null,8,["name","transition","class"])],6),xe(n.$slots,"default")],34)}const Sle=et({name:CXe,components:{VarIcon:Wn},props:bXe,setup(n){const e=se(0),t=se(null),i=se(null),s=se(0),o=se("-125%"),r=se("arrow-down"),a=se("default"),l=se(!1),c=ve(()=>Math.abs(2*e.value)),d=ve(()=>a.value==="success"),u=ve(()=>a.value!=="loading"&&a.value!=="success"&&!n.disabled),h=ve(()=>({transform:"translate3d(0px, ".concat(Us(o.value)?o.value:"".concat(o.value,"px"),", 0px) translate(-50%, 0)"),transition:l.value?"transform ".concat(n.animationDuration,"ms"):void 0,background:d.value?n.successBgColor:n.bgColor,color:d.value?n.successColor:n.color})),{startTouch:f,moveTouch:g,endTouch:p,isReachTop:_}=j0();let v,b;ht(()=>n.modelValue,x=>{x===!1&&(l.value=!0,a.value="success",r.value="checkbox-marked-circle",setTimeout(()=>{o.value=e.value,D()},Ie(n.successDuration)))}),Vo(k),fg(t,"touchmove",L);function C(x){return AG(this,null,function*(){if(r.value!==x)return r.value=x,new Promise(A=>{window.setTimeout(A,RG)})})}function w(x){("classList"in v?v:document.body).classList[x]("".concat(MG(),"--lock"))}function y(x){if(f(x),e.value===0){const{width:A}=no(i.value);e.value=-(A+A*.25)}b=pg(x.target)}function L(x){if(g(x),!u.value||!b||b!==v&&hb(b)>0||hb(v)>0)return;_(v)&&dc(x),a.value!=="pulling"&&(a.value="pulling",s.value=x.touches[0].clientY),_(v)&&qr(o.value)&&o.value>e.value&&w("add");const T=(x.touches[0].clientY-s.value)/2+e.value;o.value=T>=c.value?c.value:T,C(o.value>=c.value*.2?"refresh":"arrow-down")}function S(){return AG(this,null,function*(){p(),u.value&&(l.value=!0,Ie(o.value)>=c.value*.2?(yield C("refresh"),a.value="loading",o.value=c.value*.3,oe(n["onUpdate:modelValue"],!0),Fn(()=>{oe(n.onRefresh)}),w("remove")):(a.value="loosing",r.value="arrow-down",o.value=e.value,setTimeout(()=>{l.value=!1,w("remove")},Ie(n.animationDuration))),b=null)})}function k(){v=n.target?ooe(n.target,"PullRefresh"):pg(t.value)}function D(){setTimeout(()=>{a.value="default",r.value="arrow-down",l.value=!1},Ie(n.animationDuration))}return{ICON_TRANSITION:RG,refreshStatus:a,freshNode:t,controlNode:i,iconName:r,controlStyle:h,isSuccess:d,n:MG,classes:wXe,handleTouchstart:y,handleTouchmove:L,handleTouchend:S}}});Sle.render=yXe;var Lle=Sle;lt(Lle);var X3=Lle;const SXe={modelValue:{type:[String,Number,Boolean,Object,Array],default:!1},checkedValue:{type:[String,Number,Boolean,Object,Array],default:!0},uncheckedValue:{type:[String,Number,Boolean,Object,Array],default:!1},disabled:Boolean,readonly:Boolean,checkedColor:String,uncheckedColor:String,iconSize:[String,Number],ripple:{type:Boolean,default:!0},validateTrigger:{type:Array,default:()=>["onChange"]},rules:Array,onClick:Se(),onChange:Se(),"onUpdate:modelValue":Se()},kle=Symbol("RADIO_GROUP_BIND_RADIO_KEY");function LXe(){const{bindChildren:n,childProviders:e,length:t}=$o(kle);return{length:t,radios:e,bindRadios:n}}function kXe(){const{bindParent:n,parentProvider:e,index:t}=Ho(kle);return{index:t,radioGroup:e,bindRadioGroup:n}}const{name:DXe,n:EXe,classes:IXe}=st("radio");function TXe(n,e){const t=gt("var-icon"),i=gt("var-hover-overlay"),s=gt("var-form-details"),o=hn("ripple"),r=hn("hover");return q(),re("div",{class:B(n.n("wrap"))},[me("div",fn({class:n.n(),onClick:e[0]||(e[0]=(...a)=>n.handleClick&&n.handleClick(...a))},n.$attrs),[wi((q(),re("div",{class:B(n.classes(n.n("action"),[n.checked,n.n("--checked"),n.n("--unchecked")],[n.errorMessage||n.radioGroupErrorMessage,n.n("--error")],[n.formDisabled||n.disabled,n.n("--disabled")])),style:Fe({color:n.checked?n.checkedColor:n.uncheckedColor})},[n.checked?xe(n.$slots,"checked-icon",{key:0},()=>[Oe(t,{class:B(n.classes(n.n("icon"),[n.withAnimation,n.n("--with-animation")])),"var-radio-cover":"",name:"radio-marked",size:n.iconSize},null,8,["class","size"])]):xe(n.$slots,"unchecked-icon",{key:1},()=>[Oe(t,{class:B(n.classes(n.n("icon"),[n.withAnimation,n.n("--with-animation")])),"var-radio-cover":"",name:"radio-blank",size:n.iconSize},null,8,["class","size"])]),Oe(i,{hovering:!n.disabled&&!n.formDisabled&&n.hovering},null,8,["hovering"])],6)),[[o,{disabled:n.formReadonly||n.readonly||n.formDisabled||n.disabled||!n.ripple}],[r,n.handleHovering,"desktop"]]),me("div",{class:B(n.classes(n.n("text"),[n.errorMessage||n.radioGroupErrorMessage,n.n("--error")],[n.formDisabled||n.disabled,n.n("--disabled")]))},[xe(n.$slots,"default")],2)],16),Oe(s,{"error-message":n.errorMessage},null,8,["error-message"])],2)}const Dle=et({name:DXe,directives:{Ripple:Ns,Hover:Fa},components:{VarIcon:Wn,VarFormDetails:na,VarHoverOverlay:ml},inheritAttrs:!1,props:SXe,setup(n){const e=Xu(n,"modelValue"),t=ve(()=>e.value===n.checkedValue),i=se(!1),{radioGroup:s,bindRadioGroup:o}=kXe(),{hovering:r,handleHovering:a}=Pd(),{form:l,bindForm:c}=kl(),{errorMessage:d,validateWithTrigger:u,validate:h,resetValidation:f}=Ll(),g={sync:b,validate:w,resetValidation:f,reset:C};oe(o,g),oe(c,g);function p(L){Fn(()=>{const{validateTrigger:S,rules:k,modelValue:D}=n;u(S,L,k,D)})}function _(L){const{checkedValue:S,onChange:k}=n;s&&e.value===S||(e.value=L,oe(k,e.value),s==null||s.onToggle(S),p("onChange"))}function v(L){const{disabled:S,readonly:k,uncheckedValue:D,checkedValue:x,onClick:A}=n;l!=null&&l.disabled.value||S||(oe(A,L),!(l!=null&&l.readonly.value||k)&&(i.value=!0,_(t.value?D:x)))}function b(L){const{checkedValue:S,uncheckedValue:k}=n;e.value=L===S?S:k}function C(){e.value=n.uncheckedValue,f()}function w(){return h(n.rules,n.modelValue)}function y(L){const{uncheckedValue:S,checkedValue:k}=n;![S,k].includes(L)&&(L=t.value?S:k),_(L)}return{withAnimation:i,checked:t,errorMessage:d,radioGroupErrorMessage:s==null?void 0:s.errorMessage,formDisabled:l==null?void 0:l.disabled,formReadonly:l==null?void 0:l.readonly,hovering:r,handleHovering:a,n:EXe,classes:IXe,handleClick:v,toggle:y,reset:C,validate:w,resetValidation:f}}});Dle.render=TXe;var Ele=Dle;lt(Ele);var Q3=Ele;const xXe={modelValue:{type:[String,Number,Boolean,Object,Array],default:void 0},direction:{type:String,default:"horizontal"},validateTrigger:{type:Array,default:()=>["onChange"]},rules:Array,onChange:Se(),"onUpdate:modelValue":Se()},{name:NXe,n:AXe,classes:MXe}=st("radio-group");function RXe(n,e){const t=gt("var-form-details");return q(),re("div",{class:B(n.n("wrap"))},[me("div",{class:B(n.classes(n.n(),n.n("--".concat(n.direction))))},[xe(n.$slots,"default")],2),Oe(t,{"error-message":n.errorMessage},null,8,["error-message"])],2)}const Ile=et({name:NXe,components:{VarFormDetails:na},props:xXe,setup(n){const{length:e,radios:t,bindRadios:i}=LXe(),{bindForm:s}=kl(),{errorMessage:o,validateWithTrigger:r,validate:a,resetValidation:l}=Ll(),c=ve(()=>o.value),d={onToggle:f,validate:g,reset:p,resetValidation:l,errorMessage:c};ht(()=>n.modelValue,h),ht(()=>e.value,h),oe(s,d),i(d);function u(_){Fn(()=>{const{validateTrigger:v,rules:b,modelValue:C}=n;r(v,_,b,C)})}function h(){return t.forEach(({sync:_})=>_(n.modelValue))}function f(_){oe(n["onUpdate:modelValue"],_),oe(n.onChange,_),u("onChange")}function g(){return a(n.rules,n.modelValue)}function p(){oe(n["onUpdate:modelValue"],void 0),l()}return{errorMessage:o,n:AXe,classes:MXe,reset:p,validate:g,resetValidation:l}}});Ile.render=RXe;var Tle=Ile;lt(Tle);var J3=Tle;const PXe={modelValue:{type:Number,default:0},count:{type:[String,Number],default:5},color:String,icon:{type:String,default:"star"},emptyIcon:{type:String,default:"star-outline"},halfIcon:{type:String,default:"star-half-full"},namespace:yi(Ss,"namespace"),emptyIconNamespace:yi(Ss,"namespace"),halfIconNamespace:yi(Ss,"namespace"),emptyColor:String,size:[String,Number],gap:[String,Number],half:Boolean,disabled:Boolean,disabledColor:String,readonly:Boolean,ripple:{type:Boolean,default:!0},clearable:Boolean,rules:Array,onChange:Se(),"onUpdate:modelValue":Se()},{name:OXe,n:M1}=st("rate"),FXe=["onClick"];function BXe(n,e){const t=gt("var-icon"),i=gt("var-hover-overlay"),s=gt("var-form-details"),o=hn("ripple"),r=hn("hover");return q(),re("div",{class:B(n.n("wrap"))},[me("div",{class:B(n.n())},[(q(!0),re(li,null,ss(n.toNumber(n.count),a=>wi((q(),re("div",{key:a,style:Fe(n.getStyle(a)),class:B(n.getClass(a)),onClick:l=>n.handleClick(a,l)},[Oe(t,{class:B(n.n("content-icon")),"var-rate-cover":"",transition:0,namespace:n.getCurrentState(a).namespace,name:n.getCurrentState(a).name,style:Fe({fontSize:n.toSizeUnit(n.size)})},null,8,["class","namespace","name","style"]),Oe(i,{hovering:n.hovering&&a===n.currentHoveringValue&&!n.disabled&&!n.formDisabled},null,8,["hovering"])],14,FXe)),[[o,{disabled:n.formReadonly||n.readonly||n.formDisabled||n.disabled||!n.ripple}],[r,n.createHoverHandler(a),"desktop"]])),128))],2),Oe(s,{"error-message":n.errorMessage},null,8,["error-message"])],2)}const xle=et({name:OXe,components:{VarIcon:Wn,VarFormDetails:na,VarHoverOverlay:ml},directives:{Ripple:Ns,Hover:Fa},props:PXe,setup(n){const e=se(-1),{form:t,bindForm:i}=kl(),{errorMessage:s,validateWithTrigger:o,validate:r,resetValidation:a}=Ll(),{hovering:l}=Pd();let c=Ie(n.modelValue);oe(i,{reset:C,validate:p,resetValidation:a});function u(w){const{count:y,gap:L}=n;return{color:f(w).color,marginRight:w!==Ie(y)?ri(L):0}}function h(w){const{name:y,color:L}=f(w);return{[M1("content")]:!0,[M1("--disabled")]:(t==null?void 0:t.disabled.value)||n.disabled,[M1("--error")]:s.value,[M1("--primary")]:y!==n.emptyIcon&&!L}}function f(w){const{modelValue:y,disabled:L,disabledColor:S,color:k,half:D,emptyColor:x,icon:A,halfIcon:T,emptyIcon:P,namespace:W,halfIconNamespace:$,emptyIconNamespace:X}=n;let J=k;return(L||t!=null&&t.disabled.value)&&(J=S),w<=y?{color:J,name:A,namespace:W}:D&&w<=y+.5?{color:J,name:T,namespace:$}:{color:L||t!=null&&t.disabled.value?S:x,name:P,namespace:X}}function g(w,y){const{half:L,clearable:S}=n,{offsetWidth:k}=y.target;L&&y.offsetX<=Math.floor(k/2)&&(w-=.5),c===w&&S&&(w=0),c!==w&&(oe(n["onUpdate:modelValue"],w),oe(n.onChange,w)),c=w}function p(){return r(n.rules,n.modelValue)}function _(){return Fn(()=>o(["onChange"],"onChange",n.rules,n.modelValue))}function v(w,y){const{readonly:L,disabled:S}=n;L||S||t!=null&&t.disabled.value||t!=null&&t.readonly.value||(g(w,y),_())}function b(w){return y=>{e.value=w,l.value=y}}function C(){oe(n["onUpdate:modelValue"],0),a()}return{errorMessage:s,formDisabled:t==null?void 0:t.disabled,formReadonly:t==null?void 0:t.readonly,hovering:l,currentHoveringValue:e,getStyle:u,getClass:h,getCurrentState:f,handleClick:v,createHoverHandler:b,reset:C,validate:p,resetValidation:a,toSizeUnit:ri,toNumber:Ie,n:M1}}});xle.render=BXe;var Nle=xle;lt(Nle);var eB=Nle;const WXe=n=>(vg(""),n=n(),bg(),n),VXe={xmlns:"http://www.w3.org/2000/svg",viewBox:"2 3.6 20 20"},HXe=WXe(()=>me("path",{d:"M11,9H13V7H11M11,20H13V11H11V20Z"},null,-1)),$Xe=[HXe];function zXe(n,e){return q(),re("svg",VXe,$Xe)}const Ale=et({});Ale.render=zXe;var UXe=Ale;const jXe=n=>(vg(""),n=n(),bg(),n),KXe={xmlns:"http://www.w3.org/2000/svg",viewBox:"2 2 20 20"},qXe=jXe(()=>me("path",{d:"M19,3V5H19V19M17,8.4L13.4,12L17,15.6L15.6,17L12,13.4L8.4,17L7,15.6L10.6,12L7,8.4L8.4,7L12,10.6L15.6,7L17,8.4Z"},null,-1)),GXe=[qXe];function YXe(n,e){return q(),re("svg",KXe,GXe)}const Mle=et({});Mle.render=YXe;var ZXe=Mle;const XXe=n=>(vg(""),n=n(),bg(),n),QXe={xmlns:"http://www.w3.org/2000/svg",viewBox:"-6 -4 35 35"},JXe=XXe(()=>me("path",{d:"M10,21H14A2,2 0 0,1 12,23A2,2 0 0,1 10,21M21,19V20H3V19L5,17V11C5,7.9 7.03,5.17 10,4.29C10,4.19 10,4.1 10,4A2,2 0 0,1 12,2A2,2 0 0,1 14,4C14,4.1 14,4.19 14,4.29C16.97,5.17 19,7.9 19,11V17L21,19M17,11A5,5 0 0,0 12,6A5,5 0 0,0 7,11V18H17V11M19.75,3.19L18.33,4.61M1,11"},null,-1)),eQe=[JXe];function tQe(n,e){return q(),re("svg",QXe,eQe)}const Rle=et({});Rle.render=tQe;var iQe=Rle;const{n:nQe,classes:sQe}=st("result");function oQe(n,e){return q(),re(li,null,[me("span",{class:B(n.n("success-cover-left"))},null,2),me("span",{class:B(n.classes(n.n("success-line"),n.n("success-line-tip"))),style:Fe({animationDuration:n.animation?"760ms":"0ms",borderRadius:"calc(".concat(n.borderSize," * 0.625)")})},null,6),me("span",{class:B(n.classes(n.n("success-line"),n.n("success-line-long"))),style:Fe({animationDuration:n.animation?"770ms":"0ms",borderRadius:"calc(".concat(n.borderSize," * 0.625)")})},null,6),me("span",{ref:"circle",class:B(n.n("success-circle")),style:Fe({left:"-".concat(n.borderSize),top:"-".concat(n.borderSize),borderWidth:n.borderSize})},null,6),me("span",{class:B(n.n("success-line-fix"))},null,2),me("span",{class:B(n.n("success-cover-right")),style:Fe({animationDuration:n.animation?"4250ms":"0ms"})},null,6)],64)}const Ple=et({props:{animation:{type:Boolean},borderSize:{type:String}},setup(){return{n:nQe,classes:sQe,toNumber:Ie}}});Ple.render=oQe;var rQe=Ple;const aQe=n=>(vg(""),n=n(),bg(),n),lQe={xmlns:"http://www.w3.org/2000/svg",viewBox:"-3 -3 30 30"},cQe=aQe(()=>me("path",{d:"M10,19H13V22H10V19M12,2C17.35,2.22 19.68,7.62 16.5,11.67C15.67,12.67 14.33,13.33 13.67,14.17C13,15 13,16 13,17H10C10,15.33 10,13.92 10.67,12.92C11.33,11.92 12.67,11.33 13.5,10.67C15.92,8.43 15.32,5.26 12,5A3,3 0 0,0 9,8H6A6,6 0 0,1 12,2Z"},null,-1)),dQe=[cQe];function uQe(n,e){return q(),re("svg",lQe,dQe)}const Ole=et({});Ole.render=uQe;var hQe=Ole;const fQe=n=>(vg(""),n=n(),bg(),n),gQe={viewBox:"-4 -4 32 32"},pQe=fQe(()=>me("path",{fill:"currentColor",d:"M2,10.96C1.5,10.68 1.35,10.07 1.63,9.59L3.13,7C3.24,6.8 3.41,6.66 3.6,6.58L11.43,2.18C11.59,2.06 11.79,2 12,2C12.21,2 12.41,2.06 12.57,2.18L20.47,6.62C20.66,6.72 20.82,6.88 20.91,7.08L22.36,9.6C22.64,10.08 22.47,10.69 22,10.96L21,11.54V16.5C21,16.88 20.79,17.21 20.47,17.38L12.57,21.82C12.41,21.94 12.21,22 12,22C11.79,22 11.59,21.94 11.43,21.82L3.53,17.38C3.21,17.21 3,16.88 3,16.5V10.96C2.7,11.13 2.32,11.14 2,10.96M12,4.15V4.15L12,10.85V10.85L17.96,7.5L12,4.15M5,15.91L11,19.29V12.58L5,9.21V15.91M19,15.91V12.69L14,15.59C13.67,15.77 13.3,15.76 13,15.6V19.29L19,15.91M13.85,13.36L20.13,9.73L19.55,8.72L13.27,12.35L13.85,13.36Z"},null,-1)),mQe=[pQe];function _Qe(n,e){return q(),re("svg",gQe,mQe)}const Fle=et({});Fle.render=_Qe;var vQe=Fle;const bQe={imageSize:[String,Number],type:{type:String,default:"success"},title:String,description:String,animation:{type:Boolean,default:!0}},{name:CQe,n:wQe,classes:yQe}=st("result");function SQe(n,e){return q(),re("div",{class:B(n.classes(n.n(),n.n("$--box")))},[xe(n.$slots,"image",{},()=>[n.type?(q(),re("div",{key:0,class:B(n.n("image-container"))},[me("div",{class:B(n.classes(n.n("image"),n.n(n.type))),style:Fe({width:n.circleSize,height:n.circleSize,borderWidth:n.borderSize})},[(q(),ei(m0(n.type),{"border-size":n.borderSize,animation:n.animation},null,8,["border-size","animation"]))],6)],2)):Qe("v-if",!0)]),xe(n.$slots,"title",{},()=>[n.title?(q(),re("div",{key:0,class:B(n.n("title"))},ut(n.title),3)):Qe("v-if",!0)]),xe(n.$slots,"description",{},()=>[n.description?(q(),re("div",{key:0,class:B(n.n("description"))},ut(n.description),3)):Qe("v-if",!0)]),n.$slots.footer?(q(),re("div",{key:0,class:B(n.n("footer"))},[xe(n.$slots,"footer")],2)):Qe("v-if",!0)],2)}const Ble=et({name:CQe,components:{Info:UXe,Success:rQe,Warning:iQe,Error:ZXe,Question:hQe,Empty:vQe},props:bQe,setup(n){const e=ve(()=>{const{imageSize:i}=n;return"calc(".concat(i?ri(i):"var(--result-image-size)"," * 0.9)")}),t=ve(()=>{const{imageSize:i}=n;return"calc(".concat(i?ri(n.imageSize):"var(--result-image-size)"," * 0.05)")});return{circleSize:e,borderSize:t,toSizeUnit:ri,n:wQe,classes:yQe,toNumber:Ie,toPxNum:jn}}});Ble.render=SQe;var Wle=Ble;lt(Wle);var tB=Wle;const LQe={gutter:{type:[String,Number,Array],default:0},justify:{type:String,default:"flex-start"},align:{type:String,default:"flex-start"},onClick:Se()},{name:kQe,n:DQe,classes:EQe}=st("row");function IQe(n,e){return q(),re("div",{class:B(n.classes(n.n(),n.n("$--box"))),style:Fe({justifyContent:n.padStartFlex(n.justify),alignItems:n.padStartFlex(n.align),margin:"".concat(-n.average[0],"px ").concat(-n.average[1],"px")}),onClick:e[0]||(e[0]=(...t)=>n.handleClick&&n.handleClick(...t))},[xe(n.$slots,"default")],6)}const Vle=et({name:kQe,props:LQe,setup(n){const e=ve(()=>tn(n.gutter)?n.gutter.map(l=>jn(l)/2):[0,jn(n.gutter)/2]),{cols:t,bindCols:i,length:s}=tUe(),o={computePadding:r};ht(()=>s.value,r),ht(()=>n.gutter,r),i(o);function r(){t.forEach(l=>{const[c,d]=e.value;l.setPadding({left:d,right:d,top:c,bottom:c})})}function a(l){oe(n.onClick,l)}return{average:e,n:DQe,classes:EQe,handleClick:a,padStartFlex:cT}}});Vle.render=IQe;var Hle=Vle;lt(Hle);var iB=Hle,TQe=Object.defineProperty,PG=Object.getOwnPropertySymbols,xQe=Object.prototype.hasOwnProperty,NQe=Object.prototype.propertyIsEnumerable,OG=(n,e,t)=>e in n?TQe(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,AQe=(n,e)=>{for(var t in e||(e={}))xQe.call(e,t)&&OG(n,t,e[t]);if(PG)for(var t of PG(e))NQe.call(e,t)&&OG(n,t,e[t]);return n};const MQe=AQe({modelValue:{default:void 0},multiple:Boolean,offsetY:{type:[String,Number],default:0},chip:Boolean,readonly:Boolean,separator:{type:String,default:","},textAlign:{type:String,default:"left"},validateTrigger:{type:Array,default:()=>["onChange","onClear","onClose"]},rules:Array,onFocus:Se(),onBlur:Se(),onClose:Se(),onChange:Se(),onClear:Se(),"onUpdate:modelValue":Se()},yi($6,["size","variant","placeholder","line","hint","textColor","focusColor","blurColor","disabled","clearable","onClick"])),{name:RQe,n:PQe,classes:OQe}=st("select"),FQe={key:1};function BQe(n,e){const t=gt("var-chip"),i=gt("var-icon"),s=gt("var-field-decorator"),o=gt("var-menu"),r=gt("var-form-details");return q(),re("div",{class:B(n.n()),onClick:e[3]||(e[3]=(...a)=>n.handleFocus&&n.handleFocus(...a))},[Oe(o,{"var-select-cover":"","same-width":"","close-on-click-reference":"",show:n.showMenu,"onUpdate:show":e[1]||(e[1]=a=>n.showMenu=a),class:B(n.n("menu")),"popover-class":n.variant==="standard"&&n.hint?n.n("--standard-menu-margin"):void 0,"offset-y":n.offsetY,disabled:n.formReadonly||n.readonly||n.formDisabled||n.disabled,placement:n.placement,"default-style":!1,onClickOutside:n.handleBlur},{menu:Lt(()=>[me("div",{ref:"menuEl",class:B(n.classes(n.n("scroller"),n.n("$-elevation--3")))},[xe(n.$slots,"default")],2)]),default:Lt(()=>[Oe(s,pf(_0({value:n.modelValue,size:n.size,variant:n.variant,placeholder:n.placeholder,line:n.line,hint:n.hint,textColor:n.textColor,focusColor:n.focusColor,blurColor:n.blurColor,isFocus:n.isFocus,errorMessage:n.errorMessage,formDisabled:n.formDisabled,disabled:n.disabled,clearable:n.clearable,cursor:n.cursor,onClick:n.handleClick,onClear:n.handleClear})),YD({"append-icon":Lt(()=>[xe(n.$slots,"append-icon")]),default:Lt(()=>[me("div",{class:B(n.classes(n.n("select"),[n.errorMessage,n.n("--error")],[n.formDisabled||n.disabled,n.n("--disabled")])),style:Fe({textAlign:n.textAlign,color:n.textColor})},[me("div",{class:B(n.n("label"))},[n.isEmptyModelValue?Qe("v-if",!0):xe(n.$slots,"selected",{key:0},()=>[n.multiple?(q(),re(li,{key:0},[n.chip?(q(),re("div",{key:0,class:B(n.n("chips"))},[(q(!0),re(li,null,ss(n.labels,a=>(q(),ei(t,{class:B(n.n("chip")),"var-select-cover":"",closeable:"",size:"small",type:n.errorMessage?"danger":void 0,key:a,onClick:e[0]||(e[0]=Ia(()=>{},["stop"])),onClose:()=>n.handleClose(a)},{default:Lt(()=>[Mi(ut(a),1)]),_:2},1032,["class","type","onClose"]))),128))],2)):(q(),re("div",{key:1,class:B(n.n("values"))},ut(n.labels.join(n.separator)),3))],64)):(q(),re("span",FQe,ut(n.label),1))])],2),n.enableCustomPlaceholder?(q(),re("span",{key:0,class:B(n.classes(n.n("placeholder"),n.n("$--ellipsis"))),style:Fe({color:n.placeholderColor})},ut(n.placeholder),7)):Qe("v-if",!0),xe(n.$slots,"arrow-icon",{focus:n.showMenu},()=>[Oe(i,{class:B(n.classes(n.n("arrow"),[n.showMenu,n.n("--arrow-rotate")])),"var-select-cover":"",name:"menu-down",transition:300},null,8,["class"])])],6)]),_:2},[n.$slots["prepend-icon"]?{name:"prepend-icon",fn:Lt(()=>[xe(n.$slots,"prepend-icon")]),key:"0"}:void 0]),1040)]),_:3},8,["show","class","popover-class","offset-y","disabled","placement","onClickOutside"]),Oe(r,{"error-message":n.errorMessage,onClick:e[2]||(e[2]=Ia(()=>{},["stop"]))},null,8,["error-message"])],2)}const $le=et({name:RQe,components:{VarIcon:Wn,VarMenu:f0,VarChip:fT,VarFieldDecorator:Gy,VarFormDetails:na},props:MQe,setup(n){const e=se(!1),t=se(!1),i=ve(()=>n.multiple),s=ve(()=>n.focusColor),o=ve(()=>hd(n.modelValue)),r=ve(()=>n.disabled||n.readonly?"":"pointer"),a=se(0),{bindForm:l,form:c}=kl(),{length:d,options:u,bindOptions:h}=IZe(),{label:f,labels:g,computeLabel:p,getSelectedValue:_}=cle({modelValue:()=>n.modelValue,multiple:()=>n.multiple,optionProviders:()=>u,optionProvidersLength:()=>d.value}),{errorMessage:v,validateWithTrigger:b,validate:C,resetValidation:w}=Ll(),y=se(null),L=ve(()=>n.variant==="outlined"?"bottom":"cover-top"),S=ve(()=>{const{hint:_e,blurColor:ie,focusColor:ne}=n;if(!_e)return v.value?"var(--field-decorator-error-color)":e.value?ne||"var(--field-decorator-focus-color)":ie||"var(--field-decorator-placeholder-color, var(--field-decorator-blur-color))"}),k=ve(()=>!n.hint&&hd(n.modelValue)),D={multiple:i,focusColor:s,computeLabel:p,onSelect:P,reset:de,validate:le,resetValidation:w};ht(()=>n.multiple,()=>{const{multiple:_e,modelValue:ie}=n;_e&&!tn(ie)&&Oa("Select","The modelValue must be an array when multiple is true")}),h(D),oe(l,D);function x(_e){Fn(()=>{const{validateTrigger:ie,rules:ne,modelValue:Ye}=n;b(ie,_e,ne,Ye)})}function A(){const{disabled:_e,readonly:ie,onFocus:ne}=n;c!=null&&c.disabled.value||c!=null&&c.readonly.value||_e||ie||(a.value=jn(n.offsetY),e.value=!0,oe(ne),x("onFocus"))}function T(){const{disabled:_e,readonly:ie,onBlur:ne}=n;c!=null&&c.disabled.value||c!=null&&c.readonly.value||_e||ie||(Q(),oe(ne),x("onBlur"))}function P(_e){const{disabled:ie,readonly:ne,multiple:Ye,onChange:pe}=n;if(c!=null&&c.disabled.value||c!=null&&c.readonly.value||ie||ne)return;const Ee=_(_e);oe(n["onUpdate:modelValue"],Ee),oe(pe,Ee),x("onChange"),Ye||Q()}function W(){const{disabled:_e,readonly:ie,multiple:ne,clearable:Ye,onClear:pe}=n;if(c!=null&&c.disabled.value||c!=null&&c.readonly.value||_e||ie||!Ye)return;const Ee=ne?[]:void 0;oe(n["onUpdate:modelValue"],Ee),oe(pe,Ee),x("onClear")}function $(_e){const{disabled:ie,onClick:ne}=n;c!=null&&c.disabled.value||ie||(oe(ne,_e),x("onClick"))}function X(_e){const{disabled:ie,readonly:ne,modelValue:Ye,onClose:pe}=n;if(c!=null&&c.disabled.value||c!=null&&c.readonly.value||ie||ne)return;const Ee=u.find(({label:It})=>It.value===_e),ze=Ye.filter(It=>{var Ke;return It!==((Ke=Ee.value.value)!=null?Ke:Ee.label.value)});oe(n["onUpdate:modelValue"],ze),oe(pe,ze),x("onClose")}function J(){a.value=jn(n.offsetY),e.value=!0,t.value=!0}function Q(){e.value=!1,t.value=!1}function le(){return C(n.rules,n.modelValue)}function de(){oe(n["onUpdate:modelValue"],n.multiple?[]:void 0),w()}return{offsetY:a,isFocus:e,showMenu:t,errorMessage:v,formDisabled:c==null?void 0:c.disabled,formReadonly:c==null?void 0:c.readonly,label:f,labels:g,isEmptyModelValue:o,menuEl:y,placement:L,cursor:r,placeholderColor:S,enableCustomPlaceholder:k,n:PQe,classes:OQe,handleFocus:A,handleBlur:T,handleClear:W,handleClick:$,handleClose:X,reset:de,validate:le,resetValidation:w,focus:J,blur:Q}}});$le.render=BQe;var zle=$le;lt(zle);var nB=zle;const WQe={loading:{type:Boolean,default:!0},title:Boolean,card:Boolean,avatar:Boolean,fullscreen:Boolean,fullscreenZIndex:{type:[Number,String],default:100},titleWidth:[Number,String],cardHeight:[Number,String],avatarSize:[Number,String],rows:{type:[Number,String],default:3},rowsWidth:{type:Array,default:()=>[]}},{name:VQe,n:HQe,classes:$Qe}=st("skeleton");function zQe(n,e){return q(),re("div",{class:B(n.classes(n.n("$--box"),n.n()))},[n.loading?Qe("v-if",!0):(q(),re("div",{key:0,class:B(n.n("data"))},[xe(n.$slots,"default")],2)),n.loading&&!n.fullscreen?(q(),re("div",{key:1,class:B(n.n("content"))},[n.card?(q(),re("div",{key:0,class:B(n.n("card")),style:Fe({height:n.toSizeUnit(n.cardHeight)})},[me("div",{class:B(n.n("--animation"))},null,2)],6)):Qe("v-if",!0),n.avatar||n.title||n.toNumber(n.rows)>0?(q(),re("div",{key:1,class:B(n.n("article"))},[n.avatar?(q(),re("div",{key:0,class:B(n.n("avatar")),style:Fe({width:n.toSizeUnit(n.avatarSize),height:n.toSizeUnit(n.avatarSize)})},[me("div",{class:B(n.n("--animation"))},null,2)],6)):Qe("v-if",!0),n.title||n.toNumber(n.rows)>0?(q(),re("div",{key:1,class:B(n.n("section"))},[n.title?(q(),re("div",{key:0,class:B(n.n("title")),style:Fe({width:n.toSizeUnit(n.titleWidth)})},[me("div",{class:B(n.n("--animation"))},null,2)],6)):Qe("v-if",!0),(q(!0),re(li,null,ss(n.toNumber(n.rows),(t,i)=>(q(),re("div",{class:B(n.n("row")),key:t,style:Fe({width:n.toSizeUnit(n.rowsWidth[i])})},[me("div",{class:B(n.n("--animation"))},null,2)],6))),128))],2)):Qe("v-if",!0)],2)):Qe("v-if",!0)],2)):Qe("v-if",!0),n.loading&&n.fullscreen?(q(),re("div",{key:2,class:B(n.n("fullscreen")),style:Fe({zIndex:n.toNumber(n.fullscreenZIndex)})},[me("div",{class:B(n.n("--animation"))},null,2)],6)):Qe("v-if",!0)],2)}const Ule=et({name:VQe,props:WQe,setup:()=>({n:HQe,classes:$Qe,toSizeUnit:ri,toNumber:Ie})});Ule.render=zQe;var jle=Ule;lt(jle);var sB=jle,ps=(n=>(n.First="1",n.Second="2",n))(ps||{});const UQe={modelValue:{type:[Number,Array],default:0},step:{type:[Number,String],default:1},range:Boolean,labelVisible:{type:String,default:"normal"},activeColor:String,trackColor:String,thumbColor:String,labelColor:String,labelTextColor:String,trackHeight:[String,Number],max:{type:[String,Number],default:100},min:{type:[String,Number],default:0},thumbSize:[String,Number],disabled:Boolean,readonly:Boolean,direction:{type:String,default:"horizontal"},rules:Array,onChange:Se(),onStart:Se(),onEnd:Se(),"onUpdate:modelValue":Se()},{name:jQe,n:FG,classes:KQe}=st("slider"),qQe=["onTouchstart"];function GQe(n,e){const t=gt("var-hover-overlay"),i=gt("var-form-details"),s=hn("hover");return q(),re("div",{class:B(n.classes(n.n(n.direction),n.n("$--box")))},[me("div",{class:B(n.classes(n.n("".concat(n.direction,"-block")),[n.isDisabled,n.n("--disabled")],[n.errorMessage,n.n("".concat(n.direction,"--error"))])),ref:"sliderEl",onClick:e[0]||(e[0]=(...o)=>n.click&&n.click(...o))},[me("div",{class:B(n.n("".concat(n.direction,"-track")))},[me("div",{class:B(n.n("".concat(n.direction,"-track-background"))),style:Fe({background:n.trackColor,height:n.isVertical?"100%":n.multiplySizeUnit(n.trackHeight),width:n.isVertical?n.multiplySizeUnit(n.trackHeight):"100%"})},null,6),me("div",{class:B(n.n("".concat(n.direction,"-track-fill"))),style:Fe(n.getFillStyle)},null,6)],2),(q(!0),re(li,null,ss(n.thumbList,o=>(q(),re("div",{class:B(n.n("".concat(n.direction,"-thumb"))),key:o.enumValue,style:Fe(n.thumbStyle(o)),onTouchstart:Ia(r=>n.start(r,o.enumValue),["stop"])},[xe(n.$slots,"button",{currentValue:o.text},()=>[wi(me("div",{class:B(n.n("".concat(n.direction,"-thumb-block"))),style:Fe({background:n.thumbColor})},null,6),[[s,r=>n.hover(r,o),"desktop"]]),me("div",{class:B(n.classes(n.n("".concat(n.direction,"-thumb-ripple")),[n.thumbsProps[o.enumValue].active,n.n("".concat(n.direction,"-thumb-ripple--active"))])),style:Fe({background:n.thumbsProps[o.enumValue].active?n.thumbColor:void 0})},[Oe(t,{hovering:o.hovering},null,8,["hovering"])],6),me("div",{class:B(n.classes(n.n("".concat(n.direction,"-thumb-label")),[n.showLabel(o.enumValue),n.n("".concat(n.direction,"-thumb-label--active"))])),style:Fe({background:n.labelColor,color:n.labelTextColor,height:n.thumbSize===void 0?n.thumbSize:n.multiplySizeUnit(n.thumbSize,2),width:n.thumbSize===void 0?n.thumbSize:n.multiplySizeUnit(n.thumbSize,2)})},[me("span",null,ut(o.text),1)],6)])],46,qQe))),128))],2),Oe(i,{"error-message":n.errorMessage,class:B(n.n("form")),"var-slider-cover":""},null,8,["error-message","class"])],2)}const Kle=et({name:jQe,components:{VarFormDetails:na,VarHoverOverlay:ml},directives:{Hover:Fa},props:UQe,setup(n){const e=se(0),t=se(null),i=se(!1),s=ve(()=>Ie(n.max)-Ie(n.min)),o=ve(()=>e.value/s.value*Ie(n.step)),r=ve(()=>n.disabled||(d==null?void 0:d.disabled.value)),a=ve(()=>n.readonly||(d==null?void 0:d.readonly.value)),l=ve(()=>n.direction==="vertical"),{bindForm:c,form:d}=kl(),{errorMessage:u,validateWithTrigger:h,validate:f,resetValidation:g}=Ll(),{hovering:p,handleHovering:_}=Pd(),{hovering:v,handleHovering:b}=Pd(),C=ve(()=>{const{modelValue:Ke,range:Xe}=n;let je=[];return Xe&&tn(Ke)?je=[{value:W(Ke[0]),enumValue:ps.First,text:$(Ke[0]),hovering:ud(p),handleHovering:_},{value:W(Ke[1]),enumValue:ps.Second,text:$(Ke[1]),hovering:ud(v),handleHovering:b}]:qr(Ke)&&(je=[{value:W(Ke),enumValue:ps.First,text:$(Ke),hovering:ud(p),handleHovering:_}]),je}),w=ve(()=>{const{activeColor:Ke,range:Xe,modelValue:je}=n,Z=Xe&&tn(je)?W(Math.min(je[0],je[1])):0,z=Xe&&tn(je)?W(Math.max(je[0],je[1]))-Z:W(je);return l.value?{left:"0px",height:"".concat(z,"%"),bottom:"".concat(Z,"%"),background:Ke}:{top:"0px",width:"".concat(z,"%"),left:"".concat(Z,"%"),background:Ke}}),y=Cn({[ps.First]:D(),[ps.Second]:D()});let L;oe(c,{reset:It,validate:k,resetValidation:g}),ht([()=>n.modelValue,()=>n.step],([Ke,Xe])=>{!pe()||!Ee()||i.value||ze(Ke,Ie(Xe))}),ht(e,()=>ze()),Vo(()=>{!pe()||!Ee()||(e.value=t.value[l.value?"offsetHeight":"offsetWidth"])}),zm(()=>{de()});function k(){return f(n.rules,n.modelValue)}function D(){return{startPosition:0,currentOffset:0,active:!1,percentValue:0}}function x(){return Fn(()=>h(["onChange"],"onChange",n.rules,n.modelValue))}function A(Ke){const Xe=Ke.currentTarget;return Xe?l.value?e.value-(Ke.clientY-no(Xe).top):Ke.clientX-kVe(Xe):0}function T(Ke){return{[l.value?"bottom":"left"]:"".concat(Ke.value,"%"),zIndex:y[Ke.enumValue].active?1:void 0}}function P(Ke){return n.labelVisible==="always"?!0:n.labelVisible==="never"?!1:y[Ke].active}function W(Ke){const{min:Xe,max:je}=n;return KeIe(je)?100:(Ke-Ie(Xe))/s.value*100}function $(Ke){if(!qr(Ke))return 0;let Xe=Ke;return XeNumber(n.max)&&(Xe=Number(n.max)),parseInt("".concat(Xe),10)===Xe?Xe:Ie(Xe.toPrecision(5))}function X(Ke,Xe){r.value||Xe.handleHovering(Ke)}function J(Ke,Xe){let je=[];const{step:Z,range:z,modelValue:ae,onChange:we,min:Ne}=n,Ce=Ie(Z),Be=Math.round(Ke/o.value),Ae=Be*Ce+Ie(Ne),K=y[Xe].percentValue*Ce+Ie(Ne);if(y[Xe].percentValue=Be,z&&tn(ae)&&(je=Xe===ps.First?[Ae,ae[1]]:[ae[0],Ae]),K!==Ae){const V=z?je.map(G=>$(G)):$(Ae);oe(we,V),oe(n["onUpdate:modelValue"],V),x()}}function Q(Ke){if(!n.range)return ps.First;const Xe=y[ps.First].percentValue*o.value,je=y[ps.Second].percentValue*o.value,Z=Math.abs(Ke-Xe),z=Math.abs(Ke-je);return Z<=z?ps.First:ps.Second}function le(){document.addEventListener("touchmove",ie,{passive:!1}),document.addEventListener("touchend",ne),document.addEventListener("touchcancel",ne)}function de(){document.removeEventListener("touchmove",ie),document.removeEventListener("touchend",ne),document.removeEventListener("touchcancel",ne)}function _e(Ke,Xe){if(e.value||(e.value=t.value.offsetWidth),r.value||(y[Xe].active=!0),L=Xe,le(),r.value||a.value)return;oe(n.onStart),i.value=!0;const{clientX:je,clientY:Z}=Ke.touches[0];y[Xe].startPosition=l.value?Z:je}function ie(Ke){if(dc(Ke),r.value||a.value||!i.value)return;const{startPosition:Xe,currentOffset:je}=y[L],{clientX:Z,clientY:z}=Ke.touches[0];let ae=(l.value?Xe-z:Z-Xe)+je;ae<=0?ae=0:ae>=e.value&&(ae=e.value),J(ae,L)}function ne(){de();const{range:Ke,modelValue:Xe,onEnd:je,step:Z,min:z}=n;if(r.value||(y[L].active=!1),r.value||a.value)return;let ae=[];y[L].currentOffset=y[L].percentValue*o.value;const we=y[L].percentValue*Ie(Z)+Ie(z);Ke&&tn(Xe)&&(ae=L===ps.First?[we,Xe[1]]:[Xe[0],we]),oe(je,Ke?ae:we),i.value=!1}function Ye(Ke){if(r.value||a.value||Ke.target.closest(".".concat(FG("thumb"))))return;const Xe=A(Ke),je=Q(Xe);L=je,J(Xe,je),ne()}function pe(){const Ke=Ie(n.step);return isNaN(Ke)?(ZK("Slider",'type of prop "step" should be Number'),!1):Ke<0?(ZK("Slider",'"step" should be > 0'),!1):!0}function Ee(){const{range:Ke,modelValue:Xe}=n;return Ke&&!tn(Xe)?(console.error('[Varlet] Slider: "modelValue" should be an Array'),!1):!Ke&&tn(Xe)?(console.error('[Varlet] Slider: "modelValue" should be a Number'),!1):Ke&&tn(Xe)&&Xe.length<2?(console.error('[Varlet] Slider: "modelValue" should have two value'),!1):!0}function ze(Ke=n.modelValue,Xe=Ie(n.step)){const je=Z=>{const{min:z,max:ae}=n;return ZIe(ae)?s.value/Xe:(Z-Ie(z))/Xe};n.range&&tn(Ke)?(y[ps.First].percentValue=je(Ke[0]),y[ps.First].currentOffset=y[ps.First].percentValue*o.value,y[ps.Second].percentValue=je(Ke[1]),y[ps.Second].currentOffset=y[ps.Second].percentValue*o.value):qr(Ke)&&(y[ps.First].currentOffset=je(Ke)*o.value)}function It(){const Ke=n.range?[0,0]:0;oe(n["onUpdate:modelValue"],Ke),g()}return{Thumbs:ps,sliderEl:t,getFillStyle:w,isDisabled:r,isVertical:l,errorMessage:u,thumbsProps:y,thumbList:C,n:FG,classes:KQe,thumbStyle:T,hover:X,multiplySizeUnit:dr,toNumber:Ie,showLabel:P,start:_e,move:ie,end:ne,click:Ye}}});Kle.render=GQe;var qle=Kle;lt(qle);var oB=qle,YQe=Object.defineProperty,ZQe=Object.defineProperties,XQe=Object.getOwnPropertyDescriptors,BG=Object.getOwnPropertySymbols,QQe=Object.prototype.hasOwnProperty,JQe=Object.prototype.propertyIsEnumerable,WG=(n,e,t)=>e in n?YQe(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,eJe=(n,e)=>{for(var t in e||(e={}))QQe.call(e,t)&&WG(n,t,e[t]);if(BG)for(var t of BG(e))JQe.call(e,t)&&WG(n,t,e[t]);return n},tJe=(n,e)=>ZQe(n,XQe(e));const Gle={type:String,position:{type:String,default:"top"},content:{type:[String,Function,Object]},contentClass:String,duration:{type:Number,default:3e3},vertical:Boolean,loadingType:yi(hf,"type"),loadingSize:yi(hf,"size"),loadingRadius:yi(hf,"radius"),loadingColor:tJe(eJe({},yi(hf,"color")),{default:"currentColor"}),lockScroll:Boolean,show:Boolean,teleport:{type:[String,Object,Boolean],default:"body"},forbidClick:Boolean,onOpen:Se(),onOpened:Se(),onClose:Se(),onClosed:Se(),"onUpdate:show":Se(),_update:String},{n:iJe,classes:nJe}=st("snackbar"),sJe={success:"checkbox-marked-circle",warning:"warning",info:"information",error:"error",loading:""};function oJe(n,e){const t=gt("var-icon"),i=gt("var-loading");return wi((q(),re("div",{class:B(n.n()),style:Fe({pointerEvents:n.isForbidClick?"auto":"none",zIndex:n.zIndex})},[me("div",{class:B(n.classes(n.n("wrapper"),n.n("wrapper-".concat(n.position)),n.n("$-elevation--4"),[n.vertical,n.n("vertical")],[n.type&&n.SNACKBAR_TYPE.includes(n.type),n.n("wrapper-".concat(n.type))])),style:Fe({zIndex:n.zIndex})},[me("div",{class:B([n.n("content"),n.contentClass])},[xe(n.$slots,"default",{},()=>[Mi(ut(n.content),1)])],2),me("div",{class:B([n.n("icon")])},[n.iconName?(q(),ei(t,{key:0,name:n.iconName},null,8,["name"])):Qe("v-if",!0),n.type==="loading"?(q(),ei(i,{key:1,type:n.loadingType,size:n.loadingSize,color:n.loadingColor,radius:n.loadingRadius},null,8,["type","size","color","radius"])):Qe("v-if",!0),xe(n.$slots,"icon")],2),me("div",{class:B(n.n("action"))},[xe(n.$slots,"action")],2)],6)],6)),[[hl,n.show]])}const Yle=et({name:"VarSnackbarCore",components:{VarLoading:l0,VarIcon:Wn},props:Gle,setup(n){const e=se(null),{zIndex:t}=QS(()=>n.show,1);XS(()=>n.show,()=>n.lockScroll);const i=ve(()=>n.type==="loading"||n.forbidClick),s=ve(()=>n.type?sJe[n.type]:""),o=()=>{e.value=setTimeout(()=>{n.type!=="loading"&&oe(n["onUpdate:show"],!1)},n.duration)};return ht(()=>n.show,r=>{r?(oe(n.onOpen),o()):r===!1&&(clearTimeout(e.value),oe(n.onClose))}),ht(()=>n._update,()=>{clearTimeout(e.value),o()}),Vo(()=>{n.show&&(oe(n.onOpen),o())}),{SNACKBAR_TYPE:Qle,n:iJe,classes:nJe,zIndex:t,iconName:s,isForbidClick:i}}});Yle.render=oJe;var Zle=Yle;const{name:rJe,n:aJe}=st("snackbar");function lJe(n,e){const t=gt("var-snackbar-core");return q(),ei(Bd,{to:n.teleport===!1?void 0:n.teleport,disabled:n.disabled||n.teleport===!1},[Oe(On,{name:"".concat(n.n(),"-fade"),onAfterEnter:n.onOpened,onAfterLeave:n.onClosed},{default:Lt(()=>[Oe(t,fn(n.$props,{class:n.n("transition")}),{icon:Lt(()=>[xe(n.$slots,"icon")]),action:Lt(()=>[xe(n.$slots,"action")]),default:Lt(()=>[xe(n.$slots,"default",{},()=>[Mi(ut(n.content),1)])]),_:3},16,["class"])]),_:3},8,["name","onAfterEnter","onAfterLeave"])],8,["to","disabled"])}const Xle=et({name:rJe,components:{VarSnackbarCore:Zle},props:Gle,setup(){const{disabled:n}=u_();return{disabled:n,n:aJe}}});Xle.render=lJe;var j6=Xle,cJe=Object.defineProperty,VG=Object.getOwnPropertySymbols,dJe=Object.prototype.hasOwnProperty,uJe=Object.prototype.propertyIsEnumerable,HG=(n,e,t)=>e in n?cJe(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,Jy=(n,e)=>{for(var t in e||(e={}))dJe.call(e,t)&&HG(n,t,e[t]);if(VG)for(var t of VG(e))uJe.call(e,t)&&HG(n,t,e[t]);return n};const Qle=["loading","success","warning","info","error"];let $G=0,rB=!1,Jle,eS=!1;const ece={type:void 0,content:"",icon:"",action:"",position:"top",duration:3e3,vertical:!1,contentClass:void 0,loadingType:"circle",loadingSize:"normal",lockScroll:!1,teleport:"body",forbidClick:!1,onOpen:()=>{},onOpened:()=>{},onClose:()=>{},onClosed:()=>{}};let ul=Cn([]),K6=ece;const hJe={name:"var-snackbar-fade",tag:"div",class:"var-transition-group"},r2=n=>()=>v0(n)?n():n,fJe={setup(){return()=>{const n=ul.map(({id:e,reactiveSnackOptions:t,_update:i})=>{const s=document.querySelector(".var-transition-group");t.forbidClick||t.type==="loading"?s.classList.add("var-pointer-auto"):s.classList.remove("var-pointer-auto");const o=Jy({position:eS?"relative":"absolute"},bJe(t.position)),{content:r,icon:a,action:l}=t,c={default:r2(r),icon:r2(a),action:r2(l)};return Oe(Zle,fn(t,{key:e,style:o,"data-id":e,_update:i,show:t.show,"onUpdate:show":d=>t.show=d}),c)});return Oe(nhe,fn(hJe,{style:{zIndex:Ea.zIndex},onAfterEnter:gJe,onAfterLeave:pJe}),{default:()=>[n]})}}},Ju=function(n){const e=_Je(n),t=Cn(Jy(Jy({},K6),e));t.show=!0,rB||(rB=!0,Jle=K0(fJe).unmountInstance);const{length:i}=ul,s={id:$G++,reactiveSnackOptions:t};if(i===0||eS)mJe(s);else{const o="update-".concat($G);vJe(t,o)}return{clear(){!eS&&ul.length?ul[0].reactiveSnackOptions.show=!1:t.show=!1}}};Qle.forEach(n=>{Ju[n]=e=>(ju(e)?e.type=n:e={content:e,type:n},Ju(e))});Ju.allowMultiple=function(n=!1){n!==eS&&(ul.forEach(e=>{e.reactiveSnackOptions.show=!1}),eS=n)};Ju.clear=function(){ul.forEach(n=>{n.reactiveSnackOptions.show=!1})};Ju.setDefaultOptions=function(n){K6=n};Ju.resetDefaultOptions=function(){K6=ece};function gJe(n){const e=n.getAttribute("data-id"),t=ul.find(i=>i.id===Ie(e));t&&oe(t.reactiveSnackOptions.onOpened)}function pJe(n){n.parentElement&&n.parentElement.classList.remove("var-pointer-auto");const e=n.getAttribute("data-id"),t=ul.find(s=>s.id===Ie(e));t&&(t.animationEnd=!0,oe(t.reactiveSnackOptions.onClosed)),ul.every(s=>s.animationEnd)&&(oe(Jle),ul=Cn([]),rB=!1)}function mJe(n){ul.push(n)}function _Je(n={}){return Us(n)?{content:n}:n}function vJe(n,e){const[t]=ul;t.reactiveSnackOptions=Jy(Jy({},t.reactiveSnackOptions),n),t._update=e}function bJe(n="top"){return n==="bottom"?{top:"85%"}:{top:n==="top"?"5%":"45%"}}Ju.Component=j6;lt(j6);lt(j6,Ju);var aB=Ju;const CJe={size:{type:[String,Number,Array],default:"normal"},wrap:{type:Boolean,default:!0},direction:{type:String,default:"row"},justify:{type:String,default:"flex-start"},align:String,inline:Boolean};function ha(n){return"calc(".concat(n," / 2)")}function wJe(n,e,t){const{direction:i,justify:s,index:o,lastIndex:r}=t;let a="0";return i==="row"&&(["flex-start","center","flex-end","start","end"].includes(s)?o!==r?a="".concat(ha(n)," ").concat(e," ").concat(ha(n)," 0"):a="".concat(ha(n)," 0"):s==="space-around"?a="".concat(ha(n)," ").concat(ha(e)):s==="space-between"&&(o===0?a="".concat(ha(n)," ").concat(ha(e)," ").concat(ha(n)," 0"):o===r?a="".concat(ha(n)," 0 ").concat(ha(n)," ").concat(ha(e)):a="".concat(ha(n)," ").concat(ha(e)))),i==="column"&&o!==r&&(a="0 0 ".concat(n," 0")),a}const yJe=n=>["mini","small","normal","large"].includes(n),{name:SJe,n:a2,classes:LJe}=st("space");function kJe(n,e){return e?["var(--space-size-".concat(n,"-y)"),"var(--space-size-".concat(n,"-x)")]:tn(n)?n.map(ri):[ri(n),ri(n)]}var tce=et({name:SJe,props:CJe,setup(n,{slots:e}){return()=>{var t;const{inline:i,justify:s,align:o,wrap:r,direction:a,size:l}=n;let c=(t=oe(e.default))!=null?t:[];const[d,u]=kJe(l,yJe(l));c=Xse(c);const h=c.length-1,f=c.map((g,p)=>{const _=wJe(d,u,{direction:a,justify:s,index:p,lastIndex:h});return Oe("div",{style:{margin:_}},[g])});return Oe("div",{class:LJe(a2(),a2("$--box"),[i,a2("--inline")]),style:{flexDirection:a,justifyContent:cT(s),alignItems:cT(o),flexWrap:r?"wrap":"nowrap",margin:a==="row"?"calc(-1 * ".concat(d," / 2) 0"):void 0}},[f])}}});lt(tce);var lB=tce;const DJe={activeIcon:{type:String,default:"check"},currentIcon:yi(Ss,"name"),inactiveIcon:yi(Ss,"name"),activeIconNamespace:yi(Ss,"namespace"),currentIconNamespace:yi(Ss,"namespace"),inactiveIconNamespace:yi(Ss,"namespace")},ice=Symbol("STEPS_BIND_STEP_KEY");function EJe(){const{bindChildren:n,childProviders:e}=$o(ice);return{step:e,bindStep:n}}function IJe(){const{parentProvider:n,index:e,bindParent:t}=Ho(ice);return t||Oa("Steps"," must in "),{index:e,steps:n,bindSteps:t}}const{name:TJe,n:xJe,classes:NJe}=st("step"),AJe={key:3};function MJe(n,e){const t=gt("var-icon");return q(),re("div",{class:B(n.n())},[me("div",{class:B(n.n(n.direction))},[me("div",{class:B(n.classes(n.n("".concat(n.direction,"-tag")),[n.isActive||n.isCurrent,n.n("".concat(n.direction,"-tag--active"))])),style:Fe({backgroundColor:n.isActive||n.isCurrent?n.activeColor:n.inactiveColor}),onClick:e[0]||(e[0]=(...i)=>n.click&&n.click(...i))},[n.isActive?(q(),ei(t,{key:0,class:B(n.n("icon")),"var-step-cover":"",name:n.activeIcon,namespace:n.activeIconNamespace},null,8,["class","name","namespace"])):n.isCurrent&&n.currentIcon?(q(),ei(t,{key:1,class:B(n.n("icon")),"var-step-cover":"",name:n.currentIcon,namespace:n.currentIconNamespace},null,8,["class","name","namespace"])):n.inactiveIcon?(q(),ei(t,{key:2,class:B(n.n("icon")),"var-step-cover":"",name:n.inactiveIcon,namespace:n.inactiveIconNamespace},null,8,["class","name","namespace"])):(q(),re("span",AJe,ut(n.index+1),1))],6),me("div",{class:B(n.classes(n.n("".concat(n.direction,"-content")),[n.isActive||n.isCurrent,n.n("".concat(n.direction,"-content--active"))])),onClick:e[1]||(e[1]=(...i)=>n.click&&n.click(...i))},[xe(n.$slots,"default")],2),me("div",{class:B(n.n("".concat(n.direction,"-line")))},null,2)],2)],2)}const nce=et({name:TJe,components:{VarIcon:Wn},props:DJe,setup(){const{index:n,steps:e,bindSteps:t}=IJe(),{active:i,activeColor:s,inactiveColor:o,direction:r,clickStep:a}=e,l=ve(()=>i.value===n.value),c=ve(()=>n.value!==-1&&Ie(i.value)>n.value);t({index:n});function u(){return a(n.value)}return{index:n,isActive:c,isCurrent:l,direction:r,activeColor:s,inactiveColor:o,n:xJe,classes:NJe,click:u}}});nce.render=MJe;var sce=nce;lt(sce);var cB=sce;const RJe={active:{type:[String,Number],default:0},direction:{type:String,default:"horizontal"},activeColor:String,inactiveColor:String,onClickStep:Se()},{name:PJe,n:OJe}=st("steps");function FJe(n,e){return q(),re("div",{class:B(n.n()),style:Fe({flexDirection:n.direction==="horizontal"?"row":"column"})},[xe(n.$slots,"default")],6)}const oce=et({name:PJe,props:RJe,setup(n){const e=ve(()=>n.active),t=ve(()=>n.activeColor),i=ve(()=>n.inactiveColor),s=ve(()=>n.direction),{bindStep:o}=EJe();o({active:e,direction:s,activeColor:t,inactiveColor:i,clickStep:a});function a(l){oe(n.onClickStep,l)}return{n:OJe}}});oce.render=FJe;var rce=oce;lt(rce);var dB=rce;const BJe={styleVars:{type:Object,default:()=>({})},tag:{type:String,default:"div"}},{name:WJe,n:VJe}=st("style-provider"),HJe=et({name:WJe,props:BJe,setup(n,{slots:e}){return()=>Bc(n.tag,{class:VJe(),style:uoe(n.styleVars)},oe(e.default))}});var q6=HJe;const l2=[];function G6(n){l2.forEach(t=>document.documentElement.style.removeProperty(t)),l2.length=0;const e=uoe(n!=null?n:{});Object.entries(e).forEach(([t,i])=>{document.documentElement.style.setProperty(t,i),l2.push(t)})}G6.Component=q6;lt(q6);lt(q6,G6);var yT=G6;const $Je={modelValue:{default:!1},activeValue:{default:!0},inactiveValue:{default:!1},disabled:Boolean,readonly:Boolean,loading:Boolean,color:String,loadingColor:String,closeColor:String,size:[String,Number],rules:Array,ripple:{type:Boolean,default:!0},onClick:Se(),onChange:Se(),"onUpdate:modelValue":Se()},{name:zJe,n:UJe,classes:jJe}=st("switch"),KJe=n=>(vg(""),n=n(),bg(),n),qJe=KJe(()=>me("svg",{viewBox:"25 25 50 50"},[me("circle",{cx:"50",cy:"50",r:"20",fill:"none"})],-1)),GJe=[qJe];function YJe(n,e){const t=gt("var-hover-overlay"),i=gt("var-form-details"),s=hn("ripple"),o=hn("hover");return wi((q(),re("div",{class:B(n.n())},[me("div",{class:B(n.classes(n.n("block"),[n.disabled||n.formDisabled,n.n("--disabled")])),onClick:e[0]||(e[0]=(...r)=>n.switchActive&&n.switchActive(...r)),style:Fe(n.styleComputed.switch)},[me("div",{style:Fe(n.styleComputed.track),class:B(n.classes(n.n("track"),[n.modelValue===n.activeValue,n.n("track--active")],[n.errorMessage,n.n("track--error")]))},null,6),wi((q(),re("div",{class:B(n.classes(n.n("ripple"),[n.modelValue===n.activeValue,n.n("ripple--active")])),style:Fe(n.styleComputed.ripple)},[me("div",{style:Fe(n.styleComputed.handle),class:B(n.classes(n.n("handle"),n.n("$-elevation--2"),[n.modelValue===n.activeValue,n.n("handle--active")],[n.errorMessage,n.n("handle--error")]))},[n.loading?(q(),re("span",{key:0,class:B(n.n("loading")),style:Fe({width:n.radius,height:n.radius})},GJe,6)):Qe("v-if",!0)],6),Oe(t,{hovering:n.hovering},null,8,["hovering"])],6)),[[s,{disabled:!n.ripple||n.disabled||n.loading||n.formDisabled}]])],6),Oe(i,{"error-message":n.errorMessage},null,8,["error-message"])],2)),[[o,n.hover,"desktop"]])}const ace=et({name:zJe,components:{VarFormDetails:na,VarHoverOverlay:ml},directives:{Ripple:Ns,Hover:Fa},props:$Je,setup(n){const{bindForm:e,form:t}=kl(),{errorMessage:i,validateWithTrigger:s,validate:o,resetValidation:r}=Ll(),{hovering:a,handleHovering:l}=Pd(),c=ve(()=>{const{size:v,modelValue:b,color:C,closeColor:w,loadingColor:y,activeValue:L}=n;return{handle:{width:dr(v),height:dr(v),backgroundColor:b===L?C:w,color:y},ripple:{left:b===L?dr(v,.5):"-".concat(dr(v,.5)),color:b===L?C:w||"#999",width:dr(v,2),height:dr(v,2)},track:{height:dr(v,.72),width:dr(v,1.9),borderRadius:dr(v,2/3),filter:b===L||i!=null&&i.value?void 0:"brightness(.6)",backgroundColor:b===L?C:w},switch:{height:dr(v,1.2),width:dr(v,2)}}}),d=ve(()=>dr(n.size,.8));oe(e,{reset:_,validate:h,resetValidation:r});function h(){return o(n.rules,n.modelValue)}function f(){return Fn(()=>s(["onChange"],"onChange",n.rules,n.modelValue))}function g(v){const{onClick:b,onChange:C,disabled:w,loading:y,readonly:L,modelValue:S,activeValue:k,inactiveValue:D,"onUpdate:modelValue":x}=n;if(oe(b,v),w||y||L||t!=null&&t.disabled.value||t!=null&&t.readonly.value)return;const A=S===k?D:k;oe(C,A),oe(x,A),f()}function p(v){n.disabled||t!=null&&t.disabled.value||l(v)}function _(){oe(n["onUpdate:modelValue"],n.inactiveValue),r()}return{hovering:a,radius:d,styleComputed:c,errorMessage:i,formDisabled:t==null?void 0:t.disabled,formReadonly:t==null?void 0:t.readonly,n:UJe,classes:jJe,multiplySizeUnit:dr,switchActive:g,hover:p}}});ace.render=YJe;var lce=ace;lt(lce);var uB=lce;const ZJe={name:[String,Number],disabled:Boolean,onClick:Se()},cce=Symbol("TABS_BIND_TAB_KEY");function XJe(){const{childProviders:n,bindChildren:e,length:t}=$o(cce);return{length:t,tabList:n,bindTabList:e}}function QJe(){const{parentProvider:n,bindParent:e,index:t}=Ho(cce);return e||Oa("Tab"," must in "),{index:t,tabs:n,bindTabs:e}}const{name:JJe,n:$k,classes:eet}=st("tab");function tet(n,e){const t=hn("ripple");return wi((q(),re("div",{class:B(n.classes(n.n(),n.n("$--box"),n.computeColorClass(),n.n("--".concat(n.itemDirection)))),ref:"tabEl",style:Fe({color:n.computeColorStyle()}),onClick:e[0]||(e[0]=(...i)=>n.handleClick&&n.handleClick(...i))},[xe(n.$slots,"default")],6)),[[t,{disabled:n.disabled}]])}const dce=et({name:JJe,directives:{Ripple:Ns},props:ZJe,setup(n){const e=se(null),t=ve(()=>e.value),i=ve(()=>n.name),s=ve(()=>n.disabled),{index:o,tabs:r,bindTabs:a}=QJe(),{onTabClick:l,active:c,activeColor:d,inactiveColor:u,disabledColor:h,itemDirection:f,resize:g}=r,p={name:i,index:o,disabled:s,element:t};a(p),ht(()=>[n.name,n.disabled],g);function _(){return n.name!=null?c.value===n.name:c.value===(o==null?void 0:o.value)}function v(){return n.disabled?h.value:_()?d.value:u.value}function b(){return n.disabled?$k("$-tab--disabled"):_()?$k("$-tab--active"):$k("$-tab--inactive")}function C(w){const{disabled:y,name:L,onClick:S}=n;y||(oe(S,L!=null?L:o.value,w),l(p))}return{tabEl:e,active:c,activeColor:d,inactiveColor:u,itemDirection:f,n:$k,classes:eet,computeColorStyle:v,computeColorClass:b,handleClick:C}}});dce.render=tet;var uce=dce;lt(uce);var hB=uce;const iet={name:[String,Number]},{name:net,n:set,classes:oet}=st("tab-item");function ret(n,e){const t=gt("var-swipe-item");return q(),ei(t,{class:B(n.classes(n.n(),[!n.current,n.n("--inactive")])),"var-tab-item-cover":""},{default:Lt(()=>[xe(n.$slots,"default")]),_:3},8,["class"])}const hce=et({name:net,components:{VarSwipeItem:Zy},props:iet,setup(n){const e=se(!1),t=ve(()=>n.name),{index:i,bindTabsItems:s}=zYe(),{bindLists:o}=UYe(),r={index:i,name:t,current:ve(()=>e.value),setCurrent:a};s(r),o(r);function a(l){e.value=l}return{current:e,n:set,classes:oet}}});hce.render=ret;var fce=hce;lt(fce);var fB=fce;const aet={fullWidth:{type:[Number,String],default:"100%"},elevation:{type:[Boolean,Number,String],default:!0}},{name:cet,n:det,classes:uet}=st("table");function het(n,e){return q(),re("div",{class:B(n.classes(n.n(),n.formatElevation(n.elevation,1),n.n("$--box")))},[me("div",{class:B(n.n("main"))},[me("table",{class:B(n.n("table")),style:Fe({width:n.toSizeUnit(n.fullWidth)})},[xe(n.$slots,"default")],6)],2),n.$slots.footer?(q(),re("div",{key:0,class:B(n.n("footer"))},[xe(n.$slots,"footer")],2)):Qe("v-if",!0)],2)}const gce=et({name:cet,props:aet,setup:()=>({toSizeUnit:ri,n:det,classes:uet,formatElevation:or})});gce.render=het;var pce=gce;lt(pce);var gB=pce;const fet={active:{type:[String,Number],default:0},layoutDirection:{type:String,default:"horizontal"},itemDirection:{type:String,default:"horizontal"},fixedBottom:Boolean,activeColor:String,inactiveColor:String,disabledColor:String,color:String,indicatorColor:String,indicatorSize:[String,Number],elevation:{type:[Boolean,String,Number],default:!1},scrollable:{type:String,default:"auto"},indicatorPosition:{type:String,default:"normal"},safeArea:Boolean,sticky:Boolean,stickyCssMode:yi(zD,"cssMode"),stickyZIndex:yi(zD,"zIndex"),offsetTop:yi(zD,"offsetTop"),onClick:Se(),onChange:Se(),"onUpdate:active":Se()};var zG=(n,e,t)=>new Promise((i,s)=>{var o=l=>{try{a(t.next(l))}catch(c){s(c)}},r=l=>{try{a(t.throw(l))}catch(c){s(c)}},a=l=>l.done?i(l.value):Promise.resolve(l.value).then(o,r);a((t=t.apply(n,e)).next())});const{name:get,n:pet,classes:met}=st("tabs");function _et(n,e){return q(),ei(m0(n.sticky?n.n("$-sticky"):n.Transition),{ref:n.sticky?"stickyComponent":void 0,"css-mode":n.sticky?n.stickyCssMode:void 0,"offset-top":n.sticky?n.offsetTop:void 0,"z-index":n.sticky?n.stickyZIndex:void 0},{default:Lt(()=>[me("div",fn({class:n.classes(n.n(),n.n("$--box"),n.n("--item-".concat(n.itemDirection)),n.n("--layout-".concat(n.layoutDirection,"-padding")),n.formatElevation(n.elevation,4),[n.fixedBottom,n.n("--fixed-bottom")],[n.safeArea,n.n("--safe-area")]),style:{background:n.color}},n.$attrs),[me("div",{ref:"scrollerEl",class:B(n.classes(n.n("tab-wrap"),[n.localScrollable,n.n("--layout-".concat(n.layoutDirection,"-scrollable"))],n.n("--layout-".concat(n.layoutDirection))))},[xe(n.$slots,"default"),me("div",{class:B(n.classes(n.n("indicator"),n.n("--layout-".concat(n.layoutDirection).concat(n.indicatorPosition,"-indicator")))),style:Fe({width:n.layoutDirection==="horizontal"?n.indicatorWidth:n.toSizeUnit(n.indicatorSize),height:n.layoutDirection==="horizontal"?n.toSizeUnit(n.indicatorSize):n.indicatorHeight,transform:n.layoutDirection==="horizontal"?"translateX(".concat(n.indicatorX,")"):"translateY(".concat(n.indicatorY,")")})},[me("div",{class:B(n.classes(n.n("indicator-inner"),n.n("--layout-".concat(n.layoutDirection,"-indicator-inner")))),style:Fe({background:n.indicatorColor||n.activeColor})},null,6)],6)],2)],16)]),_:3},8,["css-mode","offset-top","z-index"])}const mce=et({name:get,components:{VarSticky:Qy},inheritAttrs:!1,props:fet,setup(n){const e=se("0px"),t=se("0px"),i=se("0px"),s=se("0px"),o=se(!1),r=se(null),a=ve(()=>n.active),l=ve(()=>n.activeColor),c=ve(()=>n.inactiveColor),d=ve(()=>n.disabledColor),u=ve(()=>n.itemDirection),h=se(null),f=ve(()=>n.indicatorPosition==="reverse"?"-reverse":""),{tabList:g,bindTabList:p,length:_}=XJe();p({active:a,activeColor:l,inactiveColor:c,disabledColor:d,itemDirection:u,resize:D,onTabClick:b}),ht(()=>_.value,()=>zG(this,null,function*(){yield Cr(),D()})),ht(()=>[n.active,n.scrollable],D),eh(D),U0(D);function b(A){var T;const P=(T=A.name.value)!=null?T:A.index.value,{active:W,onChange:$,onClick:X}=n;oe(n["onUpdate:active"],P),oe(X,P),P!==W&&oe($,P)}function C(){return g.find(({name:A})=>n.active===A.value)}function w(A){return g.find(({index:T})=>(A!=null?A:n.active)===T.value)}function y(){if(_.value===0)return;const{active:A}=n;if(qr(A)){const T=Wf(A,0,_.value-1);return oe(n["onUpdate:active"],T),w(T)}}function L(){o.value=n.scrollable==="always"||g.length>=5}function S({element:A}){const T=A.value;T&&(n.layoutDirection==="horizontal"?(e.value="".concat(T.offsetWidth,"px"),i.value="".concat(T.offsetLeft,"px")):(t.value="".concat(T.offsetHeight,"px"),s.value="".concat(T.offsetTop,"px")))}function k({element:A}){if(!o.value)return;const T=r.value,P=A.value;if(n.layoutDirection==="horizontal"){const W=P.offsetLeft+P.offsetWidth/2-T.offsetWidth/2;$y(T,{left:W,animation:i3})}else{const W=P.offsetTop+P.offsetHeight/2-T.offsetHeight/2;$y(T,{top:W,animation:i3})}}function D(){const A=C()||w()||y();!A||A.disabled.value||(L(),S(A),k(A))}function x(){return zG(this,null,function*(){n.sticky&&h.value&&(yield h.value.resize())})}return{stickyComponent:h,indicatorWidth:e,indicatorHeight:t,indicatorX:i,indicatorY:s,indicatorPosition:f,localScrollable:o,scrollerEl:r,Transition:On,toSizeUnit:ri,n:pet,classes:met,resize:D,resizeSticky:x,formatElevation:or}}});mce.render=_et;var _ce=mce;lt(_ce);var pB=_ce;const vet={active:{type:[String,Number],default:0},canSwipe:{type:Boolean,default:!0},loop:Boolean,"onUpdate:active":Se()};var bet=(n,e,t)=>new Promise((i,s)=>{var o=l=>{try{a(t.next(l))}catch(c){s(c)}},r=l=>{try{a(t.throw(l))}catch(c){s(c)}},a=l=>l.done?i(l.value):Promise.resolve(l.value).then(o,r);a((t=t.apply(n,e)).next())});const{name:Cet,n:wet}=st("tabs-items");function yet(n,e){const t=gt("var-swipe");return q(),ei(t,{class:B(n.n()),ref:"swipe",loop:n.loop,touchable:n.canSwipe,indicator:!1,onChange:n.handleSwipeChange},{default:Lt(()=>[xe(n.$slots,"default")]),_:3},8,["class","loop","touchable","onChange"])}const vce=et({name:Cet,components:{VarSwipe:Yy},props:vet,setup(n){const e=se(null),{tabItemList:t,bindTabItem:i,length:s}=$Ye();i({}),ht(()=>n.active,l),ht(()=>s.value,()=>bet(this,null,function*(){yield Cr(),l(n.active)}));function o(u){return t.find(({name:h})=>u===h.value)}function r(u){return t.find(({index:h})=>u===h.value)}function a(u){return o(u)||r(u)}function l(u){var h;const f=a(u);f&&(t.forEach(({setCurrent:g})=>g(!1)),f.setCurrent(!0),(h=e.value)==null||h.to(f.index.value))}function c(u){var h;const f=t.find(({index:p})=>p.value===u),g=(h=f.name.value)!=null?h:f.index.value;oe(n["onUpdate:active"],g)}function d(){return e.value}return{swipe:e,n:wet,handleSwipeChange:c,getSwipe:d}}});vce.render=yet;var bce=vce;lt(bce);var mB=bce,Let={"--action-sheet-background":"#1e1e1e","--action-sheet-title-color":"#aaa","--action-sheet-action-item-color":"#fff"},ket={"--badge-default-color":"#555"},Det={"--button-default-color":"#303030","--button-default-text-color":"#fff"},Eet={"--card-background":"#303030","--card-title-color":"#ffffff","--card-outline-color":"rgba(255, 255, 255, 0.2)","--card-subtitle-color":"#aaaaaa","--card-description-color":"#aaaaaa"},Iet={"--cell-description-color":"#aaa","--cell-border-color":"#545454"},Tet={"--checkbox-unchecked-color":"#fff","--checkbox-text-color":"#fff"},xet={"--chip-default-color":"#555","--chip-default-text-color":"#fff"},Net={"--collapse-background":"#303030","--collapse-text-color":"#fff","--collapse-border-top":"thin solid rgba(255, 255, 255, 0.12)"},Aet={"--date-picker-main-color":"#fff","--date-picker-body-background-color":"#303030","--day-picker-head-item-color":"#aaaaaa","--year-picker-item-color":"#fff","--picker-header-color":"#fff"},Met={"--dialog-background":"#1e1e1e","--dialog-title-color":"#fff","--dialog-message-color":"#bbb"},Ret={"--divider-color":"rgba(255, 255, 255, 0.2)","--divider-text-color":"#aaa"},Pet={"--floating-panel-background":"#272727"},Oet={"--field-decorator-text-color":"#fff","--field-decorator-blur-color":"rgb(255, 255, 255, .7)"},Fet={"--pagination-text-color":"#fff","--pagination-list-bg-color":"#303030","--pagination-hover-bg-color":"rgba(255, 255, 255, .15)","--pagination-list-active-bg-color":"#25293a","--pagination-list-active-color":"#4a7afe","--pagination-item-background":"#303030"},Bet={"--picker-background":"#1e1e1e","--picker-cancel-button-text-color":"#aaa","--picker-title-text-color":"#fff","--picker-option-text-color":"#fff","--picker-picked-border":"1px solid rgba(255, 255, 255, 0.12)","--picker-mask-background-image":"linear-gradient(180deg, hsla(0, 0%, 12%, 0.9), hsla(0, 0%, 12%, 0.4)), linear-gradient(0deg, hsla(0, 0%, 12%, 0.9), hsla(0, 0%, 12%, 0.4))"},Wet={"--popup-content-background-color":"#1e1e1e"},Vet={"--pull-refresh-background":"#303030"},Het={"--radio-unchecked-color":"#fff","--radio-text-color":"#fff"},$et={"--result-background":"#303030","--result-title-color":"#ffffff","--result-description-color":"#aaaaaa","--result-question-color":"#7f8e96","--result-question-border-color":"rgba(151,194,216,0.3)","--result-empty-color":"#adadad","--result-empty-border-color":"rgba(232,229,229,0.3)"},zet={"--select-scroller-background":"#303030"},Uet={"--skeleton-card-background-color":"hsla(0,0%,100%,.12)","--skeleton-animation-background":"linear-gradient(\n 90deg,hsla(0,0%,100%,0),hsla(0,0%,100%,.05),hsla(0,0%,100%,0))\n ","--skeleton-avatar-background-color":"hsla(0,0%,100%,.12)","--skeleton-title-background-color":"hsla(0,0%,100%,.12)"},jet={"--step-content-color":"rgba(255, 255, 255, .38)","--step-content-active-color":"#fff","--step-line-background":"#fff"},Ket={"--switch-track-background":"#727272","--switch-handle-background":"#727272"},qet={"--tab-inactive-color":"rgba(255, 255, 255, .65)"},Get={"--table-background":"#303030","--table-thead-th-text-color":"rgba(255, 255, 255, 0.6)","--table-tbody-td-text-color":"#fff","--table-tbody-tr-hover-background":"#4c4b4b","--table-thead-border-bottom":"thin solid rgba(255, 255, 255, 0.12)","--table-tbody-tr-border-bottom":"thin solid rgba(255, 255, 255, 0.12)","--table-footer-border-top":"thin solid rgba(255, 255, 255, 0.12)"},Yet={"--time-picker-clock-container-background":"#545454","--time-picker-body-background":"#303030","--time-picker-clock-item-disable-color":"#aaaaaa","--time-picker-clock-item-text-color":"#fff"},Zet={"--uploader-action-background":"#303030","--uploader-action-icon-color":"#fff","--uploader-file-name-background":"#303030","--uploader-file-name-color":"#aaa","--uploader-file-cover-background":"#303030"},Xet={"--tabs-background":"#1e1e1e"},Qet={"--app-bar-color":"#272727"},Jet={"--bottom-navigation-background-color":"#272727","--bottom-navigation-border-color":"#444"},ett={"--bottom-navigation-item-active-background-color":"#272727"},ttt={"--menu-background-color":"#272727"},itt={"--breadcrumb-inactive-color":"#aaa"},ntt={"--paper-background":"#303030"},stt={"--avatar-background-color":"#303030","--avatar-border":"2px solid #1e1e1e"},ott={"--link-default-color":"#fff"},rtt={"--progress-label-color":"#fff"},att={"--option-text-color":"#fff"},ltt={"--countdown-text-color":"#fff"},ctt={"--watermark-content-color":"#ffffff"},dtt={"--menu-select-menu-background-color":"#272727"},utt={"--menu-option-text-color":"#fff"},htt=Object.defineProperty,UG=Object.getOwnPropertySymbols,ftt=Object.prototype.hasOwnProperty,gtt=Object.prototype.propertyIsEnumerable,jG=(n,e,t)=>e in n?htt(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,hi=(n,e)=>{for(var t in e||(e={}))ftt.call(e,t)&&jG(n,t,e[t]);if(UG)for(var t of UG(e))gtt.call(e,t)&&jG(n,t,e[t]);return n},ptt=hi(hi(hi(hi(hi(hi(hi(hi(hi(hi(hi(hi(hi(hi(hi(hi(hi(hi(hi(hi(hi(hi(hi(hi(hi(hi(hi(hi(hi(hi(hi(hi(hi(hi(hi(hi(hi(hi(hi(hi(hi(hi({"--color-body":"#1e1e1e","--color-text":"#fff","--color-primary":"#4a7afe","--color-info":"#10afef","--color-success":"#10c48f","--color-warning":"#ff8800","--color-danger":"#ef5350","--color-disabled":"#404040","--color-text-disabled":"#757575"},Det),Iet),Eet),Yet),Aet),Uet),Xet),qet),Wet),Met),Let),xet),ket),Zet),Net),Vet),Ket),jet),Fet),Get),Oet),zet),Het),Tet),Ret),Bet),Qet),Jet),ett),ttt),$et),itt),ntt),stt),ott),rtt),att),ltt),ctt),dtt),utt),Pet);const mtt={dark:ptt};var ST=mtt;const Za=["12","1","2","3","4","5","6","7","8","9","10","11"],hr=["00","13","14","15","16","17","18","19","20","21","22","23"],KG=["00","05","10","15","20","25","30","35","40","45","50","55"],_tt={modelValue:String,elevation:{type:[Boolean,Number,String],default:!1},hint:String,color:String,headerColor:String,titleColor:String,format:{type:String,default:"ampm"},allowedTime:Object,min:String,max:String,useSeconds:Boolean,readonly:Boolean,"onUpdate:modelValue":Se(),onChange:Se()},Cce=(n,e)=>n==="24hr"||e==="am",Y6=(n,e,t)=>{const i=Za.findIndex(o=>Ie(o)===Ie(t)),s=Cce(n,e)?t:hr[i];return{hourStr:s,hourNum:Ie(s)}},Kr=n=>{const[e,t,i]=n.split(":");return{hour:Ie(e),minute:Ie(t),second:Ie(i)}},wce=n=>{var e,t;const{time:i,format:s,ampm:o,hour:r,max:a,min:l,disableHour:c}=n,{hourStr:d,hourNum:u}=Y6(s,o,r);let h=!1,f=!1;if(c.includes(d))return!0;if(a&&!l){const{hour:g,minute:p}=Kr(a);h=g===u&&i>p}if(!a&&l){const{hour:g,minute:p}=Kr(l);h=g===u&&ip}return(e=n.allowedTime)!=null&&e.minutes&&(f=(t=n.allowedTime)==null?void 0:t.minutes(i)),h||f},yce=n=>{var e,t;const{time:i,format:s,ampm:o,hour:r,minute:a,max:l,min:c,disableHour:d}=n,{hourStr:u,hourNum:h}=Y6(s,o,r);let f=!1,g=!1;if(d.includes(u))return!0;if(l&&!c){const{hour:p,minute:_,second:v}=Kr(l);f=p===h&&_v}if(!l&&c){const{hour:p,minute:_,second:v}=Kr(c);f=p===h&&_>a||_===a&&i>v}if(l&&c){const{hour:p,minute:_,second:v}=Kr(l),{hour:b,minute:C,second:w}=Kr(c);f=p===h&&_a||p===h&&_===a&&i>v||b===h&&C===a&&i(q(),re("div",{class:B(n.classes(n.n("clock-item"),[n.isActive(i,!1),n.n("clock-item--active")],[n.isDisable(t),n.n("clock-item--disable")])),key:t,style:Fe(n.getStyle(i,t,!1))},ut(t),7))),128)),n.format==="24hr"&&n.type==="hour"?(q(),re("div",{key:0,class:B(n.n("clock-inner")),ref:"inner"},[(q(!0),re(li,null,ss(n.hours24,(t,i)=>(q(),re("div",{class:B(n.classes(n.n("clock-item"),[n.isActive(i,!0),n.n("clock-item--active")],[n.isDisable(t),n.n("clock-item--disable")])),key:t,style:Fe(n.getStyle(i,t,!0))},ut(t),7))),128))],2)):Qe("v-if",!0)],2)}const Sce=et({name:"Clock",props:{isInner:{type:Boolean,required:!0},rad:{type:Number},format:{type:String,default:"ampm"},allowedTime:{type:Object},time:{type:Object,required:!0},useSeconds:{type:Boolean,default:!1},preventNextUpdate:{type:Boolean,default:!1},type:{type:String,default:"hour"},ampm:{type:String,default:"am"},color:{type:String},min:{type:String},max:{type:String}},emits:["update","change-prevent-update"],setup(n,{emit:e}){const t=se(null),i=se([]),s=se([]),o=ve(()=>({transform:"rotate(".concat(Ie(n.rad),"deg)"),height:n.isInner&&n.type==="hour"?"calc(50% - 40px)":"calc(50% - 4px)",backgroundColor:c(),borderColor:c()})),r=ve(()=>{if(n.rad===void 0)return;const p=n.rad/30;return p>=0?p:p+12}),a=ve(()=>n.type==="hour"?Za:KG),l=(p,_)=>{p=p!=null?p:n.type==="minute"?n.time.minute:n.time.second;const v=n.type==="minute"?wce:yce,b={time:Ie(p),format:n.format,ampm:n.ampm,hour:n.time.hour,minute:Ie(n.time.minute),max:n.max,min:n.min,allowedTime:n.allowedTime,disableHour:i.value};return _&&n.type==="minute"&&Reflect.deleteProperty(b,"minute"),v(b)},c=()=>{if(r.value===void 0)return n.color;const p=n.isInner?hr[r.value]:a.value[r.value];return a.value===KG?l()?"#bdbdbd":n.color:u(p)?"#bdbdbd":n.color},d=(p,_)=>_?r.value===p&&n.isInner:r.value===p&&(!n.isInner||n.type!=="hour"),u=p=>{if(n.type==="hour"){if(Cce(n.format,n.ampm))return i.value.includes(p);const _=Za.findIndex(v=>v===p);return s.value.includes(_)}return l(p,!0)},h=(p,_,v)=>{const b=2*Math.PI/12*p-Math.PI/2,C=50*(1+Math.cos(b)),w=50*(1+Math.sin(b)),y=()=>d(p,v)?u(_)?{backgroundColor:"#bdbdbd",color:"#fff"}:{backgroundColor:n.color,color:void 0}:{backgroundColor:void 0,color:void 0},{backgroundColor:L,color:S}=y();return{left:"".concat(C,"%"),top:"".concat(w,"%"),backgroundColor:L,color:S}},f=()=>{const{width:p,height:_}=no(t.value);return{width:p,height:_}},g=()=>{if(r.value===void 0)return;const p=n.ampm==="am"?Za:hr;return Bm(p[r.value],2,"0")};return ht([r,()=>n.isInner],([p,_],[v,b])=>{if(p===v&&_===b||n.type!=="hour"||r.value===void 0)return;const w=_?hr[r.value]:g(),y=n.useSeconds?":".concat(n.time.second):"",L="".concat(w,":").concat(n.time.minute).concat(y);n.preventNextUpdate||e("update",L),e("change-prevent-update")}),ht(()=>n.rad,(p,_)=>{if(n.type==="hour"||p===void 0||_===void 0)return;const v=p/6>=0?p/6:p/6+60,b=_/6>=0?_/6:_/6+60;if(v===b)return;let C;const{hourStr:w}=Y6(n.format,n.ampm,n.time.hour);if(n.type==="minute"){const y=wt().minute(v).format("mm"),L=n.useSeconds?":".concat(n.time.second):"";C="".concat(w,":").concat(y).concat(L)}if(n.type==="second"){const y=wt().second(v).format("ss"),L=n.useSeconds?":".concat(y):"";C="".concat(w,":").concat(n.time.minute).concat(L)}e("update",C)}),ht([()=>n.max,()=>n.min,()=>n.allowedTime],([p,_,v])=>{if(i.value=[],p&&!_){const{hour:b}=Kr(p),C=Za.filter(y=>Ie(y)>b),w=hr.filter(y=>Ie(y)>b);i.value=[...C,...w]}if(!p&&_){const{hour:b}=Kr(_),C=Za.filter(y=>Ie(y)Ie(y)Ie(L)b),y=hr.filter(L=>Ie(L)b);i.value=[...w,...y]}if(v!=null&&v.hours){const{hours:b}=v,C=Za.filter(y=>!b(Ie(y))),w=hr.filter(y=>!b(Ie(y)));i.value=[...new Set([...i.value,...C,...w])]}s.value=i.value.map(b=>hr.findIndex(C=>b===C)).filter(b=>b>=0)},{immediate:!0}),{n:vtt,classes:btt,hours24:hr,timeScales:a,inner:t,handStyle:o,disableHour:i,isActive:d,isDisable:u,getSize:f,getStyle:h,activeItemIndex:r}}});Sce.render=Ctt;var wtt=Sce;const{name:ytt,n:Stt,classes:Ltt}=st("time-picker"),ktt=n=>(vg(""),n=n(),bg(),n),Dtt=ktt(()=>me("span",null,":",-1)),Ett={key:0};function Itt(n,e){var t;const i=gt("clock");return q(),re("div",{class:B(n.classes(n.n(),n.formatElevation(n.elevation,2))),ref:"picker"},[me("div",{class:B(n.n("title")),style:Fe({background:n.titleColor||n.headerColor||n.color})},[me("div",{class:B(n.n("title-hint"))},ut((t=n.hint)!=null?t:n.pack.timePickerHint),3),me("div",{class:B(n.n("title-time-container"))},[me("div",{class:B(n.n("title-time"))},[me("div",{class:B(n.classes(n.n("title-btn"),[n.type==="hour",n.n("title-btn--active")])),onClick:e[0]||(e[0]=s=>n.checkPanel("hour"))},ut(n.time.hour),3),Dtt,me("div",{class:B(n.classes(n.n("title-btn"),[n.type==="minute",n.n("title-btn--active")])),onClick:e[1]||(e[1]=s=>n.checkPanel("minute"))},ut(n.time.minute),3),n.useSeconds?(q(),re("span",Ett,":")):Qe("v-if",!0),n.useSeconds?(q(),re("div",{key:1,class:B(n.classes(n.n("title-btn"),[n.type==="second",n.n("title-btn--active")])),onClick:e[2]||(e[2]=s=>n.checkPanel("second"))},ut(n.time.second),3)):Qe("v-if",!0)],2),n.format==="ampm"?(q(),re("div",{key:0,class:B(n.n("title-ampm"))},[me("div",{class:B(n.classes(n.n("title-btn"),[n.ampm==="am",n.n("title-btn--active")])),onClick:e[3]||(e[3]=s=>n.checkAmpm("am"))}," AM ",2),me("div",{class:B(n.classes(n.n("title-btn"),[n.ampm==="pm",n.n("title-btn--active")])),onClick:e[4]||(e[4]=s=>n.checkAmpm("pm"))}," PM ",2)],2)):Qe("v-if",!0)],2)],6),me("div",{class:B(n.n("body"))},[me("div",{class:B(n.n("clock-container")),onTouchstart:e[5]||(e[5]=(...s)=>n.moveHand&&n.moveHand(...s)),onTouchmove:e[6]||(e[6]=(...s)=>n.moveHand&&n.moveHand(...s)),onTouchend:e[7]||(e[7]=(...s)=>n.end&&n.end(...s)),ref:"container"},[Oe(On,{name:"".concat(n.n(),"-panel-fade")},{default:Lt(()=>[(q(),ei(i,{key:n.type,ref:"inner",type:n.type,ampm:n.ampm,color:n.color,"is-inner":n.isInner,format:n.format,"allowed-time":n.allowedTime,rad:n.getRad,time:n.time,"prevent-next-update":n.isPreventNextUpdate,"use-seconds":n.useSeconds,max:n.max,min:n.min,onUpdate:n.update,onChangePreventUpdate:n.changePreventUpdate},null,8,["type","ampm","color","is-inner","format","allowed-time","rad","time","prevent-next-update","use-seconds","max","min","onUpdate","onChangePreventUpdate"]))]),_:1},8,["name"])],34)],2)],2)}const Lce=et({name:ytt,components:{Clock:wtt},props:_tt,setup(n){const e=se(null),t=se(null),i=se(null),s=se(!1),o=se(!1),r=se(!1),a=se(!1),l=se(!1),c=se(!1),d=se(!1),u=se(0),h=se(0),f=se(),g=se("hour"),p=se("am"),_=se({hour:"00",minute:"00",second:"00"}),v=Cn({x:0,y:0}),b=Cn({x:[],y:[]}),C=ve(()=>g.value==="hour"?f.value:g.value==="minute"?u.value:h.value);ht(()=>n.modelValue,de=>{if(de){const{hour:_e,minute:ie,second:ne}=Kr(de),Ye=wt().hour(_e).format("hh"),pe=wt().hour(_e).format("HH"),Ee=wt().minute(ie).format("mm"),ze=wt().second(ne).format("ss");f.value=(Ye==="12"?0:Ie(Ye))*30,u.value=Ie(Ee)*6,h.value=Ie(ze)*6,_.value=x(de),n.format!=="24hr"&&(p.value=Bm("".concat(_e),2,"0")===pe&&hr.includes(pe)?"pm":"am"),s.value=n.format==="24hr"&&hr.includes(pe)}},{immediate:!0});function w(de){oe(n["onUpdate:modelValue"],de),oe(n.onChange,de)}function y(de){return de*57.29577951308232}function L(de){a.value=!1,d.value=!1,g.value=de}function S(de){const{disableHour:_e}=i.value,ie=Za.findIndex(pe=>Ie(pe)===Ie(_.value.hour)),ne=de==="am"?Za:hr;return[...ne.slice(ie),...ne.slice(0,ie)].find((pe,Ee)=>(o.value=Ee!==0,!_e.includes(pe)))}function k(de){if(n.readonly)return;p.value=de;const _e=S(de);if(!_e)return;const ie=n.useSeconds?":".concat(_.value.second):"",ne="".concat(Bm(_e,2,"0"),":").concat(_.value.minute).concat(ie);w(ne)}function D(de,_e){const ie=de>=b.x[0]&&de<=b.x[1],ne=_e>=b.y[0]&&_e<=b.y[1];return ie&&ne}function x(de){const _e=n.format==="24hr"?"HH":"hh",{hour:ie,minute:ne,second:Ye}=Kr(de);return{hour:wt().hour(ie).format(_e),minute:wt().minute(ne).format("mm"),second:wt().second(Ye).format("ss")}}function A(de){const _e=de/30;return _e>=0?_e:_e+12}function T(){const{width:de,height:_e}=i.value.getSize(),ie=v.x-de/2-8,ne=v.x+de/2+8,Ye=v.y-_e/2-8,pe=v.y+_e/2+8;return{rangeXMin:ie,rangeXMax:ne,rangeYMin:Ye,rangeYMax:pe}}function P(de,_e,ie){const{disableHour:ne}=i.value;r.value=D(de,_e);const Ye=Math.round(ie/30)*30+90,pe=A(Ye),Ee=s.value?Za[pe]:hr[pe];if(ne.includes(Ee)||(s.value=n.format==="24hr"?D(de,_e):!1),s.value!==r.value)return;const ze=s.value||p.value==="pm"?hr[pe]:Za[pe];c.value=ne.includes(ze),!c.value&&(f.value=Ye,a.value=!0)}function W(de){const{disableHour:_e}=i.value,ie=Math.round(de/6)*6+90,Ye={time:ie/6>=0?ie/6:ie/6+60,format:n.format,ampm:p.value,hour:_.value.hour,max:n.max,min:n.min,disableHour:_e,allowedTime:n.allowedTime};d.value=wce(Ye),!d.value&&(u.value=ie,l.value=!0)}function $(de){const{disableHour:_e}=i.value,ie=Math.round(de/6)*6+90,Ye={time:ie/6>=0?ie/6:ie/6+60,format:n.format,ampm:p.value,hour:_.value.hour,minute:Ie(_.value.minute),max:n.max,min:n.min,disableHour:_e,allowedTime:n.allowedTime};yce(Ye)||(h.value=ie)}function X(){const{left:de,top:_e,width:ie,height:ne}=no(e.value);if(v.x=de+ie/2,v.y=_e+ne/2,g.value==="hour"&&n.format==="24hr"){const{rangeXMin:Ye,rangeXMax:pe,rangeYMin:Ee,rangeYMax:ze}=T();b.x=[Ye,pe],b.y=[Ee,ze]}}function J(de){if(dc(de),n.readonly)return;X();const{clientX:_e,clientY:ie}=de.touches[0],ne=_e-v.x,Ye=ie-v.y,pe=Math.round(y(Math.atan2(Ye,ne)));g.value==="hour"?P(_e,ie,pe):g.value==="minute"?W(pe):$(pe)}function Q(){if(!n.readonly){if(g.value==="hour"&&a.value){g.value="minute";return}g.value==="minute"&&n.useSeconds&&l.value&&(g.value="second")}}function le(){o.value=!1}return{getRad:C,time:_,container:e,inner:i,picker:t,isInner:s,type:g,ampm:p,isPreventNextUpdate:o,n:Stt,classes:Ltt,pack:Xs,moveHand:J,checkPanel:L,checkAmpm:k,end:Q,update:w,changePreventUpdate:le,formatElevation:or}}});Lce.render=Itt;var kce=Lce;lt(kce);var _B=kce;const Ttt={modelValue:{type:Array,default:()=>[]},accept:{type:String,default:"image/*"},capture:{type:[String,Boolean],default:void 0},multiple:Boolean,readonly:Boolean,disabled:Boolean,elevation:{type:[Boolean,Number,String],default:!0},resolveType:{type:String,default:"default"},removable:{type:Boolean,default:!0},maxlength:[Number,String],maxsize:[Number,String],previewed:{type:Boolean,default:!0},ripple:{type:Boolean,default:!0},validateTrigger:{type:Array,default:()=>["onChange","onRemove"]},rules:Array,hideList:Boolean,preventDefaultPreview:Boolean,onBeforeFilter:Se(),onBeforeRead:Se(),onAfterRead:Se(),onBeforeRemove:Se(),onRemove:Se(),onOversize:Se(),onPreview:Se(),"onUpdate:modelValue":Se()};var zk=(n,e,t)=>new Promise((i,s)=>{var o=l=>{try{a(t.next(l))}catch(c){s(c)}},r=l=>{try{a(t.throw(l))}catch(c){s(c)}},a=l=>l.done?i(l.value):Promise.resolve(l.value).then(o,r);a((t=t.apply(n,e)).next())});const{name:xtt,n:Ntt,classes:Att}=st("uploader");let Mtt=0;const Rtt=["onClick"],Ptt=["onClick"],Ott=["src","alt"],Ftt=["multiple","accept","capture","disabled"],Btt=["src"];function Wtt(n,e){const t=gt("var-icon"),i=gt("var-hover-overlay"),s=gt("var-form-details"),o=gt("var-popup"),r=hn("ripple"),a=hn("hover");return q(),re("div",{class:B(n.classes(n.n(),n.n("$--box")))},[me("div",{class:B(n.n("file-list"))},[(q(!0),re(li,null,ss(n.files,l=>wi((q(),re("div",{class:B(n.classes(n.n("file"),n.formatElevation(n.elevation,2),[l.state==="loading",n.n("--loading")])),key:l.id,onClick:c=>n.preview(l)},[me("div",{class:B(n.n("file-name"))},ut(l.name||l.url),3),n.removable?(q(),re("div",{key:0,class:B(n.n("file-close")),onClick:Ia(c=>n.handleRemove(l),["stop"])},[Oe(t,{class:B(n.n("file-close-icon")),"var-uploader-cover":"",name:"delete"},null,8,["class"])],10,Ptt)):Qe("v-if",!0),l.cover?(q(),re("img",{key:1,class:B(n.n("file-cover")),style:Fe({objectFit:l.fit}),src:l.cover,alt:l.name},null,14,Ott)):Qe("v-if",!0),me("div",{class:B(n.n("file-indicator"))},[me("div",{class:B(n.classes(n.n("progress"),[l.state==="success",n.n("--success")],[l.state==="error",n.n("--error")])),style:Fe({width:l.state==="success"||l.state==="error"?"100%":"".concat(l.progress,"%")})},null,6)],2)],10,Rtt)),[[r,{disabled:n.disabled||n.formDisabled||n.readonly||n.formReadonly||!n.ripple}]])),128)),!n.maxlength||n.modelValue.lengthn.chooseFile&&n.chooseFile(...l))},[me("input",{ref:"input",type:"file",class:B(n.n("action-input")),multiple:n.multiple,accept:n.accept,capture:n.capture,disabled:n.disabled||n.formDisabled||n.readonly||n.formReadonly,onChange:e[0]||(e[0]=(...l)=>n.handleChange&&n.handleChange(...l))},null,42,Ftt),xe(n.$slots,"default",{},()=>[Oe(t,{class:B(n.n("action-icon")),"var-uploader-cover":"",name:"plus"},null,8,["class"]),Oe(i,{hovering:n.hovering&&!n.disabled&&!n.formDisabled},null,8,["hovering"])])],2)),[[r,{disabled:n.disabled||n.formDisabled||n.readonly||n.formReadonly||!n.ripple||!!n.$slots.default}],[a,n.handleHovering,"desktop"]]):Qe("v-if",!0)],2),Oe(s,{"error-message":n.errorMessage,"extra-message":n.maxlengthText},YD({_:2},[n.$slots["extra-message"]?{name:"extra-message",fn:Lt(()=>[xe(n.$slots,"extra-message")]),key:"0"}:void 0]),1032,["error-message","extra-message"]),Oe(o,{class:B(n.n("preview")),"var-uploader-cover":"",position:"center",show:n.showPreview,"onUpdate:show":e[2]||(e[2]=l=>n.showPreview=l),onClosed:e[3]||(e[3]=l=>n.currentPreview=null)},{default:Lt(()=>{var l,c;return[n.currentPreview&&n.isHTMLSupportVideo((l=n.currentPreview)==null?void 0:l.url)?(q(),re("video",{key:0,class:B(n.n("preview-video")),playsinline:"true","webkit-playsinline":"true","x5-playsinline":"true","x5-video-player-type":"h5","x5-video-player-fullscreen":"false",controls:"",src:(c=n.currentPreview)==null?void 0:c.url},null,10,Btt)):Qe("v-if",!0)]}),_:1},8,["class","show"])],2)}const Dce=et({name:xtt,directives:{Ripple:Ns,Hover:Fa},components:{VarIcon:Wn,VarPopup:gg,VarFormDetails:na,VarHoverOverlay:ml},props:Ttt,setup(n){const e=se(null),t=se(!1),i=se(null),s=ve(()=>{const{maxlength:J,modelValue:{length:Q}}=n;return qr(J)?"".concat(Q," / ").concat(J):""}),{form:o,bindForm:r}=kl(),{errorMessage:a,validateWithTrigger:l,validate:c,resetValidation:d}=Ll(),{hovering:u,handleHovering:h}=Pd(),f=ve(()=>{const{modelValue:J,hideList:Q}=n;return Q?[]:J});let g=!1;const p={getSuccess:D,getError:x,getLoading:A};oe(r,{validate:$,resetValidation:d,reset:X}),ht(()=>n.modelValue,()=>{!g&&W("onChange"),g=!1},{deep:!0});function v(J){const{disabled:Q,previewed:le,preventDefaultPreview:de,onPreview:_e}=n;if(o!=null&&o.disabled.value||Q||!le||(oe(_e,Cn(J)),de))return;const{url:ie}=J;if(rq(ie)){Xy(ie);return}aq(ie)&&(i.value=J,t.value=!0)}function b(J){return{id:Mtt++,url:"",cover:"",name:J.name,file:J,progress:0}}function C(J){const Q=J.target,{files:le}=Q;return Array.from(le)}function w(J){return zk(this,null,function*(){const Q=J.file;if(n.resolveType==="default"&&Q.type.startsWith("image")||n.resolveType==="data-url"){const de=yield Ihe(Q);J.cover=de,J.url=de}return J})}function y(J){return J.map(w)}function L(J){const{onBeforeRead:Q}=n;return J.map(le=>new Promise(de=>{Q||de({valid:!0,varFile:le});const _e=qk(oe(Q,Cn(le)));Promise.all(_e).then(ie=>{de({valid:ie.every(Boolean),varFile:le})})}))}function S(J){return zk(this,null,function*(){const{maxsize:Q,maxlength:le,modelValue:de,onOversize:_e,onAfterRead:ie,onBeforeFilter:ne,readonly:Ye,disabled:pe}=n;if(o!=null&&o.disabled.value||o!=null&&o.readonly.value||pe||Ye)return;const Ee=ae=>ae.filter(we=>we.file.size>Ie(Q)?(oe(_e,Cn(we)),!1):!0),ze=ae=>{const we=Math.min(ae.length,Ie(le)-de.length);return ae.slice(0,we)},It=ae=>zk(this,null,function*(){if(!ne)return ae;const we=qk(ne);for(const Ne of we)ae=yield Ne(ae);return ae});let Xe=C(J).map(b);Xe=yield It(Xe),Xe=Q!=null?Ee(Xe):Xe,Xe=le!=null?ze(Xe):Xe;const je=yield Promise.all(y(Xe)),z=(yield Promise.all(L(je))).filter(({valid:ae})=>ae).map(({varFile:ae})=>ae);oe(n["onUpdate:modelValue"],[...de,...z]),J.target.value="",z.forEach(ae=>oe(ie,Cn(ae)))})}function k(J){return zk(this,null,function*(){const{disabled:Q,readonly:le,modelValue:de,onBeforeRemove:_e,onRemove:ie}=n;if(o!=null&&o.disabled.value||o!=null&&o.readonly.value||Q||le)return;if(_e){const Ye=qk(oe(_e,Cn(J)));if((yield Promise.all(Ye)).some(pe=>!pe))return}const ne=de.filter(Ye=>Ye!==J);oe(ie,Cn(J)),W("onRemove"),oe(n["onUpdate:modelValue"],ne)})}function D(){return n.modelValue.filter(J=>J.state==="success")}function x(){return n.modelValue.filter(J=>J.state==="error")}function A(){return n.modelValue.filter(J=>J.state==="loading")}function T(){e.value.click()}function P(){i.value=null,t.value=!1,Xy.close()}function W(J){Fn(()=>{const{validateTrigger:Q,rules:le,modelValue:de}=n;l(Q,J,le,de,p)})}function $(){return c(n.rules,n.modelValue,p)}function X(){g=!0,oe(n["onUpdate:modelValue"],[]),d()}return{input:e,files:f,showPreview:t,currentPreview:i,errorMessage:a,maxlengthText:s,hovering:u,formDisabled:o==null?void 0:o.disabled,formReadonly:o==null?void 0:o.readonly,n:Ntt,classes:Att,formatElevation:or,toNumber:Ie,handleHovering:h,isHTMLSupportVideo:aq,isHTMLSupportImage:rq,preview:v,handleChange:S,handleRemove:k,getSuccess:D,getError:x,getLoading:A,validate:$,resetValidation:d,reset:X,chooseFile:T,closePreview:P,toSizeUnit:ri}}});Dce.render=Wtt;var Ece=Dce;lt(Ece);var vB=Ece;const Vtt={width:{type:Number,default:100},height:{type:Number,default:100},content:String,image:String,rotate:{type:Number,default:-22},offsetX:{type:Number,default:0},offsetY:{type:Number,default:0},gapX:{type:Number,default:0},gapY:{type:Number,default:0},zIndex:{type:[Number,String],default:10},opacity:{type:[Number,String],default:.5},fullscreen:Boolean,font:{type:Object,default:()=>({fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",fontSize:14})}};var Htt=Object.defineProperty,$tt=Object.defineProperties,ztt=Object.getOwnPropertyDescriptors,qG=Object.getOwnPropertySymbols,Utt=Object.prototype.hasOwnProperty,jtt=Object.prototype.propertyIsEnumerable,GG=(n,e,t)=>e in n?Htt(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,Ktt=(n,e)=>{for(var t in e||(e={}))Utt.call(e,t)&&GG(n,t,e[t]);if(qG)for(var t of qG(e))jtt.call(e,t)&&GG(n,t,e[t]);return n},qtt=(n,e)=>$tt(n,ztt(e)),YG=(n,e,t)=>new Promise((i,s)=>{var o=l=>{try{a(t.next(l))}catch(c){s(c)}},r=l=>{try{a(t.throw(l))}catch(c){s(c)}},a=l=>l.done?i(l.value):Promise.resolve(l.value).then(o,r);a((t=t.apply(n,e)).next())});const{name:Gtt,n:Ytt,classes:Ztt}=st("watermark"),Xtt={ref:"svgRef"},Qtt=["viewBox","width","height"],Jtt=["width","height"],eit=["href","xlink:href","x","y","width","height"];function tit(n,e){return q(),re("div",{class:B(n.n())},[xe(n.$slots,"default"),(q(),ei(Bd,{to:"body",disabled:!n.fullscreen},[me("div",{ref:"containerRef",class:B(n.classes(n.n("container"),[n.fullscreen,n.n("--fullscreen")])),style:Fe({backgroundImage:"url(".concat(n.watermarkUrl,")"),zIndex:n.zIndex})},[wi(me("div",Xtt,[(q(),re("svg",{xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 ".concat(n.width+n.gapX," ").concat(n.height+n.gapY),width:"".concat(n.width+n.gapX),height:"".concat(n.height+n.gapY),style:Fe({padding:"0 ".concat(n.gapX,"px ").concat(n.gapY,"px 0"),opacity:n.opacity})},[n.showContent()?(q(),re("foreignObject",{key:0,x:"0",y:"0",width:n.width,height:n.height},[me("div",{xmlns:"http://www.w3.org/1999/xhtml",style:Fe({transform:"translate(".concat(n.offsetX,"px, ").concat(n.offsetY,"px) rotate(").concat(n.rotate,"deg)"),transformOrigin:"center"})},[xe(n.$slots,"content",{},()=>[me("span",{style:Fe(qtt(Ktt({},n.font),{fontSize:"".concat(n.font.fontSize,"px"),color:n.textColor}))},ut(n.content),5)])],4)],8,Jtt)):Qe("v-if",!0),!n.$slots.content&&n.image?(q(),re("image",{key:1,href:n.imageUrl,"xlink:href":n.imageUrl,x:n.offsetX,y:n.offsetY,width:n.width,height:n.height,style:Fe({transform:"rotate(".concat(n.rotate,"deg)"),transformOrigin:"center"})},null,12,eit)):Qe("v-if",!0)],12,Qtt))],512),[[hl,!1]])],6)],8,["disabled"]))],2)}const Ice=et({name:Gtt,props:Vtt,setup(n,{slots:e}){const t=se(""),i=se(""),s=se(""),o=se(null),r=se(null);ht(()=>[n.image,n.font,n.content,n.height,n.width,n.rotate,n.gapX,n.gapY,n.offsetX,n.offsetY,n.opacity],u,{deep:!0}),bd(u),Cd(d);function a(){return!!(e.content||n.content&&!n.image)}function l(){return YG(this,null,function*(){return new Promise(h=>{const f=document.createElement("canvas"),g=f.getContext("2d"),p=new Image;p.crossOrigin="anonymous",p.referrerPolicy="no-referrer",p.src=n.image,p.onload=()=>{f.width=p.width,f.height=p.height,g.drawImage(p,0,0),h(f.toDataURL())}})})}function c(h){const f=new Blob([h],{type:"image/svg+xml"});return URL.createObjectURL(f)}function d(){t.value&&URL.revokeObjectURL(t.value)}function u(){return YG(this,null,function*(){s.value=Um(r.value).color,n.image&&(i.value=yield l()),yield Fn(),d(),t.value=c(o.value.innerHTML)})}return{svgRef:o,containerRef:r,watermarkUrl:t,imageUrl:i,textColor:s,n:Ytt,classes:Ztt,showContent:a,resize:u}}});Ice.render=tit;var Tce=Ice;lt(Tce);var bB=Tce;const iit="2.18.2";function nit(n){e3.install&&n.use(e3),t3.install&&n.use(t3),s3.install&&n.use(s3),o3.install&&n.use(o3),r3.install&&n.use(r3),uT.install&&n.use(uT),a3.install&&n.use(a3),l3.install&&n.use(l3),c3.install&&n.use(c3),d3.install&&n.use(d3),ia.install&&n.use(ia),u3.install&&n.use(u3),h3.install&&n.use(h3),hT.install&&n.use(hT),Uy.install&&n.use(Uy),f3.install&&n.use(f3),fT.install&&n.use(fT),g3.install&&n.use(g3),p3.install&&n.use(p3),m3.install&&n.use(m3),Ea.install&&n.use(Ea),C3.install&&n.use(C3),D3.install&&n.use(D3),I3.install&&n.use(I3),T3.install&&n.use(T3),x3.install&&n.use(x3),bT.install&&n.use(bT),M3.install&&n.use(M3),R3.install&&n.use(R3),Gy.install&&n.use(Gy),P3.install&&n.use(P3),O3.install&&n.use(O3),na.install&&n.use(na),Fa.install&&n.use(Fa),ml.install&&n.use(ml),Wn.install&&n.use(Wn),F3.install&&n.use(F3),Xy.install&&n.use(Xy),B3.install&&n.use(B3),W3.install&&n.use(W3),wT.install&&n.use(wT),zy.install&&n.use(zy),V3.install&&n.use(V3),H3.install&&n.use(H3),l0.install&&n.use(l0),$3.install&&n.use($3),J5.install&&n.use(J5),f0.install&&n.use(f0),z3.install&&n.use(z3),U3.install&&n.use(U3),j3.install&&n.use(j3),K3.install&&n.use(K3),q3.install&&n.use(q3),G3.install&&n.use(G3),Y3.install&&n.use(Y3),gg.install&&n.use(gg),Z3.install&&n.use(Z3),X3.install&&n.use(X3),Q3.install&&n.use(Q3),J3.install&&n.use(J3),eB.install&&n.use(eB),tB.install&&n.use(tB),Ns.install&&n.use(Ns),iB.install&&n.use(iB),nB.install&&n.use(nB),sB.install&&n.use(sB),oB.install&&n.use(oB),aB.install&&n.use(aB),lB.install&&n.use(lB),cB.install&&n.use(cB),dB.install&&n.use(dB),Qy.install&&n.use(Qy),yT.install&&n.use(yT),Yy.install&&n.use(Yy),Zy.install&&n.use(Zy),uB.install&&n.use(uB),hB.install&&n.use(hB),fB.install&&n.use(fB),gB.install&&n.use(gB),pB.install&&n.use(pB),mB.install&&n.use(mB),ST.install&&n.use(ST),_B.install&&n.use(_B),CT.install&&n.use(CT),vB.install&&n.use(vB),bB.install&&n.use(bB)}const xce={version:iit,install:nit,ActionSheet:e3,AppBar:t3,Avatar:s3,AvatarGroup:o3,BackTop:r3,Badge:uT,BottomNavigation:a3,BottomNavigationItem:l3,Breadcrumb:c3,Breadcrumbs:d3,Button:ia,ButtonGroup:u3,Card:h3,Cell:hT,Checkbox:Uy,CheckboxGroup:f3,Chip:fT,Col:g3,Collapse:p3,CollapseItem:m3,Context:Ea,Countdown:C3,Counter:D3,DatePicker:I3,Dialog:T3,Divider:x3,Drag:bT,Ellipsis:M3,Fab:R3,FieldDecorator:Gy,FloatingPanel:P3,Form:O3,FormDetails:na,Hover:Fa,HoverOverlay:ml,Icon:Wn,Image:F3,ImagePreview:Xy,IndexAnchor:B3,IndexBar:W3,Input:wT,Lazy:zy,Link:V3,List:H3,Loading:l0,LoadingBar:$3,Locale:J5,Menu:f0,MenuOption:z3,MenuSelect:U3,Option:j3,Overlay:K3,Pagination:q3,Paper:G3,Picker:Y3,Popup:gg,Progress:Z3,PullRefresh:X3,Radio:Q3,RadioGroup:J3,Rate:eB,Result:tB,Ripple:Ns,Row:iB,Select:nB,Skeleton:sB,Slider:oB,Snackbar:aB,Space:lB,Step:cB,Steps:dB,Sticky:Qy,StyleProvider:yT,Swipe:Yy,SwipeItem:Zy,Switch:uB,Tab:hB,TabItem:fB,Table:gB,Tabs:pB,TabsItems:mB,Themes:ST,TimePicker:_B,Tooltip:CT,Uploader:vB,Watermark:bB},sit=["ImagePreview","Snackbar","Picker","ActionSheet","Dialog","Locale","StyleProvider","LoadingBar"],oit=["Ripple","Lazy","Hover","version","install"];function rit(){const n=Object.entries(xce),e=qD(n.reduce((i,[s,o])=>oit.includes(s)?i:o.hasOwnProperty("Component")?(i[s]=o.Component,i):(i[s]=o,i),{})),t=qD(n.reduce((i,[s,o])=>(sit.includes(s)&&(i[s]=o),i),{}));return{components:e,injects:t}}const ait={class:"container"},lit=et({__name:"App",setup(n){var a;const{components:e,injects:t}=rit(),i={name:"Page",code:"function setup() {\n const model = ref({})\n\n onMounted(() => {\n const modelString = localStorage.getItem('cache')\n\n if (modelString) {\n model.value = JSON.parse(modelString)\n }\n })\n\n function handleSave() {\n const modelString = JSON.stringify(model.value)\n Snackbar('Save to localStorage success!')\n localStorage.setItem('cache', modelString)\n }\n\n function handleReset() {\n Snackbar('Reset and clear localStorage success!')\n localStorage.removeItem('cache')\n }\n\n return { model, handleSave, handleReset }\n}",css:".var-schema-renderer {\n padding: 16px;\n}",children:[{name:"Form",props:{onSubmit:{type:"Expression",value:"handleSave"},onReset:{type:"Expression",value:"handleReset"}},children:[{name:"Space",props:{direction:"column",size:[16,0]},children:[{name:"Input",props:{"v-model":{type:"Expression",value:"model.value.name"},placeholder:"Please input name"}},{name:"Input",props:{"v-model":{type:"Expression",value:"model.value.age"},placeholder:"Please input age"}},{name:"Select",props:{"v-model":{type:"Expression",value:"model.value.gender"},placeholder:"Please select gender"},children:[{name:"Option",props:{label:"Male"}},{name:"Option",props:{label:"Female"}}]},{name:"Space",props:{justify:"flex-end",style:{"margin-top":"10px"}},children:[{name:"Button",props:{nativeType:"reset"},children:[{name:"Text",value:"RESET"}]},{name:"Button",props:{type:"primary",nativeType:"submit"},children:[{name:"Text",value:"SAVE"}]}]}]}]}]},s=qD(localStorage.getItem("schema")?JSON.parse(localStorage.getItem("schema")):i),o=se((a=localStorage.getItem("active-tab"))!=null?a:"JSON");ht(()=>o.value,l=>{localStorage.setItem("active-tab",l)},{immediate:!0});function r(l){localStorage.setItem("schema",JSON.stringify(l))}return(l,c)=>(q(),re("div",ait,[Oe(ud(eVe),{theme:"vs-dark",components:ud(e),injects:ud(t),"active-tab":o.value,"onUpdate:activeTab":c[0]||(c[0]=d=>o.value=d),schema:s.value,"onUpdate:schema":c[1]||(c[1]=d=>s.value=d),onChange:r},null,8,["components","injects","active-tab","schema"])]))}});const cit=(n,e)=>{const t=n.__vccOpts||n;for(const[i,s]of e)t[i]=s;return t},dit=cit(lit,[["__scopeId","data-v-c405dff0"]]);const Nce=typeof window<"u",uit=Nce&&"ontouchstart"in window;let c2=!1,tm;const Ace=n=>n==="mousedown",hit=n=>n==="mousemove",CB=n=>n==="mouseup",fit=n=>Ace(n)||!tm||tm&&!tm.dispatchEvent;function git(n,e,t){const{clientX:i,clientY:s,screenX:o,screenY:r,pageX:a,pageY:l}=t;this.identifier=e,this.target=n,this.clientX=i,this.clientY=s,this.screenX=o,this.screenY=r,this.pageX=a,this.pageY=l}function pit(n){const e=Z6();return e.push(new git(tm,1,n)),e}function Z6(){const n=[];return n.item=function(e){return this[e]||null},n}function ZG(n){const{type:e}=n;return CB(e)?Z6():pit(n)}function mit(n,e){const{altKey:t,ctrlKey:i,metaKey:s,shiftKey:o}=e,r=new Event(n,{bubbles:!0,cancelable:!0});r.altKey=t,r.ctrlKey=i,r.metaKey=s,r.shiftKey=o,r.touches=ZG(e),r.targetTouches=ZG(e),r.changedTouches=Z6(),tm.dispatchEvent(r)}function d2(n,e){const{type:t,target:i}=n;c2=Ace(t)?!0:CB(t)?!1:c2,!(hit(t)&&!c2)&&(fit(t)&&(tm=i),mit(e,n),CB(t)&&(tm=null))}function _it(){window.addEventListener("mousedown",n=>d2(n,"touchstart"),!0),window.addEventListener("mousemove",n=>d2(n,"touchmove"),!0),window.addEventListener("mouseup",n=>d2(n,"touchend"),!0)}Nce&&!uit&&_it();yT(ST.dark);XY(dit).use(xce).mount("#app");export{PS as m,cie as t}; + */var Dv=9e15,Og=1e9,w3="0123456789abcdef",pT="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",mT="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",y3={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-Dv,maxE:Dv,crypto:!1},xre,Nu,si=!0,uA="[DecimalError] ",mg=uA+"Invalid argument: ",Nre=uA+"Precision limit exceeded",Are=uA+"crypto unavailable",Mre="[object Decimal]",nr=Math.floor,Gs=Math.pow,wUe=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,yUe=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,SUe=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,Rre=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,cc=1e7,Zt=7,LUe=9007199254740991,kUe=pT.length-1,S3=mT.length-1,Ge={toStringTag:Mre};Ge.absoluteValue=Ge.abs=function(){var n=new this.constructor(this);return n.s<0&&(n.s=1),Ot(n)};Ge.ceil=function(){return Ot(new this.constructor(this),this.e+1,2)};Ge.clampedTo=Ge.clamp=function(n,e){var t,i=this,s=i.constructor;if(n=new s(n),e=new s(e),!n.s||!e.s)return new s(NaN);if(n.gt(e))throw Error(mg+e);return t=i.cmp(n),t<0?n:i.cmp(e)>0?e:new s(i)};Ge.comparedTo=Ge.cmp=function(n){var e,t,i,s,o=this,r=o.d,a=(n=new o.constructor(n)).d,l=o.s,c=n.s;if(!r||!a)return!l||!c?NaN:l!==c?l:r===a?0:!r^l<0?1:-1;if(!r[0]||!a[0])return r[0]?l:a[0]?-c:0;if(l!==c)return l;if(o.e!==n.e)return o.e>n.e^l<0?1:-1;for(i=r.length,s=a.length,e=0,t=ia[e]^l<0?1:-1;return i===s?0:i>s^l<0?1:-1};Ge.cosine=Ge.cos=function(){var n,e,t=this,i=t.constructor;return t.d?t.d[0]?(n=i.precision,e=i.rounding,i.precision=n+Math.max(t.e,t.sd())+Zt,i.rounding=1,t=DUe(i,Wre(i,t)),i.precision=n,i.rounding=e,Ot(Nu==2||Nu==3?t.neg():t,n,e,!0)):new i(1):new i(NaN)};Ge.cubeRoot=Ge.cbrt=function(){var n,e,t,i,s,o,r,a,l,c,d=this,u=d.constructor;if(!d.isFinite()||d.isZero())return new u(d);for(si=!1,o=d.s*Gs(d.s*d,1/3),!o||Math.abs(o)==1/0?(t=Ao(d.d),n=d.e,(o=(n-t.length+1)%3)&&(t+=o==1||o==-2?"0":"00"),o=Gs(t,1/3),n=nr((n+1)/3)-(n%3==(n<0?-1:2)),o==1/0?t="5e"+n:(t=o.toExponential(),t=t.slice(0,t.indexOf("e")+1)+n),i=new u(t),i.s=d.s):i=new u(o.toString()),r=(n=u.precision)+3;;)if(a=i,l=a.times(a).times(a),c=l.plus(d),i=En(c.plus(d).times(a),c.plus(l),r+2,1),Ao(a.d).slice(0,r)===(t=Ao(i.d)).slice(0,r))if(t=t.slice(r-3,r+1),t=="9999"||!s&&t=="4999"){if(!s&&(Ot(a,n+1,0),a.times(a).times(a).eq(d))){i=a;break}r+=4,s=1}else{(!+t||!+t.slice(1)&&t.charAt(0)=="5")&&(Ot(i,n+1,1),e=!i.times(i).times(i).eq(d));break}return si=!0,Ot(i,n,u.rounding,e)};Ge.decimalPlaces=Ge.dp=function(){var n,e=this.d,t=NaN;if(e){if(n=e.length-1,t=(n-nr(this.e/Zt))*Zt,n=e[n],n)for(;n%10==0;n/=10)t--;t<0&&(t=0)}return t};Ge.dividedBy=Ge.div=function(n){return En(this,new this.constructor(n))};Ge.dividedToIntegerBy=Ge.divToInt=function(n){var e=this,t=e.constructor;return Ot(En(e,new t(n),0,1,1),t.precision,t.rounding)};Ge.equals=Ge.eq=function(n){return this.cmp(n)===0};Ge.floor=function(){return Ot(new this.constructor(this),this.e+1,3)};Ge.greaterThan=Ge.gt=function(n){return this.cmp(n)>0};Ge.greaterThanOrEqualTo=Ge.gte=function(n){var e=this.cmp(n);return e==1||e===0};Ge.hyperbolicCosine=Ge.cosh=function(){var n,e,t,i,s,o=this,r=o.constructor,a=new r(1);if(!o.isFinite())return new r(o.s?1/0:NaN);if(o.isZero())return a;t=r.precision,i=r.rounding,r.precision=t+Math.max(o.e,o.sd())+4,r.rounding=1,s=o.d.length,s<32?(n=Math.ceil(s/3),e=(1/fA(4,n)).toString()):(n=16,e="2.3283064365386962890625e-10"),o=c0(r,1,o.times(e),new r(1),!0);for(var l,c=n,d=new r(8);c--;)l=o.times(o),o=a.minus(l.times(d.minus(l.times(d))));return Ot(o,r.precision=t,r.rounding=i,!0)};Ge.hyperbolicSine=Ge.sinh=function(){var n,e,t,i,s=this,o=s.constructor;if(!s.isFinite()||s.isZero())return new o(s);if(e=o.precision,t=o.rounding,o.precision=e+Math.max(s.e,s.sd())+4,o.rounding=1,i=s.d.length,i<3)s=c0(o,2,s,s,!0);else{n=1.4*Math.sqrt(i),n=n>16?16:n|0,s=s.times(1/fA(5,n)),s=c0(o,2,s,s,!0);for(var r,a=new o(5),l=new o(16),c=new o(20);n--;)r=s.times(s),s=s.times(a.plus(r.times(l.times(r).plus(c))))}return o.precision=e,o.rounding=t,Ot(s,e,t,!0)};Ge.hyperbolicTangent=Ge.tanh=function(){var n,e,t=this,i=t.constructor;return t.isFinite()?t.isZero()?new i(t):(n=i.precision,e=i.rounding,i.precision=n+7,i.rounding=1,En(t.sinh(),t.cosh(),i.precision=n,i.rounding=e)):new i(t.s)};Ge.inverseCosine=Ge.acos=function(){var n,e=this,t=e.constructor,i=e.abs().cmp(1),s=t.precision,o=t.rounding;return i!==-1?i===0?e.isNeg()?tc(t,s,o):new t(0):new t(NaN):e.isZero()?tc(t,s+4,o).times(.5):(t.precision=s+6,t.rounding=1,e=e.asin(),n=tc(t,s+4,o).times(.5),t.precision=s,t.rounding=o,n.minus(e))};Ge.inverseHyperbolicCosine=Ge.acosh=function(){var n,e,t=this,i=t.constructor;return t.lte(1)?new i(t.eq(1)?0:NaN):t.isFinite()?(n=i.precision,e=i.rounding,i.precision=n+Math.max(Math.abs(t.e),t.sd())+4,i.rounding=1,si=!1,t=t.times(t).minus(1).sqrt().plus(t),si=!0,i.precision=n,i.rounding=e,t.ln()):new i(t)};Ge.inverseHyperbolicSine=Ge.asinh=function(){var n,e,t=this,i=t.constructor;return!t.isFinite()||t.isZero()?new i(t):(n=i.precision,e=i.rounding,i.precision=n+2*Math.max(Math.abs(t.e),t.sd())+6,i.rounding=1,si=!1,t=t.times(t).plus(1).sqrt().plus(t),si=!0,i.precision=n,i.rounding=e,t.ln())};Ge.inverseHyperbolicTangent=Ge.atanh=function(){var n,e,t,i,s=this,o=s.constructor;return s.isFinite()?s.e>=0?new o(s.abs().eq(1)?s.s/0:s.isZero()?s:NaN):(n=o.precision,e=o.rounding,i=s.sd(),Math.max(i,n)<2*-s.e-1?Ot(new o(s),n,e,!0):(o.precision=t=i-s.e,s=En(s.plus(1),new o(1).minus(s),t+n,1),o.precision=n+4,o.rounding=1,s=s.ln(),o.precision=n,o.rounding=e,s.times(.5))):new o(NaN)};Ge.inverseSine=Ge.asin=function(){var n,e,t,i,s=this,o=s.constructor;return s.isZero()?new o(s):(e=s.abs().cmp(1),t=o.precision,i=o.rounding,e!==-1?e===0?(n=tc(o,t+4,i).times(.5),n.s=s.s,n):new o(NaN):(o.precision=t+6,o.rounding=1,s=s.div(new o(1).minus(s.times(s)).sqrt().plus(1)).atan(),o.precision=t,o.rounding=i,s.times(2)))};Ge.inverseTangent=Ge.atan=function(){var n,e,t,i,s,o,r,a,l,c=this,d=c.constructor,u=d.precision,h=d.rounding;if(c.isFinite()){if(c.isZero())return new d(c);if(c.abs().eq(1)&&u+4<=S3)return r=tc(d,u+4,h).times(.25),r.s=c.s,r}else{if(!c.s)return new d(NaN);if(u+4<=S3)return r=tc(d,u+4,h).times(.5),r.s=c.s,r}for(d.precision=a=u+10,d.rounding=1,t=Math.min(28,a/Zt+2|0),n=t;n;--n)c=c.div(c.times(c).plus(1).sqrt().plus(1));for(si=!1,e=Math.ceil(a/Zt),i=1,l=c.times(c),r=new d(c),s=c;n!==-1;)if(s=s.times(l),o=r.minus(s.div(i+=2)),s=s.times(l),r=o.plus(s.div(i+=2)),r.d[e]!==void 0)for(n=e;r.d[n]===o.d[n]&&n--;);return t&&(r=r.times(2<this.d.length-2};Ge.isNaN=function(){return!this.s};Ge.isNegative=Ge.isNeg=function(){return this.s<0};Ge.isPositive=Ge.isPos=function(){return this.s>0};Ge.isZero=function(){return!!this.d&&this.d[0]===0};Ge.lessThan=Ge.lt=function(n){return this.cmp(n)<0};Ge.lessThanOrEqualTo=Ge.lte=function(n){return this.cmp(n)<1};Ge.logarithm=Ge.log=function(n){var e,t,i,s,o,r,a,l,c=this,d=c.constructor,u=d.precision,h=d.rounding,f=5;if(n==null)n=new d(10),e=!0;else{if(n=new d(n),t=n.d,n.s<0||!t||!t[0]||n.eq(1))return new d(NaN);e=n.eq(10)}if(t=c.d,c.s<0||!t||!t[0]||c.eq(1))return new d(t&&!t[0]?-1/0:c.s!=1?NaN:t?0:1/0);if(e)if(t.length>1)o=!0;else{for(s=t[0];s%10===0;)s/=10;o=s!==1}if(si=!1,a=u+f,r=ff(c,a),i=e?_T(d,a+10):ff(n,a),l=En(r,i,a,1),jy(l.d,s=u,h))do if(a+=10,r=ff(c,a),i=e?_T(d,a+10):ff(n,a),l=En(r,i,a,1),!o){+Ao(l.d).slice(s+1,s+15)+1==1e14&&(l=Ot(l,u+1,0));break}while(jy(l.d,s+=10,h));return si=!0,Ot(l,u,h)};Ge.minus=Ge.sub=function(n){var e,t,i,s,o,r,a,l,c,d,u,h,f=this,g=f.constructor;if(n=new g(n),!f.d||!n.d)return!f.s||!n.s?n=new g(NaN):f.d?n.s=-n.s:n=new g(n.d||f.s!==n.s?f:NaN),n;if(f.s!=n.s)return n.s=-n.s,f.plus(n);if(c=f.d,h=n.d,a=g.precision,l=g.rounding,!c[0]||!h[0]){if(h[0])n.s=-n.s;else if(c[0])n=new g(f);else return new g(l===3?-0:0);return si?Ot(n,a,l):n}if(t=nr(n.e/Zt),d=nr(f.e/Zt),c=c.slice(),o=d-t,o){for(u=o<0,u?(e=c,o=-o,r=h.length):(e=h,t=d,r=c.length),i=Math.max(Math.ceil(a/Zt),r)+2,o>i&&(o=i,e.length=1),e.reverse(),i=o;i--;)e.push(0);e.reverse()}else{for(i=c.length,r=h.length,u=i0;--i)c[r++]=0;for(i=h.length;i>o;){if(c[--i]r?o+1:r+1,s>r&&(s=r,t.length=1),t.reverse();s--;)t.push(0);t.reverse()}for(r=c.length,s=d.length,r-s<0&&(s=r,t=d,d=c,c=t),e=0;s;)e=(c[--s]=c[s]+d[s]+e)/cc|0,c[s]%=cc;for(e&&(c.unshift(e),++i),r=c.length;c[--r]==0;)c.pop();return n.d=c,n.e=hA(c,i),si?Ot(n,a,l):n};Ge.precision=Ge.sd=function(n){var e,t=this;if(n!==void 0&&n!==!!n&&n!==1&&n!==0)throw Error(mg+n);return t.d?(e=Pre(t.d),n&&t.e+1>e&&(e=t.e+1)):e=NaN,e};Ge.round=function(){var n=this,e=n.constructor;return Ot(new e(n),n.e+1,e.rounding)};Ge.sine=Ge.sin=function(){var n,e,t=this,i=t.constructor;return t.isFinite()?t.isZero()?new i(t):(n=i.precision,e=i.rounding,i.precision=n+Math.max(t.e,t.sd())+Zt,i.rounding=1,t=IUe(i,Wre(i,t)),i.precision=n,i.rounding=e,Ot(Nu>2?t.neg():t,n,e,!0)):new i(NaN)};Ge.squareRoot=Ge.sqrt=function(){var n,e,t,i,s,o,r=this,a=r.d,l=r.e,c=r.s,d=r.constructor;if(c!==1||!a||!a[0])return new d(!c||c<0&&(!a||a[0])?NaN:a?r:1/0);for(si=!1,c=Math.sqrt(+r),c==0||c==1/0?(e=Ao(a),(e.length+l)%2==0&&(e+="0"),c=Math.sqrt(e),l=nr((l+1)/2)-(l<0||l%2),c==1/0?e="5e"+l:(e=c.toExponential(),e=e.slice(0,e.indexOf("e")+1)+l),i=new d(e)):i=new d(c.toString()),t=(l=d.precision)+3;;)if(o=i,i=o.plus(En(r,o,t+2,1)).times(.5),Ao(o.d).slice(0,t)===(e=Ao(i.d)).slice(0,t))if(e=e.slice(t-3,t+1),e=="9999"||!s&&e=="4999"){if(!s&&(Ot(o,l+1,0),o.times(o).eq(r))){i=o;break}t+=4,s=1}else{(!+e||!+e.slice(1)&&e.charAt(0)=="5")&&(Ot(i,l+1,1),n=!i.times(i).eq(r));break}return si=!0,Ot(i,l,d.rounding,n)};Ge.tangent=Ge.tan=function(){var n,e,t=this,i=t.constructor;return t.isFinite()?t.isZero()?new i(t):(n=i.precision,e=i.rounding,i.precision=n+10,i.rounding=1,t=t.sin(),t.s=1,t=En(t,new i(1).minus(t.times(t)).sqrt(),n+10,0),i.precision=n,i.rounding=e,Ot(Nu==2||Nu==4?t.neg():t,n,e,!0)):new i(NaN)};Ge.times=Ge.mul=function(n){var e,t,i,s,o,r,a,l,c,d=this,u=d.constructor,h=d.d,f=(n=new u(n)).d;if(n.s*=d.s,!h||!h[0]||!f||!f[0])return new u(!n.s||h&&!h[0]&&!f||f&&!f[0]&&!h?NaN:!h||!f?n.s/0:n.s*0);for(t=nr(d.e/Zt)+nr(n.e/Zt),l=h.length,c=f.length,l=0;){for(e=0,s=l+i;s>i;)a=o[s]+f[i]*h[s-i-1]+e,o[s--]=a%cc|0,e=a/cc|0;o[s]=(o[s]+e)%cc|0}for(;!o[--r];)o.pop();return e?++t:o.shift(),n.d=o,n.e=hA(o,t),si?Ot(n,u.precision,u.rounding):n};Ge.toBinary=function(n,e){return M6(this,2,n,e)};Ge.toDecimalPlaces=Ge.toDP=function(n,e){var t=this,i=t.constructor;return t=new i(t),n===void 0?t:(sa(n,0,Og),e===void 0?e=i.rounding:sa(e,0,8),Ot(t,n+t.e+1,e))};Ge.toExponential=function(n,e){var t,i=this,s=i.constructor;return n===void 0?t=Od(i,!0):(sa(n,0,Og),e===void 0?e=s.rounding:sa(e,0,8),i=Ot(new s(i),n+1,e),t=Od(i,!0,n+1)),i.isNeg()&&!i.isZero()?"-"+t:t};Ge.toFixed=function(n,e){var t,i,s=this,o=s.constructor;return n===void 0?t=Od(s):(sa(n,0,Og),e===void 0?e=o.rounding:sa(e,0,8),i=Ot(new o(s),n+s.e+1,e),t=Od(i,!1,n+i.e+1)),s.isNeg()&&!s.isZero()?"-"+t:t};Ge.toFraction=function(n){var e,t,i,s,o,r,a,l,c,d,u,h,f=this,g=f.d,p=f.constructor;if(!g)return new p(f);if(c=t=new p(1),i=l=new p(0),e=new p(i),o=e.e=Pre(g)-f.e-1,r=o%Zt,e.d[0]=Gs(10,r<0?Zt+r:r),n==null)n=o>0?e:c;else{if(a=new p(n),!a.isInt()||a.lt(c))throw Error(mg+a);n=a.gt(e)?o>0?e:c:a}for(si=!1,a=new p(Ao(g)),d=p.precision,p.precision=o=g.length*Zt*2;u=En(a,e,0,1,1),s=t.plus(u.times(i)),s.cmp(n)!=1;)t=i,i=s,s=c,c=l.plus(u.times(s)),l=s,s=e,e=a.minus(u.times(s)),a=s;return s=En(n.minus(t),i,0,1,1),l=l.plus(s.times(c)),t=t.plus(s.times(i)),l.s=c.s=f.s,h=En(c,i,o,1).minus(f).abs().cmp(En(l,t,o,1).minus(f).abs())<1?[c,i]:[l,t],p.precision=d,si=!0,h};Ge.toHexadecimal=Ge.toHex=function(n,e){return M6(this,16,n,e)};Ge.toNearest=function(n,e){var t=this,i=t.constructor;if(t=new i(t),n==null){if(!t.d)return t;n=new i(1),e=i.rounding}else{if(n=new i(n),e===void 0?e=i.rounding:sa(e,0,8),!t.d)return n.s?t:n;if(!n.d)return n.s&&(n.s=t.s),n}return n.d[0]?(si=!1,t=En(t,n,0,e,1).times(n),si=!0,Ot(t)):(n.s=t.s,t=n),t};Ge.toNumber=function(){return+this};Ge.toOctal=function(n,e){return M6(this,8,n,e)};Ge.toPower=Ge.pow=function(n){var e,t,i,s,o,r,a=this,l=a.constructor,c=+(n=new l(n));if(!a.d||!n.d||!a.d[0]||!n.d[0])return new l(Gs(+a,c));if(a=new l(a),a.eq(1))return a;if(i=l.precision,o=l.rounding,n.eq(1))return Ot(a,i,o);if(e=nr(n.e/Zt),e>=n.d.length-1&&(t=c<0?-c:c)<=LUe)return s=Ore(l,a,t,i),n.s<0?new l(1).div(s):Ot(s,i,o);if(r=a.s,r<0){if(el.maxE+1||e0?r/0:0):(si=!1,l.rounding=a.s=1,t=Math.min(12,(e+"").length),s=L3(n.times(ff(a,i+t)),i),s.d&&(s=Ot(s,i+5,1),jy(s.d,i,o)&&(e=i+10,s=Ot(L3(n.times(ff(a,e+t)),e),e+5,1),+Ao(s.d).slice(i+1,i+15)+1==1e14&&(s=Ot(s,i+1,0)))),s.s=r,si=!0,l.rounding=o,Ot(s,i,o))};Ge.toPrecision=function(n,e){var t,i=this,s=i.constructor;return n===void 0?t=Od(i,i.e<=s.toExpNeg||i.e>=s.toExpPos):(sa(n,1,Og),e===void 0?e=s.rounding:sa(e,0,8),i=Ot(new s(i),n,e),t=Od(i,n<=i.e||i.e<=s.toExpNeg,n)),i.isNeg()&&!i.isZero()?"-"+t:t};Ge.toSignificantDigits=Ge.toSD=function(n,e){var t=this,i=t.constructor;return n===void 0?(n=i.precision,e=i.rounding):(sa(n,1,Og),e===void 0?e=i.rounding:sa(e,0,8)),Ot(new i(t),n,e)};Ge.toString=function(){var n=this,e=n.constructor,t=Od(n,n.e<=e.toExpNeg||n.e>=e.toExpPos);return n.isNeg()&&!n.isZero()?"-"+t:t};Ge.truncated=Ge.trunc=function(){return Ot(new this.constructor(this),this.e+1,1)};Ge.valueOf=Ge.toJSON=function(){var n=this,e=n.constructor,t=Od(n,n.e<=e.toExpNeg||n.e>=e.toExpPos);return n.isNeg()?"-"+t:t};function Ao(n){var e,t,i,s=n.length-1,o="",r=n[0];if(s>0){for(o+=r,e=1;et)throw Error(mg+n)}function jy(n,e,t,i){var s,o,r,a;for(o=n[0];o>=10;o/=10)--e;return--e<0?(e+=Zt,s=0):(s=Math.ceil((e+1)/Zt),e%=Zt),o=Gs(10,Zt-e),a=n[s]%o|0,i==null?e<3?(e==0?a=a/100|0:e==1&&(a=a/10|0),r=t<4&&a==99999||t>3&&a==49999||a==5e4||a==0):r=(t<4&&a+1==o||t>3&&a+1==o/2)&&(n[s+1]/o/100|0)==Gs(10,e-2)-1||(a==o/2||a==0)&&(n[s+1]/o/100|0)==0:e<4?(e==0?a=a/1e3|0:e==1?a=a/100|0:e==2&&(a=a/10|0),r=(i||t<4)&&a==9999||!i&&t>3&&a==4999):r=((i||t<4)&&a+1==o||!i&&t>3&&a+1==o/2)&&(n[s+1]/o/1e3|0)==Gs(10,e-3)-1,r}function VD(n,e,t){for(var i,s=[0],o,r=0,a=n.length;rt-1&&(s[i+1]===void 0&&(s[i+1]=0),s[i+1]+=s[i]/t|0,s[i]%=t)}return s.reverse()}function DUe(n,e){var t,i,s;if(e.isZero())return e;i=e.d.length,i<32?(t=Math.ceil(i/3),s=(1/fA(4,t)).toString()):(t=16,s="2.3283064365386962890625e-10"),n.precision+=t,e=c0(n,1,e.times(s),new n(1));for(var o=t;o--;){var r=e.times(e);e=r.times(r).minus(r).times(8).plus(1)}return n.precision-=t,e}var En=function(){function n(i,s,o){var r,a=0,l=i.length;for(i=i.slice();l--;)r=i[l]*s+a,i[l]=r%o|0,a=r/o|0;return a&&i.unshift(a),i}function e(i,s,o,r){var a,l;if(o!=r)l=o>r?1:-1;else for(a=l=0;as[a]?1:-1;break}return l}function t(i,s,o,r){for(var a=0;o--;)i[o]-=a,a=i[o]1;)i.shift()}return function(i,s,o,r,a,l){var c,d,u,h,f,g,p,_,v,b,C,w,y,L,S,k,D,x,A,T,P=i.constructor,W=i.s==s.s?1:-1,$=i.d,X=s.d;if(!$||!$[0]||!X||!X[0])return new P(!i.s||!s.s||($?X&&$[0]==X[0]:!X)?NaN:$&&$[0]==0||!X?W*0:W/0);for(l?(f=1,d=i.e-s.e):(l=cc,f=Zt,d=nr(i.e/f)-nr(s.e/f)),A=X.length,D=$.length,v=new P(W),b=v.d=[],u=0;X[u]==($[u]||0);u++);if(X[u]>($[u]||0)&&d--,o==null?(L=o=P.precision,r=P.rounding):a?L=o+(i.e-s.e)+1:L=o,L<0)b.push(1),g=!0;else{if(L=L/f+2|0,u=0,A==1){for(h=0,X=X[0],L++;(u1&&(X=n(X,h,l),$=n($,h,l),A=X.length,D=$.length),k=A,C=$.slice(0,A),w=C.length;w=l/2&&++x;do h=0,c=e(X,C,A,w),c<0?(y=C[0],A!=w&&(y=y*l+(C[1]||0)),h=y/x|0,h>1?(h>=l&&(h=l-1),p=n(X,h,l),_=p.length,w=C.length,c=e(p,C,_,w),c==1&&(h--,t(p,A<_?T:X,_,l))):(h==0&&(c=h=1),p=X.slice()),_=p.length,_=10;h/=10)u++;v.e=u+d*f-1,Ot(v,a?o+v.e+1:o,r,g)}return v}}();function Ot(n,e,t,i){var s,o,r,a,l,c,d,u,h,f=n.constructor;e:if(e!=null){if(u=n.d,!u)return n;for(s=1,a=u[0];a>=10;a/=10)s++;if(o=e-s,o<0)o+=Zt,r=e,d=u[h=0],l=d/Gs(10,s-r-1)%10|0;else if(h=Math.ceil((o+1)/Zt),a=u.length,h>=a)if(i){for(;a++<=h;)u.push(0);d=l=0,s=1,o%=Zt,r=o-Zt+1}else break e;else{for(d=a=u[h],s=1;a>=10;a/=10)s++;o%=Zt,r=o-Zt+s,l=r<0?0:d/Gs(10,s-r-1)%10|0}if(i=i||e<0||u[h+1]!==void 0||(r<0?d:d%Gs(10,s-r-1)),c=t<4?(l||i)&&(t==0||t==(n.s<0?3:2)):l>5||l==5&&(t==4||i||t==6&&(o>0?r>0?d/Gs(10,s-r):0:u[h-1])%10&1||t==(n.s<0?8:7)),e<1||!u[0])return u.length=0,c?(e-=n.e+1,u[0]=Gs(10,(Zt-e%Zt)%Zt),n.e=-e||0):u[0]=n.e=0,n;if(o==0?(u.length=h,a=1,h--):(u.length=h+1,a=Gs(10,Zt-o),u[h]=r>0?(d/Gs(10,s-r)%Gs(10,r)|0)*a:0),c)for(;;)if(h==0){for(o=1,r=u[0];r>=10;r/=10)o++;for(r=u[0]+=a,a=1;r>=10;r/=10)a++;o!=a&&(n.e++,u[0]==cc&&(u[0]=1));break}else{if(u[h]+=a,u[h]!=cc)break;u[h--]=0,a=1}for(o=u.length;u[--o]===0;)u.pop()}return si&&(n.e>f.maxE?(n.d=null,n.e=NaN):n.e0?o=o.charAt(0)+"."+o.slice(1)+Wh(i):r>1&&(o=o.charAt(0)+"."+o.slice(1)),o=o+(n.e<0?"e":"e+")+n.e):s<0?(o="0."+Wh(-s-1)+o,t&&(i=t-r)>0&&(o+=Wh(i))):s>=r?(o+=Wh(s+1-r),t&&(i=t-s-1)>0&&(o=o+"."+Wh(i))):((i=s+1)0&&(s+1===r&&(o+="."),o+=Wh(i))),o}function hA(n,e){var t=n[0];for(e*=Zt;t>=10;t/=10)e++;return e}function _T(n,e,t){if(e>kUe)throw si=!0,t&&(n.precision=t),Error(Nre);return Ot(new n(pT),e,1,!0)}function tc(n,e,t){if(e>S3)throw Error(Nre);return Ot(new n(mT),e,t,!0)}function Pre(n){var e=n.length-1,t=e*Zt+1;if(e=n[e],e){for(;e%10==0;e/=10)t--;for(e=n[0];e>=10;e/=10)t++}return t}function Wh(n){for(var e="";n--;)e+="0";return e}function Ore(n,e,t,i){var s,o=new n(1),r=Math.ceil(i/Zt+4);for(si=!1;;){if(t%2&&(o=o.times(e),Dq(o.d,r)&&(s=!0)),t=nr(t/2),t===0){t=o.d.length-1,s&&o.d[t]===0&&++o.d[t];break}e=e.times(e),Dq(e.d,r)}return si=!0,o}function kq(n){return n.d[n.d.length-1]&1}function Fre(n,e,t){for(var i,s=new n(e[0]),o=0;++o17)return new h(n.d?n.d[0]?n.s<0?0:1/0:1:n.s?n.s<0?0:n:0/0);for(e==null?(si=!1,l=g):l=e,a=new h(.03125);n.e>-2;)n=n.times(a),u+=5;for(i=Math.log(Gs(2,u))/Math.LN10*2+5|0,l+=i,t=o=r=new h(1),h.precision=l;;){if(o=Ot(o.times(n),l,1),t=t.times(++d),a=r.plus(En(o,t,l,1)),Ao(a.d).slice(0,l)===Ao(r.d).slice(0,l)){for(s=u;s--;)r=Ot(r.times(r),l,1);if(e==null)if(c<3&&jy(r.d,l-i,f,c))h.precision=l+=10,t=o=a=new h(1),d=0,c++;else return Ot(r,h.precision=g,f,si=!0);else return h.precision=g,r}r=a}}function ff(n,e){var t,i,s,o,r,a,l,c,d,u,h,f=1,g=10,p=n,_=p.d,v=p.constructor,b=v.rounding,C=v.precision;if(p.s<0||!_||!_[0]||!p.e&&_[0]==1&&_.length==1)return new v(_&&!_[0]?-1/0:p.s!=1?NaN:_?0:p);if(e==null?(si=!1,d=C):d=e,v.precision=d+=g,t=Ao(_),i=t.charAt(0),Math.abs(o=p.e)<15e14){for(;i<7&&i!=1||i==1&&t.charAt(1)>3;)p=p.times(n),t=Ao(p.d),i=t.charAt(0),f++;o=p.e,i>1?(p=new v("0."+t),o++):p=new v(i+"."+t.slice(1))}else return c=_T(v,d+2,C).times(o+""),p=ff(new v(i+"."+t.slice(1)),d-g).plus(c),v.precision=C,e==null?Ot(p,C,b,si=!0):p;for(u=p,l=r=p=En(p.minus(1),p.plus(1),d,1),h=Ot(p.times(p),d,1),s=3;;){if(r=Ot(r.times(h),d,1),c=l.plus(En(r,new v(s),d,1)),Ao(c.d).slice(0,d)===Ao(l.d).slice(0,d))if(l=l.times(2),o!==0&&(l=l.plus(_T(v,d+2,C).times(o+""))),l=En(l,new v(f),d,1),e==null)if(jy(l.d,d-g,b,a))v.precision=d+=g,c=r=p=En(u.minus(1),u.plus(1),d,1),h=Ot(p.times(p),d,1),s=a=1;else return Ot(l,v.precision=C,b,si=!0);else return v.precision=C,l;l=c,s+=2}}function Bre(n){return String(n.s*n.s/0)}function k3(n,e){var t,i,s;for((t=e.indexOf("."))>-1&&(e=e.replace(".","")),(i=e.search(/e/i))>0?(t<0&&(t=i),t+=+e.slice(i+1),e=e.substring(0,i)):t<0&&(t=e.length),i=0;e.charCodeAt(i)===48;i++);for(s=e.length;e.charCodeAt(s-1)===48;--s);if(e=e.slice(i,s),e){if(s-=i,n.e=t=t-i-1,n.d=[],i=(t+1)%Zt,t<0&&(i+=Zt),in.constructor.maxE?(n.d=null,n.e=NaN):n.e-1){if(e=e.replace(/(\d)_(?=\d)/g,"$1"),Rre.test(e))return k3(n,e)}else if(e==="Infinity"||e==="NaN")return+e||(n.s=NaN),n.e=NaN,n.d=null,n;if(yUe.test(e))t=16,e=e.toLowerCase();else if(wUe.test(e))t=2;else if(SUe.test(e))t=8;else throw Error(mg+e);for(o=e.search(/p/i),o>0?(l=+e.slice(o+1),e=e.substring(2,o)):e=e.slice(2),o=e.indexOf("."),r=o>=0,i=n.constructor,r&&(e=e.replace(".",""),a=e.length,o=a-o,s=Ore(i,new i(t),o,o*2)),c=VD(e,t,cc),d=c.length-1,o=d;c[o]===0;--o)c.pop();return o<0?new i(n.s*0):(n.e=hA(c,d),n.d=c,si=!1,r&&(n=En(n,s,a*4)),l&&(n=n.times(Math.abs(l)<54?Gs(2,l):gf.pow(2,l))),si=!0,n)}function IUe(n,e){var t,i=e.d.length;if(i<3)return e.isZero()?e:c0(n,2,e,e);t=1.4*Math.sqrt(i),t=t>16?16:t|0,e=e.times(1/fA(5,t)),e=c0(n,2,e,e);for(var s,o=new n(5),r=new n(16),a=new n(20);t--;)s=e.times(e),e=e.times(o.plus(s.times(r.times(s).minus(a))));return e}function c0(n,e,t,i,s){var o,r,a,l,c=n.precision,d=Math.ceil(c/Zt);for(si=!1,l=t.times(t),a=new n(i);;){if(r=En(a.times(l),new n(e++*e++),c,1),a=s?i.plus(r):i.minus(r),i=En(r.times(l),new n(e++*e++),c,1),r=a.plus(i),r.d[d]!==void 0){for(o=d;r.d[o]===a.d[o]&&o--;);if(o==-1)break}o=a,a=i,i=r,r=o}return si=!0,r.d.length=d+1,r}function fA(n,e){for(var t=n;--e;)t*=n;return t}function Wre(n,e){var t,i=e.s<0,s=tc(n,n.precision,1),o=s.times(.5);if(e=e.abs(),e.lte(o))return Nu=i?4:1,e;if(t=e.divToInt(s),t.isZero())Nu=i?3:2;else{if(e=e.minus(t.times(s)),e.lte(o))return Nu=kq(t)?i?2:3:i?4:1,e;Nu=kq(t)?i?1:4:i?3:2}return e.minus(s).abs()}function M6(n,e,t,i){var s,o,r,a,l,c,d,u,h,f=n.constructor,g=t!==void 0;if(g?(sa(t,1,Og),i===void 0?i=f.rounding:sa(i,0,8)):(t=f.precision,i=f.rounding),!n.isFinite())d=Bre(n);else{for(d=Od(n),r=d.indexOf("."),g?(s=2,e==16?t=t*4-3:e==8&&(t=t*3-2)):s=e,r>=0&&(d=d.replace(".",""),h=new f(1),h.e=d.length-r,h.d=VD(Od(h),10,s),h.e=h.d.length),u=VD(d,10,s),o=l=u.length;u[--l]==0;)u.pop();if(!u[0])d=g?"0p+0":"0";else{if(r<0?o--:(n=new f(n),n.d=u,n.e=o,n=En(n,h,t,i,0,s),u=n.d,o=n.e,c=xre),r=u[t],a=s/2,c=c||u[t+1]!==void 0,c=i<4?(r!==void 0||c)&&(i===0||i===(n.s<0?3:2)):r>a||r===a&&(i===4||c||i===6&&u[t-1]&1||i===(n.s<0?8:7)),u.length=t,c)for(;++u[--t]>s-1;)u[t]=0,t||(++o,u.unshift(1));for(l=u.length;!u[l-1];--l);for(r=0,d="";r1)if(e==16||e==8){for(r=e==16?4:3,--l;l%r;l++)d+="0";for(u=VD(d,s,e),l=u.length;!u[l-1];--l);for(r=1,d="1.";rl)for(o-=l;o--;)d+="0";else oe)return n.length=e,!0}function TUe(n){return new this(n).abs()}function xUe(n){return new this(n).acos()}function NUe(n){return new this(n).acosh()}function AUe(n,e){return new this(n).plus(e)}function MUe(n){return new this(n).asin()}function RUe(n){return new this(n).asinh()}function PUe(n){return new this(n).atan()}function OUe(n){return new this(n).atanh()}function FUe(n,e){n=new this(n),e=new this(e);var t,i=this.precision,s=this.rounding,o=i+4;return!n.s||!e.s?t=new this(NaN):!n.d&&!e.d?(t=tc(this,o,1).times(e.s>0?.25:.75),t.s=n.s):!e.d||n.isZero()?(t=e.s<0?tc(this,i,s):new this(0),t.s=n.s):!n.d||e.isZero()?(t=tc(this,o,1).times(.5),t.s=n.s):e.s<0?(this.precision=o,this.rounding=1,t=this.atan(En(n,e,o,1)),e=tc(this,o,1),this.precision=i,this.rounding=s,t=n.s<0?t.minus(e):t.plus(e)):t=this.atan(En(n,e,o,1)),t}function BUe(n){return new this(n).cbrt()}function WUe(n){return Ot(n=new this(n),n.e+1,2)}function VUe(n,e,t){return new this(n).clamp(e,t)}function HUe(n){if(!n||typeof n!="object")throw Error(uA+"Object expected");var e,t,i,s=n.defaults===!0,o=["precision",1,Og,"rounding",0,8,"toExpNeg",-Dv,0,"toExpPos",0,Dv,"maxE",0,Dv,"minE",-Dv,0,"modulo",0,9];for(e=0;e=o[e+1]&&i<=o[e+2])this[t]=i;else throw Error(mg+t+": "+i);if(t="crypto",s&&(this[t]=y3[t]),(i=n[t])!==void 0)if(i===!0||i===!1||i===0||i===1)if(i)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))this[t]=!0;else throw Error(Are);else this[t]=!1;else throw Error(mg+t+": "+i);return this}function $Ue(n){return new this(n).cos()}function zUe(n){return new this(n).cosh()}function Vre(n){var e,t,i;function s(o){var r,a,l,c=this;if(!(c instanceof s))return new s(o);if(c.constructor=s,Eq(o)){c.s=o.s,si?!o.d||o.e>s.maxE?(c.e=NaN,c.d=null):o.e=10;a/=10)r++;si?r>s.maxE?(c.e=NaN,c.d=null):r=429e7?e[o]=crypto.getRandomValues(new Uint32Array(1))[0]:a[o++]=s%1e7;else if(crypto.randomBytes){for(e=crypto.randomBytes(i*=4);o=214e7?crypto.randomBytes(4).copy(e,o):(a.push(s%1e7),o+=4);o=i/4}else throw Error(Are);else for(;o=10;s/=10)i++;i["onInputChange","onLazyChange","onIncrement","onDecrement"]},rules:Array,onBeforeChange:Se(),onChange:Se(),onIncrement:Se(),onDecrement:Se(),"onUpdate:modelValue":Se()},Iq=100,Tq=600,{name:pje,n:mje,classes:_je}=st("counter"),vje=["inputmode","readonly","disabled"];function bje(n,e){const t=gt("var-icon"),i=gt("var-button"),s=gt("var-form-details");return q(),re("div",{class:B(n.classes(n.n(),n.n("$--box")))},[me("div",fn({class:n.classes(n.n("controller"),n.formatElevation(n.elevation,2),[n.disabled||n.formDisabled,n.n("--disabled")],[n.errorMessage,n.n("--error")]),style:{background:n.color}},n.$attrs),[Oe(i,{class:B(n.classes(n.n("decrement-button"),[!n.decrementButton,n.n("--hidden")],[n.disabled||n.formDisabled,n.n("--not-allowed")])),style:Fe({width:n.toSizeUnit(n.buttonSize),height:n.toSizeUnit(n.buttonSize)}),round:"","var-counter-cover":"",ripple:n.ripple&&n.decrementButton&&!n.disabled&&!n.formDisabled&&!n.readonly&&!n.formReadonly&&!n.disableDecrement&&!n.isMin,onClick:n.decrement,onTouchstart:n.pressDecrement,onTouchend:n.releaseDecrement,onTouchcancel:n.releaseDecrement},{default:Lt(()=>[Oe(t,{name:"minus"})]),_:1},8,["class","style","ripple","onClick","onTouchstart","onTouchend","onTouchcancel"]),wi(me("input",{class:B(n.classes(n.n("input"),[n.disabled||n.formDisabled,n.n("--not-allowed")])),style:Fe({width:n.toSizeUnit(n.inputWidth),fontSize:n.toSizeUnit(n.inputTextSize)}),inputmode:n.toNumber(n.decimalLength)===0?"numeric":"decimal",readonly:n.readonly||n.formReadonly,disabled:n.disabled||n.formDisabled||n.disableInput,"onUpdate:modelValue":e[0]||(e[0]=o=>n.inputValue=o),onChange:e[1]||(e[1]=(...o)=>n.handleChange&&n.handleChange(...o))},null,46,vje),[[che,n.inputValue]]),Oe(i,{class:B(n.classes(n.n("increment-button"),[!n.incrementButton,n.n("--hidden")],[n.disabled||n.formDisabled,n.n("--not-allowed")])),style:Fe({width:n.toSizeUnit(n.buttonSize),height:n.toSizeUnit(n.buttonSize)}),round:"","var-counter-cover":"",ripple:n.ripple&&n.incrementButton&&!n.disabled&&!n.formDisabled&&!n.readonly&&!n.formReadonly&&!n.disableIncrement&&!n.isMax,onClick:n.increment,onTouchstart:n.pressIncrement,onTouchend:n.releaseIncrement,onTouchcancel:n.releaseIncrement},{default:Lt(()=>[Oe(t,{name:"plus"})]),_:1},8,["class","style","ripple","onClick","onTouchstart","onTouchend","onTouchcancel"])],16),Oe(s,{"error-message":n.errorMessage},null,8,["error-message"])],2)}const Hre=et({name:pje,components:{VarButton:ia,VarIcon:Wn,VarFormDetails:na},directives:{Ripple:Ns},inheritAttrs:!1,props:gje,setup(n){const e=se(""),{bindForm:t,form:i}=kl(),{errorMessage:s,validateWithTrigger:o,validate:r,resetValidation:a}=Ll(),{readonly:l,disabled:c}=i!=null?i:{},d=ve(()=>{const{max:X,modelValue:J}=n;return X!=null&&Ie(J)>=Ie(X)}),u=ve(()=>{const{min:X,modelValue:J}=n;return X!=null&&Ie(J)<=Ie(X)});let h,f,g,p;oe(t,{reset:C,validate:v,resetValidation:a}),ht(()=>n.modelValue,X=>{W(w(String(X))),oe(n.onChange,Ie(X))}),W(w(String(n.modelValue)));function v(){return r(n.rules,n.modelValue)}function b(X){Fn(()=>{const{validateTrigger:J,rules:Q,modelValue:le}=n;o(J,X,Q,le)})}function C(){const{min:X}=n;oe(n["onUpdate:modelValue"],X!=null?Ie(X):0),a()}function w(X){const{decimalLength:J,max:Q,min:le}=n;let de=Ie(X);return Q!=null&&de>Ie(Q)&&(de=Ie(Q)),le!=null&&de{P()},Tq))}function D(){const{press:X,lazyChange:J}=n;!X||J||(g=window.setTimeout(()=>{T()},Tq))}function x(){f&&clearTimeout(f),p&&clearTimeout(p)}function A(){h&&clearTimeout(h),g&&clearTimeout(g)}function T(){h=window.setTimeout(()=>{S(),T()},Iq)}function P(){f=window.setTimeout(()=>{L(),P()},Iq)}function W(X){e.value=X;const J=Ie(X);oe(n["onUpdate:modelValue"],J)}function $(X){W(w(String(X))),b("onLazyChange")}return{inputValue:e,errorMessage:s,formDisabled:c,formReadonly:l,isMax:d,isMin:u,n:mje,classes:_je,formatElevation:or,validate:v,reset:C,resetValidation:a,handleChange:y,decrement:L,increment:S,pressDecrement:k,pressIncrement:D,releaseDecrement:x,releaseIncrement:A,toSizeUnit:ri,toNumber:Ie}}});Hre.render=bje;var $re=Hre;lt($re);var D3=$re,zre=60,Ure=zre*60,jre=Ure*24,Cje=jre*7,d0=1e3,e2=zre*d0,xq=Ure*d0,wje=jre*d0,yje=Cje*d0,R6="millisecond",Ev="second",Iv="minute",Tv="hour",Vh="day",HD="week",$l="month",Kre="quarter",Hh="year",xv="date",Sje="YYYY-MM-DDTHH:mm:ssZ",Nq="Invalid Date",Lje=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,kje=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g;const Dje={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(e){var t=["th","st","nd","rd"],i=e%100;return"["+e+(t[(i-20)%10]||t[i]||t[0])+"]"}};var E3=function(e,t,i){var s=String(e);return!s||s.length>=t?e:""+Array(t+1-s.length).join(i)+e},Eje=function(e){var t=-e.utcOffset(),i=Math.abs(t),s=Math.floor(i/60),o=i%60;return(t<=0?"+":"-")+E3(s,2,"0")+":"+E3(o,2,"0")},Ije=function n(e,t){if(e.date()1)return n(r[0])}else{var a=e.name;em[a]=e,s=a}return!i&&s&&(GC=s),s||!i&&GC},wt=function(e,t){if(P6(e))return e.clone();var i=typeof t=="object"?t:{};return i.date=e,i.args=arguments,new gA(i)},Mje=function(e,t){return wt(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})},mn=Aje;mn.l=vT;mn.i=P6;mn.w=Mje;var Rje=function(e){var t=e.date,i=e.utc;if(t===null)return new Date(NaN);if(mn.u(t))return new Date;if(t instanceof Date)return new Date(t);if(typeof t=="string"&&!/Z$/i.test(t)){var s=t.match(Lje);if(s){var o=s[2]-1||0,r=(s[7]||"0").substring(0,3);return i?new Date(Date.UTC(s[1],o,s[3]||1,s[4]||0,s[5]||0,s[6]||0,r)):new Date(s[1],o,s[3]||1,s[4]||0,s[5]||0,s[6]||0,r)}}return new Date(t)},gA=function(){function n(t){this.$L=vT(t.locale,null,!0),this.parse(t),this.$x=this.$x||t.x||{},this[qre]=!0}var e=n.prototype;return e.parse=function(i){this.$d=Rje(i),this.init()},e.init=function(){var i=this.$d;this.$y=i.getFullYear(),this.$M=i.getMonth(),this.$D=i.getDate(),this.$W=i.getDay(),this.$H=i.getHours(),this.$m=i.getMinutes(),this.$s=i.getSeconds(),this.$ms=i.getMilliseconds()},e.$utils=function(){return mn},e.isValid=function(){return this.$d.toString()!==Nq},e.isSame=function(i,s){var o=wt(i);return this.startOf(s)<=o&&o<=this.endOf(s)},e.isAfter=function(i,s){return wt(i)n.checkDate("prev"))},{default:Lt(()=>[Oe(t,{name:"chevron-left"})]),_:1},8,["disabled"]),me("div",{class:B(n.n("value")),onClick:e[1]||(e[1]=s=>n.$emit("check-panel"))},[Oe(On,{name:"var-date-picker".concat(n.reverse?"-reverse":"","-translatex")},{default:Lt(()=>[(q(),re("div",{key:n.showDate},ut(n.showDate),1))]),_:1},8,["name"])],2),Oe(i,{round:"",text:"",style:{filter:"opacity(0.54)"},disabled:n.disabled.right,onClick:e[2]||(e[2]=s=>n.checkDate("next"))},{default:Lt(()=>[Oe(t,{name:"chevron-right"})]),_:1},8,["disabled"])],2)}const Xre=et({name:"PanelHeader",components:{VarButton:ia,VarIcon:Wn},props:{date:{type:Object,required:!0},type:{type:String,default:"date"},disabled:{type:Object,required:!0}},emits:["check-panel","check-date"],setup(n,{emit:e}){const t=se(!1),i=se(0),s=ve(()=>{var r;const{date:a,type:l}=n,{previewMonth:c,previewYear:d}=a;if(l==="month")return Ie(d)+i.value;const u=(r=Xs.value.datePickerMonthDict)==null?void 0:r[c.index].name;return Xs.value.lang==="zh-CN"?"".concat(d," ").concat(u):"".concat(u," ").concat(d)}),o=r=>{r==="prev"&&n.disabled.left||r==="next"&&n.disabled.right||(e("check-date",r),t.value=r==="prev",i.value+=r==="prev"?-1:1)};return ht(()=>n.date,()=>{i.value=0}),{n:Oje,reverse:t,showDate:s,checkDate:o}}});Xre.render=Fje;var Qre=Xre,Bje=Object.defineProperty,Aq=Object.getOwnPropertySymbols,Wje=Object.prototype.hasOwnProperty,Vje=Object.prototype.propertyIsEnumerable,Mq=(n,e,t)=>e in n?Bje(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,Hje=(n,e)=>{for(var t in e||(e={}))Wje.call(e,t)&&Mq(n,t,e[t]);if(Aq)for(var t of Aq(e))Vje.call(e,t)&&Mq(n,t,e[t]);return n};wt.extend(Yre);wt.extend(Zre);const{n:Ok,classes:$je}=st("month-picker"),{n:Fk}=st("date-picker");function zje(n,e){const t=gt("panel-header"),i=gt("var-button");return q(),re("div",{class:B(n.n())},[me("div",{class:B(n.n("content"))},[Oe(t,{ref:"headerEl",type:"month",date:n.preview,disabled:n.panelBtnDisabled,onCheckPanel:n.clickYear,onCheckDate:n.checkDate},null,8,["date","disabled","onCheckPanel","onCheckDate"]),Oe(On,{name:"".concat(n.nDate()).concat(n.reverse?"-reverse":"","-translatex")},{default:Lt(()=>[(q(),re("ul",{key:n.panelKey},[(q(!0),re(li,null,ss(n.MONTH_LIST,s=>(q(),re("li",{key:s.index},[Oe(i,fn({type:"primary","var-month-picker-cover":"",ripple:!1,elevation:n.componentProps.buttonElevation},Hje({},n.buttonProps(s.index)),{onClick:o=>n.chooseMonth(s,o)}),{default:Lt(()=>[Mi(ut(n.getMonthAbbr(s.index)),1)]),_:2},1040,["elevation","onClick"])]))),128))]))]),_:1},8,["name"])],2)],2)}const Jre=et({name:"MonthPickerPanel",components:{VarButton:ia,PanelHeader:Qre},props:{choose:{type:Object,required:!0},preview:{type:Object,required:!0},current:{type:String,required:!0},clickYear:{type:Function,required:!0},componentProps:{type:Object,required:!0}},emits:["check-preview","choose-month"],setup(n,{emit:e}){const[t,i]=n.current.split("-"),s=se(!1),o=se(0),r=se(null),a=Cn({left:!1,right:!1}),l=ve(()=>n.choose.chooseYear===n.preview.previewYear),c=ve(()=>n.preview.previewYear===t),d=v=>{var b,C;return(C=(b=Xs.value.datePickerMonthDict)==null?void 0:b[v].abbr)!=null?C:""},u=v=>{const{preview:{previewYear:b},componentProps:{min:C,max:w}}=n;let y=!0,L=!0;const S="".concat(b,"-").concat(v);return w&&(y=wt(S).isSameOrBefore(wt(w),"month")),C&&(L=wt(S).isSameOrAfter(wt(C),"month")),y&&L},h=v=>{const{choose:{chooseMonths:b,chooseDays:C,chooseRangeMonth:w},componentProps:{type:y,range:L}}=n;if(L){if(!w.length)return!1;const S=wt(v).isSameOrBefore(wt(w[1]),"month"),k=wt(v).isSameOrAfter(wt(w[0]),"month");return S&&k}return y==="month"?b.includes(v):C.some(S=>S.includes(v))},f=v=>{const{choose:{chooseMonth:b},preview:{previewYear:C},componentProps:{allowedDates:w,color:y,multiple:L,range:S}}=n,k="".concat(C,"-").concat(v),D=()=>S||L?h(k):(b==null?void 0:b.index)===v&&l.value,A=(()=>u(v)?w?!w(k):!1:!0)(),T=()=>A?!0:S||L?!h(k):!l.value||(b==null?void 0:b.index)!==v,P=()=>c.value&&i===v&&n.componentProps.showCurrent?(S||L||l.value)&&A?!0:S||L?!h(k):l.value?(b==null?void 0:b.index)!==i:!0:!1,W=()=>A?"":P()?y!=null?y:"":D()?"":"".concat(Fk(),"-color-cover"),$=W().startsWith(Fk());return{outline:P(),text:T(),color:T()?"":y,textColor:$?"":W(),["".concat(Fk(),"-color-cover")]:$,class:$je(Ok("button"),[A,Ok("button--disabled")]),disabled:A}},g=(v,b)=>{b.currentTarget.classList.contains(Ok("button--disabled"))||e("choose-month",v)},p=v=>{s.value=v==="prev",o.value+=v==="prev"?-1:1,e("check-preview","year",v)},_=v=>{r.value.checkDate(v)};return ht(()=>n.preview.previewYear,v=>{const{componentProps:{min:b,max:C}}=n;C&&(a.right=!wt("".concat(Ie(v)+1)).isSameOrBefore(wt(C),"year")),b&&(a.left=!wt("".concat(Ie(v)-1)).isSameOrAfter(wt(b),"year"))},{immediate:!0}),{n:Ok,nDate:Fk,pack:Xs,MONTH_LIST:$D,headerEl:r,reverse:s,panelKey:o,panelBtnDisabled:a,forwardRef:_,buttonProps:f,getMonthAbbr:d,chooseMonth:g,checkDate:p}}});Jre.render=zje;var Uje=Jre;const{n:Rq,classes:jje}=st("year-picker"),Kje=["onClick"];function qje(n,e){return q(),re("ul",{ref:"panel",class:B(n.n())},[(q(!0),re(li,null,ss(n.yearList,t=>(q(),re("li",{key:t,class:B(n.classes(n.n("item"),[t===n.toNumber(n.preview),n.n("item--active")])),style:Fe({color:t===n.toNumber(n.preview)?n.componentProps.color:""}),onClick:i=>n.chooseYear(t)},ut(t),15,Kje))),128))],2)}const eae=et({name:"YearPickerPanel",props:{preview:{type:String},componentProps:{type:Object,required:!0}},emits:["choose-year"],setup(n,{emit:e}){const t=se(),i=ve(()=>{const o=[],{preview:r,componentProps:{max:a,min:l}}=n;if(!r)return o;let c=[Ie(r)+100,Ie(r)-100];if(a){const d=wt(a).format("YYYY-MM-D"),u=Ie(d.split("-")[0]);if(uc[1]&&(c=[u,c[1]]),u<=c[1])return[u]}if(l){const d=wt(l).format("YYYY-MM-D"),u=Ie(d.split("-")[0]);if(uc[1]&&(c=[c[0],u]),u>=c[0])return[u]}for(let d=c[0];d>=c[1];d--)o.push(d);return o}),s=o=>{e("choose-year",o)};return Vo(()=>{const o=t.value.querySelector(".".concat(Rq("item--active")));o==null||o.scrollIntoView({block:"center"})}),{n:Rq,classes:jje,panel:t,yearList:i,chooseYear:s,toNumber:Ie}}});eae.render=qje;var Gje=eae,Yje=Object.defineProperty,Pq=Object.getOwnPropertySymbols,Zje=Object.prototype.hasOwnProperty,Xje=Object.prototype.propertyIsEnumerable,Oq=(n,e,t)=>e in n?Yje(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,Qje=(n,e)=>{for(var t in e||(e={}))Zje.call(e,t)&&Oq(n,t,e[t]);if(Pq)for(var t of Pq(e))Xje.call(e,t)&&Oq(n,t,e[t]);return n};wt.extend(Yre);wt.extend(Zre);const{n:H_,classes:Jje}=st("day-picker"),{n:Bk}=st("date-picker");function eKe(n,e){const t=gt("panel-header"),i=gt("var-button");return q(),re("div",{class:B(n.n())},[me("div",{class:B(n.n("content"))},[Oe(t,{ref:"headerEl",type:"day",date:n.preview,disabled:n.panelBtnDisabled,onCheckPanel:n.clickMonth,onCheckDate:n.checkDate},null,8,["date","disabled","onCheckPanel","onCheckDate"]),Oe(On,{name:"".concat(n.nDate()).concat(n.reverse?"-reverse":"","-translatex")},{default:Lt(()=>[(q(),re("div",{key:n.panelKey},[me("ul",{class:B(n.n("head"))},[(q(!0),re(li,null,ss(n.sortWeekList,s=>(q(),re("li",{key:s.index},ut(n.getDayAbbr(s.index)),1))),128))],2),me("ul",{class:B(n.n("body"))},[(q(!0),re(li,null,ss(n.days,(s,o)=>(q(),re("li",{key:o},[Oe(i,fn({type:"primary","var-day-picker-cover":"",round:"",ripple:!1,elevation:n.componentProps.buttonElevation},Qje({},n.buttonProps(s)),{onClick:r=>n.chooseDay(s,r)}),{default:Lt(()=>[Mi(ut(n.filterDay(s)),1)]),_:2},1040,["elevation","onClick"])]))),128))],2)]))]),_:1},8,["name"])],2)],2)}const tae=et({name:"DayPickerPanel",components:{VarButton:ia,PanelHeader:Qre},props:{choose:{type:Object,required:!0},preview:{type:Object,required:!0},current:{type:String,required:!0},clickMonth:{type:Function,required:!0},componentProps:{type:Object,required:!0}},emits:["check-preview","choose-day"],setup(n,{emit:e}){const[t,i,s]=n.current.split("-"),o=se([]),r=se(!1),a=se(0),l=se(null),c=Cn({left:!1,right:!1}),d=ve(()=>n.preview.previewYear===t&&n.preview.previewMonth.index===i),u=ve(()=>{var S;return n.choose.chooseYear===n.preview.previewYear&&((S=n.choose.chooseMonth)==null?void 0:S.index)===n.preview.previewMonth.index}),h=ve(()=>{const S=oC.findIndex(k=>k.index===n.componentProps.firstDayOfWeek);return S===-1||S===0?oC:oC.slice(S).concat(oC.slice(0,S))}),f=S=>{var k,D;return(D=(k=Xs.value.datePickerWeekDict)==null?void 0:k[S].abbr)!=null?D:""},g=S=>S>0?S:"",p=()=>{const{preview:{previewMonth:S,previewYear:k}}=n,D=wt("".concat(k,"-").concat(S.index)).daysInMonth(),x=wt("".concat(k,"-").concat(S.index,"-01")).day(),A=h.value.findIndex(T=>T.index==="".concat(x));o.value=[...Array(A).fill(-1),...Array.from(Array(D+1).keys())].filter(T=>T)},_=()=>{const{preview:{previewYear:S,previewMonth:k},componentProps:{max:D,min:x}}=n;if(D){const A="".concat(S,"-").concat(Ie(k.index)+1);c.right=!wt(A).isSameOrBefore(wt(D),"month")}if(x){const A="".concat(S,"-").concat(Ie(k.index)-1);c.left=!wt(A).isSameOrAfter(wt(x),"month")}},v=S=>{const{preview:{previewYear:k,previewMonth:D},componentProps:{min:x,max:A}}=n;let T=!0,P=!0;const W="".concat(k,"-").concat(D.index,"-").concat(S);return A&&(T=wt(W).isSameOrBefore(wt(A),"day")),x&&(P=wt(W).isSameOrAfter(wt(x),"day")),T&&P},b=S=>{const{choose:{chooseDays:k,chooseRangeDay:D},componentProps:{range:x}}=n;if(x){if(!D.length)return!1;const A=wt(S).isSameOrBefore(wt(D[1]),"day"),T=wt(S).isSameOrAfter(wt(D[0]),"day");return A&&T}return k.includes(S)},C=S=>{if(S<0)return{text:!0,outline:!1,textColor:"",class:H_("button"),disabled:!0};const{choose:{chooseDay:k},preview:{previewYear:D,previewMonth:x},componentProps:{allowedDates:A,color:T,multiple:P,range:W}}=n,$="".concat(D,"-").concat(x.index,"-").concat(S),X=()=>W||P?b($):Ie(k)===S&&u.value,Q=(()=>v(S)?A?!A($):!1:!0)(),le=()=>Q?!0:W||P?!b($):!u.value||Ie(k)!==S,de=()=>d.value&&Ie(s)===S&&n.componentProps.showCurrent?(W||P||u.value)&&Q?!0:W||P?!b($):u.value?k!==s:!0:!1,_e=()=>Q?"":de()?T!=null?T:"":X()?"":"".concat(Bk(),"-color-cover"),ie=_e().startsWith(Bk());return{text:le(),outline:de(),textColor:ie?"":_e(),["".concat(Bk(),"-color-cover")]:ie,class:Jje(H_("button"),H_("button--usable"),[Q,H_("button--disabled")]),disabled:Q}},w=S=>{r.value=S==="prev",a.value+=S==="prev"?-1:1,e("check-preview","month",S)},y=(S,k)=>{k.currentTarget.classList.contains(H_("button--disabled"))||e("choose-day",S)},L=S=>{l.value.checkDate(S)};return Vo(()=>{p(),_()}),ht(()=>n.preview,()=>{p(),_()}),{n:H_,nDate:Bk,days:o,reverse:r,headerEl:l,panelKey:a,sortWeekList:h,panelBtnDisabled:c,forwardRef:L,filterDay:g,getDayAbbr:f,checkDate:w,chooseDay:y,buttonProps:C}}});tae.render=eKe;var tKe=tae,iKe=(n,e,t)=>new Promise((i,s)=>{var o=l=>{try{a(t.next(l))}catch(c){s(c)}},r=l=>{try{a(t.throw(l))}catch(c){s(c)}},a=l=>l.done?i(l.value):Promise.resolve(l.value).then(o,r);a((t=t.apply(n,e)).next())});const{name:nKe,n:sKe,classes:oKe}=st("date-picker");function rKe(n,e){var t;const i=gt("year-picker-panel"),s=gt("month-picker-panel"),o=gt("day-picker-panel");return q(),re("div",{class:B(n.classes(n.n(),n.formatElevation(n.elevation,2)))},[me("div",{class:B(n.n("title")),style:Fe({background:n.titleColor||n.headerColor||n.color})},[me("div",{class:B(n.n("title-select"))},[me("div",{class:B(n.n("title-hint"))},ut((t=n.hint)!=null?t:n.pack.datePickerHint),3),me("div",{class:B(n.classes(n.n("title-year"),[n.isYearPanel,n.n("title-year--active")])),onClick:e[0]||(e[0]=r=>n.clickEl("year"))},[xe(n.$slots,"year",{year:n.chooseYear},()=>[Mi(ut(n.chooseYear),1)])],2)],2),me("div",{class:B(n.classes(n.n("title-date"),[!n.isYearPanel,n.n("title-date--active")],[n.range,n.n("title-date--range")])),onClick:e[1]||(e[1]=r=>n.clickEl("date"))},[Oe(On,{name:n.multiple?"":"".concat(n.n()).concat(n.reverse?"-reverse":"","-translatey")},{default:Lt(()=>{var r,a,l;return[n.type==="month"?(q(),re("div",{key:"".concat(n.chooseYear).concat((r=n.chooseMonth)==null?void 0:r.index)},[n.range?xe(n.$slots,"range",{key:0,choose:n.getChoose.chooseRangeMonth},()=>[Mi(ut(n.getMonthTitle),1)]):n.multiple?xe(n.$slots,"multiple",{key:1,choose:n.getChoose.chooseMonths},()=>[Mi(ut(n.getMonthTitle),1)]):xe(n.$slots,"month",{key:2,month:(a=n.chooseMonth)==null?void 0:a.index,year:n.chooseYear},()=>[Mi(ut(n.getMonthTitle),1)])])):(q(),re("div",{key:"".concat(n.chooseYear).concat((l=n.chooseMonth)==null?void 0:l.index).concat(n.chooseDay)},[n.range?xe(n.$slots,"range",{key:0,choose:n.formatRange},()=>[Mi(ut(n.getDateTitle),1)]):n.multiple?xe(n.$slots,"multiple",{key:1,choose:n.getChoose.chooseDays},()=>[Mi(ut(n.getDateTitle),1)]):xe(n.$slots,"date",pf(fn({key:2},n.slotProps)),()=>[Mi(ut(n.getDateTitle),1)])]))]}),_:3},8,["name"])],2)],6),me("div",{class:B(n.n("body")),onTouchstart:e[2]||(e[2]=(...r)=>n.handleTouchstart&&n.handleTouchstart(...r)),onTouchmove:e[3]||(e[3]=(...r)=>n.handleTouchmove&&n.handleTouchmove(...r)),onTouchend:e[4]||(e[4]=(...r)=>n.handleTouchend&&n.handleTouchend(...r))},[Oe(On,{name:"".concat(n.n(),"-panel-fade")},{default:Lt(()=>[n.getPanelType==="year"?(q(),ei(i,{key:0,"component-props":n.componentProps,preview:n.previewYear,onChooseYear:n.getChooseYear},null,8,["component-props","preview","onChooseYear"])):n.getPanelType==="month"?(q(),ei(s,{key:1,ref:"monthPanelEl",current:n.currentDate,choose:n.getChoose,preview:n.getPreview,"click-year":()=>n.clickEl("year"),"component-props":n.componentProps,onChooseMonth:n.getChooseMonth,onCheckPreview:n.checkPreview},null,8,["current","choose","preview","click-year","component-props","onChooseMonth","onCheckPreview"])):n.getPanelType==="date"?(q(),ei(o,{key:2,ref:"dayPanelEl",current:n.currentDate,choose:n.getChoose,preview:n.getPreview,"component-props":n.componentProps,"click-month":()=>n.clickEl("month"),onChooseDay:n.getChooseDay,onCheckPreview:n.checkPreview},null,8,["current","choose","preview","component-props","click-month","onChooseDay","onCheckPreview"])):Qe("v-if",!0)]),_:1},8,["name"])],34)],2)}const iae=et({name:nKe,components:{MonthPickerPanel:Uje,YearPickerPanel:Gje,DayPickerPanel:tKe},props:Pje,setup(n){const e=wt().format("YYYY-MM-D"),[t,i]=e.split("-"),s=$D.find(Ce=>Ce.index===i),o=se(!1),r=se(!1),a=se(!0),l=se(),c=se(),d=se(),u=se(s),h=se(t),f=se(!1),g=se([]),p=se([]),_=se([]),v=se([]),b=se(null),C=se(null),w=Cn({allowedDates:n.allowedDates,type:n.type,color:n.color,firstDayOfWeek:n.firstDayOfWeek,min:n.min,max:n.max,showCurrent:n.showCurrent,multiple:n.multiple,range:n.range,buttonElevation:n.buttonElevation}),y=ve(()=>({chooseMonth:l.value,chooseYear:c.value,chooseDay:d.value,chooseMonths:g.value,chooseDays:p.value,chooseRangeMonth:_.value,chooseRangeDay:v.value})),L=ve(()=>({previewMonth:u.value,previewYear:h.value})),S=ve(()=>{var Ce,Be;const{multiple:Ae,range:K}=n;if(K)return _.value.length?"".concat(_.value[0]," ~ ").concat(_.value[1]):"";let V="";return l.value&&(V=(Be=(Ce=Xs.value.datePickerMonthDict)==null?void 0:Ce[l.value.index].name)!=null?Be:""),Ae?"".concat(g.value.length).concat(Xs.value.datePickerSelected):V}),k=ve(()=>{var Ce,Be,Ae,K;const{multiple:V,range:G}=n;if(G){const Le=v.value.map(qe=>wt(qe).format("YYYY-MM-DD"));return Le.length?"".concat(Le[0]," ~ ").concat(Le[1]):""}if(V)return"".concat(p.value.length).concat(Xs.value.datePickerSelected);if(!c.value||!l.value||!d.value)return"";const N=wt("".concat(c.value,"-").concat(l.value.index,"-").concat(d.value)).day(),R=oC.find(Le=>Le.index==="".concat(N)),U=(Be=(Ce=Xs.value.datePickerWeekDict)==null?void 0:Ce[R.index].name)!=null?Be:"",H=(K=(Ae=Xs.value.datePickerMonthDict)==null?void 0:Ae[l.value.index].name)!=null?K:"",he=Bm(d.value,2,"0");return Xs.value.lang==="zh-CN"?"".concat(l.value.index,"-").concat(he," ").concat(U.slice(0,3)):"".concat(U.slice(0,3),", ").concat(H.slice(0,3)," ").concat(d.value)}),D=ve(()=>o.value?"year":n.type==="month"||r.value?"month":n.type==="date"?"date":""),x=ve(()=>!n.touchable||["","year"].includes(D.value)),A=ve(()=>{var Ce,Be,Ae,K;const V=wt("".concat(c.value,"-").concat((Ce=l.value)==null?void 0:Ce.index,"-").concat(d.value)).day(),G=d.value?Bm(d.value,2,"0"):"";return{week:"".concat(V),year:(Be=c.value)!=null?Be:"",month:(K=(Ae=l.value)==null?void 0:Ae.index)!=null?K:"",date:G}}),T=ve(()=>y.value.chooseRangeDay.map(Ce=>wt(Ce).format("YYYY-MM-DD"))),P=ve(()=>c.value===h.value),W=ve(()=>{var Ce;return((Ce=l.value)==null?void 0:Ce.index)===u.value.index});let $=0,X=0,J="",Q;ht(()=>n.modelValue,Ce=>{if(!(!je()||Z(Ce)||!Ce))if(n.range){if(!tn(Ce))return;a.value=Ce.length!==1,z(Ce,n.type)}else if(n.multiple){if(!tn(Ce))return;ae(Ce,n.type)}else we(Ce)},{immediate:!0}),ht(D,Ne);function le(Ce){Ce==="year"?o.value=!0:Ce==="month"?r.value=!0:(o.value=!1,r.value=!1)}function de(Ce){if(x.value)return;const{clientX:Be,clientY:Ae}=Ce.touches[0];$=Be,X=Ae}function _e(Ce,Be){return Ce>=Be&&Ce>20?"x":"y"}function ie(Ce){if(x.value)return;const{clientX:Be,clientY:Ae}=Ce.touches[0],K=Be-$,V=Ae-X;Q=_e(Math.abs(K),Math.abs(V)),J=K>0?"prev":"next"}function ne(){return iKe(this,null,function*(){if(x.value||Q!=="x")return;const Ce=D.value==="month"?b:C;yield Cr(),Ce.value.forwardRef(J),Ne()})}function Ye(Ce,Be){const Ae=Be==="month"?_:v;if(Ae.value=a.value?[Ce,Ce]:[Ae.value[0],Ce],a.value=!a.value,a.value){const V=wt(Ae.value[0]).isAfter(Ae.value[1])?[Ae.value[1],Ae.value[0]]:[...Ae.value];oe(n["onUpdate:modelValue"],V),oe(n.onChange,V)}}function pe(Ce,Be){const Ae=Be==="month"?g:p,K=Be==="month"?"YYYY-MM":"YYYY-MM-DD",V=Ae.value.map(N=>wt(N).format(K)),G=V.findIndex(N=>N===Ce);G===-1?V.push(Ce):V.splice(G,1),oe(n["onUpdate:modelValue"],V),oe(n.onChange,V)}function Ee(Ce,Be){return!c.value||!l.value?!1:P.value?Ce==="month"?Be.indexu.value.index:c.value>h.value}function ze(Ce){const{readonly:Be,range:Ae,multiple:K,onChange:V,"onUpdate:modelValue":G}=n;if(Ce<0||Be)return;f.value=Ee("day",Ce);const N="".concat(h.value,"-").concat(u.value.index,"-").concat(Ce),R=wt(N).format("YYYY-MM-DD");Ae?Ye(R,"day"):K?pe(R,"day"):(oe(G,R),oe(V,R))}function It(Ce){const{type:Be,readonly:Ae,range:K,multiple:V,onChange:G,onPreview:N,"onUpdate:modelValue":R}=n;if(f.value=Ee("month",Ce),Be==="month"&&!Ae){const U="".concat(h.value,"-").concat(Ce.index);K?Ye(U,"month"):V?pe(U,"month"):(oe(R,U),oe(G,U))}else u.value=Ce,oe(N,Ie(h.value),Ie(u.value.index));r.value=!1}function Ke(Ce){h.value="".concat(Ce),o.value=!1,r.value=!0,oe(n.onPreview,Ie(h.value),Ie(u.value.index))}function Xe(Ce,Be){const Ae=Be==="prev"?-1:1;if(Ce==="year")h.value="".concat(Ie(h.value)+Ae);else{let K=Ie(u.value.index)+Ae;K<1&&(h.value="".concat(Ie(h.value)-1),K=12),K>12&&(h.value="".concat(Ie(h.value)+1),K=1),u.value=$D.find(V=>Ie(V.index)===K)}oe(n.onPreview,Ie(h.value),Ie(u.value.index))}function je(){return(n.multiple||n.range)&&!tn(n.modelValue)?(console.error('[Varlet] DatePicker: type of prop "modelValue" should be an Array'),!1):!n.multiple&&!n.range&&tn(n.modelValue)?(console.error('[Varlet] DatePicker: type of prop "modelValue" should be a String'),!1):!0}function Z(Ce){return tn(Ce)?!1:Ce==="Invalid Date"?(console.error('[Varlet] DatePicker: "modelValue" is an Invalid Date'),!0):!1}function z(Ce,Be){const Ae=Be==="month"?_:v,K=Be==="month"?"YYYY-MM":"YYYY-MM-D",V=Ce.map(R=>wt(R).format(K)).slice(0,2);if(Ae.value.some(R=>Z(R)))return;Ae.value=V;const N=wt(Ae.value[0]).isAfter(Ae.value[1]);Ae.value.length===2&&N&&(Ae.value=[Ae.value[1],Ae.value[0]])}function ae(Ce,Be){const Ae=Be==="month"?g:p,K=Be==="month"?"YYYY-MM":"YYYY-MM-D",V=Array.from(new Set(Ce.map(G=>wt(G).format(K))));Ae.value=V.filter(G=>G!=="Invalid Date")}function we(Ce){const Be=wt(Ce).format("YYYY-MM-D");if(Z(Be))return;const[Ae,K,V]=Be.split("-"),G=$D.find(N=>N.index===K);l.value=G,c.value=Ae,d.value=V,u.value=G,h.value=Ae}function Ne(){X=0,$=0,J="",Q=void 0}return{monthPanelEl:b,dayPanelEl:C,reverse:f,currentDate:e,chooseMonth:l,chooseYear:c,chooseDay:d,previewYear:h,isYearPanel:o,isMonthPanel:r,getMonthTitle:S,getDateTitle:k,getPanelType:D,getChoose:y,getPreview:L,componentProps:w,slotProps:A,formatRange:T,pack:Xs,n:sKe,classes:oKe,clickEl:le,handleTouchstart:de,handleTouchmove:ie,handleTouchend:ne,getChooseDay:ze,getChooseMonth:It,getChooseYear:Ke,checkPreview:Xe,formatElevation:or}}});iae.render=rKe;var nae=iae;lt(nae);var I3=nae,aKe=Object.defineProperty,Fq=Object.getOwnPropertySymbols,lKe=Object.prototype.hasOwnProperty,cKe=Object.prototype.propertyIsEnumerable,Bq=(n,e,t)=>e in n?aKe(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,dKe=(n,e)=>{for(var t in e||(e={}))lKe.call(e,t)&&Bq(n,t,e[t]);if(Fq)for(var t of Fq(e))cKe.call(e,t)&&Bq(n,t,e[t]);return n};const uKe=dKe({show:Boolean,width:[Number,String],title:String,message:String,messageAlign:{type:String,default:"left"},confirmButton:{type:Boolean,default:!0},cancelButton:{type:Boolean,default:!0},confirmButtonText:String,cancelButtonText:String,confirmButtonTextColor:String,cancelButtonTextColor:String,confirmButtonColor:String,cancelButtonColor:String,dialogClass:String,dialogStyle:Object,onBeforeClose:Se(),onConfirm:Se(),onCancel:Se(),"onUpdate:show":Se()},yi(ZS,["overlay","overlayClass","overlayStyle","lockScroll","closeOnClickOverlay","teleport","onOpen","onClose","onOpened","onClosed","onClickOverlay","onRouteChange"]));var hKe=Object.defineProperty,Wq=Object.getOwnPropertySymbols,fKe=Object.prototype.hasOwnProperty,gKe=Object.prototype.propertyIsEnumerable,Vq=(n,e,t)=>e in n?hKe(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,pKe=(n,e)=>{for(var t in e||(e={}))fKe.call(e,t)&&Vq(n,t,e[t]);if(Wq)for(var t of Wq(e))gKe.call(e,t)&&Vq(n,t,e[t]);return n};const{name:mKe,n:_Ke,classes:vKe}=st("dialog");function bKe(n,e){const t=gt("var-button"),i=gt("var-popup");return q(),ei(i,{class:B(n.n("popup")),"var-dialog-cover":"",show:n.popupShow,overlay:n.overlay,"overlay-class":n.overlayClass,"overlay-style":n.overlayStyle,"lock-scroll":n.lockScroll,"close-on-click-overlay":n.popupCloseOnClickOverlay,teleport:n.teleport,onOpen:n.onOpen,onClose:n.onClose,onClosed:n.onClosed,onOpened:n.onOpened,onRouteChange:n.onRouteChange,onClickOverlay:n.handleClickOverlay},{default:Lt(()=>[me("div",fn({class:n.classes(n.n("$--box"),n.n(),n.dialogClass),style:pKe({width:n.toSizeUnit(n.width)},n.dialogStyle)},n.$attrs),[me("div",{class:B(n.n("title"))},[xe(n.$slots,"title",{},()=>{var s;return[Mi(ut((s=n.title)!=null?s:n.pack.dialogTitle),1)]})],2),me("div",{class:B(n.n("message")),style:Fe({textAlign:n.messageAlign})},[xe(n.$slots,"default",{},()=>[Mi(ut(n.message),1)])],6),me("div",{class:B(n.n("actions"))},[n.cancelButton?(q(),ei(t,{key:0,class:B(n.classes(n.n("button"),n.n("cancel-button"))),"var-dialog-cover":"",text:"","text-color":n.cancelButtonTextColor,color:n.cancelButtonColor,onClick:n.cancel},{default:Lt(()=>{var s;return[Mi(ut((s=n.cancelButtonText)!=null?s:n.pack.dialogCancelButtonText),1)]}),_:1},8,["class","text-color","color","onClick"])):Qe("v-if",!0),n.confirmButton?(q(),ei(t,{key:1,class:B(n.classes(n.n("button"),n.n("confirm-button"))),"var-dialog-cover":"",text:"","text-color":n.confirmButtonTextColor,color:n.confirmButtonColor,onClick:n.confirm},{default:Lt(()=>{var s;return[Mi(ut((s=n.confirmButtonText)!=null?s:n.pack.dialogConfirmButtonText),1)]}),_:1},8,["class","text-color","color","onClick"])):Qe("v-if",!0)],2)],16)]),_:3},8,["class","show","overlay","overlay-class","overlay-style","lock-scroll","close-on-click-overlay","teleport","onOpen","onClose","onClosed","onOpened","onRouteChange","onClickOverlay"])}const sae=et({name:mKe,components:{VarPopup:gg,VarButton:ia},inheritAttrs:!1,props:uKe,setup(n){const e=se(!1),t=se(!1);ht(()=>n.show,a=>{e.value=a},{immediate:!0}),ht(()=>n.closeOnClickOverlay,a=>{if(n.onBeforeClose!=null){t.value=!1;return}t.value=a},{immediate:!0});function i(){return oe(n["onUpdate:show"],!1)}function s(){const{closeOnClickOverlay:a,onClickOverlay:l,onBeforeClose:c}=n;if(oe(l),!!a){if(c!=null){oe(c,"close",i);return}oe(n["onUpdate:show"],!1)}}function o(){const{onBeforeClose:a,onConfirm:l}=n;if(oe(l),a!=null){oe(a,"confirm",i);return}oe(n["onUpdate:show"],!1)}function r(){const{onBeforeClose:a,onCancel:l}=n;if(oe(l),a!=null){oe(a,"cancel",i);return}oe(n["onUpdate:show"],!1)}return{pack:Xs,popupShow:e,popupCloseOnClickOverlay:t,n:_Ke,classes:vKe,handleClickOverlay:s,confirm:o,cancel:r,toSizeUnit:ri}}});sae.render=bKe;var pA=sae,CKe=Object.defineProperty,wKe=Object.defineProperties,yKe=Object.getOwnPropertyDescriptors,Hq=Object.getOwnPropertySymbols,SKe=Object.prototype.hasOwnProperty,LKe=Object.prototype.propertyIsEnumerable,$q=(n,e,t)=>e in n?CKe(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,t2=(n,e)=>{for(var t in e||(e={}))SKe.call(e,t)&&$q(n,t,e[t]);if(Hq)for(var t of Hq(e))LKe.call(e,t)&&$q(n,t,e[t]);return n},kKe=(n,e)=>wKe(n,yKe(e));let Gh,bT={};function DKe(n={}){return Us(n)?kKe(t2({},bT),{message:n}):t2(t2({},bT),n)}function f_(n){return nh()?new Promise(e=>{f_.close();const t=DKe(n),i=Cn(t);i.teleport="body",Gh=i;const{unmountInstance:s}=K0(pA,i,{onConfirm:()=>{oe(i.onConfirm),e("confirm")},onCancel:()=>{oe(i.onCancel),e("cancel")},onClose:()=>{oe(i.onClose),e("close")},onClosed:()=>{oe(i.onClosed),s(),Gh===i&&(Gh=null)},onRouteChange:()=>{s(),Gh===i&&(Gh=null)},"onUpdate:show":o=>{i.show=o}});i.show=!0}):Promise.resolve()}f_.setDefaultOptions=function(n){bT=n};f_.resetDefaultOptions=function(){bT={}};f_.close=function(){if(Gh!=null){const n=Gh;Gh=null,Fn().then(()=>{n.show=!1})}};f_.Component=pA;lt(pA);lt(pA,f_);var T3=f_;const EKe={inset:{type:[Boolean,Number,String],default:!1},vertical:Boolean,description:String,margin:String,dashed:Boolean,hairline:Boolean},{name:IKe,n:TKe,classes:xKe}=st("divider");function NKe(n,e){return q(),re("div",{class:B(n.classes(n.n(),n.n("$--box"),[n.vertical,n.n("--vertical")],[n.withText,n.n("--with-text")],[n.withPresetInset,n.n("--inset")],[n.dashed,n.n("--dashed")],[n.hairline,n.n("--hairline")])),style:Fe(n.style)},[n.vertical?Qe("v-if",!0):xe(n.$slots,"default",{key:0},()=>[n.description?(q(),re("span",{key:0,class:B(n.n("text"))},ut(n.description),3)):Qe("v-if",!0)])],6)}const oae=et({name:IKe,props:EKe,setup(n,{slots:e}){const t=se(!1),i=ve(()=>{const{vertical:r,inset:a}=n;return!r&&a===!0}),s=ve(()=>{const{inset:r,vertical:a,margin:l}=n;if(KB(r)||a)return{margin:l};const c=Ie(r),d=Math.abs(c)+(r+"").replace(c+"","");return{margin:l,width:"calc(100% - ".concat(ri(d),")"),left:c>0?ri(d):ri(0)}});Vo(o),Cg(o);function o(){const{description:r,vertical:a}=n;t.value=(e.default||r!=null)&&!a}return{n:TKe,classes:xKe,withText:t,style:s,withPresetInset:i}}});oae.render=NKe;var rae=oae;lt(rae);var x3=rae;const AKe={direction:{type:String,default:"xy"},attraction:String,disabled:Boolean,boundary:{type:Object,default:()=>({top:0,bottom:0,left:0,right:0})},zIndex:{type:[Number,String],default:90},teleport:{type:[String,Object,Boolean],default:"body"},onClick:Se()};var MKe=Object.defineProperty,RKe=Object.defineProperties,PKe=Object.getOwnPropertyDescriptors,zq=Object.getOwnPropertySymbols,OKe=Object.prototype.hasOwnProperty,FKe=Object.prototype.propertyIsEnumerable,Uq=(n,e,t)=>e in n?MKe(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,jq=(n,e)=>{for(var t in e||(e={}))OKe.call(e,t)&&Uq(n,t,e[t]);if(zq)for(var t of zq(e))FKe.call(e,t)&&Uq(n,t,e[t]);return n},Kq=(n,e)=>RKe(n,PKe(e)),BKe=(n,e,t)=>new Promise((i,s)=>{var o=l=>{try{a(t.next(l))}catch(c){s(c)}},r=l=>{try{a(t.throw(l))}catch(c){s(c)}},a=l=>l.done?i(l.value):Promise.resolve(l.value).then(o,r);a((t=t.apply(n,e)).next())});const{name:WKe,n:VKe,classes:HKe}=st("drag");function $Ke(n,e){return q(),ei(Bd,{to:n.teleport===!1?void 0:n.teleport,disabled:n.teleportDisabled||n.teleport===!1},[me("div",fn({ref:"drag",class:n.classes(n.n(),n.n("$--box"),[n.enableTransition,n.n("--transition")]),style:{"z-index":n.zIndex},onTouchstart:e[0]||(e[0]=(...t)=>n.handleTouchstart&&n.handleTouchstart(...t)),onTouchmove:e[1]||(e[1]=(...t)=>n.handleTouchmove&&n.handleTouchmove(...t)),onTouchend:e[2]||(e[2]=(...t)=>n.handleTouchend&&n.handleTouchend(...t)),onTouchcancel:e[3]||(e[3]=(...t)=>n.handleTouchend&&n.handleTouchend(...t)),onClick:e[4]||(e[4]=(...t)=>n.handleClick&&n.handleClick(...t))},n.getAttrs()),[xe(n.$slots,"default")],16)],8,["to","disabled"])}const aae=et({name:WKe,inheritAttrs:!1,props:AKe,setup(n,{attrs:e}){const t=se(null),i=se(0),s=se(0),o=se(!1),r=se(!1),{touching:a,dragging:l,moveX:c,moveY:d,startTouch:u,moveTouch:h,endTouch:f,resetTouch:g}=j0(),{disabled:p}=u_(),_=Cn({top:0,bottom:0,left:0,right:0});ht(()=>n.boundary,x),U0(T),Vo(()=>{x(),T()});function v(W){n.disabled||(u(W),y())}function b(W){return BKe(this,null,function*(){!a.value||n.disabled||(h(W),dc(W),r.value=!1,o.value=!0,n.direction.includes("x")&&(i.value+=c.value),n.direction.includes("y")&&(s.value+=d.value),D())})}function C(){n.disabled||(f(),r.value=!0,k())}function w(W){l.value||oe(n.onClick,W)}function y(){const{left:W,top:$}=L();i.value=W,s.value=$}function L(){const W=no(t.value),$=no(window),X=W.top-$.top,J=$.bottom-W.bottom,Q=W.left-$.left,le=$.right-W.right,{width:de,height:_e}=W,{width:ie,height:ne}=$;return{top:X,bottom:J,left:Q,right:le,width:de,height:_e,halfWidth:de/2,halfHeight:_e/2,windowWidth:ie,windowHeight:ne}}function S(){const W=L(),$=_.left,X=W.windowWidth-_.right-W.width,J=_.top,Q=W.windowHeight-_.bottom-W.height;return{minX:$,minY:J,maxX:$"u")return!1;var e=Ba(n).ShadowRoot;return n instanceof e||n instanceof ShadowRoot}function Fg(n){return((Vm(n)?n.ownerDocument:n.document)||window.document).documentElement}var YC=Math.max,Yq=Math.min,u0=Math.round;function N3(){var n=navigator.userAgentData;return n!=null&&n.brands&&Array.isArray(n.brands)?n.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function uae(){return!/^((?!chrome|android).)*safari/i.test(N3())}function h0(n,e,t){e===void 0&&(e=!1),t===void 0&&(t=!1);var i=n.getBoundingClientRect(),s=1,o=1;e&&dl(n)&&(s=n.offsetWidth>0&&u0(i.width)/n.offsetWidth||1,o=n.offsetHeight>0&&u0(i.height)/n.offsetHeight||1);var r=Vm(n)?Ba(n):window,a=r.visualViewport,l=!uae()&&t,c=(i.left+(l&&a?a.offsetLeft:0))/s,d=(i.top+(l&&a?a.offsetTop:0))/o,u=i.width/s,h=i.height/o;return{width:u,height:h,top:d,right:c+u,bottom:d+h,left:c,x:c,y:d}}function B6(n){var e=Ba(n),t=e.pageXOffset,i=e.pageYOffset;return{scrollLeft:t,scrollTop:i}}function W6(n){return h0(Fg(n)).left+B6(n).scrollLeft}function nqe(n,e){var t=Ba(n),i=Fg(n),s=t.visualViewport,o=i.clientWidth,r=i.clientHeight,a=0,l=0;if(s){o=s.width,r=s.height;var c=uae();(c||!c&&e==="fixed")&&(a=s.offsetLeft,l=s.offsetTop)}return{width:o,height:r,x:a+W6(n),y:l}}function Qu(n){return Ba(n).getComputedStyle(n)}function sqe(n){var e,t=Fg(n),i=B6(n),s=(e=n.ownerDocument)==null?void 0:e.body,o=YC(t.scrollWidth,t.clientWidth,s?s.scrollWidth:0,s?s.clientWidth:0),r=YC(t.scrollHeight,t.clientHeight,s?s.scrollHeight:0,s?s.clientHeight:0),a=-i.scrollLeft+W6(n),l=-i.scrollTop;return Qu(s||t).direction==="rtl"&&(a+=YC(t.clientWidth,s?s.clientWidth:0)-o),{width:o,height:r,x:a,y:l}}function Fd(n){return n?(n.nodeName||"").toLowerCase():null}function vA(n){return Fd(n)==="html"?n:n.assignedSlot||n.parentNode||(F6(n)?n.host:null)||Fg(n)}function V6(n){var e=Qu(n),t=e.overflow,i=e.overflowX,s=e.overflowY;return/auto|scroll|overlay|hidden/.test(t+s+i)}function hae(n){return["html","body","#document"].indexOf(Fd(n))>=0?n.ownerDocument.body:dl(n)&&V6(n)?n:hae(vA(n))}function ZC(n,e){var t;e===void 0&&(e=[]);var i=hae(n),s=i===((t=n.ownerDocument)==null?void 0:t.body),o=Ba(i),r=s?[o].concat(o.visualViewport||[],V6(i)?i:[]):i,a=e.concat(r);return s?a:a.concat(ZC(vA(r)))}function oqe(n){return["table","td","th"].indexOf(Fd(n))>=0}function Zq(n){return!dl(n)||Qu(n).position==="fixed"?null:n.offsetParent}function rqe(n){var e=/firefox/i.test(N3()),t=/Trident/i.test(N3());if(t&&dl(n)){var i=Qu(n);if(i.position==="fixed")return null}var s=vA(n);for(F6(s)&&(s=s.host);dl(s)&&["html","body"].indexOf(Fd(s))<0;){var o=Qu(s);if(o.transform!=="none"||o.perspective!=="none"||o.contain==="paint"||["transform","perspective"].indexOf(o.willChange)!==-1||e&&o.willChange==="filter"||e&&o.filter&&o.filter!=="none")return s;s=s.parentNode}return null}function H6(n){for(var e=Ba(n),t=Zq(n);t&&oqe(t)&&Qu(t).position==="static";)t=Zq(t);return t&&(Fd(t)==="html"||Fd(t)==="body"&&Qu(t).position==="static")?e:t||rqe(n)||e}function aqe(n,e){var t=e.getRootNode&&e.getRootNode();if(n.contains(e))return!0;if(t&&F6(t)){var i=e;do{if(i&&n.isSameNode(i))return!0;i=i.parentNode||i.host}while(i)}return!1}function A3(n){return Object.assign({},n,{left:n.x,top:n.y,right:n.x+n.width,bottom:n.y+n.height})}function lqe(n,e){var t=h0(n,!1,e==="fixed");return t.top=t.top+n.clientTop,t.left=t.left+n.clientLeft,t.bottom=t.top+n.clientHeight,t.right=t.left+n.clientWidth,t.width=n.clientWidth,t.height=n.clientHeight,t.x=t.left,t.y=t.top,t}function Xq(n,e,t){return e===cae?A3(nqe(n,t)):Vm(e)?lqe(e,t):A3(sqe(Fg(n)))}function cqe(n){var e=ZC(vA(n)),t=["absolute","fixed"].indexOf(Qu(n).position)>=0,i=t&&dl(n)?H6(n):n;return Vm(i)?e.filter(function(s){return Vm(s)&&aqe(s,i)&&Fd(s)!=="body"}):[]}function dqe(n,e,t,i){var s=e==="clippingParents"?cqe(n):[].concat(e),o=[].concat(s,[t]),r=o[0],a=o.reduce(function(l,c){var d=Xq(n,c,i);return l.top=YC(d.top,l.top),l.right=Yq(d.right,l.right),l.bottom=Yq(d.bottom,l.bottom),l.left=YC(d.left,l.left),l},Xq(n,r,i));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function qy(n){return n.split("-")[1]}function uqe(n){return["top","bottom"].indexOf(n)>=0?"x":"y"}function fae(n){var e=n.reference,t=n.element,i=n.placement,s=i?Of(i):null,o=i?qy(i):null,r=e.x+e.width/2-t.width/2,a=e.y+e.height/2-t.height/2,l;switch(s){case zu:l={x:r,y:e.y-t.height};break;case _g:l={x:r,y:e.y+e.height};break;case Wm:l={x:e.x+e.width,y:a};break;case Pf:l={x:e.x-t.width,y:a};break;default:l={x:e.x,y:e.y}}var c=s?uqe(s):null;if(c!=null){var d=c==="y"?"height":"width";switch(o){case _A:l[c]=l[c]-(e[d]/2-t[d]/2);break;case Ky:l[c]=l[c]+(e[d]/2-t[d]/2);break}}return l}function hqe(){return{top:0,right:0,bottom:0,left:0}}function fqe(n){return Object.assign({},hqe(),n)}function gqe(n,e){return e.reduce(function(t,i){return t[i]=n,t},{})}function gae(n,e){e===void 0&&(e={});var t=e,i=t.placement,s=i===void 0?n.placement:i,o=t.strategy,r=o===void 0?n.strategy:o,a=t.boundary,l=a===void 0?UKe:a,c=t.rootBoundary,d=c===void 0?cae:c,u=t.elementContext,h=u===void 0?A1:u,f=t.altBoundary,g=f===void 0?!1:f,p=t.padding,_=p===void 0?0:p,v=fqe(typeof _!="number"?_:gqe(_,mA)),b=h===A1?jKe:A1,C=n.rects.popper,w=n.elements[g?b:h],y=dqe(Vm(w)?w:w.contextElement||Fg(n.elements.popper),l,d,r),L=h0(n.elements.reference),S=fae({reference:L,element:C,strategy:"absolute",placement:s}),k=A3(Object.assign({},C,S)),D=h===A1?k:L,x={top:y.top-D.top+v.top,bottom:D.bottom-y.bottom+v.bottom,left:y.left-D.left+v.left,right:D.right-y.right+v.right},A=n.modifiersData.offset;if(h===A1&&A){var T=A[s];Object.keys(x).forEach(function(P){var W=[Wm,_g].indexOf(P)>=0?1:-1,$=[zu,_g].indexOf(P)>=0?"y":"x";x[P]+=T[$]*W})}return x}function pqe(n,e){e===void 0&&(e={});var t=e,i=t.placement,s=t.boundary,o=t.rootBoundary,r=t.padding,a=t.flipVariations,l=t.allowedAutoPlacements,c=l===void 0?dae:l,d=qy(i),u=d?a?qq:qq.filter(function(g){return qy(g)===d}):mA,h=u.filter(function(g){return c.indexOf(g)>=0});h.length===0&&(h=u);var f=h.reduce(function(g,p){return g[p]=gae(n,{placement:p,boundary:s,rootBoundary:o,padding:r})[Of(p)],g},{});return Object.keys(f).sort(function(g,p){return f[g]-f[p]})}function mqe(n){if(Of(n)===O6)return[];var e=zD(n);return[Gq(n),e,Gq(e)]}function _qe(n){var e=n.state,t=n.options,i=n.name;if(!e.modifiersData[i]._skip){for(var s=t.mainAxis,o=s===void 0?!0:s,r=t.altAxis,a=r===void 0?!0:r,l=t.fallbackPlacements,c=t.padding,d=t.boundary,u=t.rootBoundary,h=t.altBoundary,f=t.flipVariations,g=f===void 0?!0:f,p=t.allowedAutoPlacements,_=e.options.placement,v=Of(_),b=v===_,C=l||(b||!g?[zD(_)]:mqe(_)),w=[_].concat(C).reduce(function(Ye,pe){return Ye.concat(Of(pe)===O6?pqe(e,{placement:pe,boundary:d,rootBoundary:u,padding:c,flipVariations:g,allowedAutoPlacements:p}):pe)},[]),y=e.rects.reference,L=e.rects.popper,S=new Map,k=!0,D=w[0],x=0;x=0,$=W?"width":"height",X=gae(e,{placement:A,boundary:d,rootBoundary:u,altBoundary:h,padding:c}),J=W?P?Wm:Pf:P?_g:zu;y[$]>L[$]&&(J=zD(J));var Q=zD(J),le=[];if(o&&le.push(X[T]<=0),a&&le.push(X[J]<=0,X[Q]<=0),le.every(function(Ye){return Ye})){D=A,k=!1;break}S.set(A,le)}if(k)for(var de=g?3:1,_e=function(pe){var Ee=w.find(function(ze){var It=S.get(ze);if(It)return It.slice(0,pe).every(function(Ke){return Ke})});if(Ee)return D=Ee,"break"},ie=de;ie>0;ie--){var ne=_e(ie);if(ne==="break")break}e.placement!==D&&(e.modifiersData[i]._skip=!0,e.placement=D,e.reset=!0)}}const vqe={name:"flip",enabled:!0,phase:"main",fn:_qe,requiresIfExists:["offset"],data:{_skip:!1}};function bqe(n,e,t){var i=Of(n),s=[Pf,zu].indexOf(i)>=0?-1:1,o=typeof t=="function"?t(Object.assign({},e,{placement:n})):t,r=o[0],a=o[1];return r=r||0,a=(a||0)*s,[Pf,Wm].indexOf(i)>=0?{x:a,y:r}:{x:r,y:a}}function Cqe(n){var e=n.state,t=n.options,i=n.name,s=t.offset,o=s===void 0?[0,0]:s,r=dae.reduce(function(d,u){return d[u]=bqe(u,e.rects,o),d},{}),a=r[e.placement],l=a.x,c=a.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=l,e.modifiersData.popperOffsets.y+=c),e.modifiersData[i]=r}const wqe={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:Cqe};var yqe={top:"auto",right:"auto",bottom:"auto",left:"auto"};function Sqe(n,e){var t=n.x,i=n.y,s=e.devicePixelRatio||1;return{x:u0(t*s)/s||0,y:u0(i*s)/s||0}}function Qq(n){var e,t=n.popper,i=n.popperRect,s=n.placement,o=n.variation,r=n.offsets,a=n.position,l=n.gpuAcceleration,c=n.adaptive,d=n.roundOffsets,u=n.isFixed,h=r.x,f=h===void 0?0:h,g=r.y,p=g===void 0?0:g,_=typeof d=="function"?d({x:f,y:p}):{x:f,y:p};f=_.x,p=_.y;var v=r.hasOwnProperty("x"),b=r.hasOwnProperty("y"),C=Pf,w=zu,y=window;if(c){var L=H6(t),S="clientHeight",k="clientWidth";if(L===Ba(t)&&(L=Fg(t),Qu(L).position!=="static"&&a==="absolute"&&(S="scrollHeight",k="scrollWidth")),L=L,s===zu||(s===Pf||s===Wm)&&o===Ky){w=_g;var D=u&&L===y&&y.visualViewport?y.visualViewport.height:L[S];p-=D-i.height,p*=l?1:-1}if(s===Pf||(s===zu||s===_g)&&o===Ky){C=Wm;var x=u&&L===y&&y.visualViewport?y.visualViewport.width:L[k];f-=x-i.width,f*=l?1:-1}}var A=Object.assign({position:a},c&&yqe),T=d===!0?Sqe({x:f,y:p},Ba(t)):{x:f,y:p};if(f=T.x,p=T.y,l){var P;return Object.assign({},A,(P={},P[w]=b?"0":"",P[C]=v?"0":"",P.transform=(y.devicePixelRatio||1)<=1?"translate("+f+"px, "+p+"px)":"translate3d("+f+"px, "+p+"px, 0)",P))}return Object.assign({},A,(e={},e[w]=b?p+"px":"",e[C]=v?f+"px":"",e.transform="",e))}function Lqe(n){var e=n.state,t=n.options,i=t.gpuAcceleration,s=i===void 0?!0:i,o=t.adaptive,r=o===void 0?!0:o,a=t.roundOffsets,l=a===void 0?!0:a,c={placement:Of(e.placement),variation:qy(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:s,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,Qq(Object.assign({},c,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:r,roundOffsets:l})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,Qq(Object.assign({},c,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}const pae={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:Lqe,data:{}};function kqe(n){return{scrollLeft:n.scrollLeft,scrollTop:n.scrollTop}}function Dqe(n){return n===Ba(n)||!dl(n)?B6(n):kqe(n)}function Eqe(n){var e=n.getBoundingClientRect(),t=u0(e.width)/n.offsetWidth||1,i=u0(e.height)/n.offsetHeight||1;return t!==1||i!==1}function Iqe(n,e,t){t===void 0&&(t=!1);var i=dl(e),s=dl(e)&&Eqe(e),o=Fg(e),r=h0(n,s,t),a={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(i||!i&&!t)&&((Fd(e)!=="body"||V6(o))&&(a=Dqe(e)),dl(e)?(l=h0(e,!0),l.x+=e.clientLeft,l.y+=e.clientTop):o&&(l.x=W6(o))),{x:r.left+a.scrollLeft-l.x,y:r.top+a.scrollTop-l.y,width:r.width,height:r.height}}function Tqe(n){var e=h0(n),t=n.offsetWidth,i=n.offsetHeight;return Math.abs(e.width-t)<=1&&(t=e.width),Math.abs(e.height-i)<=1&&(i=e.height),{x:n.offsetLeft,y:n.offsetTop,width:t,height:i}}function xqe(n){var e=new Map,t=new Set,i=[];n.forEach(function(o){e.set(o.name,o)});function s(o){t.add(o.name);var r=[].concat(o.requires||[],o.requiresIfExists||[]);r.forEach(function(a){if(!t.has(a)){var l=e.get(a);l&&s(l)}}),i.push(o)}return n.forEach(function(o){t.has(o.name)||s(o)}),i}function Nqe(n){var e=xqe(n);return tqe.reduce(function(t,i){return t.concat(e.filter(function(s){return s.phase===i}))},[])}function Aqe(n){var e;return function(){return e||(e=new Promise(function(t){Promise.resolve().then(function(){e=void 0,t(n())})})),e}}function Mqe(n){var e=n.reduce(function(t,i){var s=t[i.name];return t[i.name]=s?Object.assign({},s,i,{options:Object.assign({},s.options,i.options),data:Object.assign({},s.data,i.data)}):i,t},{});return Object.keys(e).map(function(t){return e[t]})}var Jq={placement:"bottom",modifiers:[],strategy:"absolute"};function eG(){for(var n=arguments.length,e=new Array(n),t=0;te in n?Uqe(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,i2=(n,e)=>{for(var t in e||(e={}))qqe.call(e,t)&&iG(n,t,e[t]);if(tG)for(var t of tG(e))Gqe.call(e,t)&&iG(n,t,e[t]);return n},n2=(n,e)=>jqe(n,Kqe(e)),nG=(n,e,t)=>new Promise((i,s)=>{var o=l=>{try{a(t.next(l))}catch(c){s(c)}},r=l=>{try{a(t.throw(l))}catch(c){s(c)}},a=l=>l.done?i(l.value):Promise.resolve(l.value).then(o,r);a((t=t.apply(n,e)).next())});function mae(n){const e=se(null),t=se(null),i=se({width:0,height:0}),s=Xu(n,"show",{passive:!0,defaultValue:!1,emit(D,x){x?(L(),oe(n.onOpen)):oe(n.onClose)}}),{zIndex:o}=QS(()=>s.value,1);let r=null,a=!1,l=!1;const c=()=>{const{width:D,height:x}=Um(e.value);i.value={width:jn(D),height:jn(x)}},d=()=>{switch(n.placement){case"top":case"cover-bottom":return"bottom";case"top-start":case"right-end":case"cover-bottom-start":return"bottom left";case"top-end":case"left-end":case"cover-bottom-end":return"bottom right";case"bottom":case"cover-top":return"top";case"bottom-start":case"right-start":case"cover-top-start":return"top left";case"bottom-end":case"left-start":case"cover-top-end":return"top right";case"left":case"cover-right":return"right";case"right":case"cover-left":return"left"}},u=()=>{n.trigger==="hover"&&(l=!0,S())},h=()=>nG(this,null,function*(){n.trigger==="hover"&&(l=!1,yield Cr(),!a&&k())}),f=()=>{n.trigger==="hover"&&(a=!0)},g=()=>nG(this,null,function*(){n.trigger==="hover"&&(a=!1,yield Cr(),!l&&k())}),p=()=>{n.closeOnClickReference&&s.value?k():S()},_=()=>{k()},v=D=>{n.trigger==="click"&&(_(),oe(n.onClickOutside,D))},b=()=>{L(),oe(n.onClosed)},C=()=>{const{offsetX:D,offsetY:x,placement:A}=n;c();const T={x:jn(D),y:jn(x)};switch(A){case"cover-top":return{placement:"bottom",skidding:T.x,distance:T.y-i.value.height};case"cover-top-start":return{placement:"bottom-start",skidding:T.x,distance:T.y-i.value.height};case"cover-top-end":return{placement:"bottom-end",skidding:T.x,distance:T.y-i.value.height};case"cover-bottom":return{placement:"top",skidding:T.x,distance:-T.y-i.value.height};case"cover-bottom-start":return{placement:"top-start",skidding:T.x,distance:-T.y-i.value.height};case"cover-bottom-end":return{placement:"top-end",skidding:T.x,distance:-T.y-i.value.height};case"cover-left":return{placement:"right",skidding:T.y,distance:T.x-i.value.width};case"cover-right":return{placement:"left",skidding:T.y,distance:-T.x-i.value.width};case"left":case"left-start":case"left-end":return{placement:A,skidding:T.y,distance:-T.x};case"top":case"top-start":case"top-end":return{placement:A,skidding:T.x,distance:-T.y};case"bottom":case"bottom-start":case"bottom-end":return{placement:A,skidding:T.x,distance:T.y};case"right":case"right-start":case"right-end":return{placement:A,skidding:T.y,distance:T.x}}},w=()=>{const{placement:D,skidding:x,distance:A}=C(),T=[n2(i2({},vqe),{enabled:s.value}),n2(i2({},wqe),{options:{offset:[x,A]}}),n2(i2({},pae),{options:{adaptive:!1,gpuAcceleration:!1},enabled:s.value}),{name:"applyTransformOrigin",enabled:s.value,phase:"beforeWrite",fn({state:P}){P.styles.popper.transformOrigin=d()}}];return{placement:D,modifiers:T,strategy:n.strategy}},y=()=>n.reference?e.value.querySelector(n.reference):e.value,L=()=>{r.setOptions(w())},S=()=>{const{disabled:D}=n;D||(s.value=!0,oe(n["onUpdate:show"],!0))},k=()=>{s.value=!1,oe(n["onUpdate:show"],!1)};return Kse(y,"click",v),ht(()=>[n.offsetX,n.offsetY,n.placement,n.strategy],L),ht(()=>n.disabled,k),bd(()=>{var D;r=zqe((D=y())!=null?D:e.value,t.value,w())}),Cd(()=>{r.destroy()}),{show:s,popover:t,zIndex:o,host:e,hostSize:i,handleHostClick:p,handleHostMouseenter:u,handleHostMouseleave:h,handlePopoverClose:_,handlePopoverMouseenter:f,handlePopoverMouseleave:g,handleClosed:b,resize:L,open:S,close:k}}const Yqe={type:{type:String,default:"default"},color:String,content:String,show:Boolean,disabled:Boolean,trigger:{type:String,default:"hover"},reference:String,placement:{type:String,default:"bottom"},strategy:{type:String,default:"absolute"},offsetX:{type:[Number,String],default:0},offsetY:{type:[Number,String],default:0},teleport:{type:[String,Object,Boolean],default:"body"},sameWidth:Boolean,closeOnClickReference:Boolean,onOpen:Se(),onOpened:Se(),onClose:Se(),onClosed:Se(),onClickOutside:Se(),"onUpdate:show":Se()},{name:Zqe,n:Xqe,classes:Qqe}=st("tooltip");function Jqe(n,e){return q(),re("div",{ref:"host",class:B(n.classes(n.n(),n.n("$--box"))),onClick:e[3]||(e[3]=(...t)=>n.handleHostClick&&n.handleHostClick(...t)),onMouseenter:e[4]||(e[4]=(...t)=>n.handleHostMouseenter&&n.handleHostMouseenter(...t)),onMouseleave:e[5]||(e[5]=(...t)=>n.handleHostMouseleave&&n.handleHostMouseleave(...t))},[xe(n.$slots,"default"),(q(),ei(Bd,{to:n.teleport===!1?void 0:n.teleport,disabled:n.teleportDisabled||n.teleport===!1},[Oe(On,{name:n.n(),onAfterEnter:n.onOpened,onAfterLeave:n.handleClosed,persisted:""},{default:Lt(()=>[wi(me("div",{ref:"popover",class:B(n.classes(n.n("tooltip"),n.n("$--box"))),style:Fe({zIndex:n.zIndex}),onClick:e[0]||(e[0]=Ia(()=>{},["stop"])),onMouseenter:e[1]||(e[1]=(...t)=>n.handlePopoverMouseenter&&n.handlePopoverMouseenter(...t)),onMouseleave:e[2]||(e[2]=(...t)=>n.handlePopoverMouseleave&&n.handlePopoverMouseleave(...t))},[me("div",{style:Fe({background:n.color,width:n.sameWidth?n.toSizeUnit(Math.ceil(n.hostSize.width)):void 0}),class:B(n.classes(n.n("content-container"),n.n("--".concat(n.type))))},[xe(n.$slots,"content",{},()=>[Mi(ut(n.content),1)])],6)],38),[[hl,n.show]])]),_:3},8,["name","onAfterEnter","onAfterLeave"])],8,["to","disabled"]))],34)}const _ae=et({name:Zqe,props:Yqe,setup(n){const{disabled:e}=u_(),{popover:t,host:i,hostSize:s,show:o,zIndex:r,handleHostClick:a,handleHostMouseenter:l,handleHostMouseleave:c,handlePopoverMouseenter:d,handlePopoverMouseleave:u,handlePopoverClose:h,handleClosed:f,open:g,close:p,resize:_}=mae(n);return{popover:t,host:i,hostSize:s,show:o,zIndex:r,teleportDisabled:e,toSizeUnit:ri,n:Xqe,classes:Qqe,handleHostClick:a,handlePopoverClose:h,handleHostMouseenter:l,handleHostMouseleave:c,handlePopoverMouseenter:d,handlePopoverMouseleave:u,handleClosed:f,resize:_,open:g,close:p}}});_ae.render=Jqe;var vae=_ae;lt(vae);var wT=vae;const eGe={expand:Boolean,expandTrigger:String,lineClamp:[Number,String],tooltip:{type:[Object,Boolean],default:!0},"onUpdate:expand":Se()};var tGe=Object.defineProperty,sG=Object.getOwnPropertySymbols,iGe=Object.prototype.hasOwnProperty,nGe=Object.prototype.propertyIsEnumerable,oG=(n,e,t)=>e in n?tGe(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,sGe=(n,e)=>{for(var t in e||(e={}))iGe.call(e,t)&&oG(n,t,e[t]);if(sG)for(var t of sG(e))nGe.call(e,t)&&oG(n,t,e[t]);return n};const{name:oGe,n:rGe,classes:aGe}=st("ellipsis"),lGe={key:0};function cGe(n,e){const t=gt("var-tooltip");return q(),ei(t,pf(_0(n.tooltip)),{content:Lt(()=>[xe(n.$slots,"tooltip-content",{},()=>{var i;return[(i=n.tooltip)!=null&&i.content?(q(),re("span",lGe,ut(n.tooltip.content),1)):xe(n.$slots,"default",{key:1})]})]),default:Lt(()=>[me("span",{class:B(n.classes(n.n(),[n.lineClamp,n.n("--clamp"),n.n("--line")],[n.expandTrigger,n.n("--cursor")],[n.expanding,n.n("--expand")])),style:Fe(n.rootStyles),onClick:e[0]||(e[0]=(...i)=>n.handleClick&&n.handleClick(...i))},[xe(n.$slots,"default")],6)]),_:3},16)}const bae=et({name:oGe,components:{VarTooltip:wT},props:eGe,setup(n){const e=Xu(n,"expand"),t=ve(()=>n.lineClamp?{"-webkit-line-clamp":n.lineClamp}:{}),i=ve(()=>n.tooltip===!1?{disabled:!0}:n.tooltip===!0?{sameWidth:!0}:sGe({sameWidth:!0},n.tooltip));function s(){n.expandTrigger&&(e.value=!e.value)}return{tooltip:i,expanding:e,rootStyles:t,n:rGe,classes:aGe,handleClick:s}}});bae.render=cGe;var Cae=bae;lt(Cae);var M3=Cae;const dGe={active:Boolean,show:{type:Boolean,default:!0},drag:{type:[Object,Boolean],default:!1},type:{type:String,default:"primary"},position:{type:String,default:"right-bottom"},direction:{type:String,default:"top"},trigger:{type:String,default:"click"},disabled:Boolean,color:String,inactiveIcon:{type:String,default:"plus"},activeIcon:{type:String,default:"window-close"},inactiveIconSize:yi(Ss,"size"),activeIconSize:yi(Ss,"size"),inactiveIconNamespace:yi(Ss,"namespace"),activeIconNamespace:yi(Ss,"namespace"),fixed:{type:Boolean,default:!0},zIndex:{type:[Number,String],default:90},top:[Number,String],bottom:[Number,String],left:[Number,String],right:[Number,String],elevation:{type:[Boolean,Number,String],default:!0},safeArea:Boolean,teleport:{type:[String,Object,Boolean],default:"body"},onClick:Se(),onOpen:Se(),onOpened:Se(),onClose:Se(),onClosed:Se(),"onUpdate:active":Se()},{name:uGe,classes:s2,n:ua}=st("fab");var wae=et({name:uGe,inheritAttrs:!1,props:dGe,setup(n,{slots:e,attrs:t}){const i=Xu(n,"active"),s=se(null),o=se(null);ht(()=>n.trigger,()=>{i.value=!1}),ht(()=>n.disabled,()=>{i.value=!1}),ht(()=>[n.position,n.fixed,n.top,n.bottom,n.left,n.right],()=>{var d;(d=o.value)==null||d.reset()}),Kse(s,"click",l);function r(d,u,h){if(d.stopPropagation(),!(n.trigger!=="click"||n.disabled)){if(h===0){oe(n.onClick,i.value,d);return}i.value=u,oe(n.onClick,i.value,d),oe(i.value?n.onOpen:n.onClose)}}function a(d,u){n.trigger!=="hover"||n.disabled||u===0||(i.value=d,oe(i.value?n.onOpen:n.onClose))}function l(){n.trigger!=="click"||n.disabled||i.value!==!1&&(i.value=!1,oe(n.onClose))}function c(){return e.trigger?n.show?e.trigger({active:i.value}):null:wi(Oe(ia,{"var-fab-cover":!0,class:ua("trigger"),type:n.type,color:n.color,disabled:n.disabled,elevation:n.elevation,round:!0},{default:()=>[Oe(Wn,{"var-fab-cover":!0,class:s2([i.value,ua("trigger-active-icon"),ua("trigger-inactive-icon")]),name:i.value?n.activeIcon:n.inactiveIcon,size:i.value?n.activeIconSize:n.inactiveIconSize,namespace:i.value?n.activeIconNamespace:n.inactiveIconNamespace,transition:200,animationClass:ua("--trigger-icon-animation")},null)]}),[[hl,n.show]])}return()=>{var d;const u=Xse((d=oe(e.default))!=null?d:[]),h=KB(n.drag)?{}:n.drag;return Oe(CT,fn({ref:o,class:s2(ua("--position-".concat(n.position)),[!n.fixed,ua("--absolute")]),style:{top:ri(n.top),bottom:ri(n.bottom),left:ri(n.left),right:ri(n.right)},zIndex:n.zIndex,teleport:n.teleport,disabled:n.disabled||!n.drag||!n.fixed,direction:h.direction,attraction:h.attraction,boundary:h.boundary,onClick:f=>r(f,!i.value,u.length)},t),{default:()=>[Oe("div",{class:s2(ua(),ua("--direction-".concat(n.direction)),[n.safeArea,ua("--safe-area")]),ref:s,onMouseleave:()=>a(!1,u.length),onMouseenter:()=>a(!0,u.length)},[Oe(On,{name:ua("--active-transition")},{default:()=>[c()]}),Oe(On,{name:ua("--actions-transition-".concat(n.direction)),onAfterEnter:n.onOpened,onAfterLeave:n.onClosed},{default:()=>[wi(Oe("div",{class:ua("actions"),onClick:f=>f.stopPropagation()},[u.map(f=>Oe("div",{class:ua("action")},[f]))]),[[hl,n.show&&i.value&&u.length]])]})])]})}}});lt(wae);var R3=wae;const $6={value:{type:null,required:!0},id:{type:String,default:""},isFocus:Boolean,size:{type:String,default:"normal"},variant:{type:String,default:"standard"},placeholder:String,line:{type:Boolean,default:!0},hint:{type:Boolean,default:!0},textColor:String,focusColor:String,blurColor:String,errorMessage:String,formDisabled:Boolean,disabled:Boolean,clearable:Boolean,cursor:String,composing:Boolean,onClick:Se(),onClear:Se()},{name:hGe,n:o2,classes:fGe}=st("field-decorator"),gGe=["for"];function pGe(n,e){const t=gt("var-icon");return q(),re("div",{class:B(n.classes(n.n(),n.n("$--box"),n.n("--".concat(n.variant)),[n.size==="small",n.n("--small")],[n.disabled,n.n("--disabled")])),onClick:e[0]||(e[0]=(...i)=>n.handleClick&&n.handleClick(...i))},[me("div",{class:B(n.classes(n.n("controller"),[n.isFocus,n.n("--focus")],[n.errorMessage,n.n("--error")],[n.formDisabled||n.disabled,n.n("--disabled")])),style:Fe({color:n.color,cursor:n.cursor,overflow:n.isFloating?"visible":"hidden"})},[me("div",{class:B(n.classes(n.n("icon"),[!n.hint,n.n("--icon-non-hint")]))},[xe(n.$slots,"prepend-icon")],2),me("div",{class:B(n.classes(n.n("middle"),[!n.hint,n.n("--middle-non-hint")]))},[xe(n.$slots,"default")],2),n.placeholder&&n.hint?(q(),re("label",{key:0,class:B(n.classes(n.n("placeholder"),n.n("$--ellipsis"),[n.isFocus,n.n("--focus")],[n.formDisabled||n.disabled,n.n("--disabled")],[n.errorMessage,n.n("--error")],n.computePlaceholderState())),style:Fe({color:n.color}),for:n.id},[me("span",null,ut(n.placeholder),1)],14,gGe)):Qe("v-if",!0),me("div",{class:B(n.classes(n.n("icon"),[!n.hint,n.n("--icon-non-hint")]))},[n.clearable&&!n.isEmpty(n.value)?(q(),ei(t,{key:0,class:B(n.n("clear-icon")),"var-field-decorator-cover":"",name:"close-circle",onClick:n.handleClear},null,8,["class","onClick"])):Qe("v-if",!0),xe(n.$slots,"append-icon")],2)],6),n.line?(q(),re(li,{key:0},[n.variant==="outlined"?(q(),re("fieldset",{key:0,class:B(n.classes(n.n("line"),[n.isFocus,n.n("--line-focus")],[n.errorMessage,n.n("--line-error")],[n.formDisabled||n.disabled,n.n("--line-disabled")])),style:Fe({borderColor:n.color})},[me("legend",{class:B(n.classes(n.n("line-legend"),[n.isFloating,n.n("line-legend--hint")])),style:Fe({width:n.legendWidth})},[n.placeholder&&n.hint?(q(),ei(Bd,{key:0,to:"body"},[me("span",{ref:"placeholderTextEl",class:B(n.classes(n.n("placeholder-text"),n.n("$--ellipsis"),[n.size==="small",n.n("placeholder-text--small")]))},ut(n.placeholder),3)])):Qe("v-if",!0)],6)],6)):(q(),re("div",{key:1,class:B(n.classes(n.n("line"),[n.formDisabled||n.disabled,n.n("--line-disabled")],[n.errorMessage,n.n("--line-error")])),style:Fe({background:n.errorMessage?void 0:n.blurColor})},[me("div",{class:B(n.classes(n.n("dot"),[n.isFocus,n.n("--line-focus")],[n.formDisabled||n.disabled,n.n("--line-disabled")],[n.errorMessage,n.n("--line-error")])),style:Fe({background:n.errorMessage?void 0:n.focusColor})},null,6)],6))],64)):Qe("v-if",!0)],2)}const yae=et({name:hGe,components:{VarIcon:Wn},props:$6,setup(n,{slots:e}){const t=se(null),i=se(""),s=ve(()=>n.hint&&(!hd(n.value)||n.isFocus||e["prepend-icon"])),o=ve(()=>n.errorMessage?void 0:n.isFocus?n.focusColor:n.blurColor);U0(a),Vo(a),Cg(a);function r(){const{hint:d,value:u,composing:h}=n;if(!d&&(!hd(u)||h))return o2("--placeholder-hidden");if(s.value)return o2("--placeholder-hint")}function a(){const{size:d,hint:u,variant:h,placeholder:f}=n;if(!f||!u||h!=="outlined"){i.value="";return}const g=Um(t.value),p="var(--field-decorator-outlined-".concat(d,"-placeholder-space)");i.value="calc(".concat(g.width," * 0.75 + ").concat(p," * 2)")}function l(d){oe(n.onClear,d)}function c(d){oe(n.onClick,d)}return{placeholderTextEl:t,color:o,legendWidth:i,isFloating:s,computePlaceholderState:r,n:o2,classes:fGe,isEmpty:hd,handleClear:l,handleClick:c}}});yae.render=pGe;var Sae=yae;lt(Sae);var Gy=Sae;const mGe={anchor:Number,anchors:Array,contentDraggable:{type:Boolean,default:!0},duration:{type:[Number,String],default:300},elevation:{type:[Boolean,Number,String],default:!0},teleport:{type:[String,Object,Boolean],default:"body"},safeArea:Boolean,"onUpdate:anchor":Se(),onAnchorChange:Se()},{name:_Ge,n:vGe,classes:bGe}=st("floating-panel"),CGe=100,rG=.2;function wGe(n,e){return q(),ei(Bd,{to:n.teleport===!1?void 0:n.teleport,disabled:n.teleportDisabled||n.teleport===!1},[me("div",{class:B(n.classes(n.n(),[n.safeArea,n.n("--safe-area")],n.formatElevation(n.elevation,3))),style:Fe({height:"".concat(n.toSizeUnit(n.maxAnchor)),transform:"translateY(calc(100% - ".concat(n.toSizeUnit(n.visibleHeight),"))"),transition:n.touching?"none":"transform ".concat(n.toNumber(n.duration),"ms var(--floating-panel-transition-timing-function), background-color 0.25s")}),onTouchstart:e[0]||(e[0]=(...t)=>n.handleTouchstart&&n.handleTouchstart(...t)),onTouchmove:e[1]||(e[1]=(...t)=>n.handleTouchmove&&n.handleTouchmove(...t)),onTouchend:e[2]||(e[2]=(...t)=>n.handleTouchend&&n.handleTouchend(...t)),onTouchcancel:e[3]||(e[3]=(...t)=>n.handleTouchend&&n.handleTouchend(...t))},[me("div",{class:B(n.n("header"))},[me("div",{class:B(n.n("header-toolbar"))},null,2)],2),me("div",{class:B(n.n("content")),ref:"contentRef"},[xe(n.$slots,"default")],2)],38)],8,["to","disabled"])}const Lae=et({name:_Ge,props:mGe,setup(n){const e=se(0),t=se(null),{height:i}=Gse(),s=ve(()=>i.value*.6),o=Xu(n,"anchor"),r=ve(()=>{const D=[CGe,s.value],{anchors:x}=n;return hd(x)?D:x}),a=ve(()=>Math.min(...r.value)),l=ve(()=>Math.max(...r.value)),{disabled:c}=u_(),{deltaY:d,touching:u,startTouch:h,moveTouch:f,endTouch:g,isReachTop:p,isReachBottom:_}=j0();let v;XS(()=>u.value),ht(()=>o.value,b,{immediate:!0}),ht(()=>r.value,()=>{b(o.value)},{immediate:!0});function b(D){L(D!=null?D:a.value)}function C(D){h(D),v=e.value}function w(D){var x;f(D);const A=D.target,T=t.value===A||((x=t.value)==null?void 0:x.contains(A));if(T&&!n.contentDraggable)return;if(T&&n.contentDraggable&&e.value>=l.value&&!p(t.value)){_(t.value)&&dc(D);return}const P=v-d.value;L(S(P)),dc(D)}function y(){g();const D=o.value;L(e.value),o.value=e.value,o.value!==D&&oe(n.onAnchorChange,e.value)}function L(D){e.value=u.value?D:k(D)}function S(D){if(D>l.value){const x=D-l.value;return l.value+x*rG}if(D{const P=Math.abs(T-D);Pnew Promise((i,s)=>{var o=l=>{try{a(t.next(l))}catch(c){s(c)}},r=l=>{try{a(t.throw(l))}catch(c){s(c)}},a=l=>l.done?i(l.value):Promise.resolve(l.value).then(o,r);a((t=t.apply(n,e)).next())});const{name:SGe,n:LGe}=st("form");function kGe(n,e){return q(),re("form",{class:B(n.n()),onSubmit:e[0]||(e[0]=(...t)=>n.handleSubmit&&n.handleSubmit(...t)),onReset:e[1]||(e[1]=(...t)=>n.handleReset&&n.handleReset(...t))},[xe(n.$slots,"default")],34)}const Dae=et({name:SGe,props:yGe,setup(n){const e=ve(()=>n.disabled),t=ve(()=>n.readonly),{formItems:i,bindFormItems:s}=Vze();s({disabled:e,readonly:t});function r(h){setTimeout(()=>{const f=pg(h),g=f===window?0:XK(f),p=XK(h)-g-jn(n.scrollToErrorOffsetY);$y(f,{top:p,animation:i3})},300)}function a(h){return aG(this,null,function*(){dc(h);const f=yield c();oe(n.onSubmit,f)})}function l(h){dc(h),d(),oe(n.onReset)}function c(){return aG(this,null,function*(){var h;const f=yield Promise.all(i.map(({validate:g})=>g()));if(n.scrollToError){const[,g]=Dhe(f,_=>_===!1,n.scrollToError),p=g>-1;if(p){const _=(h=i[g].instance.proxy)==null?void 0:h.$el;r(_)}return!p}return f.every(g=>g===!0)})}function d(){return i.forEach(({reset:h})=>h())}function u(){return i.forEach(({resetValidation:h})=>h())}return{n:LGe,handleSubmit:a,handleReset:l,validate:c,reset:d,resetValidation:u}}});Dae.render=kGe;var bA=Dae;bA.useValidation=Ll;bA.useForm=kl;lt(bA);var O3=bA;const DGe={src:String,fit:{type:String,default:"fill"},alt:String,title:String,width:[String,Number],height:[String,Number],radius:{type:[String,Number],default:0},loading:String,error:String,lazy:Boolean,ripple:Boolean,block:{type:Boolean,default:!0},onClick:Se(),onLoad:Se(),onError:Se()},{name:EGe,n:IGe,classes:TGe}=st("image"),xGe=["alt","title","lazy-loading","lazy-error"],NGe=["alt","title","src"];function AGe(n,e){var t;const i=hn("lazy"),s=hn("ripple");return wi((q(),re("div",{class:B(n.classes(n.n(),n.n("$--box"),[!n.block,n.n("$--inline-block")])),style:Fe({width:n.toSizeUnit(n.width),height:n.toSizeUnit(n.height),borderRadius:n.toSizeUnit(n.radius)})},[n.lazy&&!n.showErrorSlot?wi((q(),re("img",{key:0,class:B(n.n("image")),alt:n.alt,title:n.title,"lazy-loading":n.loading,"lazy-error":n.error,style:Fe({objectFit:n.fit}),onLoad:e[0]||(e[0]=(...o)=>n.handleLoad&&n.handleLoad(...o)),onClick:e[1]||(e[1]=(...o)=>n.handleClick&&n.handleClick(...o))},null,46,xGe)),[[i,(t=n.src)!=null?t:""]]):Qe("v-if",!0),!n.lazy&&!n.showErrorSlot?(q(),re("img",{key:1,class:B(n.n("image")),alt:n.alt,title:n.title,style:Fe({objectFit:n.fit}),src:n.src,onLoad:e[2]||(e[2]=(...o)=>n.handleLoad&&n.handleLoad(...o)),onError:e[3]||(e[3]=(...o)=>n.handleError&&n.handleError(...o)),onClick:e[4]||(e[4]=(...o)=>n.handleClick&&n.handleClick(...o))},null,46,NGe)):Qe("v-if",!0),n.showErrorSlot?xe(n.$slots,"error",{key:2}):Qe("v-if",!0)],6)),[[s,{disabled:!n.ripple}]])}const Eae=et({name:EGe,directives:{Lazy:zy,Ripple:Ns},props:DGe,setup(n,{slots:e}){const t=se(!1);ht(()=>n.src,()=>{t.value=!1});function i(r){t.value=!!e.error,oe(n.onError,r)}function s(r){const a=r.currentTarget;if(n.lazy){if(a._lazy.state==="success"){oe(n.onLoad,r);return}a._lazy.state==="error"&&i(r)}else oe(n.onLoad,r)}function o(r){oe(n.onClick,r)}return{showErrorSlot:t,n:IGe,classes:TGe,toSizeUnit:ri,handleLoad:s,handleError:i,handleClick:o}}});Eae.render=AGe;var Iae=Eae;lt(Iae);var F3=Iae;const Tae=Symbol("SWIPE_BIND_SWIPE_ITEM_KEY");function MGe(){const{childProviders:n,length:e,bindChildren:t}=$o(Tae);return{length:e,swipeItems:n,bindSwipeItems:t}}const xae={loop:{type:Boolean,default:!0},autoplay:[String,Number],duration:{type:[String,Number],default:300},initialIndex:{type:[String,Number],default:0},navigation:{type:[Boolean,String],default:!1},indicator:{type:Boolean,default:!0},indicatorColor:String,vertical:Boolean,touchable:{type:Boolean,default:!0},onChange:Se()};var $_=(n,e,t)=>new Promise((i,s)=>{var o=l=>{try{a(t.next(l))}catch(c){s(c)}},r=l=>{try{a(t.throw(l))}catch(c){s(c)}},a=l=>l.done?i(l.value):Promise.resolve(l.value).then(o,r);a((t=t.apply(n,e)).next())});const RGe=250,PGe=20,{name:OGe,n:lG,classes:FGe}=st("swipe"),BGe=["onClick"];function WGe(n,e){const t=gt("var-icon"),i=gt("var-button"),s=hn("hover");return wi((q(),re("div",{class:B(n.n()),ref:"swipeEl"},[me("div",{class:B(n.classes(n.n("track"),[n.vertical,n.n("--vertical")])),style:Fe({width:n.vertical?void 0:"".concat(n.trackSize,"px"),height:n.vertical?"".concat(n.trackSize,"px"):void 0,transform:"translate".concat(n.vertical?"Y":"X","(").concat(n.trackTranslate,"px)"),transitionDuration:n.lockDuration?"0ms":"".concat(n.toNumber(n.duration),"ms")}),onTouchstart:e[0]||(e[0]=(...o)=>n.handleTouchstart&&n.handleTouchstart(...o)),onTouchmove:e[1]||(e[1]=(...o)=>n.handleTouchmove&&n.handleTouchmove(...o)),onTouchend:e[2]||(e[2]=(...o)=>n.handleTouchend&&n.handleTouchend(...o))},[xe(n.$slots,"default")],38),n.navigation?xe(n.$slots,"prev",pf(fn({key:0},{index:n.index,length:n.length,prev:n.prev,next:n.next,to:n.to,hovering:n.hovering})),()=>[Oe(On,{name:n.getNavigationAnimation("prev")},{default:Lt(()=>[n.navigation===!0||n.hovering?(q(),re("div",{key:0,class:B(n.classes(n.n("navigation"),n.n("navigation-prev"),[n.vertical,n.n("--navigation-vertical-prev")]))},[Oe(i,{"var-swipe-cover":"",disabled:!n.loop&&n.index===0,class:B(n.n("navigation-prev-button")),onClick:e[3]||(e[3]=o=>n.prev())},{default:Lt(()=>[Oe(t,{"var-swipe-cover":"",class:B(n.n("navigation-prev-button-icon")),name:n.vertical?"chevron-up":"chevron-left"},null,8,["class","name"])]),_:1},8,["disabled","class"])],2)):Qe("v-if",!0)]),_:1},8,["name"])]):Qe("v-if",!0),n.navigation?xe(n.$slots,"next",pf(fn({key:1},{index:n.index,length:n.length,hovering:n.hovering,prev:n.prev,next:n.next,to:n.to})),()=>[Oe(On,{name:n.getNavigationAnimation("next")},{default:Lt(()=>[n.navigation===!0||n.hovering?(q(),re("div",{key:0,class:B(n.classes(n.n("navigation"),n.n("navigation-next"),[n.vertical,n.n("--navigation-vertical-next")]))},[Oe(i,{"var-swipe-cover":"",class:B(n.n("navigation-next-button")),disabled:!n.loop&&n.index===n.length-1,onClick:e[4]||(e[4]=o=>n.next())},{default:Lt(()=>[Oe(t,{"var-swipe-cover":"",class:B(n.n("navigation-next-button-icon")),name:n.vertical?"chevron-down":"chevron-right"},null,8,["class","name"])]),_:1},8,["class","disabled"])],2)):Qe("v-if",!0)]),_:1},8,["name"])]):Qe("v-if",!0),xe(n.$slots,"indicator",pf(_0({index:n.index,length:n.length,hovering:n.hovering,prev:n.prev,next:n.next,to:n.to})),()=>[n.indicator&&n.length?(q(),re("div",{key:0,class:B(n.classes(n.n("indicators"),[n.vertical,n.n("--indicators-vertical")]))},[(q(!0),re(li,null,ss(n.length,(o,r)=>(q(),re("div",{class:B(n.classes(n.n("indicator"),[n.index===r,n.n("--indicator-active")],[n.vertical,n.n("--indicator-vertical")])),style:Fe({background:n.indicatorColor}),key:o,onClick:a=>n.to(r)},null,14,BGe))),128))],2)):Qe("v-if",!0)])],2)),[[s,n.handleHovering]])}const Nae=et({name:OGe,directives:{Hover:Fa},components:{VarButton:ia,VarIcon:Wn},props:xae,setup(n){const e=se(null),t=se(0),i=ve(()=>n.vertical),s=se(0),o=se(0),r=se(!1),a=se(0),l=se(!1),{swipeItems:c,bindSwipeItems:d,length:u}=MGe(),{popup:h,bindPopup:f}=vVe(),{deltaX:g,deltaY:p,moveX:_,moveY:v,offsetX:b,offsetY:C,touching:w,direction:y,startTime:L,startTouch:S,moveTouch:k,endTouch:D}=j0(),x=ve(()=>y.value===(n.vertical?"vertical":"horizontal"));let A=!1,T=-1;d({size:t,vertical:i}),oe(f,null),ht(()=>u.value,()=>$_(this,null,function*(){yield Cr(),de(),Ke()})),h&&ht(()=>h.show.value,z=>$_(this,null,function*(){z?(yield Cr(),Ke()):ie()})),eh(Ke),rA(ie),U0(Ke);function W(z){return c.find(({index:ae})=>ae.value===z)}function $(){n.loop&&(o.value>=0&&W(u.value-1).setTranslate(-s.value),o.value<=-(s.value-t.value)&&W(0).setTranslate(s.value),o.value>-(s.value-t.value)&&o.value<0&&(W(u.value-1).setTranslate(0),W(0).setTranslate(0)))}function X(z){const ae=qr(z)?z:Math.floor((o.value-t.value/2)/-t.value),{loop:we}=n;return ae<=-1?we?-1:0:ae>=u.value?we?u.value:u.value-1:ae}function J(z){const{loop:ae}=n;return z===-1?ae?u.value-1:0:z===u.value?ae?0:u.value-1:z}function Q(z){return n.loop?z<0?u.value+z:z>=u.value?z-u.value:z:Wf(z,0,u.value-1)}function le(){return $_(this,null,function*(){const z=o.value>=t.value,ae=o.value<=-s.value,we=0,Ne=-(s.value-t.value);r.value=!0,(z||ae)&&(r.value=!0,o.value=ae?we:Ne,W(0).setTranslate(0),W(u.value-1).setTranslate(0)),yield Cr(),r.value=!1})}function de(){A||(a.value=Q(Ie(n.initialIndex)),A=!0)}function _e(){const{autoplay:z}=n;!z||u.value<=1||(ie(),T=window.setTimeout(()=>{Xe(),_e()},Ie(z)))}function ie(){T&&clearTimeout(T)}function ne(z){o.value=z,$()}function Ye(z){return $_(this,null,function*(){u.value<=1||!n.touchable||(S(z),ie(),yield le(),r.value=!0)})}function pe(z){const{touchable:ae,vertical:we}=n;!w.value||!ae||(k(z),x.value&&(dc(z),ne(o.value+(we?v.value:_.value))))}function Ee(){if(!w.value||(D(),!x.value))return;const{vertical:z,onChange:ae}=n,we=z?p.value<0:g.value<0,Ne=z?C.value:b.value,Be=performance.now()-L.value<=RGe&&Ne>=PGe?X(we?a.value+1:a.value-1):X();r.value=!1,ne(Be*-t.value);const Ae=a.value;a.value=J(Be),_e(),Ae!==a.value&&oe(ae,a.value)}function ze(z){n.navigation==="hover"&&(l.value=z)}function It(z){return n.navigation!=="hover"?"":lG("--navigation".concat(n.vertical?"-vertical":"","-").concat(z,"-animation"))}function Ke(){e.value&&(r.value=!0,t.value=n.vertical?e.value.offsetHeight:e.value.offsetWidth,s.value=t.value*u.value,o.value=a.value*-t.value,c.forEach(z=>{z.setTranslate(0)}),_e(),setTimeout(()=>{r.value=!1}))}function Xe(z){return $_(this,null,function*(){if(u.value<=1)return;de();const{loop:ae,onChange:we}=n,Ne=a.value;if(a.value=Q(Ne+1),(z==null?void 0:z.event)!==!1&&oe(we,a.value),yield le(),Ne===u.value-1&&ae){W(0).setTranslate(s.value),o.value=u.value*-t.value;return}Ne!==u.value-1&&(o.value=a.value*-t.value)})}function je(z){return $_(this,null,function*(){if(u.value<=1)return;de();const{loop:ae,onChange:we}=n,Ne=a.value;if(a.value=Q(Ne-1),(z==null?void 0:z.event)!==!1&&oe(we,a.value),yield le(),Ne===0&&ae){W(u.value-1).setTranslate(-s.value),o.value=t.value;return}Ne!==0&&(o.value=a.value*-t.value)})}function Z(z,ae){if(u.value<=1||z===a.value)return;z=z<0?0:z,z=z>=u.value?u.value:z;const we=z>a.value?Xe:je,Ne=Math.abs(z-a.value);Array.from({length:Ne}).forEach((Ce,Be)=>{we({event:Be===Ne-1?ae==null?void 0:ae.event:!1})})}return{length:u,index:a,swipeEl:e,trackSize:s,trackTranslate:o,lockDuration:r,hovering:l,n:lG,classes:FGe,handleTouchstart:Ye,handleTouchmove:pe,handleTouchend:Ee,next:Xe,prev:je,to:Z,resize:Ke,toNumber:Ie,handleHovering:ze,getNavigationAnimation:It}}});Nae.render=WGe;var Aae=Nae;lt(Aae);var Yy=Aae;function VGe(){const{bindParent:n,index:e,parentProvider:t}=Ho(Tae);return n||Oa("SwipeItem"," must in "),{index:e,swipe:t,bindSwipe:n}}const{name:HGe,n:$Ge}=st("swipe-item");function zGe(n,e){return q(),re("div",{class:B(n.n()),style:Fe({width:n.vertical?void 0:"".concat(n.size,"px"),height:n.vertical?"".concat(n.size,"px"):void 0,transform:"translate".concat(n.vertical?"Y":"X","(").concat(n.translate,"px)")})},[xe(n.$slots,"default")],6)}const Mae=et({name:HGe,setup(){const n=se(0),{swipe:e,bindSwipe:t,index:i}=VGe(),{size:s,vertical:o}=e;t({index:i,setTranslate:a});function a(l){n.value=l}return{n:$Ge,size:s,vertical:o,translate:n}}});Mae.render=zGe;var Rae=Mae;lt(Rae);var Zy=Rae,UGe=Object.defineProperty,cG=Object.getOwnPropertySymbols,jGe=Object.prototype.hasOwnProperty,KGe=Object.prototype.propertyIsEnumerable,dG=(n,e,t)=>e in n?UGe(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,uG=(n,e)=>{for(var t in e||(e={}))jGe.call(e,t)&&dG(n,t,e[t]);if(cG)for(var t of cG(e))KGe.call(e,t)&&dG(n,t,e[t]);return n};const qGe=uG(uG({show:Boolean,imagePreventDefault:Boolean,images:{type:Array,default:()=>[]},current:String,initialIndex:{type:[String,Number],default:0},zoom:{type:[String,Number],default:2},closeable:Boolean,"onUpdate:show":Se(),onLongPress:Se()},yi(xae,["loop","indicator","onChange"])),yi(ZS,["lockScroll","teleport","onOpen","onClose","onOpened","onClosed","onRouteChange"])),{name:GGe,n:hG,classes:YGe}=st("image-preview"),r2=12,fG=200,ZGe=350,gG=200,XGe=500,QGe=["onTouchstart"],JGe=["src","alt"];function eYe(n,e){const t=gt("var-swipe-item"),i=gt("var-swipe"),s=gt("var-icon"),o=gt("var-popup");return q(),ei(o,{class:B(n.n("popup")),"var-image-preview-cover":"",transition:n.n("$-fade"),show:n.popupShow,overlay:!1,"close-on-click-overlay":!1,"lock-scroll":n.lockScroll,teleport:n.teleport,onOpen:n.onOpen,onClose:n.onClose,onClosed:n.onClosed,onOpened:n.onOpened,onRouteChange:n.onRouteChange},{default:Lt(()=>[Oe(i,fn({ref:"swipeRef",class:n.n("swipe"),"var-image-preview-cover":"",touchable:n.canSwipe,indicator:n.indicator&&n.images.length>1,"initial-index":n.initialIndex,loop:n.loop,onChange:n.onChange},n.$attrs),{default:Lt(()=>[(q(!0),re(li,null,ss(n.images,(r,a)=>(q(),ei(t,{class:B(n.n("swipe-item")),"var-image-preview-cover":"",key:r},{default:Lt(()=>[me("div",{class:B(n.n("zoom-container")),style:Fe({transform:"scale(".concat(n.scale,") translate(").concat(n.translateX,"px, ").concat(n.translateY,"px)"),transitionTimingFunction:n.transitionTimingFunction,transitionDuration:n.transitionDuration}),onTouchstart:l=>n.handleTouchstart(l,a),onTouchmove:e[0]||(e[0]=(...l)=>n.handleTouchmove&&n.handleTouchmove(...l)),onTouchend:e[1]||(e[1]=(...l)=>n.handleTouchend&&n.handleTouchend(...l)),onTouchcancel:e[2]||(e[2]=(...l)=>n.handleTouchcancel&&n.handleTouchcancel(...l))},[me("img",{class:B(n.classes(n.n("image"),[n.isPreventDefault,n.n("--prevent")])),src:r,alt:r},null,10,JGe)],46,QGe)]),_:2},1032,["class"]))),128))]),indicator:Lt(({index:r,length:a})=>[xe(n.$slots,"indicator",{index:r,length:a},()=>[n.indicator&&n.images.length>1?(q(),re("div",{key:0,class:B(n.n("indicators"))},ut(r+1)+" / "+ut(a),3)):Qe("v-if",!0)])]),_:3},16,["class","touchable","indicator","initial-index","loop","onChange"]),xe(n.$slots,"close-icon",{},()=>[n.closeable?(q(),ei(s,{key:0,class:B(n.n("close-icon")),name:"close-circle","var-image-preview-cover":"",onClick:n.close},null,8,["class","onClick"])):Qe("v-if",!0)]),me("div",{class:B(n.n("extra"))},[xe(n.$slots,"extra")],2)]),_:3},8,["class","transition","show","lock-scroll","teleport","onOpen","onClose","onClosed","onOpened","onRouteChange"])}const Pae=et({name:GGe,components:{VarSwipe:Yy,VarSwipeItem:Zy,VarPopup:gg,VarIcon:Wn},inheritAttrs:!1,props:qGe,setup(n){const e=se(!1),t=se(1),i=se(0),s=se(0),o=se(),r=se(),a=se(!0),l=se(null),{moveX:c,moveY:d,distance:u,startTime:h,startTouch:f,moveTouch:g,endTouch:p}=j0(),_=ve(()=>{const{images:ie,current:ne,initialIndex:Ye}=n;if(Ye!=null)return Ie(Ye);const pe=ie.findIndex(Ee=>Ee===ne);return Math.max(pe,0)}),v=ve(()=>{const{imagePreventDefault:ie,show:ne}=n;return ne&&ie});let b=null,C=null,w=!1;const y={start:null,prev:null};fg(()=>document,"contextmenu",_e),ht(()=>n.show,ie=>{e.value=ie},{immediate:!0});function L(){t.value=Ie(n.zoom),a.value=!1,y.prev=null,window.setTimeout(()=>{o.value="linear",r.value="0s"},gG)}function S(){t.value=1,i.value=0,s.value=0,a.value=!0,y.prev=null,o.value=void 0,r.value=void 0}function k(ie){return y.prev?u.value<=r2&&performance.now()-h.value<=fG&&y.prev===ie:!1}function D(ie){return!ie||!y.start||!y.prev?!1:u.value<=r2&&performance.now()-h.value{ne&&J(),y.start=null},fG)}function T(ie,ne){window.clearTimeout(b),window.clearTimeout(C);const Ye=ie.currentTarget;if(y.start=Ye,C=window.setTimeout(()=>{w=!0,oe(n.onLongPress,ne)},XGe),k(Ye)){t.value>1?S():L();return}f(ie),y.prev=Ye}function P(ie){const{offsetWidth:ne,offsetHeight:Ye}=ie,{naturalWidth:pe,naturalHeight:Ee}=ie.querySelector(".".concat(hG("image")));return{width:ne,height:Ye,imageRadio:Ee/pe,rootRadio:Ye/ne,zoom:Ie(n.zoom)}}function W(ie){const{zoom:ne,imageRadio:Ye,rootRadio:pe,width:Ee,height:ze}=P(ie);if(!Ye)return 0;const It=Ye>pe?ze/Ye:Ee;return Math.max(0,(ne*It-Ee)/2)/ne}function $(ie){const{zoom:ne,imageRadio:Ye,rootRadio:pe,width:Ee,height:ze}=P(ie);if(!Ye)return 0;const It=Ye>pe?ze:Ee*Ye;return Math.max(0,(ne*It-ze)/2)/ne}function X(ie){if(!y.prev)return;g(ie);const ne=ie.currentTarget;if(u.value>r2&&window.clearTimeout(C),t.value>1){const Ye=W(ne),pe=$(ne);i.value=Wf(i.value+c.value,-Ye,Ye),s.value=Wf(s.value+d.value,-pe,pe)}y.prev=ne}function J(){if(t.value>1){S(),setTimeout(()=>oe(n["onUpdate:show"],!1),gG);return}oe(n["onUpdate:show"],!1)}function Q(ie){var ne;(ne=l.value)==null||ne.prev(ie)}function le(ie){var ne;(ne=l.value)==null||ne.next(ie)}function de(ie,ne){var Ye;(Ye=l.value)==null||Ye.to(ie,ne)}function _e(ie){n.imagePreventDefault&&n.show&&dc(ie)}return{swipeRef:l,isPreventDefault:v,initialIndex:_,popupShow:e,scale:t,translateX:i,translateY:s,canSwipe:a,transitionTimingFunction:o,transitionDuration:r,n:hG,classes:YGe,handleTouchstart:T,handleTouchmove:X,handleTouchend:A,handleTouchcancel:x,close:J,prev:Q,next:le,to:de}}});Pae.render=eYe;var CA=Pae,tYe=Object.defineProperty,iYe=Object.defineProperties,nYe=Object.getOwnPropertyDescriptors,pG=Object.getOwnPropertySymbols,sYe=Object.prototype.hasOwnProperty,oYe=Object.prototype.propertyIsEnumerable,mG=(n,e,t)=>e in n?tYe(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,Vk=(n,e)=>{for(var t in e||(e={}))sYe.call(e,t)&&mG(n,t,e[t]);if(pG)for(var t of pG(e))oYe.call(e,t)&&mG(n,t,e[t]);return n},_G=(n,e)=>iYe(n,nYe(e));let Yh,XC={};function rYe(n={}){return Us(n)?_G(Vk({},XC),{images:[n]}):tn(n)?_G(Vk({},XC),{images:n}):Vk(Vk({},XC),n)}function g_(n){if(!nh())return;g_.close();const e=rYe(n),t=Cn(e);t.teleport="body",Yh=t;const{unmountInstance:i}=K0(CA,t,{onClose:()=>oe(t.onClose),onClosed:()=>{oe(t.onClosed),i(),Yh===t&&(Yh=null)},onRouteChange:()=>{i(),Yh===t&&(Yh=null)},"onUpdate:show":s=>{t.show=s}});t.show=!0}g_.close=()=>{if(Yh!=null){const n=Yh;Yh=null,Fn().then(()=>{n.show=!1})}};g_.setDefaultOptions=n=>{XC=n};g_.resetDefaultOptions=()=>{XC={}};g_.Component=CA;lt(CA);lt(CA,g_);var Xy=g_;const UD={offsetTop:{type:[String,Number],default:0},zIndex:{type:[String,Number],default:10},cssMode:Boolean,disabled:Boolean,onScroll:Se()};var vG=(n,e,t)=>new Promise((i,s)=>{var o=l=>{try{a(t.next(l))}catch(c){s(c)}},r=l=>{try{a(t.throw(l))}catch(c){s(c)}},a=l=>l.done?i(l.value):Promise.resolve(l.value).then(o,r);a((t=t.apply(n,e)).next())});const{name:aYe,n:lYe,classes:cYe}=st("sticky");function dYe(n,e){return q(),re("div",{class:B(n.classes(n.n(),[n.enableCSSMode,n.n("--css-mode")])),ref:"stickyEl",style:Fe({zIndex:n.toNumber(n.zIndex),top:n.enableCSSMode?"".concat(n.offsetTop,"px"):void 0,width:n.enableFixedMode?n.fixedWidth:void 0,height:n.enableFixedMode?n.fixedHeight:void 0})},[me("div",{class:B(n.n("wrapper")),ref:"wrapperEl",style:Fe({zIndex:n.toNumber(n.zIndex),position:n.enableFixedMode?"fixed":void 0,width:n.enableFixedMode?n.fixedWrapperWidth:void 0,height:n.enableFixedMode?n.fixedWrapperHeight:void 0,left:n.enableFixedMode?n.fixedLeft:void 0,top:n.enableFixedMode?n.fixedTop:void 0})},[xe(n.$slots,"default")],6)],6)}const Oae=et({name:aYe,props:UD,setup(n){const e=se(null),t=se(null),i=se(!1),s=se("0px"),o=se("0px"),r=se("auto"),a=se("auto"),l=se("auto"),c=se("auto"),d=ve(()=>!n.disabled&&n.cssMode),u=ve(()=>!n.disabled&&!n.cssMode&&i.value),h=ve(()=>jn(n.offsetTop));let f;ht(()=>n.disabled,_),Vo(v),rA(b),U0(_),fg(()=>window,"scroll",p);function g(){const{cssMode:C,disabled:w}=n;if(w)return;let y=0;if(f!==window){const{top:A}=no(f);y=A}const L=t.value,S=e.value,{top:k,left:D}=no(S),x=k-y;return x<=h.value?(C||(r.value="".concat(S.offsetWidth,"px"),a.value="".concat(S.offsetHeight,"px"),s.value="".concat(y+h.value,"px"),o.value="".concat(D,"px"),l.value="".concat(L.offsetWidth,"px"),c.value="".concat(L.offsetHeight,"px"),i.value=!0),{offsetTop:h.value,isFixed:!0}):(i.value=!1,{offsetTop:x,isFixed:!1})}function p(){if(!f)return;const C=g();C&&oe(n.onScroll,C.offsetTop,C.isFixed)}function _(){return vG(this,null,function*(){i.value=!1,yield Gk(),g()})}function v(){return vG(this,null,function*(){yield Cr(),f=pg(e.value),f!==window&&f.addEventListener("scroll",p),p()})}function b(){f!==window&&f.removeEventListener("scroll",p)}return{stickyEl:e,wrapperEl:t,isFixed:i,offsetTop:h,fixedTop:s,fixedLeft:o,fixedWidth:r,fixedHeight:a,fixedWrapperWidth:l,fixedWrapperHeight:c,enableCSSMode:d,enableFixedMode:u,n:lYe,classes:cYe,resize:_,toNumber:Ie}}});Oae.render=dYe;var Fae=Oae;lt(Fae);var Qy=Fae;const Bae=Symbol("INDEX_BAR_BIND_INDEX_ANCHOR_KEY");function uYe(){const{bindChildren:n,length:e,childProviders:t}=$o(Bae);return{length:e,indexAnchors:t,bindIndexAnchors:n}}function hYe(){const{parentProvider:n,index:e,bindParent:t}=Ho(Bae);return t||Oa("IndexAnchor",'You should use this component in "IndexBar"'),{index:e,indexBar:n,bindIndexBar:t}}const fYe={index:[Number,String]},{name:gYe,n:pYe,classes:mYe}=st("index-anchor");function _Ye(n,e){return q(),ei(m0(n.sticky?n.n("$-sticky"):n.Transition),{"offset-top":n.sticky?n.stickyOffsetTop:null,"z-index":n.sticky?n.zIndex:null,disabled:n.disabled&&!n.cssMode,"css-mode":n.cssMode,ref:"anchorEl"},{default:Lt(()=>[me("div",fn({class:n.n()},n.$attrs),[xe(n.$slots,"default",{},()=>[Mi(ut(n.name),1)])],16)]),_:3},8,["offset-top","z-index","disabled","css-mode"])}const Wae=et({name:gYe,components:{VarSticky:Qy},inheritAttrs:!1,props:fYe,setup(n){const e=se(0),t=se(!1),i=ve(()=>n.index),s=se(null),{index:o,indexBar:r,bindIndexBar:a}=hYe(),{active:l,sticky:c,cssMode:d,stickyOffsetTop:u,zIndex:h}=r;a({index:o,name:i,ownTop:e,setOwnTop:g,setDisabled:p});function g(){s.value&&(e.value=s.value.$el?s.value.$el.offsetTop:s.value.offsetTop)}function p(_){t.value=_}return{n:pYe,classes:mYe,name:i,anchorEl:s,active:l,sticky:c,zIndex:h,disabled:t,cssMode:d,stickyOffsetTop:u,Transition:On}}});Wae.render=_Ye;var Vae=Wae;lt(Vae);var B3=Vae;const vYe={sticky:{type:Boolean,default:!0},stickyOffsetTop:{type:[String,Number],default:0},cssMode:Boolean,stickyCssMode:Boolean,hideList:Boolean,zIndex:{type:[Number,String],default:1},highlightColor:String,duration:{type:[Number,String],default:0},onClick:Se(),onChange:Se()};var Hk=(n,e,t)=>new Promise((i,s)=>{var o=l=>{try{a(t.next(l))}catch(c){s(c)}},r=l=>{try{a(t.throw(l))}catch(c){s(c)}},a=l=>l.done?i(l.value):Promise.resolve(l.value).then(o,r);a((t=t.apply(n,e)).next())});const{name:bYe,n:CYe,classes:wYe}=st("index-bar"),yYe=["onClick"];function SYe(n,e){return q(),re("div",{class:B(n.n()),ref:"barEl"},[xe(n.$slots,"default"),me("ul",{class:B(n.n("anchor-list")),style:Fe({zIndex:n.toNumber(n.zIndex)+2,display:n.hideList?"none":"block"})},[(q(!0),re(li,null,ss(n.anchorNameList,t=>(q(),re("li",{key:t,class:B(n.classes(n.n("anchor-item"),[n.active===t,n.n("anchor-item--active")])),style:Fe({color:n.active===t&&n.highlightColor?n.highlightColor:""}),onClick:i=>n.anchorClick({anchorName:t,manualCall:!0})},ut(t),15,yYe))),128))],6)],2)}const Hae=et({name:bYe,props:vYe,setup(n){const e=se(""),t=se(null),i=se([]),s=se(),o=ve(()=>n.sticky),r=ve(()=>n.stickyCssMode||n.cssMode),a=ve(()=>jn(n.stickyOffsetTop)),l=ve(()=>n.zIndex),{length:c,indexAnchors:d,bindIndexAnchors:u}=uYe();let h=null,f=!1;const g={active:s,sticky:o,cssMode:r,stickyOffsetTop:a,zIndex:l};ht(()=>c.value,()=>Hk(this,null,function*(){yield Cr(),d.forEach(({name:S,setOwnTop:k})=>{S.value&&i.value.push(S.value),k()})})),Vo(()=>Hk(this,null,function*(){yield C(),w()})),zm(y),$m(()=>{f=!0,y()}),eh(()=>{!f||s.value===void 0||(b({anchorName:s.value,options:{event:!1}}),f=!1)}),u(g);function p(S,k){const D=ju(S)?S.name.value:S;D===s.value||D===void 0||(s.value=D,(k==null?void 0:k.event)!==!1&&oe(n.onChange,D))}function _(){if(qB(h))return 0;const{top:S}=no(h),{scrollTop:k}=h,{top:D}=no(t.value);return k-S+D}function v(){const S=hb(h),k=h===window?document.body.scrollHeight:h.scrollHeight,D=_();d.forEach((x,A)=>{const T=x.ownTop.value,P=S-T+a.value-D,W=A===d.length-1?k:d[A+1].ownTop.value-x.ownTop.value;x.setDisabled(!0),P>=0&&Pk===$.value);if(!A)return;const T=_(),P=A.ownTop.value-a.value+T,W=GB(h);e.value=k,p(k,x),yield $y(h,{left:W,top:P,animation:yoe,duration:Ie(n.duration)}),yield Cr(),e.value=""})}function C(){return Hk(this,null,function*(){yield Cr(),h=pg(t.value)})}function w(){h.addEventListener("scroll",v)}function y(){h.removeEventListener("scroll",v)}function L(S,k){aw(()=>b({anchorName:S,options:k}))}return{barEl:t,active:s,zIndex:l,anchorNameList:i,n:CYe,classes:wYe,toNumber:Ie,scrollTo:L,anchorClick:b}}});Hae.render=SYe;var $ae=Hae;lt($ae);var W3=$ae,LYe=Object.defineProperty,bG=Object.getOwnPropertySymbols,kYe=Object.prototype.hasOwnProperty,DYe=Object.prototype.propertyIsEnumerable,CG=(n,e,t)=>e in n?LYe(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,EYe=(n,e)=>{for(var t in e||(e={}))kYe.call(e,t)&&CG(n,t,e[t]);if(bG)for(var t of bG(e))DYe.call(e,t)&&CG(n,t,e[t]);return n};const IYe=EYe({modelValue:String,modelModifiers:{type:Object,default:()=>({})},type:{type:String,default:"text"},textarea:Boolean,rows:{type:[String,Number],default:8},maxlength:[String,Number],readonly:Boolean,resize:Boolean,autofocus:Boolean,validateTrigger:{type:Array,default:()=>["onInput","onClear"]},rules:Array,enterkeyhint:String,onFocus:Se(),onBlur:Se(),onInput:Se(),onChange:Se(),onClear:Se(),"onUpdate:modelValue":Se()},yi($6,["size","variant","placeholder","line","hint","textColor","focusColor","blurColor","disabled","clearable","onClick"])),{name:TYe,n:xYe,classes:NYe}=st("input"),AYe=["placeholder","enterkeyhint"],MYe=["id","disabled","readonly","type","value","placeholder","maxlength","rows","enterkeyhint","inputmode"],RYe=["id","disabled","readonly","type","value","placeholder","maxlength","enterkeyhint","inputmode"];function PYe(n,e){const t=gt("var-field-decorator"),i=gt("var-form-details");return q(),re("div",{class:B(n.classes(n.n(),n.n("$--box"))),onMousedown:e[13]||(e[13]=(...s)=>n.handleMousedown&&n.handleMousedown(...s))},[Oe(t,pf(_0({value:n.modelValue,id:n.id,size:n.size,variant:n.variant,placeholder:n.placeholder,line:n.line,hint:n.hint,textColor:n.textColor,focusColor:n.focusColor,blurColor:n.blurColor,isFocus:n.isFocus,errorMessage:n.errorMessage,formDisabled:n.formDisabled,disabled:n.disabled,clearable:n.clearable,cursor:n.cursor,composing:n.isComposing,onClick:n.handleClick,onClear:n.handleClear})),ZD({"append-icon":Lt(()=>[xe(n.$slots,"append-icon")]),default:Lt(()=>[n.normalizedType==="password"?(q(),re("input",{key:0,tabindex:"-1",class:B(n.n("autocomplete")),placeholder:n.hint?void 0:n.placeholder,style:Fe({"--input-placeholder-color":n.placeholderColor}),enterkeyhint:n.enterkeyhint},null,14,AYe)):Qe("v-if",!0),n.textarea?(q(),re("textarea",{key:1,class:B(n.classes(n.n("input"),n.n("--textarea"),[n.formDisabled||n.disabled,n.n("--disabled")],[n.errorMessage,n.n("--error")],[n.errorMessage,n.n("--caret-error")])),ref:"el",autocomplete:"new-password",id:n.id,disabled:n.formDisabled||n.disabled,readonly:n.formReadonly||n.readonly,type:n.normalizedType,value:n.modelValue,placeholder:n.hint?void 0:n.placeholder,maxlength:n.maxlength,rows:n.rows,enterkeyhint:n.enterkeyhint,inputmode:n.type==="number"?"numeric":void 0,style:Fe({color:n.errorMessage?void 0:n.textColor,caretColor:n.errorMessage?void 0:n.focusColor,resize:n.resize?"vertical":"none","--input-placeholder-color":n.placeholderColor}),onFocus:e[0]||(e[0]=(...s)=>n.handleFocus&&n.handleFocus(...s)),onBlur:e[1]||(e[1]=(...s)=>n.handleBlur&&n.handleBlur(...s)),onInput:e[2]||(e[2]=(...s)=>n.handleInput&&n.handleInput(...s)),onChange:e[3]||(e[3]=(...s)=>n.handleChange&&n.handleChange(...s)),onCompositionstart:e[4]||(e[4]=(...s)=>n.handleCompositionStart&&n.handleCompositionStart(...s)),onCompositionend:e[5]||(e[5]=(...s)=>n.handleCompositionEnd&&n.handleCompositionEnd(...s))},"\n ",46,MYe)):(q(),re("input",{key:2,class:B(n.classes(n.n("input"),[n.formDisabled||n.disabled,n.n("--disabled")],[n.errorMessage,n.n("--error")],[n.errorMessage,n.n("--caret-error")])),ref:"el",autocomplete:"new-password",id:n.id,disabled:n.formDisabled||n.disabled,readonly:n.formReadonly||n.readonly,type:n.normalizedType,value:n.modelValue,placeholder:n.hint?void 0:n.placeholder,maxlength:n.maxlength,enterkeyhint:n.enterkeyhint,inputmode:n.type==="number"?"numeric":void 0,style:Fe({color:n.errorMessage?void 0:n.textColor,caretColor:n.errorMessage?void 0:n.focusColor,"--input-placeholder-color":n.placeholderColor}),onFocus:e[6]||(e[6]=(...s)=>n.handleFocus&&n.handleFocus(...s)),onBlur:e[7]||(e[7]=(...s)=>n.handleBlur&&n.handleBlur(...s)),onInput:e[8]||(e[8]=(...s)=>n.handleInput&&n.handleInput(...s)),onChange:e[9]||(e[9]=(...s)=>n.handleChange&&n.handleChange(...s)),onCompositionstart:e[10]||(e[10]=(...s)=>n.handleCompositionStart&&n.handleCompositionStart(...s)),onCompositionend:e[11]||(e[11]=(...s)=>n.handleCompositionEnd&&n.handleCompositionEnd(...s))},null,46,RYe))]),_:2},[n.$slots["prepend-icon"]?{name:"prepend-icon",fn:Lt(()=>[xe(n.$slots,"prepend-icon")]),key:"0"}:void 0]),1040),Oe(i,{"error-message":n.errorMessage,"extra-message":n.maxlengthText,onMousedown:e[12]||(e[12]=Ia(()=>{},["stop"]))},ZD({_:2},[n.$slots["extra-message"]?{name:"extra-message",fn:Lt(()=>[xe(n.$slots,"extra-message")]),key:"0"}:void 0]),1032,["error-message","extra-message"])],34)}const zae=et({name:TYe,components:{VarFormDetails:na,VarFieldDecorator:Gy},props:IYe,setup(n){const e=qse(),t=se(null),i=se(!1),s=se(!1),{bindForm:o,form:r}=kl(),{errorMessage:a,validateWithTrigger:l,validate:c,resetValidation:d}=Ll(),u=ve(()=>n.disabled||n.readonly?"":"text"),h=ve(()=>n.type==="number"?"text":n.type),f=ve(()=>{const{maxlength:Q,modelValue:le}=n;return Q?hd(le)?"0 / ".concat(Q):"".concat(String(le).length,"/").concat(Q):""}),g=ve(()=>{const{hint:Q,blurColor:le,focusColor:de}=n;if(!Q)return a.value?"var(--field-decorator-error-color)":i.value?de||"var(--field-decorator-focus-color)":le||"var(--field-decorator-placeholder-color, var(--field-decorator-blur-color))"});oe(o,{reset:W,validate:$,resetValidation:d}),Vo(()=>{n.autofocus&&X()});function _(Q){Fn(()=>{const{validateTrigger:le,rules:de,modelValue:_e}=n;l(le,Q,de,_e)})}function v(Q){i.value=!0,oe(n.onFocus,Q),_("onFocus")}function b(Q){i.value=!1,oe(n.onBlur,Q),_("onBlur")}function C(Q){const le=Q.target;let{value:de}=le;return n.type==="number"&&(de=x(de)),T(A(de))}function w(){s.value=!0}function y(Q){s.value&&(s.value=!1,Q.target.dispatchEvent(new Event("input")))}function L(Q){if(s.value)return;const le=C(Q);oe(n["onUpdate:modelValue"],le),oe(n.onInput,le,Q),_("onInput")}function S(Q){const le=C(Q);oe(n.onChange,le,Q),_("onChange")}function k(){const{disabled:Q,readonly:le,clearable:de,onClear:_e}=n;r!=null&&r.disabled.value||r!=null&&r.readonly.value||Q||le||!de||(oe(n["onUpdate:modelValue"],""),oe(_e,""),_("onClear"))}function D(Q){const{disabled:le,onClick:de}=n;r!=null&&r.disabled.value||le||(oe(de,Q),_("onClick"))}function x(Q){const le=Q.indexOf("-"),de=Q.indexOf(".");return le>-1&&(Q=le===0?"-"+Q.replace(/-/g,""):Q.replace(/-/g,"")),de>-1&&(Q=Q.slice(0,de+1)+Q.slice(de).replace(/\./g,"")),Q.replace(/[^-0-9.]/g,"")}function A(Q){return n.modelModifiers.trim?Q.trim():Q}function T(Q){return n.maxlength?Q.slice(0,Ie(n.maxlength)):Q}function P(Q){const{disabled:le}=n;r!=null&&r.disabled.value||le||Q.target===t.value||(X(),dc(Q))}function W(){oe(n["onUpdate:modelValue"],""),d()}function $(){return c(n.rules,n.modelValue)}function X(){var Q;(Q=t.value)==null||Q.focus()}function J(){t.value.blur()}return{el:t,id:e,isFocus:i,isComposing:s,errorMessage:a,placeholderColor:g,normalizedType:h,cursor:u,maxlengthText:f,formDisabled:r==null?void 0:r.disabled,formReadonly:r==null?void 0:r.readonly,n:xYe,classes:NYe,isEmpty:hd,handleFocus:v,handleBlur:b,handleInput:L,handleChange:S,handleClear:k,handleClick:D,handleCompositionStart:w,handleCompositionEnd:y,handleMousedown:P,validate:$,resetValidation:d,reset:W,focus:X,blur:J}}});zae.render=PYe;var Uae=zae;lt(Uae);var yT=Uae;const OYe={type:{type:String,default:"default"},href:String,target:String,rel:String,to:[String,Object],replace:Boolean,underline:{type:String,default:"always"},disabled:Boolean,textSize:[String,Number],textColor:String,onClick:Se()},{name:FYe,n:BYe,classes:WYe}=st("link");function VYe(n,e){return q(),ei(m0(n.tag),fn(n.linkProps,{class:n.classes(n.n(),n.n("$--box"),n.n("$--inline-flex"),n.n("--".concat(n.type)),[n.underline!=="none",n.n("--underline-".concat(n.underline))],[n.disabled,n.n("--disabled")]),style:{color:n.textColor,fontSize:n.toSizeUnit(n.textSize)},onClick:n.handleClick}),{default:Lt(()=>[xe(n.$slots,"default")]),_:3},16,["class","style","onClick"])}const jae=et({name:FYe,props:OYe,setup(n){const e=ve(()=>n.disabled?"span":n.href?"a":n.to?"router-link":"a"),t=ve(()=>{const{disabled:s,href:o,target:r,to:a,replace:l,rel:c}=n;return s?{}:o?{href:o,target:r,rel:c}:a?{to:a,target:r,replace:l}:{}});function i(s){n.disabled||oe(n.onClick,s)}return{tag:e,linkProps:t,n:BYe,classes:WYe,handleClick:i,toSizeUnit:ri}}});jae.render=VYe;var Kae=jae;lt(Kae);var V3=Kae;const HYe={loading:Boolean,immediateCheck:{type:Boolean,default:!0},finished:Boolean,error:Boolean,offset:{type:[String,Number],default:0},loadingText:String,finishedText:String,errorText:String,onLoad:Se(),"onUpdate:loading":Se(),"onUpdate:error":Se()},qae=Symbol("TABS_ITEMS_BIND_TAB_ITEM_KEY");function $Ye(){const{bindChildren:n,childProviders:e,length:t}=$o(qae);return{length:t,tabItemList:e,bindTabItem:n}}const Gae=Symbol("TAB_ITEM_BIND_LIST_KEY");function zYe(){const{parentProvider:n,bindParent:e,index:t}=Ho(qae);return e||Oa("TabItem"," must in "),{index:t,tabsItems:n,bindTabsItems:e}}function UYe(){const{childProviders:n,bindChildren:e,length:t}=$o(Gae);return{length:t,lists:n,bindLists:e}}function jYe(){const{parentProvider:n,bindParent:e,index:t}=Ho(Gae);return{index:t,tabItem:n,bindTabItem:e}}var KYe=(n,e,t)=>new Promise((i,s)=>{var o=l=>{try{a(t.next(l))}catch(c){s(c)}},r=l=>{try{a(t.throw(l))}catch(c){s(c)}},a=l=>l.done?i(l.value):Promise.resolve(l.value).then(o,r);a((t=t.apply(n,e)).next())});const{name:qYe,n:GYe,classes:YYe}=st("list");function ZYe(n,e){const t=gt("var-loading"),i=hn("ripple");return q(),re("div",{class:B(n.classes(n.n(),n.n("$--box"))),ref:"listEl"},[xe(n.$slots,"default"),n.loading?xe(n.$slots,"loading",{key:0},()=>{var s;return[me("div",{class:B(n.n("loading"))},[me("div",{class:B(n.n("loading-text"))},ut((s=n.loadingText)!=null?s:n.pack.listLoadingText),3),Oe(t,{size:"mini",radius:10})],2)]}):Qe("v-if",!0),n.finished?xe(n.$slots,"finished",{key:1},()=>{var s;return[me("div",{class:B(n.n("finished"))},ut((s=n.finishedText)!=null?s:n.pack.listFinishedText),3)]}):Qe("v-if",!0),n.error?xe(n.$slots,"error",{key:2},()=>{var s;return[wi((q(),re("div",{class:B(n.n("error")),onClick:e[0]||(e[0]=(...o)=>n.load&&n.load(...o))},[Mi(ut((s=n.errorText)!=null?s:n.pack.listErrorText),1)],2)),[[i]])]}):Qe("v-if",!0),me("div",{class:B(n.n("detector")),ref:"detectorEl"},null,2)],2)}const Yae=et({name:qYe,directives:{Ripple:Ns},components:{VarLoading:l0},props:HYe,setup(n){const e=se(null),t=se(null),{tabItem:i,bindTabItem:s}=jYe();let o;oe(s,{}),i&&ht(()=>i.current.value,c),ht(()=>[n.loading,n.error,n.finished],c),Vo(()=>{o=pg(e.value),o.addEventListener("scroll",c),n.immediateCheck&&c()}),rA(l);function r(){oe(n["onUpdate:error"],!1),oe(n["onUpdate:loading"],!0),oe(n.onLoad)}function a(){const{bottom:d}=no(o),{bottom:u}=no(t.value);return Math.floor(u)-jn(n.offset)<=d}function l(){o.removeEventListener("scroll",c)}function c(){return KYe(this,null,function*(){yield Fn(),!(n.loading||n.finished||n.error||(i==null?void 0:i.current.value)===!1||!a())&&r()})}return{pack:Xs,listEl:e,detectorEl:t,isNumber:qr,load:r,check:c,n:GYe,classes:YYe}}});Yae.render=ZYe;var Zae=Yae;lt(Zae);var H3=Zae;const XYe={value:{type:Number,default:0},opacity:{type:Number,default:0},error:Boolean,color:String,errorColor:String,height:[Number,String],top:[Number,String]},{name:QYe,classes:JYe,n:wG}=st("loading-bar");var eZe=et({name:QYe,props:XYe,setup(n){return()=>Oe("div",{class:JYe(wG(),[n.error,wG("--error")]),style:{zIndex:Ea.zIndex+10,width:"".concat(n.value,"%"),opacity:n.opacity,height:ri(n.height),backgroundColor:n.error?n.errorColor:n.color,top:ri(n.top)}},null)}});let Xae,Qae,wA,Jae,yG,ele={};const tZe={value:0,opacity:0,error:!1},vo=Cn(tZe),iZe=n=>{Object.assign(vo,n)},nZe=n=>{Object.assign(vo,n),ele=n},sZe=()=>{Object.keys(ele).forEach(n=>{vo[n]!==void 0&&(vo[n]=void 0)})},tle=()=>{yG||(yG=!0,K0(eZe,vo))},z6=()=>{Xae=window.setTimeout(()=>{if(vo.value>=95)return;let n=Math.random();vo.value<70&&(n=Math.round(5*Math.random())),vo.value+=n,z6()},200)},U6=()=>{window.clearTimeout(Qae),window.clearTimeout(Xae),window.clearTimeout(wA),window.clearTimeout(Jae)},oZe=()=>{U6(),vo.error=!1,vo.value=0,tle(),wA=window.setTimeout(()=>{vo.opacity=1},200),z6()},ile=()=>{U6(),vo.value=100,wA=window.setTimeout(()=>{vo.opacity=0,Qae=window.setTimeout(()=>{vo.error=!1},250)},300)},rZe=()=>{U6(),vo.error=!0,vo.value===100&&(vo.value=0),tle(),wA=window.setTimeout(()=>{vo.opacity=1},200),z6(),Jae=window.setTimeout(ile,300)},aZe={start:oZe,finish:ile,error:rZe,mergeConfig:iZe,setDefaultOptions:nZe,resetDefaultOptions:sZe};var $3=aZe;const nle={show:Boolean,disabled:Boolean,trigger:{type:String,default:"click"},reference:String,placement:{type:String,default:"cover-top-start"},strategy:{type:String,default:"absolute"},offsetX:{type:[Number,String],default:0},offsetY:{type:[Number,String],default:0},teleport:{type:[String,Object,Boolean],default:"body"},sameWidth:Boolean,elevation:{type:[Boolean,String,Number],default:!0},defaultStyle:{type:Boolean,default:!0},popoverClass:String,closeOnClickReference:Boolean,onOpen:Se(),onOpened:Se(),onClose:Se(),onClosed:Se(),onClickOutside:Se(),"onUpdate:show":Se()},{name:lZe,n:cZe,classes:dZe}=st("menu");function uZe(n,e){return q(),re("div",{ref:"host",class:B(n.classes(n.n(),n.n("$--box"))),onClick:e[3]||(e[3]=(...t)=>n.handleHostClick&&n.handleHostClick(...t)),onMouseenter:e[4]||(e[4]=(...t)=>n.handleHostMouseenter&&n.handleHostMouseenter(...t)),onMouseleave:e[5]||(e[5]=(...t)=>n.handleHostMouseleave&&n.handleHostMouseleave(...t))},[xe(n.$slots,"default"),(q(),ei(Bd,{to:n.teleport===!1?void 0:n.teleport,disabled:n.teleportDisabled||n.teleport===!1},[Oe(On,{name:n.n(),onAfterEnter:n.onOpened,onAfterLeave:n.handleClosed,persisted:""},{default:Lt(()=>[wi(me("div",{ref:"popover",style:Fe({zIndex:n.zIndex,width:n.sameWidth?n.toSizeUnit(Math.ceil(n.hostSize.width)):void 0}),class:B(n.classes(n.n("menu"),n.n("$--box"),n.popoverClass,[n.defaultStyle,n.n("--menu-background-color")],[n.defaultStyle,n.formatElevation(n.elevation,3)])),onClick:e[0]||(e[0]=Ia(()=>{},["stop"])),onMouseenter:e[1]||(e[1]=(...t)=>n.handlePopoverMouseenter&&n.handlePopoverMouseenter(...t)),onMouseleave:e[2]||(e[2]=(...t)=>n.handlePopoverMouseleave&&n.handlePopoverMouseleave(...t))},[xe(n.$slots,"menu")],38),[[hl,n.show]])]),_:3},8,["name","onAfterEnter","onAfterLeave"])],8,["to","disabled"]))],34)}const sle=et({name:lZe,props:nle,setup(n){const{disabled:e}=u_(),{popover:t,host:i,hostSize:s,show:o,zIndex:r,handleHostClick:a,handleHostMouseenter:l,handleHostMouseleave:c,handlePopoverMouseenter:d,handlePopoverMouseleave:u,handlePopoverClose:h,handleClosed:f,open:g,close:p,resize:_}=mae(n);return{popover:t,host:i,hostSize:s,show:o,zIndex:r,teleportDisabled:e,formatElevation:or,toSizeUnit:ri,n:cZe,classes:dZe,handleHostClick:a,handleHostMouseenter:l,handleHostMouseleave:c,handlePopoverMouseenter:d,handlePopoverMouseleave:u,handlePopoverClose:h,handleClosed:f,resize:_,open:g,close:p}}});sle.render=uZe;var ole=sle;lt(ole);var f0=ole;const rle=Symbol("MENU_SELECT_BIND_MENU_OPTION_KEY");function hZe(){const{length:n,childProviders:e,bindChildren:t}=$o(rle);return{length:n,menuOptions:e,bindMenuOptions:t}}function fZe(){const{index:n,parentProvider:e,bindParent:t}=Ho(rle);return t||Oa("MenuOption"," must in "),{index:n,menuSelect:e,bindMenuSelect:t}}const gZe={label:{},value:{},disabled:Boolean},{name:pZe,n:mZe,classes:_Ze}=st("menu-option");function vZe(n,e){const t=gt("var-checkbox"),i=gt("var-hover-overlay"),s=hn("ripple"),o=hn("hover");return wi((q(),re("div",{class:B(n.classes(n.n(),n.n("$--box"),n.n("--".concat(n.size)),[n.optionSelected,n.n("--selected-color")],[n.disabled,n.n("--disabled")])),onClick:e[2]||(e[2]=(...r)=>n.handleClick&&n.handleClick(...r))},[me("div",{class:B(n.classes(n.n("cover"),[n.optionSelected,n.n("--selected-background")]))},null,2),n.multiple?(q(),ei(t,{key:0,ref:"checkbox",modelValue:n.optionSelected,"onUpdate:modelValue":e[0]||(e[0]=r=>n.optionSelected=r),disabled:n.disabled,onClick:e[1]||(e[1]=Ia(()=>{},["stop"])),onChange:n.handleSelect},null,8,["modelValue","disabled","onChange"])):Qe("v-if",!0),xe(n.$slots,"default",{},()=>[me("div",{class:B(n.classes(n.n("text"),n.n("$--ellipsis")))},ut(n.label),3)]),Oe(i,{hovering:n.hovering&&!n.disabled},null,8,["hovering"])],2)),[[s,{disabled:n.disabled}],[o,n.handleHovering,"desktop"]])}const ale=et({name:pZe,directives:{Ripple:Ns,Hover:Fa},components:{VarCheckbox:Uy,VarHoverOverlay:ml},props:gZe,setup(n){const e=se(!1),t=ve(()=>e.value),i=ve(()=>n.label),s=ve(()=>n.value),{menuSelect:o,bindMenuSelect:r}=fZe(),{size:a,multiple:l,onSelect:c,computeLabel:d}=o,{hovering:u,handleHovering:h}=Pd(),f={label:i,value:s,selected:t,sync:_};ht([()=>n.label,()=>n.value],d),r(f);function g(){n.disabled||p()}function p(){l.value&&(e.value=!e.value),c(f)}function _(v){e.value=v}return{optionSelected:e,size:a,multiple:l,hovering:u,n:mZe,classes:_Ze,handleHovering:h,handleClick:g,handleSelect:p}}});ale.render=vZe;var lle=ale;lt(lle);var z3=lle,bZe=Object.defineProperty,SG=Object.getOwnPropertySymbols,CZe=Object.prototype.hasOwnProperty,wZe=Object.prototype.propertyIsEnumerable,LG=(n,e,t)=>e in n?bZe(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,yZe=(n,e)=>{for(var t in e||(e={}))CZe.call(e,t)&&LG(n,t,e[t]);if(SG)for(var t of SG(e))wZe.call(e,t)&&LG(n,t,e[t]);return n};const SZe=yZe({modelValue:{default:void 0},size:{type:String,default:"normal"},multiple:Boolean,scrollable:Boolean,closeOnSelect:{type:Boolean,default:!0},"onUpdate:modelValue":Se()},yi(nle,["show","disabled","trigger","reference","placement","strategy","offsetX","offsetY","teleport","sameWidth","elevation","popoverClass","closeOnClickReference","onOpen","onOpened","onClose","onClosed","onClickOutside","onUpdate:show"]));function cle(n){const{multiple:e,modelValue:t,optionProviders:i,optionProvidersLength:s}=n,o=se(""),r=se([]);ht(t,u,{deep:!0}),ht(s,u);function a(){const h=e(),f=t();h&&(r.value=f.map(l)),!h&&!hd(f)&&(o.value=l(f)),!h&&hd(f)&&(o.value="")}function l(h){var f;const g=i();let p=g.find(({value:_})=>_.value===h);return p||(p=g.find(({label:_})=>_.value===h)),(f=p==null?void 0:p.label.value)!=null?f:""}function c({value:h,label:f}){return h.value!=null?h.value:f.value}function d(h){const f=e(),g=i();return f?g.filter(({selected:p})=>p.value).map(c):c(h)}function u(){const h=e(),f=t(),g=i();h?g.forEach(p=>p.sync(f.includes(c(p)))):g.forEach(p=>p.sync(f===c(p))),a()}return{label:o,labels:r,computeLabel:a,getSelectedValue:d}}const{name:LZe,n:kZe,classes:DZe}=st("menu-select");function EZe(n,e){const t=gt("var-menu");return q(),ei(t,{ref:"menu",class:B(n.n()),disabled:n.disabled,trigger:n.trigger,reference:n.reference,placement:n.placement,strategy:n.strategy,"offset-x":n.offsetX,"offset-y":n.offsetY,teleport:n.teleport,"same-width":n.sameWidth,elevation:n.elevation,"default-style":!1,"popover-class":n.popoverClass,"close-on-click-reference":n.closeOnClickReference,show:n.show,"onUpdate:show":e[0]||(e[0]=i=>n.show=i),onOpen:n.onOpen,onOpened:n.onOpened,onClose:n.onClose,onClosed:n.onClosed,onClickOutside:n.onClickOutside},{menu:Lt(()=>[me("div",{class:B(n.classes(n.n("menu"),n.formatElevation(n.elevation,3),[n.scrollable,n.n("--scrollable")]))},[xe(n.$slots,"options")],2)]),default:Lt(()=>[xe(n.$slots,"default")]),_:3},8,["class","disabled","trigger","reference","placement","strategy","offset-x","offset-y","teleport","same-width","elevation","popover-class","close-on-click-reference","show","onOpen","onOpened","onClose","onClosed","onClickOutside"])}const dle=et({name:LZe,components:{VarMenu:f0},props:SZe,setup(n){const e=se(null),t=Xu(n,"show"),{menuOptions:i,length:s,bindMenuOptions:o}=hZe(),{computeLabel:r,getSelectedValue:a}=cle({modelValue:()=>n.modelValue,multiple:()=>n.multiple,optionProviders:()=>i,optionProvidersLength:()=>s.value}),l={size:ve(()=>n.size),multiple:ve(()=>n.multiple),computeLabel:r,onSelect:c};o(l);function c(f){const{multiple:g,closeOnSelect:p}=n;oe(n["onUpdate:modelValue"],a(f)),!g&&p&&(t.value=!1)}function d(){var f;(f=e.value)==null||f.open()}function u(){var f;(f=e.value)==null||f.close()}function h(){var f;(f=e.value)==null||f.resize()}return{show:t,menu:e,n:kZe,classes:DZe,formatElevation:or,open:d,close:u,resize:h}}});dle.render=EZe;var ule=dle;lt(ule);var U3=ule;const hle=Symbol("SELECT_BIND_OPTION_KEY");function IZe(){const{length:n,childProviders:e,bindChildren:t}=$o(hle);return{length:n,options:e,bindOptions:t}}function TZe(){const{index:n,parentProvider:e,bindParent:t}=Ho(hle);return t||Oa("Option"," must in "),{index:n,select:e,bindSelect:t}}const xZe={label:{},value:{},disabled:Boolean},{name:NZe,n:AZe,classes:MZe}=st("option");function RZe(n,e){const t=gt("var-checkbox"),i=gt("var-hover-overlay"),s=hn("ripple"),o=hn("hover");return wi((q(),re("div",{class:B(n.classes(n.n(),n.n("$--box"),[n.optionSelected,n.n("--selected-color")],[n.disabled,n.n("--disabled")])),style:Fe({color:n.optionSelected?n.focusColor:void 0}),onClick:e[2]||(e[2]=(...r)=>n.handleClick&&n.handleClick(...r))},[me("div",{class:B(n.classes(n.n("cover"),[n.optionSelected,n.n("--selected-background")])),style:Fe({background:n.optionSelected?n.focusColor:void 0})},null,6),n.multiple?(q(),ei(t,{key:0,ref:"checkbox",modelValue:n.optionSelected,"onUpdate:modelValue":e[0]||(e[0]=r=>n.optionSelected=r),"checked-color":n.focusColor,disabled:n.disabled,onClick:e[1]||(e[1]=Ia(()=>{},["stop"])),onChange:n.handleSelect},null,8,["modelValue","checked-color","disabled","onChange"])):Qe("v-if",!0),xe(n.$slots,"default",{},()=>[me("div",{class:B(n.classes(n.n("text"),n.n("$--ellipsis")))},ut(n.label),3)]),Oe(i,{hovering:n.hovering&&!n.disabled},null,8,["hovering"])],6)),[[s,{disabled:n.disabled}],[o,n.handleHovering,"desktop"]])}const fle=et({name:NZe,directives:{Ripple:Ns,Hover:Fa},components:{VarCheckbox:Uy,VarHoverOverlay:ml},props:xZe,setup(n){const e=se(!1),t=ve(()=>e.value),i=ve(()=>n.label),s=ve(()=>n.value),{select:o,bindSelect:r}=TZe(),{multiple:a,focusColor:l,onSelect:c,computeLabel:d}=o,{hovering:u,handleHovering:h}=Pd(),f={label:i,value:s,selected:t,sync:_};ht([()=>n.label,()=>n.value],d),r(f);function g(){n.disabled||p()}function p(){a.value&&(e.value=!e.value),c(f)}function _(v){e.value=v}return{optionSelected:e,multiple:a,focusColor:l,hovering:u,n:AZe,classes:MZe,handleHovering:h,handleClick:g,handleSelect:p}}});fle.render=RZe;var gle=fle;lt(gle);var j3=gle;const PZe={show:Boolean,lockScroll:{type:Boolean,default:!0},teleport:[String,Object,Boolean],onClick:Se(),"onUpdate:show":Se()},{name:OZe,n:kG}=st("overlay");var ple=et({name:OZe,inheritAttrs:!1,props:PZe,setup(n,{slots:e,attrs:t}){const{zIndex:i}=QS(()=>n.show,1),{disabled:s}=u_();XS(()=>n.show,()=>n.lockScroll);function o(){oe(n.onClick),oe(n["onUpdate:show"],!1)}function r(){return Oe("div",fn({class:kG(),style:{zIndex:i.value-1}},t,{onClick:o}),[oe(e.default)])}function a(){return Oe(On,{name:kG("--fade")},{default:()=>[n.show&&r()]})}return()=>{const{teleport:l}=n;return l?Oe(Bd,{to:l,disabled:s.value},{default:()=>[a()]}):a()}}});lt(ple);var K3=ple;const FZe={current:[Number,String],size:{type:[Number,String],default:10},total:{type:[Number,String],default:0},elevation:{type:[Boolean,Number,String],default:!0},maxPagerCount:{type:Number,default:3},disabled:Boolean,simple:{type:Boolean,default:!0},showSizeChanger:{type:Boolean,default:!0},showQuickJumper:Boolean,sizeOption:{type:Array,default:()=>[10,20,50,100]},showTotal:Function,onChange:Se(),"onUpdate:current":Se(),"onUpdate:size":Se()},{name:BZe,n:WZe,classes:VZe}=st("pagination"),HZe=["item-mode","onClick"];function $Ze(n,e){const t=gt("var-icon"),i=gt("var-input"),s=gt("var-cell"),o=gt("var-menu"),r=hn("ripple");return q(),re("ul",{class:B(n.n())},[wi((q(),re("li",{class:B(n.classes(n.n("item"),n.n("prev"),[n.current<=1||n.disabled,n.n("item--disabled")],[n.simple,n.n("item--simple"),n.formatElevation(n.elevation,2)])),onClick:e[0]||(e[0]=a=>n.clickItem("prev"))},[xe(n.$slots,"prev",{},()=>[Oe(t,{name:"chevron-left"})])],2)),[[r,{disabled:n.current<=1||n.disabled}]]),n.simple?(q(),re("li",{key:0,class:B(n.classes(n.n("simple"),[n.disabled,n.n("item--disabled")]))},[Oe(i,{"var-pagination-cover":"",hint:!1,disabled:n.disabled,modelValue:n.simpleCurrentValue,"onUpdate:modelValue":e[1]||(e[1]=a=>n.simpleCurrentValue=a),onBlur:e[2]||(e[2]=a=>n.setPage("simple",n.simpleCurrentValue,a)),onKeydown:e[3]||(e[3]=VW(a=>n.setPage("simple",n.simpleCurrentValue,a),["enter"]))},null,8,["disabled","modelValue"]),me("span",null,[Mi(" / "+ut(n.pageCount)+" ",1),me("div",{class:B(n.n("simple-line"))},null,2)])],2)):(q(!0),re(li,{key:1},ss(n.pageList,(a,l)=>wi((q(),re("li",{key:l,"item-mode":n.getMode(a,l),class:B(n.classes(n.n("item"),n.formatElevation(n.elevation,2),[a===n.current&&!n.disabled,n.n("item--active")],[n.isHideEllipsis(a,l),n.n("item--hide")],[n.disabled,n.n("item--disabled")],[a===n.current&&n.disabled,n.n("item--disabled--active")])),onClick:c=>n.clickItem(a,l)},[Mi(ut(a),1)],10,HZe)),[[r,{disabled:n.disabled}]])),128)),wi((q(),re("li",{class:B(n.classes(n.n("item"),n.n("next"),[n.current>=n.pageCount||n.disabled,n.n("item--disabled")],[n.simple,n.n("item--simple"),n.formatElevation(n.elevation,2)])),onClick:e[4]||(e[4]=a=>n.clickItem("next"))},[xe(n.$slots,"next",{},()=>[Oe(t,{name:"chevron-right"})])],2)),[[r,{disabled:n.current>=n.pageCount||n.disabled}]]),n.showSizeChanger?(q(),re("li",{key:2,class:B(n.classes(n.n("size"),[n.disabled,n.n("item--disabled")]))},[Oe(o,{placement:"cover-top",disabled:n.disabled,show:n.menuVisible,"onUpdate:show":e[6]||(e[6]=a=>n.menuVisible=a)},{menu:Lt(()=>[(q(!0),re(li,null,ss(n.sizeOption,(a,l)=>wi((q(),ei(s,{class:B(n.classes(n.n("list"),[n.size===a,n.n("list--active")])),key:l,onClick:c=>n.clickSize(a)},{default:Lt(()=>[Mi(ut(a)+ut(n.pack.paginationItem)+" / "+ut(n.pack.paginationPage),1)]),_:2},1032,["class","onClick"])),[[r]])),128))]),default:Lt(()=>[me("div",{class:B(n.classes(n.n("size--open"),[n.current<=1||n.disabled,n.n("size--open--disabled")])),onClick:e[5]||(e[5]=Ia((...a)=>n.showMenu&&n.showMenu(...a),["stop"]))},[me("span",null,ut(n.size)+ut(n.pack.paginationItem)+" / "+ut(n.pack.paginationPage),1),Oe(t,{class:B(n.n("size--open-icon")),"var-pagination-cover":"",name:"menu-down"},null,8,["class"])],2)]),_:1},8,["disabled","show"])],2)):Qe("v-if",!0),n.showQuickJumper&&!n.simple?(q(),re("li",{key:3,class:B(n.classes(n.n("quickly"),[n.disabled,n.n("item--disabled")]))},[Mi(ut(n.pack.paginationJump)+" ",1),Oe(i,{modelValue:n.quickJumperValue,"onUpdate:modelValue":e[7]||(e[7]=a=>n.quickJumperValue=a),disabled:n.disabled,"var-pagination-cover":"",onBlur:e[8]||(e[8]=a=>n.setPage("quick",n.quickJumperValue,a)),onKeydown:e[9]||(e[9]=VW(a=>n.setPage("quick",n.quickJumperValue,a),["enter"]))},null,8,["modelValue","disabled"])],2)):Qe("v-if",!0),n.totalText?(q(),re("li",{key:4,class:B(n.classes(n.n("total"),[n.disabled,n.n("item--disabled")]))},ut(n.totalText),3)):Qe("v-if",!0)],2)}const mle=et({name:BZe,components:{VarMenu:f0,VarIcon:Wn,VarCell:fT,VarInput:yT},directives:{Ripple:Ns},props:FZe,setup(n){const e=se(!1),t=se(""),i=se("1"),s=se(!1),o=se(!1),r=se(Ie(n.current)||1),a=se(Ie(n.size)||10),l=se([]),c=ve(()=>Math.ceil(n.maxPagerCount/2)),d=ve(()=>Math.ceil(Ie(n.total)/Ie(a.value))),u=ve(()=>{const w=a.value*(r.value-1)+1,y=Math.min(a.value*r.value,Ie(n.total));return[w,y]}),h=ve(()=>n.showTotal?n.showTotal(Ie(n.total),u.value):"");ht([()=>n.current,()=>n.size],([w,y])=>{r.value=Ie(w)||1,a.value=Ie(y||10)}),ht([r,a,d],([w,y,L],[S,k])=>{let D=[];const{maxPagerCount:x,total:A,onChange:T}=n,P=Math.ceil(Ie(A)/Ie(k)),W=L-(x-c.value)-1;if(i.value="".concat(w),L-2>x){if(S===void 0||L!==P)for(let $=2;$x&&w=W){D=[];for(let $=1;$0&&oe(T,w,y),oe(n["onUpdate:current"],w),oe(n["onUpdate:size"],y)},{immediate:!0});function f(w,y){return qr(w)?!1:y===1?s.value:o.value}function g(w,y){return qr(w)?"basic":y===1?"head":"tail"}function p(w,y){if(!(w===r.value||n.disabled)){if(w==="..."){r.value=y===1?Math.max(r.value-n.maxPagerCount,1):Math.min(r.value+n.maxPagerCount,d.value);return}if(w==="prev"){r.value=b(r.value-1);return}if(w==="next"){r.value=b(r.value+1);return}qr(w)&&(r.value=w)}}function _(){n.disabled||(e.value=!0)}function v(w){a.value=w,e.value=!1;const y=b(r.value);i.value=String(y),r.value=y}function b(w){return w>d.value?d.value:w<1?1:w}function C(w,y,L){L.target.blur();const S=b(Ie(y));i.value=String(S),r.value=S,w==="quick"&&(t.value="")}return{pack:Xs,current:r,menuVisible:e,size:a,pageCount:d,pageList:l,quickJumperValue:t,simpleCurrentValue:i,totalText:h,n:WZe,classes:VZe,getMode:g,isHideEllipsis:f,clickItem:p,showMenu:_,clickSize:v,setPage:C,toNumber:Ie,formatElevation:or}}});mle.render=$Ze;var _le=mle;lt(_le);var q3=_le;const zZe={elevation:{type:[Boolean,Number,String],default:!1},ripple:Boolean,radius:[Number,String],width:[Number,String],height:[Number,String],round:Boolean,inline:Boolean,onClick:Se()},{name:UZe,n:jZe,classes:KZe}=st("paper");function qZe(n,e){const t=hn("ripple");return wi((q(),re("div",{class:B(n.classes(n.n(),n.n("$--box"),n.formatElevation(n.elevation,2),[n.onClick,n.n("--cursor")],[n.round,n.n("--round")],[n.inline,n.n("$--inline-flex")])),style:Fe({width:n.toSizeUnit(n.width),height:n.toSizeUnit(n.height),"border-radius":n.toSizeUnit(n.radius)}),onClick:e[0]||(e[0]=(...i)=>n.handleClick&&n.handleClick(...i))},[xe(n.$slots,"default")],6)),[[t,{disabled:!n.ripple}]])}const vle=et({name:UZe,directives:{Ripple:Ns},props:zZe,setup(n){function e(t){oe(n.onClick,t)}return{n:jZe,classes:KZe,formatElevation:or,toSizeUnit:ri,handleClick:e}}});vle.render=qZe;var ble=vle;lt(ble);var G3=ble,GZe=Object.defineProperty,DG=Object.getOwnPropertySymbols,YZe=Object.prototype.hasOwnProperty,ZZe=Object.prototype.propertyIsEnumerable,EG=(n,e,t)=>e in n?GZe(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,XZe=(n,e)=>{for(var t in e||(e={}))YZe.call(e,t)&&EG(n,t,e[t]);if(DG)for(var t of DG(e))ZZe.call(e,t)&&EG(n,t,e[t]);return n};const QZe=XZe({modelValue:{type:Array,default:()=>[]},columns:{type:Array,default:()=>[]},title:String,textKey:{type:String,default:"text"},valueKey:{type:String,default:"value"},childrenKey:{type:String,default:"children"},toolbar:{type:Boolean,default:!0},cascade:Boolean,optionHeight:{type:[Number,String],default:44},optionCount:{type:[Number,String],default:6},confirmButtonText:String,cancelButtonText:String,confirmButtonTextColor:String,cancelButtonTextColor:String,dynamic:Boolean,onChange:Se(),onConfirm:Se(),onCancel:Se(),"onUpdate:modelValue":Se()},yi(ZS,["show","onUpdate:show","closeOnClickOverlay","teleport","safeArea","onOpen","onClose","onOpened","onClosed","onClickOverlay","onRouteChange"])),{name:JZe,n:eXe,classes:tXe}=st("picker"),IG=300,iXe=15,TG=200,nXe=1e3;let xG=0;const sXe=["onTouchstartPassive","onTouchmove","onTouchend"],oXe=["onTransitionend"],rXe=["onClick"];function aXe(n,e){const t=gt("var-button");return q(),ei(m0(n.dynamic?n.n("$-popup"):n.Transition),fn(n.dynamic?{onOpen:n.onOpen,onOpened:n.onOpened,onClose:n.onClose,onClosed:n.onClosed,onClickOverlay:n.onClickOverlay,onRouteChange:n.onRouteChange,closeOnClickOverlay:n.closeOnClickOverlay,teleport:n.teleport,show:n.show,safeArea:n.safeArea,"onUpdate:show":n.handlePopupUpdateShow,position:"bottom",class:n.n("popup")}:null,{"var-picker-cover":""}),{default:Lt(()=>[me("div",fn({class:n.n()},n.$attrs),[n.toolbar?(q(),re("div",{key:0,class:B(n.n("toolbar"))},[xe(n.$slots,"cancel",{},()=>[Oe(t,{class:B(n.n("cancel-button")),"var-picker-cover":"",text:"","text-color":n.cancelButtonTextColor,onClick:n.cancel},{default:Lt(()=>{var i;return[Mi(ut((i=n.cancelButtonText)!=null?i:n.pack.pickerCancelButtonText),1)]}),_:1},8,["class","text-color","onClick"])]),xe(n.$slots,"title",{},()=>{var i;return[me("div",{class:B(n.n("title"))},ut((i=n.title)!=null?i:n.pack.pickerTitle),3)]}),xe(n.$slots,"confirm",{},()=>[Oe(t,{class:B(n.n("confirm-button")),text:"","var-picker-cover":"","text-color":n.confirmButtonTextColor,onClick:n.confirm},{default:Lt(()=>{var i;return[Mi(ut((i=n.confirmButtonText)!=null?i:n.pack.pickerConfirmButtonText),1)]}),_:1},8,["class","text-color","onClick"])])],2)):Qe("v-if",!0),me("div",{class:B(n.n("columns")),style:Fe({height:"".concat(n.columnHeight,"px")})},[(q(!0),re(li,null,ss(n.scrollColumns,i=>(q(),re("div",{class:B(n.n("column")),key:i.id,onTouchstartPassive:s=>n.handleTouchstart(s,i),onTouchmove:Ia(s=>n.handleTouchmove(s,i),["prevent"]),onTouchend:s=>n.handleTouchend(i)},[me("div",{class:B(n.n("scroller")),ref_for:!0,ref:s=>n.setScrollEl(s,i),style:Fe({transform:"translateY(".concat(i.translate,"px)"),transitionDuration:"".concat(i.duration,"ms"),transitionProperty:i.duration?"transform":"none"}),onTransitionend:s=>n.handleTransitionend(i)},[(q(!0),re(li,null,ss(i.column,(s,o)=>(q(),re("div",{key:n.getValue(s),class:B(n.classes(n.n("option"),s.className)),style:Fe({height:"".concat(n.optionHeight,"px")}),onClick:r=>n.handleClick(i,o)},[me("div",{class:B(n.classes(n.n("text"),s.textClassName))},ut(s[n.getOptionKey("text")]),3)],14,rXe))),128))],46,oXe)],42,sXe))),128)),me("div",{class:B(n.n("picked")),style:Fe({top:"".concat(n.center,"px"),height:"".concat(n.optionHeight,"px")})},null,6),me("div",{class:B(n.n("mask")),style:Fe({backgroundSize:"100% ".concat((n.columnHeight-n.optionHeight)/2,"px")})},null,6)],6)],16)]),_:3},16)}const Cle=et({name:JZe,components:{VarButton:ia,VarPopup:gg},inheritAttrs:!1,props:QZe,setup(n){const e=Xu(n,"modelValue"),t=se([]),i=ve(()=>jn(n.optionHeight)),s=ve(()=>jn(n.optionCount)),o=ve(()=>s.value*i.value/2-i.value/2),r=ve(()=>s.value*i.value),{prevY:a,moveY:l,dragging:c,startTouch:d,moveTouch:u,endTouch:h}=j0();let f=[];y(),ht(()=>n.columns,y,{deep:!0}),ht(()=>e.value,L);function g(pe){return{text:n.textKey,value:n.valueKey,children:n.childrenKey}[pe]}function p(pe){var Ee;return(Ee=pe[g("value")])!=null?Ee:pe[g("text")]}function _(pe){f=[...pe]}function v(pe){return pe.map(Ee=>{const ze={id:xG++,prevY:0,momentumPrevY:0,touching:!1,translate:o.value,index:0,duration:0,momentumTime:0,column:Ee,scrollEl:null,scrolling:!1};return P(ze),ze})}function b(pe){const Ee=[];return C(Ee,pe),Ee}function C(pe,Ee){var ze;if(Ee.length){const It={id:xG++,prevY:0,momentumPrevY:0,touching:!1,translate:o.value,index:0,duration:0,momentumTime:0,column:Ee,scrollEl:null,scrolling:!1};pe.push(It),P(It),C(pe,(ze=It.column[It.index][g("children")])!=null?ze:[])}}function w(pe){var Ee;t.value.splice(t.value.indexOf(pe)+1),C(t.value,(Ee=pe.column[pe.index][g("children")])!=null?Ee:[])}function y(){t.value=n.cascade?b(n.columns):v(n.columns),L()}function L(){t.value.forEach((Ee,ze)=>{const It=Ee.column.findIndex(Ke=>e.value[ze]===p(Ke));Ee.index=It===-1?0:It,P(Ee)});const{indexes:pe}=T();_(pe)}function S(pe,Ee){Ee.scrollEl=pe}function k(pe){oe(n["onUpdate:show"],pe)}function D(pe){const Ee=o.value-pe.column.length*i.value,ze=i.value+o.value;pe.translate=Wf(pe.translate,Ee,ze)}function x(pe,Ee){const ze=Math.round((o.value-Ee)/i.value);return The(ze,pe.column)}function A(pe){return pe.translate=o.value-pe.index*i.value,pe.translate}function T(){const pe=[],Ee=[],ze=[];return t.value.forEach(({column:It,index:Ke})=>{const Xe=It[Ke];pe.push(p(Xe)),Ee.push(Ke),ze.push(Xe)}),{values:pe,indexes:Ee,options:ze}}function P(pe,Ee=0){A(pe),pe.duration=Ee}function W(pe,Ee,ze){pe.translate+=Math.abs(Ee/ze)/.003*(Ee<0?-1:1)}function $(pe,Ee){c.value||(pe.index=Ee,P(pe,TG))}function X(pe,Ee){Ee.touching=!0,Ee.translate=JR(Ee.scrollEl),d(pe)}function J(pe,Ee){if(!Ee.touching)return;u(pe),Ee.scrolling=!1,Ee.duration=0,Ee.prevY=a.value,Ee.translate+=l.value,D(Ee);const ze=performance.now();ze-Ee.momentumTime>IG&&(Ee.momentumTime=ze,Ee.momentumPrevY=Ee.translate)}function Q(pe){h(),pe.touching=!1,pe.prevY=0;const Ee=pe.translate-pe.momentumPrevY,ze=performance.now()-pe.momentumTime,It=Math.abs(Ee)>=iXe&&ze<=IG,Ke=pe.translate;It&&W(pe,Ee,ze),pe.index=x(pe,pe.translate),P(pe,It?nXe:TG),pe.scrolling=pe.translate!==Ke,pe.scrolling||_e(pe)}function le(pe){pe.scrolling=!1,_e(pe)}function de(){const{indexes:pe}=T();return pe.every((Ee,ze)=>Ee===f[ze])}function _e(pe){const{cascade:Ee,onChange:ze}=n;if(de())return;Ee&&w(pe);const It=t.value.some(z=>z.scrolling),Ke=t.value.some(z=>z.touching);if(It||Ke)return;const{values:Xe,indexes:je,options:Z}=T();_(je),oe(ze,Xe,je,Z),e.value=Xe}function ie(){if(n.cascade){const pe=t.value.find(Ee=>Ee.scrolling);pe&&(pe.index=x(pe,JR(pe.scrollEl)),pe.scrolling=!1,P(pe),w(pe))}else t.value.forEach(pe=>{pe.index=x(pe,JR(pe.scrollEl)),P(pe)})}function ne(){ie();const{values:pe,indexes:Ee,options:ze}=T();_(Ee),oe(n.onConfirm,pe,Ee,ze)}function Ye(){ie();const{values:pe,indexes:Ee,options:ze}=T();_(Ee),oe(n.onCancel,pe,Ee,ze)}return{pack:Xs,optionHeight:i,optionCount:s,scrollColumns:t,columnHeight:r,center:o,Transition:On,n:eXe,classes:tXe,setScrollEl:S,getOptionKey:g,getValue:p,handlePopupUpdateShow:k,handleTouchstart:X,handleTouchmove:J,handleTouchend:Q,handleTransitionend:le,confirm:ne,cancel:Ye,handleClick:$}}});Cle.render=aXe;var yA=Cle;let db;function eL(n){return new Promise(e=>{eL.close();const t=tn(n)?{columns:n}:n,i=Cn(t);i.dynamic=!0,i.teleport="body",db=i;function s(){db===i&&(db=null)}const{unmountInstance:o}=K0(yA,i,{onConfirm:(r,a,l)=>{oe(i.onConfirm,r,a,l),e({state:"confirm",values:r,indexes:a,options:l}),i.show=!1,s()},onCancel:(r,a,l)=>{oe(i.onCancel,r,a,l),e({state:"cancel",values:r,indexes:a,options:l}),i.show=!1,s()},onClose:()=>{oe(i.onClose),e({state:"close"}),s()},onClosed:()=>{oe(i.onClosed),o(),s()},onRouteChange:()=>{o(),s()},"onUpdate:show":r=>{i.show=r}});i.show=!0})}eL.close=function(){if(db==null)return;const n=db;db=null,Fn().then(()=>{n.show=!1})};eL.Component=yA;lt(yA);lt(yA,eL);var Y3=eL;const lXe={mode:{type:String,default:"linear"},lineWidth:{type:[Number,String],default:4},color:[String,Object],trackColor:String,ripple:Boolean,value:{type:[Number,String],default:0},label:Boolean,labelClass:String,size:{type:[Number,String],default:40},rotate:{type:Number,default:0},track:{type:Boolean,default:!0},indeterminate:Boolean,type:{type:String,default:"primary"}},Lh=100,nu=20,NG=2*Math.PI*nu,{name:cXe,n:dXe,classes:uXe}=st("progress"),hXe=["viewBox"],fXe={key:0},gXe=["id"],pXe=["offset","stop-color"],mXe=["d","stroke-width","stroke-dasharray"],_Xe=["d","stroke-width","stroke-dasharray","stroke-dashoffset"];function vXe(n,e){return q(),re("div",{class:B(n.n())},[n.mode==="linear"?(q(),re("div",{key:0,class:B(n.n("linear"))},[me("div",{class:B(n.classes(n.n("linear-block"),[n.track,n.n("linear-background")])),style:Fe({height:n.toSizeUnit(n.lineWidth),background:n.trackColor})},[n.indeterminate?(q(),re("div",{key:0,class:B(n.classes([n.indeterminate,n.n("linear-indeterminate")]))},[me("div",{class:B(n.classes(n.n("linear--".concat(n.type)))),style:Fe({background:n.progressColor})},null,6),me("div",{class:B(n.classes(n.n("linear--".concat(n.type)))),style:Fe({background:n.progressColor})},null,6)],2)):(q(),re("div",{key:1,class:B(n.classes(n.n("linear-certain"),n.n("linear--".concat(n.type)),[n.ripple,n.n("linear-ripple")])),style:Fe({background:n.progressColor,width:n.linearProps.width})},null,6))],6),n.label?(q(),re("div",{key:0,class:B(n.classes(n.n("linear-label"),[n.labelClass,n.labelClass]))},[xe(n.$slots,"default",{},()=>[Mi(ut(n.linearProps.roundValue),1)])],2)):Qe("v-if",!0)],2)):Qe("v-if",!0),n.mode==="circle"?(q(),re("div",{key:1,class:B(n.classes(n.n("circle"),[n.indeterminate,n.n("circle-indeterminate")])),style:Fe({width:n.toSizeUnit(n.size),height:n.toSizeUnit(n.size)})},[(q(),re("svg",{class:B(n.n("circle-svg")),viewBox:n.circleProps.viewBox},[n.isPlainObject(n.color)?(q(),re("defs",fXe,[me("linearGradient",{id:n.id,x1:"100%",y1:"0%",x2:"0%",y2:"0%"},[(q(!0),re(li,null,ss(n.linearGradientProgress,(t,i)=>(q(),re("stop",{key:i,offset:t,"stop-color":n.color[t]},null,8,pXe))),128))],8,gXe)])):Qe("v-if",!0),n.track?(q(),re("path",{key:1,class:B(n.n("circle-background")),d:n.circleProps.path,fill:"transparent","stroke-width":n.circleProps.strokeWidth,"stroke-dasharray":n.CIRCUMFERENCE,style:Fe({stroke:n.trackColor})},null,14,mXe)):Qe("v-if",!0),me("path",{class:B(n.classes(n.n("circle-certain"),n.n("circle--".concat(n.type)),[n.indeterminate,n.n("circle-overlay")])),d:n.circleProps.path,fill:"transparent","stroke-width":n.circleProps.strokeWidth,"stroke-dasharray":n.CIRCUMFERENCE,"stroke-dashoffset":n.circleProps.strokeOffset,style:Fe({stroke:n.progressColor,transform:"rotateZ(".concat(n.rotate,"deg)"),transformOrigin:"50% 50%"})},null,14,_Xe)],10,hXe)),n.label?(q(),re("div",{key:0,class:B(n.classes(n.n("circle-label"),[n.labelClass,n.labelClass]))},[xe(n.$slots,"default",{},()=>[Mi(ut(n.circleProps.roundValue),1)])],2)):Qe("v-if",!0)],6)):Qe("v-if",!0)],2)}const wle=et({name:cXe,props:lXe,setup(n){const e=qse(),t=ve(()=>{const r=Ie(n.value),a=r>Lh?Lh:r,l=r>Lh?Lh:Math.round(r);return{width:"".concat(a,"%"),roundValue:"".concat(l,"%")}}),i=ve(()=>{const{size:r,lineWidth:a,value:l}=n,c=nu/(1-jn(a)/jn(r))*2,d="0 0 ".concat(c," ").concat(c),u=Ie(l)>Lh?Lh:Math.round(Ie(l)),h="".concat((Lh-u)/Lh*NG),f=jn(a)/jn(r)*c,g=0,p=-nu,_=0,v=-2*nu,b="M ".concat(c/2," ").concat(c/2," m ").concat(g," ").concat(p," a ").concat(nu," ").concat(nu," \n 0 1 1 ").concat(_," ").concat(-v," a ").concat(nu," ").concat(nu," 0 1 1 ").concat(-_," ").concat(v);return{strokeWidth:f,viewBox:d,strokeOffset:h,roundValue:"".concat(u,"%"),path:b}}),s=ve(()=>ju(n.color)?"url(#".concat(e.value,")"):n.color),o=ve(()=>Object.keys(n.color).sort((r,a)=>parseFloat(r)-parseFloat(a)));return{id:e,linearProps:t,CIRCUMFERENCE:NG,RADIUS:nu,circleProps:i,progressColor:s,linearGradientProgress:o,n:dXe,classes:uXe,toSizeUnit:ri,isPlainObject:ju}}});wle.render=vXe;var yle=wle;lt(yle);var Z3=yle;const bXe={modelValue:Boolean,disabled:Boolean,animationDuration:{type:[Number,String],default:300},successDuration:{type:[Number,String],default:2e3},bgColor:String,successBgColor:String,color:String,successColor:String,target:[String,Object],onRefresh:Se(),"onUpdate:modelValue":Se()};var AG=(n,e,t)=>new Promise((i,s)=>{var o=l=>{try{a(t.next(l))}catch(c){s(c)}},r=l=>{try{a(t.throw(l))}catch(c){s(c)}},a=l=>l.done?i(l.value):Promise.resolve(l.value).then(o,r);a((t=t.apply(n,e)).next())});const{name:CXe,n:MG,classes:wXe}=st("pull-refresh"),RG=150;function yXe(n,e){const t=gt("var-icon");return q(),re("div",{ref:"freshNode",class:B(n.n()),onTouchstart:e[0]||(e[0]=(...i)=>n.handleTouchstart&&n.handleTouchstart(...i)),onTouchend:e[1]||(e[1]=(...i)=>n.handleTouchend&&n.handleTouchend(...i)),onTouchcancel:e[2]||(e[2]=(...i)=>n.handleTouchend&&n.handleTouchend(...i))},[me("div",{ref:"controlNode",class:B(n.classes(n.n("control"),n.n("$-elevation--2"),[n.isSuccess,n.n("control-success")])),style:Fe(n.controlStyle)},[Oe(t,{name:n.iconName,transition:n.ICON_TRANSITION,class:B(n.classes(n.n("icon"),[n.refreshStatus==="loading",n.n("animation")])),"var-pull-refresh-cover":""},null,8,["name","transition","class"])],6),xe(n.$slots,"default")],34)}const Sle=et({name:CXe,components:{VarIcon:Wn},props:bXe,setup(n){const e=se(0),t=se(null),i=se(null),s=se(0),o=se("-125%"),r=se("arrow-down"),a=se("default"),l=se(!1),c=ve(()=>Math.abs(2*e.value)),d=ve(()=>a.value==="success"),u=ve(()=>a.value!=="loading"&&a.value!=="success"&&!n.disabled),h=ve(()=>({transform:"translate3d(0px, ".concat(Us(o.value)?o.value:"".concat(o.value,"px"),", 0px) translate(-50%, 0)"),transition:l.value?"transform ".concat(n.animationDuration,"ms"):void 0,background:d.value?n.successBgColor:n.bgColor,color:d.value?n.successColor:n.color})),{startTouch:f,moveTouch:g,endTouch:p,isReachTop:_}=j0();let v,b;ht(()=>n.modelValue,x=>{x===!1&&(l.value=!0,a.value="success",r.value="checkbox-marked-circle",setTimeout(()=>{o.value=e.value,D()},Ie(n.successDuration)))}),Vo(k),fg(t,"touchmove",L);function C(x){return AG(this,null,function*(){if(r.value!==x)return r.value=x,new Promise(A=>{window.setTimeout(A,RG)})})}function w(x){("classList"in v?v:document.body).classList[x]("".concat(MG(),"--lock"))}function y(x){if(f(x),e.value===0){const{width:A}=no(i.value);e.value=-(A+A*.25)}b=pg(x.target)}function L(x){if(g(x),!u.value||!b||b!==v&&hb(b)>0||hb(v)>0)return;_(v)&&dc(x),a.value!=="pulling"&&(a.value="pulling",s.value=x.touches[0].clientY),_(v)&&qr(o.value)&&o.value>e.value&&w("add");const T=(x.touches[0].clientY-s.value)/2+e.value;o.value=T>=c.value?c.value:T,C(o.value>=c.value*.2?"refresh":"arrow-down")}function S(){return AG(this,null,function*(){p(),u.value&&(l.value=!0,Ie(o.value)>=c.value*.2?(yield C("refresh"),a.value="loading",o.value=c.value*.3,oe(n["onUpdate:modelValue"],!0),Fn(()=>{oe(n.onRefresh)}),w("remove")):(a.value="loosing",r.value="arrow-down",o.value=e.value,setTimeout(()=>{l.value=!1,w("remove")},Ie(n.animationDuration))),b=null)})}function k(){v=n.target?ooe(n.target,"PullRefresh"):pg(t.value)}function D(){setTimeout(()=>{a.value="default",r.value="arrow-down",l.value=!1},Ie(n.animationDuration))}return{ICON_TRANSITION:RG,refreshStatus:a,freshNode:t,controlNode:i,iconName:r,controlStyle:h,isSuccess:d,n:MG,classes:wXe,handleTouchstart:y,handleTouchmove:L,handleTouchend:S}}});Sle.render=yXe;var Lle=Sle;lt(Lle);var X3=Lle;const SXe={modelValue:{type:[String,Number,Boolean,Object,Array],default:!1},checkedValue:{type:[String,Number,Boolean,Object,Array],default:!0},uncheckedValue:{type:[String,Number,Boolean,Object,Array],default:!1},disabled:Boolean,readonly:Boolean,checkedColor:String,uncheckedColor:String,iconSize:[String,Number],ripple:{type:Boolean,default:!0},validateTrigger:{type:Array,default:()=>["onChange"]},rules:Array,onClick:Se(),onChange:Se(),"onUpdate:modelValue":Se()},kle=Symbol("RADIO_GROUP_BIND_RADIO_KEY");function LXe(){const{bindChildren:n,childProviders:e,length:t}=$o(kle);return{length:t,radios:e,bindRadios:n}}function kXe(){const{bindParent:n,parentProvider:e,index:t}=Ho(kle);return{index:t,radioGroup:e,bindRadioGroup:n}}const{name:DXe,n:EXe,classes:IXe}=st("radio");function TXe(n,e){const t=gt("var-icon"),i=gt("var-hover-overlay"),s=gt("var-form-details"),o=hn("ripple"),r=hn("hover");return q(),re("div",{class:B(n.n("wrap"))},[me("div",fn({class:n.n(),onClick:e[0]||(e[0]=(...a)=>n.handleClick&&n.handleClick(...a))},n.$attrs),[wi((q(),re("div",{class:B(n.classes(n.n("action"),[n.checked,n.n("--checked"),n.n("--unchecked")],[n.errorMessage||n.radioGroupErrorMessage,n.n("--error")],[n.formDisabled||n.disabled,n.n("--disabled")])),style:Fe({color:n.checked?n.checkedColor:n.uncheckedColor})},[n.checked?xe(n.$slots,"checked-icon",{key:0},()=>[Oe(t,{class:B(n.classes(n.n("icon"),[n.withAnimation,n.n("--with-animation")])),"var-radio-cover":"",name:"radio-marked",size:n.iconSize},null,8,["class","size"])]):xe(n.$slots,"unchecked-icon",{key:1},()=>[Oe(t,{class:B(n.classes(n.n("icon"),[n.withAnimation,n.n("--with-animation")])),"var-radio-cover":"",name:"radio-blank",size:n.iconSize},null,8,["class","size"])]),Oe(i,{hovering:!n.disabled&&!n.formDisabled&&n.hovering},null,8,["hovering"])],6)),[[o,{disabled:n.formReadonly||n.readonly||n.formDisabled||n.disabled||!n.ripple}],[r,n.handleHovering,"desktop"]]),me("div",{class:B(n.classes(n.n("text"),[n.errorMessage||n.radioGroupErrorMessage,n.n("--error")],[n.formDisabled||n.disabled,n.n("--disabled")]))},[xe(n.$slots,"default")],2)],16),Oe(s,{"error-message":n.errorMessage},null,8,["error-message"])],2)}const Dle=et({name:DXe,directives:{Ripple:Ns,Hover:Fa},components:{VarIcon:Wn,VarFormDetails:na,VarHoverOverlay:ml},inheritAttrs:!1,props:SXe,setup(n){const e=Xu(n,"modelValue"),t=ve(()=>e.value===n.checkedValue),i=se(!1),{radioGroup:s,bindRadioGroup:o}=kXe(),{hovering:r,handleHovering:a}=Pd(),{form:l,bindForm:c}=kl(),{errorMessage:d,validateWithTrigger:u,validate:h,resetValidation:f}=Ll(),g={sync:b,validate:w,resetValidation:f,reset:C};oe(o,g),oe(c,g);function p(L){Fn(()=>{const{validateTrigger:S,rules:k,modelValue:D}=n;u(S,L,k,D)})}function _(L){const{checkedValue:S,onChange:k}=n;s&&e.value===S||(e.value=L,oe(k,e.value),s==null||s.onToggle(S),p("onChange"))}function v(L){const{disabled:S,readonly:k,uncheckedValue:D,checkedValue:x,onClick:A}=n;l!=null&&l.disabled.value||S||(oe(A,L),!(l!=null&&l.readonly.value||k)&&(i.value=!0,_(t.value?D:x)))}function b(L){const{checkedValue:S,uncheckedValue:k}=n;e.value=L===S?S:k}function C(){e.value=n.uncheckedValue,f()}function w(){return h(n.rules,n.modelValue)}function y(L){const{uncheckedValue:S,checkedValue:k}=n;![S,k].includes(L)&&(L=t.value?S:k),_(L)}return{withAnimation:i,checked:t,errorMessage:d,radioGroupErrorMessage:s==null?void 0:s.errorMessage,formDisabled:l==null?void 0:l.disabled,formReadonly:l==null?void 0:l.readonly,hovering:r,handleHovering:a,n:EXe,classes:IXe,handleClick:v,toggle:y,reset:C,validate:w,resetValidation:f}}});Dle.render=TXe;var Ele=Dle;lt(Ele);var Q3=Ele;const xXe={modelValue:{type:[String,Number,Boolean,Object,Array],default:void 0},direction:{type:String,default:"horizontal"},validateTrigger:{type:Array,default:()=>["onChange"]},rules:Array,onChange:Se(),"onUpdate:modelValue":Se()},{name:NXe,n:AXe,classes:MXe}=st("radio-group");function RXe(n,e){const t=gt("var-form-details");return q(),re("div",{class:B(n.n("wrap"))},[me("div",{class:B(n.classes(n.n(),n.n("--".concat(n.direction))))},[xe(n.$slots,"default")],2),Oe(t,{"error-message":n.errorMessage},null,8,["error-message"])],2)}const Ile=et({name:NXe,components:{VarFormDetails:na},props:xXe,setup(n){const{length:e,radios:t,bindRadios:i}=LXe(),{bindForm:s}=kl(),{errorMessage:o,validateWithTrigger:r,validate:a,resetValidation:l}=Ll(),c=ve(()=>o.value),d={onToggle:f,validate:g,reset:p,resetValidation:l,errorMessage:c};ht(()=>n.modelValue,h),ht(()=>e.value,h),oe(s,d),i(d);function u(_){Fn(()=>{const{validateTrigger:v,rules:b,modelValue:C}=n;r(v,_,b,C)})}function h(){return t.forEach(({sync:_})=>_(n.modelValue))}function f(_){oe(n["onUpdate:modelValue"],_),oe(n.onChange,_),u("onChange")}function g(){return a(n.rules,n.modelValue)}function p(){oe(n["onUpdate:modelValue"],void 0),l()}return{errorMessage:o,n:AXe,classes:MXe,reset:p,validate:g,resetValidation:l}}});Ile.render=RXe;var Tle=Ile;lt(Tle);var J3=Tle;const PXe={modelValue:{type:Number,default:0},count:{type:[String,Number],default:5},color:String,icon:{type:String,default:"star"},emptyIcon:{type:String,default:"star-outline"},halfIcon:{type:String,default:"star-half-full"},namespace:yi(Ss,"namespace"),emptyIconNamespace:yi(Ss,"namespace"),halfIconNamespace:yi(Ss,"namespace"),emptyColor:String,size:[String,Number],gap:[String,Number],half:Boolean,disabled:Boolean,disabledColor:String,readonly:Boolean,ripple:{type:Boolean,default:!0},clearable:Boolean,rules:Array,onChange:Se(),"onUpdate:modelValue":Se()},{name:OXe,n:M1}=st("rate"),FXe=["onClick"];function BXe(n,e){const t=gt("var-icon"),i=gt("var-hover-overlay"),s=gt("var-form-details"),o=hn("ripple"),r=hn("hover");return q(),re("div",{class:B(n.n("wrap"))},[me("div",{class:B(n.n())},[(q(!0),re(li,null,ss(n.toNumber(n.count),a=>wi((q(),re("div",{key:a,style:Fe(n.getStyle(a)),class:B(n.getClass(a)),onClick:l=>n.handleClick(a,l)},[Oe(t,{class:B(n.n("content-icon")),"var-rate-cover":"",transition:0,namespace:n.getCurrentState(a).namespace,name:n.getCurrentState(a).name,style:Fe({fontSize:n.toSizeUnit(n.size)})},null,8,["class","namespace","name","style"]),Oe(i,{hovering:n.hovering&&a===n.currentHoveringValue&&!n.disabled&&!n.formDisabled},null,8,["hovering"])],14,FXe)),[[o,{disabled:n.formReadonly||n.readonly||n.formDisabled||n.disabled||!n.ripple}],[r,n.createHoverHandler(a),"desktop"]])),128))],2),Oe(s,{"error-message":n.errorMessage},null,8,["error-message"])],2)}const xle=et({name:OXe,components:{VarIcon:Wn,VarFormDetails:na,VarHoverOverlay:ml},directives:{Ripple:Ns,Hover:Fa},props:PXe,setup(n){const e=se(-1),{form:t,bindForm:i}=kl(),{errorMessage:s,validateWithTrigger:o,validate:r,resetValidation:a}=Ll(),{hovering:l}=Pd();let c=Ie(n.modelValue);oe(i,{reset:C,validate:p,resetValidation:a});function u(w){const{count:y,gap:L}=n;return{color:f(w).color,marginRight:w!==Ie(y)?ri(L):0}}function h(w){const{name:y,color:L}=f(w);return{[M1("content")]:!0,[M1("--disabled")]:(t==null?void 0:t.disabled.value)||n.disabled,[M1("--error")]:s.value,[M1("--primary")]:y!==n.emptyIcon&&!L}}function f(w){const{modelValue:y,disabled:L,disabledColor:S,color:k,half:D,emptyColor:x,icon:A,halfIcon:T,emptyIcon:P,namespace:W,halfIconNamespace:$,emptyIconNamespace:X}=n;let J=k;return(L||t!=null&&t.disabled.value)&&(J=S),w<=y?{color:J,name:A,namespace:W}:D&&w<=y+.5?{color:J,name:T,namespace:$}:{color:L||t!=null&&t.disabled.value?S:x,name:P,namespace:X}}function g(w,y){const{half:L,clearable:S}=n,{offsetWidth:k}=y.target;L&&y.offsetX<=Math.floor(k/2)&&(w-=.5),c===w&&S&&(w=0),c!==w&&(oe(n["onUpdate:modelValue"],w),oe(n.onChange,w)),c=w}function p(){return r(n.rules,n.modelValue)}function _(){return Fn(()=>o(["onChange"],"onChange",n.rules,n.modelValue))}function v(w,y){const{readonly:L,disabled:S}=n;L||S||t!=null&&t.disabled.value||t!=null&&t.readonly.value||(g(w,y),_())}function b(w){return y=>{e.value=w,l.value=y}}function C(){oe(n["onUpdate:modelValue"],0),a()}return{errorMessage:s,formDisabled:t==null?void 0:t.disabled,formReadonly:t==null?void 0:t.readonly,hovering:l,currentHoveringValue:e,getStyle:u,getClass:h,getCurrentState:f,handleClick:v,createHoverHandler:b,reset:C,validate:p,resetValidation:a,toSizeUnit:ri,toNumber:Ie,n:M1}}});xle.render=BXe;var Nle=xle;lt(Nle);var eB=Nle;const WXe=n=>(vg(""),n=n(),bg(),n),VXe={xmlns:"http://www.w3.org/2000/svg",viewBox:"2 3.6 20 20"},HXe=WXe(()=>me("path",{d:"M11,9H13V7H11M11,20H13V11H11V20Z"},null,-1)),$Xe=[HXe];function zXe(n,e){return q(),re("svg",VXe,$Xe)}const Ale=et({});Ale.render=zXe;var UXe=Ale;const jXe=n=>(vg(""),n=n(),bg(),n),KXe={xmlns:"http://www.w3.org/2000/svg",viewBox:"2 2 20 20"},qXe=jXe(()=>me("path",{d:"M19,3V5H19V19M17,8.4L13.4,12L17,15.6L15.6,17L12,13.4L8.4,17L7,15.6L10.6,12L7,8.4L8.4,7L12,10.6L15.6,7L17,8.4Z"},null,-1)),GXe=[qXe];function YXe(n,e){return q(),re("svg",KXe,GXe)}const Mle=et({});Mle.render=YXe;var ZXe=Mle;const XXe=n=>(vg(""),n=n(),bg(),n),QXe={xmlns:"http://www.w3.org/2000/svg",viewBox:"-6 -4 35 35"},JXe=XXe(()=>me("path",{d:"M10,21H14A2,2 0 0,1 12,23A2,2 0 0,1 10,21M21,19V20H3V19L5,17V11C5,7.9 7.03,5.17 10,4.29C10,4.19 10,4.1 10,4A2,2 0 0,1 12,2A2,2 0 0,1 14,4C14,4.1 14,4.19 14,4.29C16.97,5.17 19,7.9 19,11V17L21,19M17,11A5,5 0 0,0 12,6A5,5 0 0,0 7,11V18H17V11M19.75,3.19L18.33,4.61M1,11"},null,-1)),eQe=[JXe];function tQe(n,e){return q(),re("svg",QXe,eQe)}const Rle=et({});Rle.render=tQe;var iQe=Rle;const{n:nQe,classes:sQe}=st("result");function oQe(n,e){return q(),re(li,null,[me("span",{class:B(n.n("success-cover-left"))},null,2),me("span",{class:B(n.classes(n.n("success-line"),n.n("success-line-tip"))),style:Fe({animationDuration:n.animation?"760ms":"0ms",borderRadius:"calc(".concat(n.borderSize," * 0.625)")})},null,6),me("span",{class:B(n.classes(n.n("success-line"),n.n("success-line-long"))),style:Fe({animationDuration:n.animation?"770ms":"0ms",borderRadius:"calc(".concat(n.borderSize," * 0.625)")})},null,6),me("span",{ref:"circle",class:B(n.n("success-circle")),style:Fe({left:"-".concat(n.borderSize),top:"-".concat(n.borderSize),borderWidth:n.borderSize})},null,6),me("span",{class:B(n.n("success-line-fix"))},null,2),me("span",{class:B(n.n("success-cover-right")),style:Fe({animationDuration:n.animation?"4250ms":"0ms"})},null,6)],64)}const Ple=et({props:{animation:{type:Boolean},borderSize:{type:String}},setup(){return{n:nQe,classes:sQe,toNumber:Ie}}});Ple.render=oQe;var rQe=Ple;const aQe=n=>(vg(""),n=n(),bg(),n),lQe={xmlns:"http://www.w3.org/2000/svg",viewBox:"-3 -3 30 30"},cQe=aQe(()=>me("path",{d:"M10,19H13V22H10V19M12,2C17.35,2.22 19.68,7.62 16.5,11.67C15.67,12.67 14.33,13.33 13.67,14.17C13,15 13,16 13,17H10C10,15.33 10,13.92 10.67,12.92C11.33,11.92 12.67,11.33 13.5,10.67C15.92,8.43 15.32,5.26 12,5A3,3 0 0,0 9,8H6A6,6 0 0,1 12,2Z"},null,-1)),dQe=[cQe];function uQe(n,e){return q(),re("svg",lQe,dQe)}const Ole=et({});Ole.render=uQe;var hQe=Ole;const fQe=n=>(vg(""),n=n(),bg(),n),gQe={viewBox:"-4 -4 32 32"},pQe=fQe(()=>me("path",{fill:"currentColor",d:"M2,10.96C1.5,10.68 1.35,10.07 1.63,9.59L3.13,7C3.24,6.8 3.41,6.66 3.6,6.58L11.43,2.18C11.59,2.06 11.79,2 12,2C12.21,2 12.41,2.06 12.57,2.18L20.47,6.62C20.66,6.72 20.82,6.88 20.91,7.08L22.36,9.6C22.64,10.08 22.47,10.69 22,10.96L21,11.54V16.5C21,16.88 20.79,17.21 20.47,17.38L12.57,21.82C12.41,21.94 12.21,22 12,22C11.79,22 11.59,21.94 11.43,21.82L3.53,17.38C3.21,17.21 3,16.88 3,16.5V10.96C2.7,11.13 2.32,11.14 2,10.96M12,4.15V4.15L12,10.85V10.85L17.96,7.5L12,4.15M5,15.91L11,19.29V12.58L5,9.21V15.91M19,15.91V12.69L14,15.59C13.67,15.77 13.3,15.76 13,15.6V19.29L19,15.91M13.85,13.36L20.13,9.73L19.55,8.72L13.27,12.35L13.85,13.36Z"},null,-1)),mQe=[pQe];function _Qe(n,e){return q(),re("svg",gQe,mQe)}const Fle=et({});Fle.render=_Qe;var vQe=Fle;const bQe={imageSize:[String,Number],type:{type:String,default:"success"},title:String,description:String,animation:{type:Boolean,default:!0}},{name:CQe,n:wQe,classes:yQe}=st("result");function SQe(n,e){return q(),re("div",{class:B(n.classes(n.n(),n.n("$--box")))},[xe(n.$slots,"image",{},()=>[n.type?(q(),re("div",{key:0,class:B(n.n("image-container"))},[me("div",{class:B(n.classes(n.n("image"),n.n(n.type))),style:Fe({width:n.circleSize,height:n.circleSize,borderWidth:n.borderSize})},[(q(),ei(m0(n.type),{"border-size":n.borderSize,animation:n.animation},null,8,["border-size","animation"]))],6)],2)):Qe("v-if",!0)]),xe(n.$slots,"title",{},()=>[n.title?(q(),re("div",{key:0,class:B(n.n("title"))},ut(n.title),3)):Qe("v-if",!0)]),xe(n.$slots,"description",{},()=>[n.description?(q(),re("div",{key:0,class:B(n.n("description"))},ut(n.description),3)):Qe("v-if",!0)]),n.$slots.footer?(q(),re("div",{key:0,class:B(n.n("footer"))},[xe(n.$slots,"footer")],2)):Qe("v-if",!0)],2)}const Ble=et({name:CQe,components:{Info:UXe,Success:rQe,Warning:iQe,Error:ZXe,Question:hQe,Empty:vQe},props:bQe,setup(n){const e=ve(()=>{const{imageSize:i}=n;return"calc(".concat(i?ri(i):"var(--result-image-size)"," * 0.9)")}),t=ve(()=>{const{imageSize:i}=n;return"calc(".concat(i?ri(n.imageSize):"var(--result-image-size)"," * 0.05)")});return{circleSize:e,borderSize:t,toSizeUnit:ri,n:wQe,classes:yQe,toNumber:Ie,toPxNum:jn}}});Ble.render=SQe;var Wle=Ble;lt(Wle);var tB=Wle;const LQe={gutter:{type:[String,Number,Array],default:0},justify:{type:String,default:"flex-start"},align:{type:String,default:"flex-start"},onClick:Se()},{name:kQe,n:DQe,classes:EQe}=st("row");function IQe(n,e){return q(),re("div",{class:B(n.classes(n.n(),n.n("$--box"))),style:Fe({justifyContent:n.padStartFlex(n.justify),alignItems:n.padStartFlex(n.align),margin:"".concat(-n.average[0],"px ").concat(-n.average[1],"px")}),onClick:e[0]||(e[0]=(...t)=>n.handleClick&&n.handleClick(...t))},[xe(n.$slots,"default")],6)}const Vle=et({name:kQe,props:LQe,setup(n){const e=ve(()=>tn(n.gutter)?n.gutter.map(l=>jn(l)/2):[0,jn(n.gutter)/2]),{cols:t,bindCols:i,length:s}=tUe(),o={computePadding:r};ht(()=>s.value,r),ht(()=>n.gutter,r),i(o);function r(){t.forEach(l=>{const[c,d]=e.value;l.setPadding({left:d,right:d,top:c,bottom:c})})}function a(l){oe(n.onClick,l)}return{average:e,n:DQe,classes:EQe,handleClick:a,padStartFlex:dT}}});Vle.render=IQe;var Hle=Vle;lt(Hle);var iB=Hle,TQe=Object.defineProperty,PG=Object.getOwnPropertySymbols,xQe=Object.prototype.hasOwnProperty,NQe=Object.prototype.propertyIsEnumerable,OG=(n,e,t)=>e in n?TQe(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,AQe=(n,e)=>{for(var t in e||(e={}))xQe.call(e,t)&&OG(n,t,e[t]);if(PG)for(var t of PG(e))NQe.call(e,t)&&OG(n,t,e[t]);return n};const MQe=AQe({modelValue:{default:void 0},multiple:Boolean,offsetY:{type:[String,Number],default:0},chip:Boolean,readonly:Boolean,separator:{type:String,default:","},textAlign:{type:String,default:"left"},validateTrigger:{type:Array,default:()=>["onChange","onClear","onClose"]},rules:Array,onFocus:Se(),onBlur:Se(),onClose:Se(),onChange:Se(),onClear:Se(),"onUpdate:modelValue":Se()},yi($6,["size","variant","placeholder","line","hint","textColor","focusColor","blurColor","disabled","clearable","onClick"])),{name:RQe,n:PQe,classes:OQe}=st("select"),FQe={key:1};function BQe(n,e){const t=gt("var-chip"),i=gt("var-icon"),s=gt("var-field-decorator"),o=gt("var-menu"),r=gt("var-form-details");return q(),re("div",{class:B(n.n()),onClick:e[3]||(e[3]=(...a)=>n.handleFocus&&n.handleFocus(...a))},[Oe(o,{"var-select-cover":"","same-width":"","close-on-click-reference":"",show:n.showMenu,"onUpdate:show":e[1]||(e[1]=a=>n.showMenu=a),class:B(n.n("menu")),"popover-class":n.variant==="standard"&&n.hint?n.n("--standard-menu-margin"):void 0,"offset-y":n.offsetY,disabled:n.formReadonly||n.readonly||n.formDisabled||n.disabled,placement:n.placement,"default-style":!1,onClickOutside:n.handleBlur},{menu:Lt(()=>[me("div",{ref:"menuEl",class:B(n.classes(n.n("scroller"),n.n("$-elevation--3")))},[xe(n.$slots,"default")],2)]),default:Lt(()=>[Oe(s,pf(_0({value:n.modelValue,size:n.size,variant:n.variant,placeholder:n.placeholder,line:n.line,hint:n.hint,textColor:n.textColor,focusColor:n.focusColor,blurColor:n.blurColor,isFocus:n.isFocus,errorMessage:n.errorMessage,formDisabled:n.formDisabled,disabled:n.disabled,clearable:n.clearable,cursor:n.cursor,onClick:n.handleClick,onClear:n.handleClear})),ZD({"append-icon":Lt(()=>[xe(n.$slots,"append-icon")]),default:Lt(()=>[me("div",{class:B(n.classes(n.n("select"),[n.errorMessage,n.n("--error")],[n.formDisabled||n.disabled,n.n("--disabled")])),style:Fe({textAlign:n.textAlign,color:n.textColor})},[me("div",{class:B(n.n("label"))},[n.isEmptyModelValue?Qe("v-if",!0):xe(n.$slots,"selected",{key:0},()=>[n.multiple?(q(),re(li,{key:0},[n.chip?(q(),re("div",{key:0,class:B(n.n("chips"))},[(q(!0),re(li,null,ss(n.labels,a=>(q(),ei(t,{class:B(n.n("chip")),"var-select-cover":"",closeable:"",size:"small",type:n.errorMessage?"danger":void 0,key:a,onClick:e[0]||(e[0]=Ia(()=>{},["stop"])),onClose:()=>n.handleClose(a)},{default:Lt(()=>[Mi(ut(a),1)]),_:2},1032,["class","type","onClose"]))),128))],2)):(q(),re("div",{key:1,class:B(n.n("values"))},ut(n.labels.join(n.separator)),3))],64)):(q(),re("span",FQe,ut(n.label),1))])],2),n.enableCustomPlaceholder?(q(),re("span",{key:0,class:B(n.classes(n.n("placeholder"),n.n("$--ellipsis"))),style:Fe({color:n.placeholderColor})},ut(n.placeholder),7)):Qe("v-if",!0),xe(n.$slots,"arrow-icon",{focus:n.showMenu},()=>[Oe(i,{class:B(n.classes(n.n("arrow"),[n.showMenu,n.n("--arrow-rotate")])),"var-select-cover":"",name:"menu-down",transition:300},null,8,["class"])])],6)]),_:2},[n.$slots["prepend-icon"]?{name:"prepend-icon",fn:Lt(()=>[xe(n.$slots,"prepend-icon")]),key:"0"}:void 0]),1040)]),_:3},8,["show","class","popover-class","offset-y","disabled","placement","onClickOutside"]),Oe(r,{"error-message":n.errorMessage,onClick:e[2]||(e[2]=Ia(()=>{},["stop"]))},null,8,["error-message"])],2)}const $le=et({name:RQe,components:{VarIcon:Wn,VarMenu:f0,VarChip:gT,VarFieldDecorator:Gy,VarFormDetails:na},props:MQe,setup(n){const e=se(!1),t=se(!1),i=ve(()=>n.multiple),s=ve(()=>n.focusColor),o=ve(()=>hd(n.modelValue)),r=ve(()=>n.disabled||n.readonly?"":"pointer"),a=se(0),{bindForm:l,form:c}=kl(),{length:d,options:u,bindOptions:h}=IZe(),{label:f,labels:g,computeLabel:p,getSelectedValue:_}=cle({modelValue:()=>n.modelValue,multiple:()=>n.multiple,optionProviders:()=>u,optionProvidersLength:()=>d.value}),{errorMessage:v,validateWithTrigger:b,validate:C,resetValidation:w}=Ll(),y=se(null),L=ve(()=>n.variant==="outlined"?"bottom":"cover-top"),S=ve(()=>{const{hint:_e,blurColor:ie,focusColor:ne}=n;if(!_e)return v.value?"var(--field-decorator-error-color)":e.value?ne||"var(--field-decorator-focus-color)":ie||"var(--field-decorator-placeholder-color, var(--field-decorator-blur-color))"}),k=ve(()=>!n.hint&&hd(n.modelValue)),D={multiple:i,focusColor:s,computeLabel:p,onSelect:P,reset:de,validate:le,resetValidation:w};ht(()=>n.multiple,()=>{const{multiple:_e,modelValue:ie}=n;_e&&!tn(ie)&&Oa("Select","The modelValue must be an array when multiple is true")}),h(D),oe(l,D);function x(_e){Fn(()=>{const{validateTrigger:ie,rules:ne,modelValue:Ye}=n;b(ie,_e,ne,Ye)})}function A(){const{disabled:_e,readonly:ie,onFocus:ne}=n;c!=null&&c.disabled.value||c!=null&&c.readonly.value||_e||ie||(a.value=jn(n.offsetY),e.value=!0,oe(ne),x("onFocus"))}function T(){const{disabled:_e,readonly:ie,onBlur:ne}=n;c!=null&&c.disabled.value||c!=null&&c.readonly.value||_e||ie||(Q(),oe(ne),x("onBlur"))}function P(_e){const{disabled:ie,readonly:ne,multiple:Ye,onChange:pe}=n;if(c!=null&&c.disabled.value||c!=null&&c.readonly.value||ie||ne)return;const Ee=_(_e);oe(n["onUpdate:modelValue"],Ee),oe(pe,Ee),x("onChange"),Ye||Q()}function W(){const{disabled:_e,readonly:ie,multiple:ne,clearable:Ye,onClear:pe}=n;if(c!=null&&c.disabled.value||c!=null&&c.readonly.value||_e||ie||!Ye)return;const Ee=ne?[]:void 0;oe(n["onUpdate:modelValue"],Ee),oe(pe,Ee),x("onClear")}function $(_e){const{disabled:ie,onClick:ne}=n;c!=null&&c.disabled.value||ie||(oe(ne,_e),x("onClick"))}function X(_e){const{disabled:ie,readonly:ne,modelValue:Ye,onClose:pe}=n;if(c!=null&&c.disabled.value||c!=null&&c.readonly.value||ie||ne)return;const Ee=u.find(({label:It})=>It.value===_e),ze=Ye.filter(It=>{var Ke;return It!==((Ke=Ee.value.value)!=null?Ke:Ee.label.value)});oe(n["onUpdate:modelValue"],ze),oe(pe,ze),x("onClose")}function J(){a.value=jn(n.offsetY),e.value=!0,t.value=!0}function Q(){e.value=!1,t.value=!1}function le(){return C(n.rules,n.modelValue)}function de(){oe(n["onUpdate:modelValue"],n.multiple?[]:void 0),w()}return{offsetY:a,isFocus:e,showMenu:t,errorMessage:v,formDisabled:c==null?void 0:c.disabled,formReadonly:c==null?void 0:c.readonly,label:f,labels:g,isEmptyModelValue:o,menuEl:y,placement:L,cursor:r,placeholderColor:S,enableCustomPlaceholder:k,n:PQe,classes:OQe,handleFocus:A,handleBlur:T,handleClear:W,handleClick:$,handleClose:X,reset:de,validate:le,resetValidation:w,focus:J,blur:Q}}});$le.render=BQe;var zle=$le;lt(zle);var nB=zle;const WQe={loading:{type:Boolean,default:!0},title:Boolean,card:Boolean,avatar:Boolean,fullscreen:Boolean,fullscreenZIndex:{type:[Number,String],default:100},titleWidth:[Number,String],cardHeight:[Number,String],avatarSize:[Number,String],rows:{type:[Number,String],default:3},rowsWidth:{type:Array,default:()=>[]}},{name:VQe,n:HQe,classes:$Qe}=st("skeleton");function zQe(n,e){return q(),re("div",{class:B(n.classes(n.n("$--box"),n.n()))},[n.loading?Qe("v-if",!0):(q(),re("div",{key:0,class:B(n.n("data"))},[xe(n.$slots,"default")],2)),n.loading&&!n.fullscreen?(q(),re("div",{key:1,class:B(n.n("content"))},[n.card?(q(),re("div",{key:0,class:B(n.n("card")),style:Fe({height:n.toSizeUnit(n.cardHeight)})},[me("div",{class:B(n.n("--animation"))},null,2)],6)):Qe("v-if",!0),n.avatar||n.title||n.toNumber(n.rows)>0?(q(),re("div",{key:1,class:B(n.n("article"))},[n.avatar?(q(),re("div",{key:0,class:B(n.n("avatar")),style:Fe({width:n.toSizeUnit(n.avatarSize),height:n.toSizeUnit(n.avatarSize)})},[me("div",{class:B(n.n("--animation"))},null,2)],6)):Qe("v-if",!0),n.title||n.toNumber(n.rows)>0?(q(),re("div",{key:1,class:B(n.n("section"))},[n.title?(q(),re("div",{key:0,class:B(n.n("title")),style:Fe({width:n.toSizeUnit(n.titleWidth)})},[me("div",{class:B(n.n("--animation"))},null,2)],6)):Qe("v-if",!0),(q(!0),re(li,null,ss(n.toNumber(n.rows),(t,i)=>(q(),re("div",{class:B(n.n("row")),key:t,style:Fe({width:n.toSizeUnit(n.rowsWidth[i])})},[me("div",{class:B(n.n("--animation"))},null,2)],6))),128))],2)):Qe("v-if",!0)],2)):Qe("v-if",!0)],2)):Qe("v-if",!0),n.loading&&n.fullscreen?(q(),re("div",{key:2,class:B(n.n("fullscreen")),style:Fe({zIndex:n.toNumber(n.fullscreenZIndex)})},[me("div",{class:B(n.n("--animation"))},null,2)],6)):Qe("v-if",!0)],2)}const Ule=et({name:VQe,props:WQe,setup:()=>({n:HQe,classes:$Qe,toSizeUnit:ri,toNumber:Ie})});Ule.render=zQe;var jle=Ule;lt(jle);var sB=jle,ps=(n=>(n.First="1",n.Second="2",n))(ps||{});const UQe={modelValue:{type:[Number,Array],default:0},step:{type:[Number,String],default:1},range:Boolean,labelVisible:{type:String,default:"normal"},activeColor:String,trackColor:String,thumbColor:String,labelColor:String,labelTextColor:String,trackHeight:[String,Number],max:{type:[String,Number],default:100},min:{type:[String,Number],default:0},thumbSize:[String,Number],disabled:Boolean,readonly:Boolean,direction:{type:String,default:"horizontal"},rules:Array,onChange:Se(),onStart:Se(),onEnd:Se(),"onUpdate:modelValue":Se()},{name:jQe,n:FG,classes:KQe}=st("slider"),qQe=["onTouchstart"];function GQe(n,e){const t=gt("var-hover-overlay"),i=gt("var-form-details"),s=hn("hover");return q(),re("div",{class:B(n.classes(n.n(n.direction),n.n("$--box")))},[me("div",{class:B(n.classes(n.n("".concat(n.direction,"-block")),[n.isDisabled,n.n("--disabled")],[n.errorMessage,n.n("".concat(n.direction,"--error"))])),ref:"sliderEl",onClick:e[0]||(e[0]=(...o)=>n.click&&n.click(...o))},[me("div",{class:B(n.n("".concat(n.direction,"-track")))},[me("div",{class:B(n.n("".concat(n.direction,"-track-background"))),style:Fe({background:n.trackColor,height:n.isVertical?"100%":n.multiplySizeUnit(n.trackHeight),width:n.isVertical?n.multiplySizeUnit(n.trackHeight):"100%"})},null,6),me("div",{class:B(n.n("".concat(n.direction,"-track-fill"))),style:Fe(n.getFillStyle)},null,6)],2),(q(!0),re(li,null,ss(n.thumbList,o=>(q(),re("div",{class:B(n.n("".concat(n.direction,"-thumb"))),key:o.enumValue,style:Fe(n.thumbStyle(o)),onTouchstart:Ia(r=>n.start(r,o.enumValue),["stop"])},[xe(n.$slots,"button",{currentValue:o.text},()=>[wi(me("div",{class:B(n.n("".concat(n.direction,"-thumb-block"))),style:Fe({background:n.thumbColor})},null,6),[[s,r=>n.hover(r,o),"desktop"]]),me("div",{class:B(n.classes(n.n("".concat(n.direction,"-thumb-ripple")),[n.thumbsProps[o.enumValue].active,n.n("".concat(n.direction,"-thumb-ripple--active"))])),style:Fe({background:n.thumbsProps[o.enumValue].active?n.thumbColor:void 0})},[Oe(t,{hovering:o.hovering},null,8,["hovering"])],6),me("div",{class:B(n.classes(n.n("".concat(n.direction,"-thumb-label")),[n.showLabel(o.enumValue),n.n("".concat(n.direction,"-thumb-label--active"))])),style:Fe({background:n.labelColor,color:n.labelTextColor,height:n.thumbSize===void 0?n.thumbSize:n.multiplySizeUnit(n.thumbSize,2),width:n.thumbSize===void 0?n.thumbSize:n.multiplySizeUnit(n.thumbSize,2)})},[me("span",null,ut(o.text),1)],6)])],46,qQe))),128))],2),Oe(i,{"error-message":n.errorMessage,class:B(n.n("form")),"var-slider-cover":""},null,8,["error-message","class"])],2)}const Kle=et({name:jQe,components:{VarFormDetails:na,VarHoverOverlay:ml},directives:{Hover:Fa},props:UQe,setup(n){const e=se(0),t=se(null),i=se(!1),s=ve(()=>Ie(n.max)-Ie(n.min)),o=ve(()=>e.value/s.value*Ie(n.step)),r=ve(()=>n.disabled||(d==null?void 0:d.disabled.value)),a=ve(()=>n.readonly||(d==null?void 0:d.readonly.value)),l=ve(()=>n.direction==="vertical"),{bindForm:c,form:d}=kl(),{errorMessage:u,validateWithTrigger:h,validate:f,resetValidation:g}=Ll(),{hovering:p,handleHovering:_}=Pd(),{hovering:v,handleHovering:b}=Pd(),C=ve(()=>{const{modelValue:Ke,range:Xe}=n;let je=[];return Xe&&tn(Ke)?je=[{value:W(Ke[0]),enumValue:ps.First,text:$(Ke[0]),hovering:ud(p),handleHovering:_},{value:W(Ke[1]),enumValue:ps.Second,text:$(Ke[1]),hovering:ud(v),handleHovering:b}]:qr(Ke)&&(je=[{value:W(Ke),enumValue:ps.First,text:$(Ke),hovering:ud(p),handleHovering:_}]),je}),w=ve(()=>{const{activeColor:Ke,range:Xe,modelValue:je}=n,Z=Xe&&tn(je)?W(Math.min(je[0],je[1])):0,z=Xe&&tn(je)?W(Math.max(je[0],je[1]))-Z:W(je);return l.value?{left:"0px",height:"".concat(z,"%"),bottom:"".concat(Z,"%"),background:Ke}:{top:"0px",width:"".concat(z,"%"),left:"".concat(Z,"%"),background:Ke}}),y=Cn({[ps.First]:D(),[ps.Second]:D()});let L;oe(c,{reset:It,validate:k,resetValidation:g}),ht([()=>n.modelValue,()=>n.step],([Ke,Xe])=>{!pe()||!Ee()||i.value||ze(Ke,Ie(Xe))}),ht(e,()=>ze()),Vo(()=>{!pe()||!Ee()||(e.value=t.value[l.value?"offsetHeight":"offsetWidth"])}),zm(()=>{de()});function k(){return f(n.rules,n.modelValue)}function D(){return{startPosition:0,currentOffset:0,active:!1,percentValue:0}}function x(){return Fn(()=>h(["onChange"],"onChange",n.rules,n.modelValue))}function A(Ke){const Xe=Ke.currentTarget;return Xe?l.value?e.value-(Ke.clientY-no(Xe).top):Ke.clientX-kVe(Xe):0}function T(Ke){return{[l.value?"bottom":"left"]:"".concat(Ke.value,"%"),zIndex:y[Ke.enumValue].active?1:void 0}}function P(Ke){return n.labelVisible==="always"?!0:n.labelVisible==="never"?!1:y[Ke].active}function W(Ke){const{min:Xe,max:je}=n;return KeIe(je)?100:(Ke-Ie(Xe))/s.value*100}function $(Ke){if(!qr(Ke))return 0;let Xe=Ke;return XeNumber(n.max)&&(Xe=Number(n.max)),parseInt("".concat(Xe),10)===Xe?Xe:Ie(Xe.toPrecision(5))}function X(Ke,Xe){r.value||Xe.handleHovering(Ke)}function J(Ke,Xe){let je=[];const{step:Z,range:z,modelValue:ae,onChange:we,min:Ne}=n,Ce=Ie(Z),Be=Math.round(Ke/o.value),Ae=Be*Ce+Ie(Ne),K=y[Xe].percentValue*Ce+Ie(Ne);if(y[Xe].percentValue=Be,z&&tn(ae)&&(je=Xe===ps.First?[Ae,ae[1]]:[ae[0],Ae]),K!==Ae){const V=z?je.map(G=>$(G)):$(Ae);oe(we,V),oe(n["onUpdate:modelValue"],V),x()}}function Q(Ke){if(!n.range)return ps.First;const Xe=y[ps.First].percentValue*o.value,je=y[ps.Second].percentValue*o.value,Z=Math.abs(Ke-Xe),z=Math.abs(Ke-je);return Z<=z?ps.First:ps.Second}function le(){document.addEventListener("touchmove",ie,{passive:!1}),document.addEventListener("touchend",ne),document.addEventListener("touchcancel",ne)}function de(){document.removeEventListener("touchmove",ie),document.removeEventListener("touchend",ne),document.removeEventListener("touchcancel",ne)}function _e(Ke,Xe){if(e.value||(e.value=t.value.offsetWidth),r.value||(y[Xe].active=!0),L=Xe,le(),r.value||a.value)return;oe(n.onStart),i.value=!0;const{clientX:je,clientY:Z}=Ke.touches[0];y[Xe].startPosition=l.value?Z:je}function ie(Ke){if(dc(Ke),r.value||a.value||!i.value)return;const{startPosition:Xe,currentOffset:je}=y[L],{clientX:Z,clientY:z}=Ke.touches[0];let ae=(l.value?Xe-z:Z-Xe)+je;ae<=0?ae=0:ae>=e.value&&(ae=e.value),J(ae,L)}function ne(){de();const{range:Ke,modelValue:Xe,onEnd:je,step:Z,min:z}=n;if(r.value||(y[L].active=!1),r.value||a.value)return;let ae=[];y[L].currentOffset=y[L].percentValue*o.value;const we=y[L].percentValue*Ie(Z)+Ie(z);Ke&&tn(Xe)&&(ae=L===ps.First?[we,Xe[1]]:[Xe[0],we]),oe(je,Ke?ae:we),i.value=!1}function Ye(Ke){if(r.value||a.value||Ke.target.closest(".".concat(FG("thumb"))))return;const Xe=A(Ke),je=Q(Xe);L=je,J(Xe,je),ne()}function pe(){const Ke=Ie(n.step);return isNaN(Ke)?(ZK("Slider",'type of prop "step" should be Number'),!1):Ke<0?(ZK("Slider",'"step" should be > 0'),!1):!0}function Ee(){const{range:Ke,modelValue:Xe}=n;return Ke&&!tn(Xe)?(console.error('[Varlet] Slider: "modelValue" should be an Array'),!1):!Ke&&tn(Xe)?(console.error('[Varlet] Slider: "modelValue" should be a Number'),!1):Ke&&tn(Xe)&&Xe.length<2?(console.error('[Varlet] Slider: "modelValue" should have two value'),!1):!0}function ze(Ke=n.modelValue,Xe=Ie(n.step)){const je=Z=>{const{min:z,max:ae}=n;return ZIe(ae)?s.value/Xe:(Z-Ie(z))/Xe};n.range&&tn(Ke)?(y[ps.First].percentValue=je(Ke[0]),y[ps.First].currentOffset=y[ps.First].percentValue*o.value,y[ps.Second].percentValue=je(Ke[1]),y[ps.Second].currentOffset=y[ps.Second].percentValue*o.value):qr(Ke)&&(y[ps.First].currentOffset=je(Ke)*o.value)}function It(){const Ke=n.range?[0,0]:0;oe(n["onUpdate:modelValue"],Ke),g()}return{Thumbs:ps,sliderEl:t,getFillStyle:w,isDisabled:r,isVertical:l,errorMessage:u,thumbsProps:y,thumbList:C,n:FG,classes:KQe,thumbStyle:T,hover:X,multiplySizeUnit:dr,toNumber:Ie,showLabel:P,start:_e,move:ie,end:ne,click:Ye}}});Kle.render=GQe;var qle=Kle;lt(qle);var oB=qle,YQe=Object.defineProperty,ZQe=Object.defineProperties,XQe=Object.getOwnPropertyDescriptors,BG=Object.getOwnPropertySymbols,QQe=Object.prototype.hasOwnProperty,JQe=Object.prototype.propertyIsEnumerable,WG=(n,e,t)=>e in n?YQe(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,eJe=(n,e)=>{for(var t in e||(e={}))QQe.call(e,t)&&WG(n,t,e[t]);if(BG)for(var t of BG(e))JQe.call(e,t)&&WG(n,t,e[t]);return n},tJe=(n,e)=>ZQe(n,XQe(e));const Gle={type:String,position:{type:String,default:"top"},content:{type:[String,Function,Object]},contentClass:String,duration:{type:Number,default:3e3},vertical:Boolean,loadingType:yi(hf,"type"),loadingSize:yi(hf,"size"),loadingRadius:yi(hf,"radius"),loadingColor:tJe(eJe({},yi(hf,"color")),{default:"currentColor"}),lockScroll:Boolean,show:Boolean,teleport:{type:[String,Object,Boolean],default:"body"},forbidClick:Boolean,onOpen:Se(),onOpened:Se(),onClose:Se(),onClosed:Se(),"onUpdate:show":Se(),_update:String},{n:iJe,classes:nJe}=st("snackbar"),sJe={success:"checkbox-marked-circle",warning:"warning",info:"information",error:"error",loading:""};function oJe(n,e){const t=gt("var-icon"),i=gt("var-loading");return wi((q(),re("div",{class:B(n.n()),style:Fe({pointerEvents:n.isForbidClick?"auto":"none",zIndex:n.zIndex})},[me("div",{class:B(n.classes(n.n("wrapper"),n.n("wrapper-".concat(n.position)),n.n("$-elevation--4"),[n.vertical,n.n("vertical")],[n.type&&n.SNACKBAR_TYPE.includes(n.type),n.n("wrapper-".concat(n.type))])),style:Fe({zIndex:n.zIndex})},[me("div",{class:B([n.n("content"),n.contentClass])},[xe(n.$slots,"default",{},()=>[Mi(ut(n.content),1)])],2),me("div",{class:B([n.n("icon")])},[n.iconName?(q(),ei(t,{key:0,name:n.iconName},null,8,["name"])):Qe("v-if",!0),n.type==="loading"?(q(),ei(i,{key:1,type:n.loadingType,size:n.loadingSize,color:n.loadingColor,radius:n.loadingRadius},null,8,["type","size","color","radius"])):Qe("v-if",!0),xe(n.$slots,"icon")],2),me("div",{class:B(n.n("action"))},[xe(n.$slots,"action")],2)],6)],6)),[[hl,n.show]])}const Yle=et({name:"VarSnackbarCore",components:{VarLoading:l0,VarIcon:Wn},props:Gle,setup(n){const e=se(null),{zIndex:t}=QS(()=>n.show,1);XS(()=>n.show,()=>n.lockScroll);const i=ve(()=>n.type==="loading"||n.forbidClick),s=ve(()=>n.type?sJe[n.type]:""),o=()=>{e.value=setTimeout(()=>{n.type!=="loading"&&oe(n["onUpdate:show"],!1)},n.duration)};return ht(()=>n.show,r=>{r?(oe(n.onOpen),o()):r===!1&&(clearTimeout(e.value),oe(n.onClose))}),ht(()=>n._update,()=>{clearTimeout(e.value),o()}),Vo(()=>{n.show&&(oe(n.onOpen),o())}),{SNACKBAR_TYPE:Qle,n:iJe,classes:nJe,zIndex:t,iconName:s,isForbidClick:i}}});Yle.render=oJe;var Zle=Yle;const{name:rJe,n:aJe}=st("snackbar");function lJe(n,e){const t=gt("var-snackbar-core");return q(),ei(Bd,{to:n.teleport===!1?void 0:n.teleport,disabled:n.disabled||n.teleport===!1},[Oe(On,{name:"".concat(n.n(),"-fade"),onAfterEnter:n.onOpened,onAfterLeave:n.onClosed},{default:Lt(()=>[Oe(t,fn(n.$props,{class:n.n("transition")}),{icon:Lt(()=>[xe(n.$slots,"icon")]),action:Lt(()=>[xe(n.$slots,"action")]),default:Lt(()=>[xe(n.$slots,"default",{},()=>[Mi(ut(n.content),1)])]),_:3},16,["class"])]),_:3},8,["name","onAfterEnter","onAfterLeave"])],8,["to","disabled"])}const Xle=et({name:rJe,components:{VarSnackbarCore:Zle},props:Gle,setup(){const{disabled:n}=u_();return{disabled:n,n:aJe}}});Xle.render=lJe;var j6=Xle,cJe=Object.defineProperty,VG=Object.getOwnPropertySymbols,dJe=Object.prototype.hasOwnProperty,uJe=Object.prototype.propertyIsEnumerable,HG=(n,e,t)=>e in n?cJe(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,Jy=(n,e)=>{for(var t in e||(e={}))dJe.call(e,t)&&HG(n,t,e[t]);if(VG)for(var t of VG(e))uJe.call(e,t)&&HG(n,t,e[t]);return n};const Qle=["loading","success","warning","info","error"];let $G=0,rB=!1,Jle,eS=!1;const ece={type:void 0,content:"",icon:"",action:"",position:"top",duration:3e3,vertical:!1,contentClass:void 0,loadingType:"circle",loadingSize:"normal",lockScroll:!1,teleport:"body",forbidClick:!1,onOpen:()=>{},onOpened:()=>{},onClose:()=>{},onClosed:()=>{}};let ul=Cn([]),K6=ece;const hJe={name:"var-snackbar-fade",tag:"div",class:"var-transition-group"},a2=n=>()=>v0(n)?n():n,fJe={setup(){return()=>{const n=ul.map(({id:e,reactiveSnackOptions:t,_update:i})=>{const s=document.querySelector(".var-transition-group");t.forbidClick||t.type==="loading"?s.classList.add("var-pointer-auto"):s.classList.remove("var-pointer-auto");const o=Jy({position:eS?"relative":"absolute"},bJe(t.position)),{content:r,icon:a,action:l}=t,c={default:a2(r),icon:a2(a),action:a2(l)};return Oe(Zle,fn(t,{key:e,style:o,"data-id":e,_update:i,show:t.show,"onUpdate:show":d=>t.show=d}),c)});return Oe(nhe,fn(hJe,{style:{zIndex:Ea.zIndex},onAfterEnter:gJe,onAfterLeave:pJe}),{default:()=>[n]})}}},Ju=function(n){const e=_Je(n),t=Cn(Jy(Jy({},K6),e));t.show=!0,rB||(rB=!0,Jle=K0(fJe).unmountInstance);const{length:i}=ul,s={id:$G++,reactiveSnackOptions:t};if(i===0||eS)mJe(s);else{const o="update-".concat($G);vJe(t,o)}return{clear(){!eS&&ul.length?ul[0].reactiveSnackOptions.show=!1:t.show=!1}}};Qle.forEach(n=>{Ju[n]=e=>(ju(e)?e.type=n:e={content:e,type:n},Ju(e))});Ju.allowMultiple=function(n=!1){n!==eS&&(ul.forEach(e=>{e.reactiveSnackOptions.show=!1}),eS=n)};Ju.clear=function(){ul.forEach(n=>{n.reactiveSnackOptions.show=!1})};Ju.setDefaultOptions=function(n){K6=n};Ju.resetDefaultOptions=function(){K6=ece};function gJe(n){const e=n.getAttribute("data-id"),t=ul.find(i=>i.id===Ie(e));t&&oe(t.reactiveSnackOptions.onOpened)}function pJe(n){n.parentElement&&n.parentElement.classList.remove("var-pointer-auto");const e=n.getAttribute("data-id"),t=ul.find(s=>s.id===Ie(e));t&&(t.animationEnd=!0,oe(t.reactiveSnackOptions.onClosed)),ul.every(s=>s.animationEnd)&&(oe(Jle),ul=Cn([]),rB=!1)}function mJe(n){ul.push(n)}function _Je(n={}){return Us(n)?{content:n}:n}function vJe(n,e){const[t]=ul;t.reactiveSnackOptions=Jy(Jy({},t.reactiveSnackOptions),n),t._update=e}function bJe(n="top"){return n==="bottom"?{top:"85%"}:{top:n==="top"?"5%":"45%"}}Ju.Component=j6;lt(j6);lt(j6,Ju);var aB=Ju;const CJe={size:{type:[String,Number,Array],default:"normal"},wrap:{type:Boolean,default:!0},direction:{type:String,default:"row"},justify:{type:String,default:"flex-start"},align:String,inline:Boolean};function ha(n){return"calc(".concat(n," / 2)")}function wJe(n,e,t){const{direction:i,justify:s,index:o,lastIndex:r}=t;let a="0";return i==="row"&&(["flex-start","center","flex-end","start","end"].includes(s)?o!==r?a="".concat(ha(n)," ").concat(e," ").concat(ha(n)," 0"):a="".concat(ha(n)," 0"):s==="space-around"?a="".concat(ha(n)," ").concat(ha(e)):s==="space-between"&&(o===0?a="".concat(ha(n)," ").concat(ha(e)," ").concat(ha(n)," 0"):o===r?a="".concat(ha(n)," 0 ").concat(ha(n)," ").concat(ha(e)):a="".concat(ha(n)," ").concat(ha(e)))),i==="column"&&o!==r&&(a="0 0 ".concat(n," 0")),a}const yJe=n=>["mini","small","normal","large"].includes(n),{name:SJe,n:l2,classes:LJe}=st("space");function kJe(n,e){return e?["var(--space-size-".concat(n,"-y)"),"var(--space-size-".concat(n,"-x)")]:tn(n)?n.map(ri):[ri(n),ri(n)]}var tce=et({name:SJe,props:CJe,setup(n,{slots:e}){return()=>{var t;const{inline:i,justify:s,align:o,wrap:r,direction:a,size:l}=n;let c=(t=oe(e.default))!=null?t:[];const[d,u]=kJe(l,yJe(l));c=Xse(c);const h=c.length-1,f=c.map((g,p)=>{const _=wJe(d,u,{direction:a,justify:s,index:p,lastIndex:h});return Oe("div",{style:{margin:_}},[g])});return Oe("div",{class:LJe(l2(),l2("$--box"),[i,l2("--inline")]),style:{flexDirection:a,justifyContent:dT(s),alignItems:dT(o),flexWrap:r?"wrap":"nowrap",margin:a==="row"?"calc(-1 * ".concat(d," / 2) 0"):void 0}},[f])}}});lt(tce);var lB=tce;const DJe={activeIcon:{type:String,default:"check"},currentIcon:yi(Ss,"name"),inactiveIcon:yi(Ss,"name"),activeIconNamespace:yi(Ss,"namespace"),currentIconNamespace:yi(Ss,"namespace"),inactiveIconNamespace:yi(Ss,"namespace")},ice=Symbol("STEPS_BIND_STEP_KEY");function EJe(){const{bindChildren:n,childProviders:e}=$o(ice);return{step:e,bindStep:n}}function IJe(){const{parentProvider:n,index:e,bindParent:t}=Ho(ice);return t||Oa("Steps"," must in "),{index:e,steps:n,bindSteps:t}}const{name:TJe,n:xJe,classes:NJe}=st("step"),AJe={key:3};function MJe(n,e){const t=gt("var-icon");return q(),re("div",{class:B(n.n())},[me("div",{class:B(n.n(n.direction))},[me("div",{class:B(n.classes(n.n("".concat(n.direction,"-tag")),[n.isActive||n.isCurrent,n.n("".concat(n.direction,"-tag--active"))])),style:Fe({backgroundColor:n.isActive||n.isCurrent?n.activeColor:n.inactiveColor}),onClick:e[0]||(e[0]=(...i)=>n.click&&n.click(...i))},[n.isActive?(q(),ei(t,{key:0,class:B(n.n("icon")),"var-step-cover":"",name:n.activeIcon,namespace:n.activeIconNamespace},null,8,["class","name","namespace"])):n.isCurrent&&n.currentIcon?(q(),ei(t,{key:1,class:B(n.n("icon")),"var-step-cover":"",name:n.currentIcon,namespace:n.currentIconNamespace},null,8,["class","name","namespace"])):n.inactiveIcon?(q(),ei(t,{key:2,class:B(n.n("icon")),"var-step-cover":"",name:n.inactiveIcon,namespace:n.inactiveIconNamespace},null,8,["class","name","namespace"])):(q(),re("span",AJe,ut(n.index+1),1))],6),me("div",{class:B(n.classes(n.n("".concat(n.direction,"-content")),[n.isActive||n.isCurrent,n.n("".concat(n.direction,"-content--active"))])),onClick:e[1]||(e[1]=(...i)=>n.click&&n.click(...i))},[xe(n.$slots,"default")],2),me("div",{class:B(n.n("".concat(n.direction,"-line")))},null,2)],2)],2)}const nce=et({name:TJe,components:{VarIcon:Wn},props:DJe,setup(){const{index:n,steps:e,bindSteps:t}=IJe(),{active:i,activeColor:s,inactiveColor:o,direction:r,clickStep:a}=e,l=ve(()=>i.value===n.value),c=ve(()=>n.value!==-1&&Ie(i.value)>n.value);t({index:n});function u(){return a(n.value)}return{index:n,isActive:c,isCurrent:l,direction:r,activeColor:s,inactiveColor:o,n:xJe,classes:NJe,click:u}}});nce.render=MJe;var sce=nce;lt(sce);var cB=sce;const RJe={active:{type:[String,Number],default:0},direction:{type:String,default:"horizontal"},activeColor:String,inactiveColor:String,onClickStep:Se()},{name:PJe,n:OJe}=st("steps");function FJe(n,e){return q(),re("div",{class:B(n.n()),style:Fe({flexDirection:n.direction==="horizontal"?"row":"column"})},[xe(n.$slots,"default")],6)}const oce=et({name:PJe,props:RJe,setup(n){const e=ve(()=>n.active),t=ve(()=>n.activeColor),i=ve(()=>n.inactiveColor),s=ve(()=>n.direction),{bindStep:o}=EJe();o({active:e,direction:s,activeColor:t,inactiveColor:i,clickStep:a});function a(l){oe(n.onClickStep,l)}return{n:OJe}}});oce.render=FJe;var rce=oce;lt(rce);var dB=rce;const BJe={styleVars:{type:Object,default:()=>({})},tag:{type:String,default:"div"}},{name:WJe,n:VJe}=st("style-provider"),HJe=et({name:WJe,props:BJe,setup(n,{slots:e}){return()=>Bc(n.tag,{class:VJe(),style:uoe(n.styleVars)},oe(e.default))}});var q6=HJe;const c2=[];function G6(n){c2.forEach(t=>document.documentElement.style.removeProperty(t)),c2.length=0;const e=uoe(n!=null?n:{});Object.entries(e).forEach(([t,i])=>{document.documentElement.style.setProperty(t,i),c2.push(t)})}G6.Component=q6;lt(q6);lt(q6,G6);var ST=G6;const $Je={modelValue:{default:!1},activeValue:{default:!0},inactiveValue:{default:!1},disabled:Boolean,readonly:Boolean,loading:Boolean,color:String,loadingColor:String,closeColor:String,size:[String,Number],rules:Array,ripple:{type:Boolean,default:!0},onClick:Se(),onChange:Se(),"onUpdate:modelValue":Se()},{name:zJe,n:UJe,classes:jJe}=st("switch"),KJe=n=>(vg(""),n=n(),bg(),n),qJe=KJe(()=>me("svg",{viewBox:"25 25 50 50"},[me("circle",{cx:"50",cy:"50",r:"20",fill:"none"})],-1)),GJe=[qJe];function YJe(n,e){const t=gt("var-hover-overlay"),i=gt("var-form-details"),s=hn("ripple"),o=hn("hover");return wi((q(),re("div",{class:B(n.n())},[me("div",{class:B(n.classes(n.n("block"),[n.disabled||n.formDisabled,n.n("--disabled")])),onClick:e[0]||(e[0]=(...r)=>n.switchActive&&n.switchActive(...r)),style:Fe(n.styleComputed.switch)},[me("div",{style:Fe(n.styleComputed.track),class:B(n.classes(n.n("track"),[n.modelValue===n.activeValue,n.n("track--active")],[n.errorMessage,n.n("track--error")]))},null,6),wi((q(),re("div",{class:B(n.classes(n.n("ripple"),[n.modelValue===n.activeValue,n.n("ripple--active")])),style:Fe(n.styleComputed.ripple)},[me("div",{style:Fe(n.styleComputed.handle),class:B(n.classes(n.n("handle"),n.n("$-elevation--2"),[n.modelValue===n.activeValue,n.n("handle--active")],[n.errorMessage,n.n("handle--error")]))},[n.loading?(q(),re("span",{key:0,class:B(n.n("loading")),style:Fe({width:n.radius,height:n.radius})},GJe,6)):Qe("v-if",!0)],6),Oe(t,{hovering:n.hovering},null,8,["hovering"])],6)),[[s,{disabled:!n.ripple||n.disabled||n.loading||n.formDisabled}]])],6),Oe(i,{"error-message":n.errorMessage},null,8,["error-message"])],2)),[[o,n.hover,"desktop"]])}const ace=et({name:zJe,components:{VarFormDetails:na,VarHoverOverlay:ml},directives:{Ripple:Ns,Hover:Fa},props:$Je,setup(n){const{bindForm:e,form:t}=kl(),{errorMessage:i,validateWithTrigger:s,validate:o,resetValidation:r}=Ll(),{hovering:a,handleHovering:l}=Pd(),c=ve(()=>{const{size:v,modelValue:b,color:C,closeColor:w,loadingColor:y,activeValue:L}=n;return{handle:{width:dr(v),height:dr(v),backgroundColor:b===L?C:w,color:y},ripple:{left:b===L?dr(v,.5):"-".concat(dr(v,.5)),color:b===L?C:w||"#999",width:dr(v,2),height:dr(v,2)},track:{height:dr(v,.72),width:dr(v,1.9),borderRadius:dr(v,2/3),filter:b===L||i!=null&&i.value?void 0:"brightness(.6)",backgroundColor:b===L?C:w},switch:{height:dr(v,1.2),width:dr(v,2)}}}),d=ve(()=>dr(n.size,.8));oe(e,{reset:_,validate:h,resetValidation:r});function h(){return o(n.rules,n.modelValue)}function f(){return Fn(()=>s(["onChange"],"onChange",n.rules,n.modelValue))}function g(v){const{onClick:b,onChange:C,disabled:w,loading:y,readonly:L,modelValue:S,activeValue:k,inactiveValue:D,"onUpdate:modelValue":x}=n;if(oe(b,v),w||y||L||t!=null&&t.disabled.value||t!=null&&t.readonly.value)return;const A=S===k?D:k;oe(C,A),oe(x,A),f()}function p(v){n.disabled||t!=null&&t.disabled.value||l(v)}function _(){oe(n["onUpdate:modelValue"],n.inactiveValue),r()}return{hovering:a,radius:d,styleComputed:c,errorMessage:i,formDisabled:t==null?void 0:t.disabled,formReadonly:t==null?void 0:t.readonly,n:UJe,classes:jJe,multiplySizeUnit:dr,switchActive:g,hover:p}}});ace.render=YJe;var lce=ace;lt(lce);var uB=lce;const ZJe={name:[String,Number],disabled:Boolean,onClick:Se()},cce=Symbol("TABS_BIND_TAB_KEY");function XJe(){const{childProviders:n,bindChildren:e,length:t}=$o(cce);return{length:t,tabList:n,bindTabList:e}}function QJe(){const{parentProvider:n,bindParent:e,index:t}=Ho(cce);return e||Oa("Tab"," must in "),{index:t,tabs:n,bindTabs:e}}const{name:JJe,n:$k,classes:eet}=st("tab");function tet(n,e){const t=hn("ripple");return wi((q(),re("div",{class:B(n.classes(n.n(),n.n("$--box"),n.computeColorClass(),n.n("--".concat(n.itemDirection)))),ref:"tabEl",style:Fe({color:n.computeColorStyle()}),onClick:e[0]||(e[0]=(...i)=>n.handleClick&&n.handleClick(...i))},[xe(n.$slots,"default")],6)),[[t,{disabled:n.disabled}]])}const dce=et({name:JJe,directives:{Ripple:Ns},props:ZJe,setup(n){const e=se(null),t=ve(()=>e.value),i=ve(()=>n.name),s=ve(()=>n.disabled),{index:o,tabs:r,bindTabs:a}=QJe(),{onTabClick:l,active:c,activeColor:d,inactiveColor:u,disabledColor:h,itemDirection:f,resize:g}=r,p={name:i,index:o,disabled:s,element:t};a(p),ht(()=>[n.name,n.disabled],g);function _(){return n.name!=null?c.value===n.name:c.value===(o==null?void 0:o.value)}function v(){return n.disabled?h.value:_()?d.value:u.value}function b(){return n.disabled?$k("$-tab--disabled"):_()?$k("$-tab--active"):$k("$-tab--inactive")}function C(w){const{disabled:y,name:L,onClick:S}=n;y||(oe(S,L!=null?L:o.value,w),l(p))}return{tabEl:e,active:c,activeColor:d,inactiveColor:u,itemDirection:f,n:$k,classes:eet,computeColorStyle:v,computeColorClass:b,handleClick:C}}});dce.render=tet;var uce=dce;lt(uce);var hB=uce;const iet={name:[String,Number]},{name:net,n:set,classes:oet}=st("tab-item");function ret(n,e){const t=gt("var-swipe-item");return q(),ei(t,{class:B(n.classes(n.n(),[!n.current,n.n("--inactive")])),"var-tab-item-cover":""},{default:Lt(()=>[xe(n.$slots,"default")]),_:3},8,["class"])}const hce=et({name:net,components:{VarSwipeItem:Zy},props:iet,setup(n){const e=se(!1),t=ve(()=>n.name),{index:i,bindTabsItems:s}=zYe(),{bindLists:o}=UYe(),r={index:i,name:t,current:ve(()=>e.value),setCurrent:a};s(r),o(r);function a(l){e.value=l}return{current:e,n:set,classes:oet}}});hce.render=ret;var fce=hce;lt(fce);var fB=fce;const aet={fullWidth:{type:[Number,String],default:"100%"},elevation:{type:[Boolean,Number,String],default:!0}},{name:cet,n:det,classes:uet}=st("table");function het(n,e){return q(),re("div",{class:B(n.classes(n.n(),n.formatElevation(n.elevation,1),n.n("$--box")))},[me("div",{class:B(n.n("main"))},[me("table",{class:B(n.n("table")),style:Fe({width:n.toSizeUnit(n.fullWidth)})},[xe(n.$slots,"default")],6)],2),n.$slots.footer?(q(),re("div",{key:0,class:B(n.n("footer"))},[xe(n.$slots,"footer")],2)):Qe("v-if",!0)],2)}const gce=et({name:cet,props:aet,setup:()=>({toSizeUnit:ri,n:det,classes:uet,formatElevation:or})});gce.render=het;var pce=gce;lt(pce);var gB=pce;const fet={active:{type:[String,Number],default:0},layoutDirection:{type:String,default:"horizontal"},itemDirection:{type:String,default:"horizontal"},fixedBottom:Boolean,activeColor:String,inactiveColor:String,disabledColor:String,color:String,indicatorColor:String,indicatorSize:[String,Number],elevation:{type:[Boolean,String,Number],default:!1},scrollable:{type:String,default:"auto"},indicatorPosition:{type:String,default:"normal"},safeArea:Boolean,sticky:Boolean,stickyCssMode:yi(UD,"cssMode"),stickyZIndex:yi(UD,"zIndex"),offsetTop:yi(UD,"offsetTop"),onClick:Se(),onChange:Se(),"onUpdate:active":Se()};var zG=(n,e,t)=>new Promise((i,s)=>{var o=l=>{try{a(t.next(l))}catch(c){s(c)}},r=l=>{try{a(t.throw(l))}catch(c){s(c)}},a=l=>l.done?i(l.value):Promise.resolve(l.value).then(o,r);a((t=t.apply(n,e)).next())});const{name:get,n:pet,classes:met}=st("tabs");function _et(n,e){return q(),ei(m0(n.sticky?n.n("$-sticky"):n.Transition),{ref:n.sticky?"stickyComponent":void 0,"css-mode":n.sticky?n.stickyCssMode:void 0,"offset-top":n.sticky?n.offsetTop:void 0,"z-index":n.sticky?n.stickyZIndex:void 0},{default:Lt(()=>[me("div",fn({class:n.classes(n.n(),n.n("$--box"),n.n("--item-".concat(n.itemDirection)),n.n("--layout-".concat(n.layoutDirection,"-padding")),n.formatElevation(n.elevation,4),[n.fixedBottom,n.n("--fixed-bottom")],[n.safeArea,n.n("--safe-area")]),style:{background:n.color}},n.$attrs),[me("div",{ref:"scrollerEl",class:B(n.classes(n.n("tab-wrap"),[n.localScrollable,n.n("--layout-".concat(n.layoutDirection,"-scrollable"))],n.n("--layout-".concat(n.layoutDirection))))},[xe(n.$slots,"default"),me("div",{class:B(n.classes(n.n("indicator"),n.n("--layout-".concat(n.layoutDirection).concat(n.indicatorPosition,"-indicator")))),style:Fe({width:n.layoutDirection==="horizontal"?n.indicatorWidth:n.toSizeUnit(n.indicatorSize),height:n.layoutDirection==="horizontal"?n.toSizeUnit(n.indicatorSize):n.indicatorHeight,transform:n.layoutDirection==="horizontal"?"translateX(".concat(n.indicatorX,")"):"translateY(".concat(n.indicatorY,")")})},[me("div",{class:B(n.classes(n.n("indicator-inner"),n.n("--layout-".concat(n.layoutDirection,"-indicator-inner")))),style:Fe({background:n.indicatorColor||n.activeColor})},null,6)],6)],2)],16)]),_:3},8,["css-mode","offset-top","z-index"])}const mce=et({name:get,components:{VarSticky:Qy},inheritAttrs:!1,props:fet,setup(n){const e=se("0px"),t=se("0px"),i=se("0px"),s=se("0px"),o=se(!1),r=se(null),a=ve(()=>n.active),l=ve(()=>n.activeColor),c=ve(()=>n.inactiveColor),d=ve(()=>n.disabledColor),u=ve(()=>n.itemDirection),h=se(null),f=ve(()=>n.indicatorPosition==="reverse"?"-reverse":""),{tabList:g,bindTabList:p,length:_}=XJe();p({active:a,activeColor:l,inactiveColor:c,disabledColor:d,itemDirection:u,resize:D,onTabClick:b}),ht(()=>_.value,()=>zG(this,null,function*(){yield Cr(),D()})),ht(()=>[n.active,n.scrollable],D),eh(D),U0(D);function b(A){var T;const P=(T=A.name.value)!=null?T:A.index.value,{active:W,onChange:$,onClick:X}=n;oe(n["onUpdate:active"],P),oe(X,P),P!==W&&oe($,P)}function C(){return g.find(({name:A})=>n.active===A.value)}function w(A){return g.find(({index:T})=>(A!=null?A:n.active)===T.value)}function y(){if(_.value===0)return;const{active:A}=n;if(qr(A)){const T=Wf(A,0,_.value-1);return oe(n["onUpdate:active"],T),w(T)}}function L(){o.value=n.scrollable==="always"||g.length>=5}function S({element:A}){const T=A.value;T&&(n.layoutDirection==="horizontal"?(e.value="".concat(T.offsetWidth,"px"),i.value="".concat(T.offsetLeft,"px")):(t.value="".concat(T.offsetHeight,"px"),s.value="".concat(T.offsetTop,"px")))}function k({element:A}){if(!o.value)return;const T=r.value,P=A.value;if(n.layoutDirection==="horizontal"){const W=P.offsetLeft+P.offsetWidth/2-T.offsetWidth/2;$y(T,{left:W,animation:i3})}else{const W=P.offsetTop+P.offsetHeight/2-T.offsetHeight/2;$y(T,{top:W,animation:i3})}}function D(){const A=C()||w()||y();!A||A.disabled.value||(L(),S(A),k(A))}function x(){return zG(this,null,function*(){n.sticky&&h.value&&(yield h.value.resize())})}return{stickyComponent:h,indicatorWidth:e,indicatorHeight:t,indicatorX:i,indicatorY:s,indicatorPosition:f,localScrollable:o,scrollerEl:r,Transition:On,toSizeUnit:ri,n:pet,classes:met,resize:D,resizeSticky:x,formatElevation:or}}});mce.render=_et;var _ce=mce;lt(_ce);var pB=_ce;const vet={active:{type:[String,Number],default:0},canSwipe:{type:Boolean,default:!0},loop:Boolean,"onUpdate:active":Se()};var bet=(n,e,t)=>new Promise((i,s)=>{var o=l=>{try{a(t.next(l))}catch(c){s(c)}},r=l=>{try{a(t.throw(l))}catch(c){s(c)}},a=l=>l.done?i(l.value):Promise.resolve(l.value).then(o,r);a((t=t.apply(n,e)).next())});const{name:Cet,n:wet}=st("tabs-items");function yet(n,e){const t=gt("var-swipe");return q(),ei(t,{class:B(n.n()),ref:"swipe",loop:n.loop,touchable:n.canSwipe,indicator:!1,onChange:n.handleSwipeChange},{default:Lt(()=>[xe(n.$slots,"default")]),_:3},8,["class","loop","touchable","onChange"])}const vce=et({name:Cet,components:{VarSwipe:Yy},props:vet,setup(n){const e=se(null),{tabItemList:t,bindTabItem:i,length:s}=$Ye();i({}),ht(()=>n.active,l),ht(()=>s.value,()=>bet(this,null,function*(){yield Cr(),l(n.active)}));function o(u){return t.find(({name:h})=>u===h.value)}function r(u){return t.find(({index:h})=>u===h.value)}function a(u){return o(u)||r(u)}function l(u){var h;const f=a(u);f&&(t.forEach(({setCurrent:g})=>g(!1)),f.setCurrent(!0),(h=e.value)==null||h.to(f.index.value))}function c(u){var h;const f=t.find(({index:p})=>p.value===u),g=(h=f.name.value)!=null?h:f.index.value;oe(n["onUpdate:active"],g)}function d(){return e.value}return{swipe:e,n:wet,handleSwipeChange:c,getSwipe:d}}});vce.render=yet;var bce=vce;lt(bce);var mB=bce,Let={"--action-sheet-background":"#1e1e1e","--action-sheet-title-color":"#aaa","--action-sheet-action-item-color":"#fff"},ket={"--badge-default-color":"#555"},Det={"--button-default-color":"#303030","--button-default-text-color":"#fff"},Eet={"--card-background":"#303030","--card-title-color":"#ffffff","--card-outline-color":"rgba(255, 255, 255, 0.2)","--card-subtitle-color":"#aaaaaa","--card-description-color":"#aaaaaa"},Iet={"--cell-description-color":"#aaa","--cell-border-color":"#545454"},Tet={"--checkbox-unchecked-color":"#fff","--checkbox-text-color":"#fff"},xet={"--chip-default-color":"#555","--chip-default-text-color":"#fff"},Net={"--collapse-background":"#303030","--collapse-text-color":"#fff","--collapse-border-top":"thin solid rgba(255, 255, 255, 0.12)"},Aet={"--date-picker-main-color":"#fff","--date-picker-body-background-color":"#303030","--day-picker-head-item-color":"#aaaaaa","--year-picker-item-color":"#fff","--picker-header-color":"#fff"},Met={"--dialog-background":"#1e1e1e","--dialog-title-color":"#fff","--dialog-message-color":"#bbb"},Ret={"--divider-color":"rgba(255, 255, 255, 0.2)","--divider-text-color":"#aaa"},Pet={"--floating-panel-background":"#272727"},Oet={"--field-decorator-text-color":"#fff","--field-decorator-blur-color":"rgb(255, 255, 255, .7)"},Fet={"--pagination-text-color":"#fff","--pagination-list-bg-color":"#303030","--pagination-hover-bg-color":"rgba(255, 255, 255, .15)","--pagination-list-active-bg-color":"#25293a","--pagination-list-active-color":"#4a7afe","--pagination-item-background":"#303030"},Bet={"--picker-background":"#1e1e1e","--picker-cancel-button-text-color":"#aaa","--picker-title-text-color":"#fff","--picker-option-text-color":"#fff","--picker-picked-border":"1px solid rgba(255, 255, 255, 0.12)","--picker-mask-background-image":"linear-gradient(180deg, hsla(0, 0%, 12%, 0.9), hsla(0, 0%, 12%, 0.4)), linear-gradient(0deg, hsla(0, 0%, 12%, 0.9), hsla(0, 0%, 12%, 0.4))"},Wet={"--popup-content-background-color":"#1e1e1e"},Vet={"--pull-refresh-background":"#303030"},Het={"--radio-unchecked-color":"#fff","--radio-text-color":"#fff"},$et={"--result-background":"#303030","--result-title-color":"#ffffff","--result-description-color":"#aaaaaa","--result-question-color":"#7f8e96","--result-question-border-color":"rgba(151,194,216,0.3)","--result-empty-color":"#adadad","--result-empty-border-color":"rgba(232,229,229,0.3)"},zet={"--select-scroller-background":"#303030"},Uet={"--skeleton-card-background-color":"hsla(0,0%,100%,.12)","--skeleton-animation-background":"linear-gradient(\n 90deg,hsla(0,0%,100%,0),hsla(0,0%,100%,.05),hsla(0,0%,100%,0))\n ","--skeleton-avatar-background-color":"hsla(0,0%,100%,.12)","--skeleton-title-background-color":"hsla(0,0%,100%,.12)"},jet={"--step-content-color":"rgba(255, 255, 255, .38)","--step-content-active-color":"#fff","--step-line-background":"#fff"},Ket={"--switch-track-background":"#727272","--switch-handle-background":"#727272"},qet={"--tab-inactive-color":"rgba(255, 255, 255, .65)"},Get={"--table-background":"#303030","--table-thead-th-text-color":"rgba(255, 255, 255, 0.6)","--table-tbody-td-text-color":"#fff","--table-tbody-tr-hover-background":"#4c4b4b","--table-thead-border-bottom":"thin solid rgba(255, 255, 255, 0.12)","--table-tbody-tr-border-bottom":"thin solid rgba(255, 255, 255, 0.12)","--table-footer-border-top":"thin solid rgba(255, 255, 255, 0.12)"},Yet={"--time-picker-clock-container-background":"#545454","--time-picker-body-background":"#303030","--time-picker-clock-item-disable-color":"#aaaaaa","--time-picker-clock-item-text-color":"#fff"},Zet={"--uploader-action-background":"#303030","--uploader-action-icon-color":"#fff","--uploader-file-name-background":"#303030","--uploader-file-name-color":"#aaa","--uploader-file-cover-background":"#303030"},Xet={"--tabs-background":"#1e1e1e"},Qet={"--app-bar-color":"#272727"},Jet={"--bottom-navigation-background-color":"#272727","--bottom-navigation-border-color":"#444"},ett={"--bottom-navigation-item-active-background-color":"#272727"},ttt={"--menu-background-color":"#272727"},itt={"--breadcrumb-inactive-color":"#aaa"},ntt={"--paper-background":"#303030"},stt={"--avatar-background-color":"#303030","--avatar-border":"2px solid #1e1e1e"},ott={"--link-default-color":"#fff"},rtt={"--progress-label-color":"#fff"},att={"--option-text-color":"#fff"},ltt={"--countdown-text-color":"#fff"},ctt={"--watermark-content-color":"#ffffff"},dtt={"--menu-select-menu-background-color":"#272727"},utt={"--menu-option-text-color":"#fff"},htt=Object.defineProperty,UG=Object.getOwnPropertySymbols,ftt=Object.prototype.hasOwnProperty,gtt=Object.prototype.propertyIsEnumerable,jG=(n,e,t)=>e in n?htt(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,hi=(n,e)=>{for(var t in e||(e={}))ftt.call(e,t)&&jG(n,t,e[t]);if(UG)for(var t of UG(e))gtt.call(e,t)&&jG(n,t,e[t]);return n},ptt=hi(hi(hi(hi(hi(hi(hi(hi(hi(hi(hi(hi(hi(hi(hi(hi(hi(hi(hi(hi(hi(hi(hi(hi(hi(hi(hi(hi(hi(hi(hi(hi(hi(hi(hi(hi(hi(hi(hi(hi(hi(hi({"--color-body":"#1e1e1e","--color-text":"#fff","--color-primary":"#4a7afe","--color-info":"#10afef","--color-success":"#10c48f","--color-warning":"#ff8800","--color-danger":"#ef5350","--color-disabled":"#404040","--color-text-disabled":"#757575"},Det),Iet),Eet),Yet),Aet),Uet),Xet),qet),Wet),Met),Let),xet),ket),Zet),Net),Vet),Ket),jet),Fet),Get),Oet),zet),Het),Tet),Ret),Bet),Qet),Jet),ett),ttt),$et),itt),ntt),stt),ott),rtt),att),ltt),ctt),dtt),utt),Pet);const mtt={dark:ptt};var LT=mtt;const Za=["12","1","2","3","4","5","6","7","8","9","10","11"],hr=["00","13","14","15","16","17","18","19","20","21","22","23"],KG=["00","05","10","15","20","25","30","35","40","45","50","55"],_tt={modelValue:String,elevation:{type:[Boolean,Number,String],default:!1},hint:String,color:String,headerColor:String,titleColor:String,format:{type:String,default:"ampm"},allowedTime:Object,min:String,max:String,useSeconds:Boolean,readonly:Boolean,"onUpdate:modelValue":Se(),onChange:Se()},Cce=(n,e)=>n==="24hr"||e==="am",Y6=(n,e,t)=>{const i=Za.findIndex(o=>Ie(o)===Ie(t)),s=Cce(n,e)?t:hr[i];return{hourStr:s,hourNum:Ie(s)}},Kr=n=>{const[e,t,i]=n.split(":");return{hour:Ie(e),minute:Ie(t),second:Ie(i)}},wce=n=>{var e,t;const{time:i,format:s,ampm:o,hour:r,max:a,min:l,disableHour:c}=n,{hourStr:d,hourNum:u}=Y6(s,o,r);let h=!1,f=!1;if(c.includes(d))return!0;if(a&&!l){const{hour:g,minute:p}=Kr(a);h=g===u&&i>p}if(!a&&l){const{hour:g,minute:p}=Kr(l);h=g===u&&ip}return(e=n.allowedTime)!=null&&e.minutes&&(f=(t=n.allowedTime)==null?void 0:t.minutes(i)),h||f},yce=n=>{var e,t;const{time:i,format:s,ampm:o,hour:r,minute:a,max:l,min:c,disableHour:d}=n,{hourStr:u,hourNum:h}=Y6(s,o,r);let f=!1,g=!1;if(d.includes(u))return!0;if(l&&!c){const{hour:p,minute:_,second:v}=Kr(l);f=p===h&&_v}if(!l&&c){const{hour:p,minute:_,second:v}=Kr(c);f=p===h&&_>a||_===a&&i>v}if(l&&c){const{hour:p,minute:_,second:v}=Kr(l),{hour:b,minute:C,second:w}=Kr(c);f=p===h&&_a||p===h&&_===a&&i>v||b===h&&C===a&&i(q(),re("div",{class:B(n.classes(n.n("clock-item"),[n.isActive(i,!1),n.n("clock-item--active")],[n.isDisable(t),n.n("clock-item--disable")])),key:t,style:Fe(n.getStyle(i,t,!1))},ut(t),7))),128)),n.format==="24hr"&&n.type==="hour"?(q(),re("div",{key:0,class:B(n.n("clock-inner")),ref:"inner"},[(q(!0),re(li,null,ss(n.hours24,(t,i)=>(q(),re("div",{class:B(n.classes(n.n("clock-item"),[n.isActive(i,!0),n.n("clock-item--active")],[n.isDisable(t),n.n("clock-item--disable")])),key:t,style:Fe(n.getStyle(i,t,!0))},ut(t),7))),128))],2)):Qe("v-if",!0)],2)}const Sce=et({name:"Clock",props:{isInner:{type:Boolean,required:!0},rad:{type:Number},format:{type:String,default:"ampm"},allowedTime:{type:Object},time:{type:Object,required:!0},useSeconds:{type:Boolean,default:!1},preventNextUpdate:{type:Boolean,default:!1},type:{type:String,default:"hour"},ampm:{type:String,default:"am"},color:{type:String},min:{type:String},max:{type:String}},emits:["update","change-prevent-update"],setup(n,{emit:e}){const t=se(null),i=se([]),s=se([]),o=ve(()=>({transform:"rotate(".concat(Ie(n.rad),"deg)"),height:n.isInner&&n.type==="hour"?"calc(50% - 40px)":"calc(50% - 4px)",backgroundColor:c(),borderColor:c()})),r=ve(()=>{if(n.rad===void 0)return;const p=n.rad/30;return p>=0?p:p+12}),a=ve(()=>n.type==="hour"?Za:KG),l=(p,_)=>{p=p!=null?p:n.type==="minute"?n.time.minute:n.time.second;const v=n.type==="minute"?wce:yce,b={time:Ie(p),format:n.format,ampm:n.ampm,hour:n.time.hour,minute:Ie(n.time.minute),max:n.max,min:n.min,allowedTime:n.allowedTime,disableHour:i.value};return _&&n.type==="minute"&&Reflect.deleteProperty(b,"minute"),v(b)},c=()=>{if(r.value===void 0)return n.color;const p=n.isInner?hr[r.value]:a.value[r.value];return a.value===KG?l()?"#bdbdbd":n.color:u(p)?"#bdbdbd":n.color},d=(p,_)=>_?r.value===p&&n.isInner:r.value===p&&(!n.isInner||n.type!=="hour"),u=p=>{if(n.type==="hour"){if(Cce(n.format,n.ampm))return i.value.includes(p);const _=Za.findIndex(v=>v===p);return s.value.includes(_)}return l(p,!0)},h=(p,_,v)=>{const b=2*Math.PI/12*p-Math.PI/2,C=50*(1+Math.cos(b)),w=50*(1+Math.sin(b)),y=()=>d(p,v)?u(_)?{backgroundColor:"#bdbdbd",color:"#fff"}:{backgroundColor:n.color,color:void 0}:{backgroundColor:void 0,color:void 0},{backgroundColor:L,color:S}=y();return{left:"".concat(C,"%"),top:"".concat(w,"%"),backgroundColor:L,color:S}},f=()=>{const{width:p,height:_}=no(t.value);return{width:p,height:_}},g=()=>{if(r.value===void 0)return;const p=n.ampm==="am"?Za:hr;return Bm(p[r.value],2,"0")};return ht([r,()=>n.isInner],([p,_],[v,b])=>{if(p===v&&_===b||n.type!=="hour"||r.value===void 0)return;const w=_?hr[r.value]:g(),y=n.useSeconds?":".concat(n.time.second):"",L="".concat(w,":").concat(n.time.minute).concat(y);n.preventNextUpdate||e("update",L),e("change-prevent-update")}),ht(()=>n.rad,(p,_)=>{if(n.type==="hour"||p===void 0||_===void 0)return;const v=p/6>=0?p/6:p/6+60,b=_/6>=0?_/6:_/6+60;if(v===b)return;let C;const{hourStr:w}=Y6(n.format,n.ampm,n.time.hour);if(n.type==="minute"){const y=wt().minute(v).format("mm"),L=n.useSeconds?":".concat(n.time.second):"";C="".concat(w,":").concat(y).concat(L)}if(n.type==="second"){const y=wt().second(v).format("ss"),L=n.useSeconds?":".concat(y):"";C="".concat(w,":").concat(n.time.minute).concat(L)}e("update",C)}),ht([()=>n.max,()=>n.min,()=>n.allowedTime],([p,_,v])=>{if(i.value=[],p&&!_){const{hour:b}=Kr(p),C=Za.filter(y=>Ie(y)>b),w=hr.filter(y=>Ie(y)>b);i.value=[...C,...w]}if(!p&&_){const{hour:b}=Kr(_),C=Za.filter(y=>Ie(y)Ie(y)Ie(L)b),y=hr.filter(L=>Ie(L)b);i.value=[...w,...y]}if(v!=null&&v.hours){const{hours:b}=v,C=Za.filter(y=>!b(Ie(y))),w=hr.filter(y=>!b(Ie(y)));i.value=[...new Set([...i.value,...C,...w])]}s.value=i.value.map(b=>hr.findIndex(C=>b===C)).filter(b=>b>=0)},{immediate:!0}),{n:vtt,classes:btt,hours24:hr,timeScales:a,inner:t,handStyle:o,disableHour:i,isActive:d,isDisable:u,getSize:f,getStyle:h,activeItemIndex:r}}});Sce.render=Ctt;var wtt=Sce;const{name:ytt,n:Stt,classes:Ltt}=st("time-picker"),ktt=n=>(vg(""),n=n(),bg(),n),Dtt=ktt(()=>me("span",null,":",-1)),Ett={key:0};function Itt(n,e){var t;const i=gt("clock");return q(),re("div",{class:B(n.classes(n.n(),n.formatElevation(n.elevation,2))),ref:"picker"},[me("div",{class:B(n.n("title")),style:Fe({background:n.titleColor||n.headerColor||n.color})},[me("div",{class:B(n.n("title-hint"))},ut((t=n.hint)!=null?t:n.pack.timePickerHint),3),me("div",{class:B(n.n("title-time-container"))},[me("div",{class:B(n.n("title-time"))},[me("div",{class:B(n.classes(n.n("title-btn"),[n.type==="hour",n.n("title-btn--active")])),onClick:e[0]||(e[0]=s=>n.checkPanel("hour"))},ut(n.time.hour),3),Dtt,me("div",{class:B(n.classes(n.n("title-btn"),[n.type==="minute",n.n("title-btn--active")])),onClick:e[1]||(e[1]=s=>n.checkPanel("minute"))},ut(n.time.minute),3),n.useSeconds?(q(),re("span",Ett,":")):Qe("v-if",!0),n.useSeconds?(q(),re("div",{key:1,class:B(n.classes(n.n("title-btn"),[n.type==="second",n.n("title-btn--active")])),onClick:e[2]||(e[2]=s=>n.checkPanel("second"))},ut(n.time.second),3)):Qe("v-if",!0)],2),n.format==="ampm"?(q(),re("div",{key:0,class:B(n.n("title-ampm"))},[me("div",{class:B(n.classes(n.n("title-btn"),[n.ampm==="am",n.n("title-btn--active")])),onClick:e[3]||(e[3]=s=>n.checkAmpm("am"))}," AM ",2),me("div",{class:B(n.classes(n.n("title-btn"),[n.ampm==="pm",n.n("title-btn--active")])),onClick:e[4]||(e[4]=s=>n.checkAmpm("pm"))}," PM ",2)],2)):Qe("v-if",!0)],2)],6),me("div",{class:B(n.n("body"))},[me("div",{class:B(n.n("clock-container")),onTouchstart:e[5]||(e[5]=(...s)=>n.moveHand&&n.moveHand(...s)),onTouchmove:e[6]||(e[6]=(...s)=>n.moveHand&&n.moveHand(...s)),onTouchend:e[7]||(e[7]=(...s)=>n.end&&n.end(...s)),ref:"container"},[Oe(On,{name:"".concat(n.n(),"-panel-fade")},{default:Lt(()=>[(q(),ei(i,{key:n.type,ref:"inner",type:n.type,ampm:n.ampm,color:n.color,"is-inner":n.isInner,format:n.format,"allowed-time":n.allowedTime,rad:n.getRad,time:n.time,"prevent-next-update":n.isPreventNextUpdate,"use-seconds":n.useSeconds,max:n.max,min:n.min,onUpdate:n.update,onChangePreventUpdate:n.changePreventUpdate},null,8,["type","ampm","color","is-inner","format","allowed-time","rad","time","prevent-next-update","use-seconds","max","min","onUpdate","onChangePreventUpdate"]))]),_:1},8,["name"])],34)],2)],2)}const Lce=et({name:ytt,components:{Clock:wtt},props:_tt,setup(n){const e=se(null),t=se(null),i=se(null),s=se(!1),o=se(!1),r=se(!1),a=se(!1),l=se(!1),c=se(!1),d=se(!1),u=se(0),h=se(0),f=se(),g=se("hour"),p=se("am"),_=se({hour:"00",minute:"00",second:"00"}),v=Cn({x:0,y:0}),b=Cn({x:[],y:[]}),C=ve(()=>g.value==="hour"?f.value:g.value==="minute"?u.value:h.value);ht(()=>n.modelValue,de=>{if(de){const{hour:_e,minute:ie,second:ne}=Kr(de),Ye=wt().hour(_e).format("hh"),pe=wt().hour(_e).format("HH"),Ee=wt().minute(ie).format("mm"),ze=wt().second(ne).format("ss");f.value=(Ye==="12"?0:Ie(Ye))*30,u.value=Ie(Ee)*6,h.value=Ie(ze)*6,_.value=x(de),n.format!=="24hr"&&(p.value=Bm("".concat(_e),2,"0")===pe&&hr.includes(pe)?"pm":"am"),s.value=n.format==="24hr"&&hr.includes(pe)}},{immediate:!0});function w(de){oe(n["onUpdate:modelValue"],de),oe(n.onChange,de)}function y(de){return de*57.29577951308232}function L(de){a.value=!1,d.value=!1,g.value=de}function S(de){const{disableHour:_e}=i.value,ie=Za.findIndex(pe=>Ie(pe)===Ie(_.value.hour)),ne=de==="am"?Za:hr;return[...ne.slice(ie),...ne.slice(0,ie)].find((pe,Ee)=>(o.value=Ee!==0,!_e.includes(pe)))}function k(de){if(n.readonly)return;p.value=de;const _e=S(de);if(!_e)return;const ie=n.useSeconds?":".concat(_.value.second):"",ne="".concat(Bm(_e,2,"0"),":").concat(_.value.minute).concat(ie);w(ne)}function D(de,_e){const ie=de>=b.x[0]&&de<=b.x[1],ne=_e>=b.y[0]&&_e<=b.y[1];return ie&&ne}function x(de){const _e=n.format==="24hr"?"HH":"hh",{hour:ie,minute:ne,second:Ye}=Kr(de);return{hour:wt().hour(ie).format(_e),minute:wt().minute(ne).format("mm"),second:wt().second(Ye).format("ss")}}function A(de){const _e=de/30;return _e>=0?_e:_e+12}function T(){const{width:de,height:_e}=i.value.getSize(),ie=v.x-de/2-8,ne=v.x+de/2+8,Ye=v.y-_e/2-8,pe=v.y+_e/2+8;return{rangeXMin:ie,rangeXMax:ne,rangeYMin:Ye,rangeYMax:pe}}function P(de,_e,ie){const{disableHour:ne}=i.value;r.value=D(de,_e);const Ye=Math.round(ie/30)*30+90,pe=A(Ye),Ee=s.value?Za[pe]:hr[pe];if(ne.includes(Ee)||(s.value=n.format==="24hr"?D(de,_e):!1),s.value!==r.value)return;const ze=s.value||p.value==="pm"?hr[pe]:Za[pe];c.value=ne.includes(ze),!c.value&&(f.value=Ye,a.value=!0)}function W(de){const{disableHour:_e}=i.value,ie=Math.round(de/6)*6+90,Ye={time:ie/6>=0?ie/6:ie/6+60,format:n.format,ampm:p.value,hour:_.value.hour,max:n.max,min:n.min,disableHour:_e,allowedTime:n.allowedTime};d.value=wce(Ye),!d.value&&(u.value=ie,l.value=!0)}function $(de){const{disableHour:_e}=i.value,ie=Math.round(de/6)*6+90,Ye={time:ie/6>=0?ie/6:ie/6+60,format:n.format,ampm:p.value,hour:_.value.hour,minute:Ie(_.value.minute),max:n.max,min:n.min,disableHour:_e,allowedTime:n.allowedTime};yce(Ye)||(h.value=ie)}function X(){const{left:de,top:_e,width:ie,height:ne}=no(e.value);if(v.x=de+ie/2,v.y=_e+ne/2,g.value==="hour"&&n.format==="24hr"){const{rangeXMin:Ye,rangeXMax:pe,rangeYMin:Ee,rangeYMax:ze}=T();b.x=[Ye,pe],b.y=[Ee,ze]}}function J(de){if(dc(de),n.readonly)return;X();const{clientX:_e,clientY:ie}=de.touches[0],ne=_e-v.x,Ye=ie-v.y,pe=Math.round(y(Math.atan2(Ye,ne)));g.value==="hour"?P(_e,ie,pe):g.value==="minute"?W(pe):$(pe)}function Q(){if(!n.readonly){if(g.value==="hour"&&a.value){g.value="minute";return}g.value==="minute"&&n.useSeconds&&l.value&&(g.value="second")}}function le(){o.value=!1}return{getRad:C,time:_,container:e,inner:i,picker:t,isInner:s,type:g,ampm:p,isPreventNextUpdate:o,n:Stt,classes:Ltt,pack:Xs,moveHand:J,checkPanel:L,checkAmpm:k,end:Q,update:w,changePreventUpdate:le,formatElevation:or}}});Lce.render=Itt;var kce=Lce;lt(kce);var _B=kce;const Ttt={modelValue:{type:Array,default:()=>[]},accept:{type:String,default:"image/*"},capture:{type:[String,Boolean],default:void 0},multiple:Boolean,readonly:Boolean,disabled:Boolean,elevation:{type:[Boolean,Number,String],default:!0},resolveType:{type:String,default:"default"},removable:{type:Boolean,default:!0},maxlength:[Number,String],maxsize:[Number,String],previewed:{type:Boolean,default:!0},ripple:{type:Boolean,default:!0},validateTrigger:{type:Array,default:()=>["onChange","onRemove"]},rules:Array,hideList:Boolean,preventDefaultPreview:Boolean,onBeforeFilter:Se(),onBeforeRead:Se(),onAfterRead:Se(),onBeforeRemove:Se(),onRemove:Se(),onOversize:Se(),onPreview:Se(),"onUpdate:modelValue":Se()};var zk=(n,e,t)=>new Promise((i,s)=>{var o=l=>{try{a(t.next(l))}catch(c){s(c)}},r=l=>{try{a(t.throw(l))}catch(c){s(c)}},a=l=>l.done?i(l.value):Promise.resolve(l.value).then(o,r);a((t=t.apply(n,e)).next())});const{name:xtt,n:Ntt,classes:Att}=st("uploader");let Mtt=0;const Rtt=["onClick"],Ptt=["onClick"],Ott=["src","alt"],Ftt=["multiple","accept","capture","disabled"],Btt=["src"];function Wtt(n,e){const t=gt("var-icon"),i=gt("var-hover-overlay"),s=gt("var-form-details"),o=gt("var-popup"),r=hn("ripple"),a=hn("hover");return q(),re("div",{class:B(n.classes(n.n(),n.n("$--box")))},[me("div",{class:B(n.n("file-list"))},[(q(!0),re(li,null,ss(n.files,l=>wi((q(),re("div",{class:B(n.classes(n.n("file"),n.formatElevation(n.elevation,2),[l.state==="loading",n.n("--loading")])),key:l.id,onClick:c=>n.preview(l)},[me("div",{class:B(n.n("file-name"))},ut(l.name||l.url),3),n.removable?(q(),re("div",{key:0,class:B(n.n("file-close")),onClick:Ia(c=>n.handleRemove(l),["stop"])},[Oe(t,{class:B(n.n("file-close-icon")),"var-uploader-cover":"",name:"delete"},null,8,["class"])],10,Ptt)):Qe("v-if",!0),l.cover?(q(),re("img",{key:1,class:B(n.n("file-cover")),style:Fe({objectFit:l.fit}),src:l.cover,alt:l.name},null,14,Ott)):Qe("v-if",!0),me("div",{class:B(n.n("file-indicator"))},[me("div",{class:B(n.classes(n.n("progress"),[l.state==="success",n.n("--success")],[l.state==="error",n.n("--error")])),style:Fe({width:l.state==="success"||l.state==="error"?"100%":"".concat(l.progress,"%")})},null,6)],2)],10,Rtt)),[[r,{disabled:n.disabled||n.formDisabled||n.readonly||n.formReadonly||!n.ripple}]])),128)),!n.maxlength||n.modelValue.lengthn.chooseFile&&n.chooseFile(...l))},[me("input",{ref:"input",type:"file",class:B(n.n("action-input")),multiple:n.multiple,accept:n.accept,capture:n.capture,disabled:n.disabled||n.formDisabled||n.readonly||n.formReadonly,onChange:e[0]||(e[0]=(...l)=>n.handleChange&&n.handleChange(...l))},null,42,Ftt),xe(n.$slots,"default",{},()=>[Oe(t,{class:B(n.n("action-icon")),"var-uploader-cover":"",name:"plus"},null,8,["class"]),Oe(i,{hovering:n.hovering&&!n.disabled&&!n.formDisabled},null,8,["hovering"])])],2)),[[r,{disabled:n.disabled||n.formDisabled||n.readonly||n.formReadonly||!n.ripple||!!n.$slots.default}],[a,n.handleHovering,"desktop"]]):Qe("v-if",!0)],2),Oe(s,{"error-message":n.errorMessage,"extra-message":n.maxlengthText},ZD({_:2},[n.$slots["extra-message"]?{name:"extra-message",fn:Lt(()=>[xe(n.$slots,"extra-message")]),key:"0"}:void 0]),1032,["error-message","extra-message"]),Oe(o,{class:B(n.n("preview")),"var-uploader-cover":"",position:"center",show:n.showPreview,"onUpdate:show":e[2]||(e[2]=l=>n.showPreview=l),onClosed:e[3]||(e[3]=l=>n.currentPreview=null)},{default:Lt(()=>{var l,c;return[n.currentPreview&&n.isHTMLSupportVideo((l=n.currentPreview)==null?void 0:l.url)?(q(),re("video",{key:0,class:B(n.n("preview-video")),playsinline:"true","webkit-playsinline":"true","x5-playsinline":"true","x5-video-player-type":"h5","x5-video-player-fullscreen":"false",controls:"",src:(c=n.currentPreview)==null?void 0:c.url},null,10,Btt)):Qe("v-if",!0)]}),_:1},8,["class","show"])],2)}const Dce=et({name:xtt,directives:{Ripple:Ns,Hover:Fa},components:{VarIcon:Wn,VarPopup:gg,VarFormDetails:na,VarHoverOverlay:ml},props:Ttt,setup(n){const e=se(null),t=se(!1),i=se(null),s=ve(()=>{const{maxlength:J,modelValue:{length:Q}}=n;return qr(J)?"".concat(Q," / ").concat(J):""}),{form:o,bindForm:r}=kl(),{errorMessage:a,validateWithTrigger:l,validate:c,resetValidation:d}=Ll(),{hovering:u,handleHovering:h}=Pd(),f=ve(()=>{const{modelValue:J,hideList:Q}=n;return Q?[]:J});let g=!1;const p={getSuccess:D,getError:x,getLoading:A};oe(r,{validate:$,resetValidation:d,reset:X}),ht(()=>n.modelValue,()=>{!g&&W("onChange"),g=!1},{deep:!0});function v(J){const{disabled:Q,previewed:le,preventDefaultPreview:de,onPreview:_e}=n;if(o!=null&&o.disabled.value||Q||!le||(oe(_e,Cn(J)),de))return;const{url:ie}=J;if(rq(ie)){Xy(ie);return}aq(ie)&&(i.value=J,t.value=!0)}function b(J){return{id:Mtt++,url:"",cover:"",name:J.name,file:J,progress:0}}function C(J){const Q=J.target,{files:le}=Q;return Array.from(le)}function w(J){return zk(this,null,function*(){const Q=J.file;if(n.resolveType==="default"&&Q.type.startsWith("image")||n.resolveType==="data-url"){const de=yield Ihe(Q);J.cover=de,J.url=de}return J})}function y(J){return J.map(w)}function L(J){const{onBeforeRead:Q}=n;return J.map(le=>new Promise(de=>{Q||de({valid:!0,varFile:le});const _e=qk(oe(Q,Cn(le)));Promise.all(_e).then(ie=>{de({valid:ie.every(Boolean),varFile:le})})}))}function S(J){return zk(this,null,function*(){const{maxsize:Q,maxlength:le,modelValue:de,onOversize:_e,onAfterRead:ie,onBeforeFilter:ne,readonly:Ye,disabled:pe}=n;if(o!=null&&o.disabled.value||o!=null&&o.readonly.value||pe||Ye)return;const Ee=ae=>ae.filter(we=>we.file.size>Ie(Q)?(oe(_e,Cn(we)),!1):!0),ze=ae=>{const we=Math.min(ae.length,Ie(le)-de.length);return ae.slice(0,we)},It=ae=>zk(this,null,function*(){if(!ne)return ae;const we=qk(ne);for(const Ne of we)ae=yield Ne(ae);return ae});let Xe=C(J).map(b);Xe=yield It(Xe),Xe=Q!=null?Ee(Xe):Xe,Xe=le!=null?ze(Xe):Xe;const je=yield Promise.all(y(Xe)),z=(yield Promise.all(L(je))).filter(({valid:ae})=>ae).map(({varFile:ae})=>ae);oe(n["onUpdate:modelValue"],[...de,...z]),J.target.value="",z.forEach(ae=>oe(ie,Cn(ae)))})}function k(J){return zk(this,null,function*(){const{disabled:Q,readonly:le,modelValue:de,onBeforeRemove:_e,onRemove:ie}=n;if(o!=null&&o.disabled.value||o!=null&&o.readonly.value||Q||le)return;if(_e){const Ye=qk(oe(_e,Cn(J)));if((yield Promise.all(Ye)).some(pe=>!pe))return}const ne=de.filter(Ye=>Ye!==J);oe(ie,Cn(J)),W("onRemove"),oe(n["onUpdate:modelValue"],ne)})}function D(){return n.modelValue.filter(J=>J.state==="success")}function x(){return n.modelValue.filter(J=>J.state==="error")}function A(){return n.modelValue.filter(J=>J.state==="loading")}function T(){e.value.click()}function P(){i.value=null,t.value=!1,Xy.close()}function W(J){Fn(()=>{const{validateTrigger:Q,rules:le,modelValue:de}=n;l(Q,J,le,de,p)})}function $(){return c(n.rules,n.modelValue,p)}function X(){g=!0,oe(n["onUpdate:modelValue"],[]),d()}return{input:e,files:f,showPreview:t,currentPreview:i,errorMessage:a,maxlengthText:s,hovering:u,formDisabled:o==null?void 0:o.disabled,formReadonly:o==null?void 0:o.readonly,n:Ntt,classes:Att,formatElevation:or,toNumber:Ie,handleHovering:h,isHTMLSupportVideo:aq,isHTMLSupportImage:rq,preview:v,handleChange:S,handleRemove:k,getSuccess:D,getError:x,getLoading:A,validate:$,resetValidation:d,reset:X,chooseFile:T,closePreview:P,toSizeUnit:ri}}});Dce.render=Wtt;var Ece=Dce;lt(Ece);var vB=Ece;const Vtt={width:{type:Number,default:100},height:{type:Number,default:100},content:String,image:String,rotate:{type:Number,default:-22},offsetX:{type:Number,default:0},offsetY:{type:Number,default:0},gapX:{type:Number,default:0},gapY:{type:Number,default:0},zIndex:{type:[Number,String],default:10},opacity:{type:[Number,String],default:.5},fullscreen:Boolean,font:{type:Object,default:()=>({fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",fontSize:14})}};var Htt=Object.defineProperty,$tt=Object.defineProperties,ztt=Object.getOwnPropertyDescriptors,qG=Object.getOwnPropertySymbols,Utt=Object.prototype.hasOwnProperty,jtt=Object.prototype.propertyIsEnumerable,GG=(n,e,t)=>e in n?Htt(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,Ktt=(n,e)=>{for(var t in e||(e={}))Utt.call(e,t)&&GG(n,t,e[t]);if(qG)for(var t of qG(e))jtt.call(e,t)&&GG(n,t,e[t]);return n},qtt=(n,e)=>$tt(n,ztt(e)),YG=(n,e,t)=>new Promise((i,s)=>{var o=l=>{try{a(t.next(l))}catch(c){s(c)}},r=l=>{try{a(t.throw(l))}catch(c){s(c)}},a=l=>l.done?i(l.value):Promise.resolve(l.value).then(o,r);a((t=t.apply(n,e)).next())});const{name:Gtt,n:Ytt,classes:Ztt}=st("watermark"),Xtt={ref:"svgRef"},Qtt=["viewBox","width","height"],Jtt=["width","height"],eit=["href","xlink:href","x","y","width","height"];function tit(n,e){return q(),re("div",{class:B(n.n())},[xe(n.$slots,"default"),(q(),ei(Bd,{to:"body",disabled:!n.fullscreen},[me("div",{ref:"containerRef",class:B(n.classes(n.n("container"),[n.fullscreen,n.n("--fullscreen")])),style:Fe({backgroundImage:"url(".concat(n.watermarkUrl,")"),zIndex:n.zIndex})},[wi(me("div",Xtt,[(q(),re("svg",{xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 ".concat(n.width+n.gapX," ").concat(n.height+n.gapY),width:"".concat(n.width+n.gapX),height:"".concat(n.height+n.gapY),style:Fe({padding:"0 ".concat(n.gapX,"px ").concat(n.gapY,"px 0"),opacity:n.opacity})},[n.showContent()?(q(),re("foreignObject",{key:0,x:"0",y:"0",width:n.width,height:n.height},[me("div",{xmlns:"http://www.w3.org/1999/xhtml",style:Fe({transform:"translate(".concat(n.offsetX,"px, ").concat(n.offsetY,"px) rotate(").concat(n.rotate,"deg)"),transformOrigin:"center"})},[xe(n.$slots,"content",{},()=>[me("span",{style:Fe(qtt(Ktt({},n.font),{fontSize:"".concat(n.font.fontSize,"px"),color:n.textColor}))},ut(n.content),5)])],4)],8,Jtt)):Qe("v-if",!0),!n.$slots.content&&n.image?(q(),re("image",{key:1,href:n.imageUrl,"xlink:href":n.imageUrl,x:n.offsetX,y:n.offsetY,width:n.width,height:n.height,style:Fe({transform:"rotate(".concat(n.rotate,"deg)"),transformOrigin:"center"})},null,12,eit)):Qe("v-if",!0)],12,Qtt))],512),[[hl,!1]])],6)],8,["disabled"]))],2)}const Ice=et({name:Gtt,props:Vtt,setup(n,{slots:e}){const t=se(""),i=se(""),s=se(""),o=se(null),r=se(null);ht(()=>[n.image,n.font,n.content,n.height,n.width,n.rotate,n.gapX,n.gapY,n.offsetX,n.offsetY,n.opacity],u,{deep:!0}),bd(u),Cd(d);function a(){return!!(e.content||n.content&&!n.image)}function l(){return YG(this,null,function*(){return new Promise(h=>{const f=document.createElement("canvas"),g=f.getContext("2d"),p=new Image;p.crossOrigin="anonymous",p.referrerPolicy="no-referrer",p.src=n.image,p.onload=()=>{f.width=p.width,f.height=p.height,g.drawImage(p,0,0),h(f.toDataURL())}})})}function c(h){const f=new Blob([h],{type:"image/svg+xml"});return URL.createObjectURL(f)}function d(){t.value&&URL.revokeObjectURL(t.value)}function u(){return YG(this,null,function*(){s.value=Um(r.value).color,n.image&&(i.value=yield l()),yield Fn(),d(),t.value=c(o.value.innerHTML)})}return{svgRef:o,containerRef:r,watermarkUrl:t,imageUrl:i,textColor:s,n:Ytt,classes:Ztt,showContent:a,resize:u}}});Ice.render=tit;var Tce=Ice;lt(Tce);var bB=Tce;const iit="2.18.2";function nit(n){e3.install&&n.use(e3),t3.install&&n.use(t3),s3.install&&n.use(s3),o3.install&&n.use(o3),r3.install&&n.use(r3),hT.install&&n.use(hT),a3.install&&n.use(a3),l3.install&&n.use(l3),c3.install&&n.use(c3),d3.install&&n.use(d3),ia.install&&n.use(ia),u3.install&&n.use(u3),h3.install&&n.use(h3),fT.install&&n.use(fT),Uy.install&&n.use(Uy),f3.install&&n.use(f3),gT.install&&n.use(gT),g3.install&&n.use(g3),p3.install&&n.use(p3),m3.install&&n.use(m3),Ea.install&&n.use(Ea),C3.install&&n.use(C3),D3.install&&n.use(D3),I3.install&&n.use(I3),T3.install&&n.use(T3),x3.install&&n.use(x3),CT.install&&n.use(CT),M3.install&&n.use(M3),R3.install&&n.use(R3),Gy.install&&n.use(Gy),P3.install&&n.use(P3),O3.install&&n.use(O3),na.install&&n.use(na),Fa.install&&n.use(Fa),ml.install&&n.use(ml),Wn.install&&n.use(Wn),F3.install&&n.use(F3),Xy.install&&n.use(Xy),B3.install&&n.use(B3),W3.install&&n.use(W3),yT.install&&n.use(yT),zy.install&&n.use(zy),V3.install&&n.use(V3),H3.install&&n.use(H3),l0.install&&n.use(l0),$3.install&&n.use($3),J5.install&&n.use(J5),f0.install&&n.use(f0),z3.install&&n.use(z3),U3.install&&n.use(U3),j3.install&&n.use(j3),K3.install&&n.use(K3),q3.install&&n.use(q3),G3.install&&n.use(G3),Y3.install&&n.use(Y3),gg.install&&n.use(gg),Z3.install&&n.use(Z3),X3.install&&n.use(X3),Q3.install&&n.use(Q3),J3.install&&n.use(J3),eB.install&&n.use(eB),tB.install&&n.use(tB),Ns.install&&n.use(Ns),iB.install&&n.use(iB),nB.install&&n.use(nB),sB.install&&n.use(sB),oB.install&&n.use(oB),aB.install&&n.use(aB),lB.install&&n.use(lB),cB.install&&n.use(cB),dB.install&&n.use(dB),Qy.install&&n.use(Qy),ST.install&&n.use(ST),Yy.install&&n.use(Yy),Zy.install&&n.use(Zy),uB.install&&n.use(uB),hB.install&&n.use(hB),fB.install&&n.use(fB),gB.install&&n.use(gB),pB.install&&n.use(pB),mB.install&&n.use(mB),LT.install&&n.use(LT),_B.install&&n.use(_B),wT.install&&n.use(wT),vB.install&&n.use(vB),bB.install&&n.use(bB)}const xce={version:iit,install:nit,ActionSheet:e3,AppBar:t3,Avatar:s3,AvatarGroup:o3,BackTop:r3,Badge:hT,BottomNavigation:a3,BottomNavigationItem:l3,Breadcrumb:c3,Breadcrumbs:d3,Button:ia,ButtonGroup:u3,Card:h3,Cell:fT,Checkbox:Uy,CheckboxGroup:f3,Chip:gT,Col:g3,Collapse:p3,CollapseItem:m3,Context:Ea,Countdown:C3,Counter:D3,DatePicker:I3,Dialog:T3,Divider:x3,Drag:CT,Ellipsis:M3,Fab:R3,FieldDecorator:Gy,FloatingPanel:P3,Form:O3,FormDetails:na,Hover:Fa,HoverOverlay:ml,Icon:Wn,Image:F3,ImagePreview:Xy,IndexAnchor:B3,IndexBar:W3,Input:yT,Lazy:zy,Link:V3,List:H3,Loading:l0,LoadingBar:$3,Locale:J5,Menu:f0,MenuOption:z3,MenuSelect:U3,Option:j3,Overlay:K3,Pagination:q3,Paper:G3,Picker:Y3,Popup:gg,Progress:Z3,PullRefresh:X3,Radio:Q3,RadioGroup:J3,Rate:eB,Result:tB,Ripple:Ns,Row:iB,Select:nB,Skeleton:sB,Slider:oB,Snackbar:aB,Space:lB,Step:cB,Steps:dB,Sticky:Qy,StyleProvider:ST,Swipe:Yy,SwipeItem:Zy,Switch:uB,Tab:hB,TabItem:fB,Table:gB,Tabs:pB,TabsItems:mB,Themes:LT,TimePicker:_B,Tooltip:wT,Uploader:vB,Watermark:bB},sit=["ImagePreview","Snackbar","Picker","ActionSheet","Dialog","Locale","StyleProvider","LoadingBar"],oit=["Ripple","Lazy","Hover","version","install"];function rit(){const n=Object.entries(xce),e=GD(n.reduce((i,[s,o])=>oit.includes(s)?i:o.hasOwnProperty("Component")?(i[s]=o.Component,i):(i[s]=o,i),{})),t=GD(n.reduce((i,[s,o])=>(sit.includes(s)&&(i[s]=o),i),{}));return{components:e,injects:t}}const ait={class:"container"},lit=et({__name:"App",setup(n){var a;const{components:e,injects:t}=rit(),i={name:"Page",code:"function setup() {\n const model = ref({})\n\n onMounted(() => {\n const modelString = localStorage.getItem('cache')\n\n if (modelString) {\n model.value = JSON.parse(modelString)\n }\n })\n\n function handleSave() {\n const modelString = JSON.stringify(model.value)\n Snackbar('Save to localStorage success!')\n localStorage.setItem('cache', modelString)\n }\n\n function handleReset() {\n Snackbar('Reset and clear localStorage success!')\n localStorage.removeItem('cache')\n }\n\n return { model, handleSave, handleReset }\n}",css:".var-schema-renderer {\n padding: 16px;\n}",children:[{name:"Form",props:{onSubmit:{type:"Expression",value:"handleSave"},onReset:{type:"Expression",value:"handleReset"}},children:[{name:"Space",props:{direction:"column",size:[16,0]},children:[{name:"Input",props:{"v-model":{type:"Expression",value:"model.value.name"},placeholder:"Please input name"}},{name:"Input",props:{"v-model":{type:"Expression",value:"model.value.age"},placeholder:"Please input age"}},{name:"Select",props:{"v-model":{type:"Expression",value:"model.value.gender"},placeholder:"Please select gender"},children:[{name:"Option",props:{label:"Male"}},{name:"Option",props:{label:"Female"}}]},{name:"Space",props:{justify:"flex-end",style:{"margin-top":"10px"}},children:[{name:"Button",props:{nativeType:"reset"},children:[{name:"Text",value:"RESET"}]},{name:"Button",props:{type:"primary",nativeType:"submit"},children:[{name:"Text",value:"SAVE"}]}]}]}]}]},s=GD(localStorage.getItem("schema")?JSON.parse(localStorage.getItem("schema")):i),o=se((a=localStorage.getItem("active-tab"))!=null?a:"JSON");ht(()=>o.value,l=>{localStorage.setItem("active-tab",l)},{immediate:!0});function r(l){localStorage.setItem("schema",JSON.stringify(l))}return(l,c)=>(q(),re("div",ait,[Oe(ud(eVe),{theme:"vs-dark",components:ud(e),injects:ud(t),"active-tab":o.value,"onUpdate:activeTab":c[0]||(c[0]=d=>o.value=d),schema:s.value,"onUpdate:schema":c[1]||(c[1]=d=>s.value=d),onChange:r},null,8,["components","injects","active-tab","schema"])]))}});const cit=(n,e)=>{const t=n.__vccOpts||n;for(const[i,s]of e)t[i]=s;return t},dit=cit(lit,[["__scopeId","data-v-c405dff0"]]);const Nce=typeof window<"u",uit=Nce&&"ontouchstart"in window;let d2=!1,tm;const Ace=n=>n==="mousedown",hit=n=>n==="mousemove",CB=n=>n==="mouseup",fit=n=>Ace(n)||!tm||tm&&!tm.dispatchEvent;function git(n,e,t){const{clientX:i,clientY:s,screenX:o,screenY:r,pageX:a,pageY:l}=t;this.identifier=e,this.target=n,this.clientX=i,this.clientY=s,this.screenX=o,this.screenY=r,this.pageX=a,this.pageY=l}function pit(n){const e=Z6();return e.push(new git(tm,1,n)),e}function Z6(){const n=[];return n.item=function(e){return this[e]||null},n}function ZG(n){const{type:e}=n;return CB(e)?Z6():pit(n)}function mit(n,e){const{altKey:t,ctrlKey:i,metaKey:s,shiftKey:o}=e,r=new Event(n,{bubbles:!0,cancelable:!0});r.altKey=t,r.ctrlKey=i,r.metaKey=s,r.shiftKey=o,r.touches=ZG(e),r.targetTouches=ZG(e),r.changedTouches=Z6(),tm.dispatchEvent(r)}function u2(n,e){const{type:t,target:i}=n;d2=Ace(t)?!0:CB(t)?!1:d2,!(hit(t)&&!d2)&&(fit(t)&&(tm=i),mit(e,n),CB(t)&&(tm=null))}function _it(){window.addEventListener("mousedown",n=>u2(n,"touchstart"),!0),window.addEventListener("mousemove",n=>u2(n,"touchmove"),!0),window.addEventListener("mouseup",n=>u2(n,"touchend"),!0)}Nce&&!uit&&_it();ST(LT.dark);XY(dit).use(xce).mount("#app");export{PS as m,cie as t}; diff --git a/assets/javascript-f7d4365a.js b/assets/javascript-e0d19f86.js similarity index 89% rename from assets/javascript-f7d4365a.js rename to assets/javascript-e0d19f86.js index cd0fa26..3cf9678 100644 --- a/assets/javascript-f7d4365a.js +++ b/assets/javascript-e0d19f86.js @@ -1,4 +1,4 @@ -import{conf as t,language as e}from"./typescript-e18a52a8.js";import"./index-96cdf3d3.js";/*!----------------------------------------------------------------------------- +import{conf as t,language as e}from"./typescript-f88e371e.js";import"./index-dcd446f7.js";/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.44.0(3e047efd345ff102c8c61b5398fb30845aaac166) * Released under the MIT license diff --git a/assets/jsonMode-b1401d4e.js b/assets/jsonMode-beb93c45.js similarity index 99% rename from assets/jsonMode-b1401d4e.js rename to assets/jsonMode-beb93c45.js index 344274d..26a1828 100644 --- a/assets/jsonMode-b1401d4e.js +++ b/assets/jsonMode-beb93c45.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-96cdf3d3.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-dcd446f7.js";/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.44.0(3e047efd345ff102c8c61b5398fb30845aaac166) * Released under the MIT license diff --git a/assets/liquid-a601b5f4.js b/assets/liquid-6db0575e.js similarity index 98% rename from assets/liquid-a601b5f4.js rename to assets/liquid-6db0575e.js index 9cd9150..fc449e1 100644 --- a/assets/liquid-a601b5f4.js +++ b/assets/liquid-6db0575e.js @@ -1,4 +1,4 @@ -import{m as d}from"./index-96cdf3d3.js";/*!----------------------------------------------------------------------------- +import{m as d}from"./index-dcd446f7.js";/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.44.0(3e047efd345ff102c8c61b5398fb30845aaac166) * Released under the MIT license diff --git a/assets/mdx-a89474f5.js b/assets/mdx-540b1040.js similarity index 98% rename from assets/mdx-a89474f5.js rename to assets/mdx-540b1040.js index ee4053c..cd82c35 100644 --- a/assets/mdx-a89474f5.js +++ b/assets/mdx-540b1040.js @@ -1,4 +1,4 @@ -import{m as d}from"./index-96cdf3d3.js";/*!----------------------------------------------------------------------------- +import{m as d}from"./index-dcd446f7.js";/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.44.0(3e047efd345ff102c8c61b5398fb30845aaac166) * Released under the MIT license diff --git a/assets/python-e2c00b4d.js b/assets/python-64c1a453.js similarity index 98% rename from assets/python-e2c00b4d.js rename to assets/python-64c1a453.js index e382588..ff4808d 100644 --- a/assets/python-e2c00b4d.js +++ b/assets/python-64c1a453.js @@ -1,4 +1,4 @@ -import{m as a}from"./index-96cdf3d3.js";/*!----------------------------------------------------------------------------- +import{m as a}from"./index-dcd446f7.js";/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.44.0(3e047efd345ff102c8c61b5398fb30845aaac166) * Released under the MIT license diff --git a/assets/razor-957bc68d.js b/assets/razor-a2bbc2c7.js similarity index 99% rename from assets/razor-957bc68d.js rename to assets/razor-a2bbc2c7.js index 5c1983f..558dcd7 100644 --- a/assets/razor-957bc68d.js +++ b/assets/razor-a2bbc2c7.js @@ -1,4 +1,4 @@ -import{m as s}from"./index-96cdf3d3.js";/*!----------------------------------------------------------------------------- +import{m as s}from"./index-dcd446f7.js";/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.44.0(3e047efd345ff102c8c61b5398fb30845aaac166) * Released under the MIT license diff --git a/assets/tsMode-f12f1309.js b/assets/tsMode-1d146d19.js similarity index 99% rename from assets/tsMode-f12f1309.js rename to assets/tsMode-1d146d19.js index a151b0c..c4b3409 100644 --- a/assets/tsMode-f12f1309.js +++ b/assets/tsMode-1d146d19.js @@ -1,4 +1,4 @@ -var M=Object.defineProperty;var R=(e,t,r)=>t in e?M(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var _=(e,t,r)=>(R(e,typeof t!="symbol"?t+"":t,r),r);import{t as K,m as E}from"./index-96cdf3d3.js";/*!----------------------------------------------------------------------------- +var M=Object.defineProperty;var R=(e,t,r)=>t in e?M(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var _=(e,t,r)=>(R(e,typeof t!="symbol"?t+"":t,r),r);import{t as K,m as E}from"./index-dcd446f7.js";/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.44.0(3e047efd345ff102c8c61b5398fb30845aaac166) * Released under the MIT license diff --git a/assets/typescript-e18a52a8.js b/assets/typescript-f88e371e.js similarity index 98% rename from assets/typescript-e18a52a8.js rename to assets/typescript-f88e371e.js index ea7e1e8..7b77576 100644 --- a/assets/typescript-e18a52a8.js +++ b/assets/typescript-f88e371e.js @@ -1,4 +1,4 @@ -import{m as a}from"./index-96cdf3d3.js";/*!----------------------------------------------------------------------------- +import{m as a}from"./index-dcd446f7.js";/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.44.0(3e047efd345ff102c8c61b5398fb30845aaac166) * Released under the MIT license diff --git a/assets/xml-ea76a9d4.js b/assets/xml-89a70cb1.js similarity index 97% rename from assets/xml-ea76a9d4.js rename to assets/xml-89a70cb1.js index e2720b6..a371931 100644 --- a/assets/xml-ea76a9d4.js +++ b/assets/xml-89a70cb1.js @@ -1,4 +1,4 @@ -import{m}from"./index-96cdf3d3.js";/*!----------------------------------------------------------------------------- +import{m}from"./index-dcd446f7.js";/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.44.0(3e047efd345ff102c8c61b5398fb30845aaac166) * Released under the MIT license diff --git a/assets/yaml-cdf718b7.js b/assets/yaml-b5381d78.js similarity index 98% rename from assets/yaml-cdf718b7.js rename to assets/yaml-b5381d78.js index 70ecc7d..4e1dfd2 100644 --- a/assets/yaml-cdf718b7.js +++ b/assets/yaml-b5381d78.js @@ -1,4 +1,4 @@ -import{m as i}from"./index-96cdf3d3.js";/*!----------------------------------------------------------------------------- +import{m as i}from"./index-dcd446f7.js";/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.44.0(3e047efd345ff102c8c61b5398fb30845aaac166) * Released under the MIT license diff --git a/index.html b/index.html index 7b6ee01..efc19a3 100644 --- a/index.html +++ b/index.html @@ -19,7 +19,7 @@ Varlet Schema Playground - +